Generates Angular code and provides architectural guidance for existing Angular v19 projects. Trigger for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.
This skill targets existing Angular v19 projects. All guidance, APIs, and examples are written for v19. Features exclusive to v20+ or v21+ are not included.
The following legacy Angular APIs are FORBIDDEN in new code. Never generate them. Never suggest them. Always use the modern equivalent.
| Legacy (NEVER use) | Modern (ALWAYS use) | Notes |
|---|---|---|
@Input() decorator | input() / input.required() | Signal-based, reactive, type-safe |
@Output() + EventEmitter | output() |
No EventEmitter import needed |
@HostBinding() | host: { '[prop]': expr } in metadata | Declarative, co-located |
@HostListener() | host: { '(event)': 'handler($event)' } in metadata | Declarative, co-located |
@ViewChild() / @ViewChildren() | viewChild() / viewChildren() | Signal-based queries |
@ContentChild() / @ContentChildren() | contentChild() / contentChildren() | Signal-based queries |
*ngIf / *ngFor / *ngSwitch | @if / @for / @switch | Built-in control flow |
constructor(private svc: Service) | private svc = inject(Service) | Functional injection |
NgModule (for new code) | Standalone components | standalone: true is default in v19 |
ngOnInit for signal derivation | computed() / effect() | Reactive by default |
ngOnDestroy for cleanup | DestroyRef.onDestroy() / takeUntilDestroyed() | Prefer modern alternatives; ngOnDestroy is not forbidden |
When the agent is editing or working in a file that uses legacy syntax:
"This file uses legacy
@Input()/@Output()decorators. Want me to refactor them to signal-basedinput()/output()as a separate change?"
Do not rewrite manually. Angular ships official schematics that perform full-program analysis across TypeScript and templates. Always prefer a schematic over hand-editing.
Protocol:
.ts and .html files to identify which legacy patterns are present.--path when appropriate).ng build to verify no errors were introduced.Read refactoring.md for all available schematics, exact commands, flags, and known limitations.
ng build to ensure there are no build errors. If there are errors, analyze the error messages and fix them before proceeding.When working with Angular components, consult the following references based on the task:
signal-input-migration, output-migration, signal-queries-migration, inject-migration, control-flow-migration, standalone-migration, and more). Read refactoring.mdIf you require deeper documentation not found in the references above, read the documentation at https://angular.dev/guide/components.
When managing state and data reactivity, use Angular Signals and consult the following references:
signal, computed), reactive contexts, and untracked. Read signals-overview.mdlinkedSignal): Creating writable state linked to source signals. Read linked-signal.mdresource): Fetching asynchronous data directly into signal state. Read resource.md
⚠️
resource(),httpResource(), andrxResource()are experimental in v19. Use with awareness that the API may change in v20+.
effect): Logging, third-party DOM manipulation, and when NOT to use effects. Read effects.mdtoSignal(), toObservable(), and takeUntilDestroyed(). Read rxjs-interop.mdDefault for v19: Typed Reactive Forms.
Signal Forms (
@angular/forms/signals) are not available in v19. Do not reference them.
When implementing dependency injection in Angular, follow these guidelines:
inject() function. Read di-fundamentals.mdprovidedIn: 'root' option, and injecting into components or other services. Read creating-services.mdInjectionToken, useClass, useValue, useFactory, and scopes. Read defining-providers.mdinject() is allowed, runInInjectionContext, and assertInInjectionContext. Read injection-context.mdEnvironmentInjector vs ElementInjector, resolution rules, modifiers (optional, skipSelf), and providers vs viewProviders. Read hierarchical-injectors.mdWhen implementing navigation in Angular, consult the following references:
<router-outlet>, nested outlets, and named outlets. Read show-routes-with-outlets.mdRouterLink and programmatic navigation with Router. Read navigate-to-routes.mdCanActivate, CanMatch, and other guards for security. Read route-guards.mdResolveFn. Read data-resolvers.mdIf you require deeper documentation or more context, visit the official Angular Routing guide.
When implementing HTTP and data fetching, consult the following references:
HttpClient mutations, error handling): Read http.mdhttpResource(), resource(), rxResource(), state signals, loading states): Read resource.md
⚠️ All resource APIs are experimental in v19.
When implementing styling and animations in Angular, consult the following references:
@angular/animations DSL for dynamic effects. Read angular-animations.md
animate.enter/animate.leaveare not available in v19. Use CSS animations or the@angular/animationsDSL.
When writing or updating tests, consult the following references based on the task:
TestBed. Use Jasmine/Karma or a manual Vitest setup (native Vitest support is v20+ only). Read testing-fundamentals.mdRouterTestingHarness for reliable navigation tests. Read router-testing.mdWhen working with Angular tooling, consult the following references:
nx generate, nx build, nx serve, and nx test instead of the Angular CLI directly. Refer to the Nx docs for available generators and executors.