angular-best-practices

Applies Angular performance optimization rules for change detection, bundles, rendering, and SSR.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/nperepichka/Antigravity --skill angular-best-practices-nperepichka
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: angular-best-practices
Source: https://github.com/nperepichka/Antigravity/tree/main/config/skills/angular-best-practices
Command: npx skills add https://github.com/nperepichka/Antigravity --skill angular-best-practices-nperepichka

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Angular applications often suffer from slow rendering, bloated bundles, and inefficient change detection. This Skill provides a prioritized, rule-based guide that helps you write, review, and refactor Angular code to eliminate performance bottlenecks. ## Core Features & Use Cases - Prioritized Rule Set: Eight ranked categories covering change detection (Signals, OnPush, zoneless), async waterfalls, bundle optimization, rendering, SSR/hydration, templates, state management, and memory cleanup. - Correct vs. Wrong Code Patterns: Each rule includes side-by-side TypeScript and template examples showing the anti-pattern and the optimized approach. - Review Checklists: Ready-to-use checklists for new components, performance reviews, and SSR configuration. - Use Case: When reviewing a slow Angular dashboard, apply the rules to convert components to OnPush with signals, lazy-load routes, defer heavy charts with @defer, and configure incremental hydration for SSR. ## Quick Start Review my Angular component using the angular-best-practices skill and suggest performance improvements.

Frequently Asked Questions about angular-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve Angular change detection performance?▼

Use ChangeDetectionStrategy.OnPush combined with Signals for state, and enable zoneless change detection in Angular v20+ via provideZonelessChangeDetection(). This eliminates zone.js overhead and triggers updates only when signal values actually change.

How to reduce Angular bundle size with lazy loading?▼

Lazy load feature routes with loadChildren or loadComponent, defer heavy components using @defer blocks, avoid barrel file re-exports that break tree-shaking, and dynamically import large third-party libraries like Chart.js only when needed.

Does Angular SSR support incremental hydration?▼

Yes, Angular supports incremental hydration through provideClientHydration(withIncrementalHydration(), withEventReplay()). Combine it with @defer (hydrate on viewport) or (hydrate on interaction) to hydrate non-critical content lazily.

Why does my Angular app re-render too often?▼

Frequent re-renders usually come from default change detection, methods called in templates, or subscribing to entire state objects. Switch to OnPush, replace template methods with pure pipes or computed() signals, and use fine-grained selectors.

When should I use Signals instead of RxJS subscriptions in Angular?▼

Prefer Signals for synchronous component state and derived values via computed(), since they need no manual cleanup. Use toSignal() to bridge observables, and takeUntilDestroyed for remaining subscriptions to prevent memory leaks.