Home › Angular › Angular 20 Copilot instructions
Angular 20 Copilot instructions
Copilot instructions for Angular 20 apps using standalone components, signals, and the new control flow.
GitHub CopilotAngular
How to use
Save this as .github/copilot-instructions.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
.github/copilot-instructions.mdDownload # Angular 20 project instructions
## Conventions
- Standalone components only; no new `NgModule`s. Generate with `ng generate component feature/name`.
- State: signals (`signal`, `computed`, `linkedSignal`) and `input()` / `output()` / `model()` functions instead of `@Input`/`@Output` decorators.
- Templates use built-in control flow (`@if`, `@for` with `track`, `@switch`, `@defer`), not `*ngIf`/`*ngFor`.
- Inject with `inject()` in field initializers rather than constructor parameters.
- Set `changeDetection: ChangeDetectionStrategy.OnPush` on every component. Assume the app may run zoneless; don't rely on zone.js side effects.
- HTTP: `HttpClient` in a feature service; expose results via `toSignal()` or `httpResource()` where the project already uses it. Unsubscribe with `takeUntilDestroyed()`.
- Forms: typed reactive forms (`FormGroup<{...}>`), validators in the component class.
- Routes are lazy: `loadComponent: () => import(...)`. Guards and resolvers are functions.
## Don't
- Don't use `any`, `subscribe` inside `subscribe`, or manual `ChangeDetectorRef.detectChanges()` as a fix.
- Don't touch `angular.json` budgets to make a build pass.
## Before finishing
Run `ng lint`, `ng test --watch=false`, and `ng build`.