Angular and AI ·
Frameworks in the AI era: Angular ships the prompt for your agent
Angular publishes best-practices.md and rules files for Copilot, Cursor, JetBrains, VS Code and Windsurf. Why conventions make agent-written code easy to check.
The Angular AI best-practices prompt is a file the Angular team maintains for coding agents. The "LLM prompts and AI IDE setup" page on angular.dev offers best-practices.md as system instructions, plus ready-made rules files for Antigravity (GEMINI.md), Copilot-powered IDEs (copilot-instructions.md), Cursor, JetBrains IDEs (AGENTS.md), VS Code (.instructions.md) and Windsurf (guidelines.md), an llms.txt and llms-full.txt for tools that read documentation, and an experimental MCP server in the Angular CLI. The team says the files are updated regularly to track Angular's conventions.
What the prompt says
Most of it is rules, and many are phrased as MUST or Do NOT. A selection from the current file:
- Always use standalone components over NgModules
- Do NOT set `changeDetection: ChangeDetectionStrategy.OnPush` explicitly. `OnPush` is the default in Angular v22+.
- Use signals for state management
- Use `input()` and `output()` functions instead of decorators
- Use `computed()` for derived state
- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
- Use the `inject()` function instead of constructor injection
- Do NOT import `CommonModule`, import only the directives and pipes the template uses
- Do NOT use `ngClass`, use `class` bindings instead
- It MUST pass all AXE checks.
- It MUST follow all WCAG AA minimumsWhy conventions matter more when a machine writes the code
A framework with one right shape for a component turns review into comparison. When every component uses input(), signals and @if, a generated one either matches the shape or it does not, and the mismatch is visible in seconds. In a codebase where state can live in five places and templates mix three control-flow styles, the reviewer has to reconstruct intent first. The prompt is the Angular team writing down the shape so the agent starts from it.
That is why I would pick a convention-heavy framework for a codebase an agent will write most of. The argument for flexibility was always that experienced developers make good local decisions. When the author is a model and the human only reviews, predictability is worth more than freedom.
Setup
Download the rules file for your editor from the angular.dev page and commit it to the repository, so every agent session and every teammate starts from the same conventions. Re-download after a major Angular release; the defaults in the file (standalone, OnPush, Signal Forms, the @Service decorator) are tied to versions.
Sources
I post short notes like this on LinkedIn.
Need help with this?
