skills/angular-best-practices/SKILL.md
Angular performance optimization and best practices guidelines for signals/reactivity, change detection, bundle optimization, templates, RxJS, component architecture, dependency injection, routing, forms, accessibility, testing, and tooling. Use when writing, reviewing, or refactoring Angular code, designing component hierarchies, optimizing performance, implementing reactive patterns, or scaffolding new projects.
npx skillsauth add sajeetharan/angular-agent-kit angular-best-practicesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive performance optimization and modern Angular guide, containing 55+ rules across 12 categories, prioritized by impact to guide automated refactoring and code generation.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Signals & Reactivity | CRITICAL | signals- |
| 2 | Change Detection | CRITICAL | cd- |
| 3 | Bundle Size Optimization | CRITICAL | bundle- |
| 4 | Template Performance | HIGH | template- |
| 5 | RxJS & Async Operations | HIGH | rxjs- |
| 6 | Component Architecture | HIGH | component- |
| 7 | Dependency Injection | HIGH | di- |
| 8 | Routing & Navigation | MEDIUM | routing- |
| 9 | HTTP & Data Fetching | MEDIUM | http- |
| 10 | Forms & Validation | MEDIUM | forms- |
| 11 | Accessibility | MEDIUM | a11y- |
| 12 | Testing & Debugging | MEDIUM | testing- |
| 13 | Tooling | MEDIUM | tooling- |
signals-overview - Use signals for reactive state managementsignals-linked-signal - Use linkedSignal for dependent writable statesignals-resource - Use resource for async data fetchingsignals-effects - Use effects only for side effects, never for state synccd-onpush - Use OnPush change detection strategycd-trackby - Always use trackBy in *ngForcd-pure-pipes - Prefer pure pipes over methods in templatescd-immutable-data - Use immutable data patternscd-detach-reattach - Detach change detection for heavy computationscd-run-outside-angular - Run non-UI code outside NgZonebundle-lazy-loading - Lazy load feature modulesbundle-tree-shaking - Ensure tree-shakeable providersbundle-standalone-components - Use standalone componentsbundle-defer-views - Use @defer for heavy componentsbundle-preload-strategies - Implement smart preloadingbundle-avoid-barrel-exports - Import directly, avoid barrel filestemplate-avoid-function-calls - Avoid function calls in templatestemplate-async-pipe - Use async pipe instead of manual subscriptionstemplate-ng-container - Use ng-container for structural directivestemplate-control-flow - Use new control flow syntax (@if, @for)template-optimize-ngif-ngfor - Never use *ngIf and *ngFor on same elementtemplate-image-optimization - Use NgOptimizedImage directiverxjs-avoid-nested-subscriptions - Never nest subscriptionsrxjs-unsubscribe - Always unsubscribe (takeUntilDestroyed, DestroyRef)rxjs-share-replay - Use shareReplay for HTTP cachingrxjs-switchmap-vs-mergemap - Choose correct flattening operatorrxjs-signals-vs-observables - Prefer signals for synchronous staterxjs-debounce-throttle - Debounce user input eventscomponent-smart-presentational - Separate smart and presentational componentscomponent-signal-inputs - Use signal-based inputs and outputscomponent-input-transforms - Use input transforms for data conversioncomponent-output-naming - Follow output naming conventionscomponent-content-projection - Use content projection effectivelycomponent-dynamic-components - Load components dynamically when neededcomponent-host-directives - Compose behavior with host directivesdi-inject-function - Use inject() function over constructor injectionrouting-guards - Use functional route guardsrouting-rendering-strategies - Choose correct rendering strategy (CSR/SSR/SSG)http-interceptors - Use interceptors for cross-cutting concernshttp-caching - Implement HTTP caching strategieshttp-retry-logic - Add retry logic for resiliencehttp-cancel-requests - Cancel pending requests on navigationhttp-typed-responses - Always type HTTP responseshttp-error-handling - Implement centralized error handlingforms-signal-forms - Use signal forms for Angular v21+ appsforms-reactive-over-template - Prefer reactive forms for complex formsforms-typed-forms - Use strictly typed reactive formsforms-custom-validators - Create reusable custom validatorsforms-async-validation - Debounce async validatorsforms-control-value-accessor - Implement ControlValueAccessor correctlyforms-form-arrays - Handle dynamic form arrays efficientlya11y-angular-aria - Use Angular Aria for accessible componentstesting-zoneless-async - Use zoneless async-first testing patterntesting-component-harness - Use component harnessestesting-mock-services - Mock services properlytesting-async-testing - Use fakeAsync/tick for async teststesting-change-detection - Trigger change detection in teststesting-marble-testing - Use marble testing for RxJStesting-performance-profiling - Profile with Angular DevToolstooling-cli-generate - Use Angular CLI for code generation and dependenciesRead individual rule files for detailed explanations and code examples:
rules/cd-onpush.md
rules/bundle-lazy-loading.md
rules/_sections.md
Each rule file contains:
For the complete guide with all rules expanded: AGENTS.md
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.