
Angular Best Practices
Apply a prioritized Angular performance rule set when writing, reviewing, or refactoring components, bundles, and SSR setup.
Overview
Angular Best Practices is an agent skill most often used in Build (also Ship review and perf) that applies seven prioritized rule categories for Angular performance, bundles, and rendering.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill angular-best-practicesWhat is this skill?
- 7 prioritized rule categories from CRITICAL change detection through MEDIUM template optimization
- CRITICAL focus on signals, OnPush, zoneless, async waterfalls, and bundle lazy loading
- HIGH coverage for @defer, trackBy, virtualization, SSR hydration, and prerendering
- Explicit When to Use triggers for new components, fetching patterns, reviews, and refactors
- Marked safe-risk self-sourced guide for performance and rendering efficiency
- 7 prioritized rule categories in the performance guide
- 3 CRITICAL-tier categories: change detection, async waterfalls, bundle optimization
Adoption & trust: 451 installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your Angular app feels slow or bloated and ad-hoc agent advice misses the highest-impact change-detection, async, and bundle fixes.
Who is it for?
Solo builders maintaining Angular SaaS or admin UIs who want consistent performance reviews across feature work and pre-ship hardening.
Skip if: React/Vue/Svelte projects, greenfield non-Angular stacks, or pure visual/UI mock work without Angular runtime concerns.
When should I use this skill?
Writing, reviewing, or refactoring Angular code for optimal performance, bundle size, and rendering efficiency.
What do I get? / Deliverables
You get checklist-driven recommendations—signals, OnPush, lazy routes, @defer, SSR hydration—that align refactors and reviews with ordered performance impact.
- Performance-oriented refactor recommendations
- Review notes mapped to rule priority tiers
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build frontend because most rules apply while implementing Angular UI and data flows. Change detection, defer, lazy routes, and template control flow are frontend architecture concerns first.
Where it fits
Scaffold a new dashboard route with lazy loading and OnPush instead of default change detection.
Run a PR review focused on async waterfalls and RxJS patterns before merge.
Tune @defer boundaries and trackBy before a launch-week performance pass.
How it compares
Structured Angular performance playbook—not generic TypeScript lint rules or a component library catalog.
Common Questions / FAQ
Who is angular-best-practices for?
Solo and indie developers on Angular who want agents to follow a prioritized performance guide when coding or reviewing frontend work.
When should I use angular-best-practices?
In Build when adding components or data fetching; in Ship during code review, bundle/SSR tuning, or refactors targeting load time and rendering.
Is angular-best-practices safe to install?
The skill metadata marks safe risk; still review the Security Audits panel on this Prism page before installing from the upstream repo.
SKILL.md
READMESKILL.md - Angular Best Practices
# Angular Best Practices Comprehensive performance optimization guide for Angular applications. Contains prioritized rules for eliminating performance bottlenecks, optimizing bundles, and improving rendering. ## When to Use Reference these guidelines when: - Writing new Angular components or pages - Implementing data fetching patterns - Reviewing code for performance issues - Refactoring existing Angular code - Optimizing bundle size or load times - Configuring SSR/hydration --- ## Rule Categories by Priority | Priority | Category | Impact | Focus | | -------- | --------------------- | ---------- | ------------------------------- | | 1 | Change Detection | CRITICAL | Signals, OnPush, Zoneless | | 2 | Async Waterfalls | CRITICAL | RxJS patterns, SSR preloading | | 3 | Bundle Optimization | CRITICAL | Lazy loading, tree shaking | | 4 | Rendering Performance | HIGH | @defer, trackBy, virtualization | | 5 | Server-Side Rendering | HIGH | Hydration, prerendering | | 6 | Template Optimization | MEDIUM | Control flow, pipes | | 7 | State Management | MEDIUM | Signal patterns, selectors | | 8 | Memory Management | LOW-MEDIUM | Cleanup, subscriptions | --- ## 1. Change Detection (CRITICAL) ### Use OnPush Change Detection ```typescript // CORRECT - OnPush with Signals @Component({ changeDetection: ChangeDetectionStrategy.OnPush, template: `<div>{{ count() }}</div>`, }) export class CounterComponent { count = signal(0); } // WRONG - Default change detection @Component({ template: `<div>{{ count }}</div>`, // Checked every cycle }) export class CounterComponent { count = 0; } ``` ### Prefer Signals Over Mutable Properties ```typescript // CORRECT - Signals trigger precise updates @Component({ template: ` <h1>{{ title() }}</h1> <p>Count: {{ count() }}</p> `, }) export class DashboardComponent { title = signal("Dashboard"); count = signal(0); } // WRONG - Mutable properties require zone.js checks @Component({ template: ` <h1>{{ title }}</h1> <p>Count: {{ count }}</p> `, }) export class DashboardComponent { title = "Dashboard"; count = 0; } ``` ### Enable Zoneless for New Projects ```typescript // main.ts - Zoneless Angular (v20+) bootstrapApplication(AppComponent, { providers: [provideZonelessChangeDetection()], }); ``` **Benefits:** - No zone.js patches on async APIs - Smaller bundle (~15KB savings) - Clean stack traces for debugging - Better micro-frontend compatibility --- ## 2. Async Operations & Waterfalls (CRITICAL) ### Eliminate Sequential Data Fetching ```typescript // WRONG - Nested subscriptions create waterfalls this.route.params.subscribe((params) => { // 1. Wait for params this.userService.getUser(params.id).subscribe((user) => { // 2. Wait for user this.postsService.getPosts(user.id).subscribe((posts) => { // 3. Wait for posts }); }); }); // CORRECT - Parallel execution with forkJoin forkJoin({ user: this.userService.getUser(id), posts: this.postsService.getPosts(id), }).subscribe((data) => { // Fetched in parallel }); // CORRECT - Flatten dependent calls with switchMap this.route.params .pipe( map((p) => p.id), switchMap((id) => this.userService.getUser(id)), ) .subscribe(); ``` ### Avoid Client-Side Waterfalls in SSR ```typescript // CORRECT - Use resolvers or blocking hydration for critical data export const route: Route = { path: "profile/:id", resolve: { data: profileResolver }, // Fetched on server before navigation component: ProfileCom