AI Config, Rules & Skills đ
AI assistants write better Angular code when theyâre told how your project wants code written. Angular 22 gives you three ready-made ways to do that: a generated rules file (AGENTS.md, CLAUDE.md or GEMINI.md), the MCP server config for your tool, and official agent skills. On top of that, the CLI includes an interactive AI tutor.
What youâll learn
Section titled âWhat youâll learnâ- How
ng new --ai-configandng generate ai-configwork, and exactly which files they create per tool - Whatâs inside the generated Angular best-practices rules file and how to customise it
- Where rules files live for Copilot, Cursor, Claude Code, Gemini CLI, Codex, JetBrains, Windsurf and Antigravity
- How to install the official Angular agent skills
- How to start and use the Angular AI tutor
Generate AI config with the CLI
Section titled âGenerate AI config with the CLIâWhen creating a project
Section titled âWhen creating a projectâng new asks âWhich AI tools should Angular integrate with?â You can also answer up front:
ng new my-app --ai-config=claude-codeIn an existing project
Section titled âIn an existing projectâng generate ai-config --tool=vscodePass --tool more than once to configure several tools at the same time:
ng generate ai-config --tool=cursor --tool=claude-codeWhich files are created
Section titled âWhich files are createdâEach choice creates one rules file (Angular best practices) and one MCP config that registers the Angular CLI MCP server.
--tool value | Rules file | MCP config |
|---|---|---|
claude-code | CLAUDE.md | .mcp.json (mcpServers) |
cursor | AGENTS.md | .cursor/mcp.json (mcpServers) |
gemini-cli | .gemini/GEMINI.md | .gemini/settings.json (mcpServers) |
open-ai-codex | AGENTS.md | .codex/config.toml ([mcp_servers.angular-cli]) |
vscode | AGENTS.md | .vscode/mcp.json (servers) |
none | â | â |
The schematic is non-destructive:
- If the rules file already exists, it is skipped with a warning (so your customisations survive). Delete it and re-run to get the latest Angular defaults.
- If a JSON MCP config exists, the
angular-clientry is merged into it; other servers stay. - If
.codex/config.tomlalready has[mcp_servers.angular-cli], it is left alone; otherwise the section is appended.
Whatâs in the generated rules file
Section titled âWhatâs in the generated rules fileâThe rules file is a short, opinionated Angular style guide written for an LLM. It starts with a role (âYou are an expert in TypeScript, Angular, and scalable web application developmentâŚâ) followed by sections like these (abridged):
## Angular Best Practices- Always use standalone components over NgModules- Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v20+.- Do NOT set `changeDetection: ChangeDetectionStrategy.OnPush` explicitly. `OnPush` is the default in Angular v22+.- Use signals for state management- Implement lazy loading for feature routes- Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object âŚ- Use `NgOptimizedImage` for all static images.
## Components- Use `input()` and `output()` functions instead of decorators- Use `model()` for two-way bound properties âŚ- Use `computed()` for derived state- Prefer Signal Forms (`@angular/forms/signals`) for new forms âŚ- Do NOT use `ngClass`, use `class` bindings instead- Do NOT use `ngStyle`, use `style` bindings instead- Do NOT import `CommonModule` âŚ
## Templates- Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
## Services- Prefer the `@Service` decorator over `@Injectable({providedIn: 'root'})` for new singleton services (Angular v22+)- Use the `inject()` function instead of constructor injectionIt also has sections on TypeScript (strict types, no any), accessibility (must pass AXE checks and WCAG AA) and state management (no mutate, use set/update).
The same guide is shipped inside @angular/core (@angular/core/resources/best-practices.md), which is what the MCP serverâs get_best_practices tool loads for your installed version.
Customise it for your project
Section titled âCustomise it for your projectâThe generated file is a starting point. Add the things an assistant canât guess:
## Project conventions- Angular 22.2, TypeScript 6.0, Vitest for unit tests, Playwright for e2e.- Feature folders live in `src/app/features/<name>/`; shared UI in `src/app/ui/`.- State: signals in `@Service()` classes; no NgRx in new code.- HTTP: use `httpResource` for reads, `HttpClient` for writes. Never add `withFetch()` (fetch is the default).- Forms: Signal Forms with `[formField]`.- Run `ng test` and `ng build` before saying a task is done.Keep it short and specific. Rules files are sent with many requests, so every line costs context.
Rules files for other tools
Section titled âRules files for other toolsâDifferent tools look for instructions in different places. The Angular team also publishes ready-made files you can download from angular.devâs âLLM prompts and AI IDE setupâ page.
| Tool | Where it reads instructions |
|---|---|
| GitHub Copilot (VS Code, JetBrains, GitHub) | .github/copilot-instructions.md; VS Code also reads AGENTS.md and *.instructions.md files |
| Cursor | AGENTS.md or rules in .cursor/rules/ |
| Claude Code | CLAUDE.md |
| Gemini CLI | GEMINI.md |
| OpenAI Codex | AGENTS.md |
| JetBrains Junie | AGENTS.md |
| Antigravity | GEMINI.md |
| Windsurf | Rules files (Angular publishes a guidelines.md) |
The downloadable Angular best-practices prompt lives at https://angular.dev/assets/context/best-practices.md. You can also paste it as context into any chat that has no rules-file support.
llms.txt context files
Section titled âllms.txt context filesâllms.txt is a proposed convention that helps LLMs find a siteâs key content. angular.dev provides:
https://angular.dev/llms.txtâ an index of key pages and resourceshttps://angular.dev/assets/context/llms-full.txtâ a large compiled guide to how Angular works
Give these to tools that can fetch URLs, or attach them as context when you ask about Angular concepts.
Agent skills
Section titled âAgent skillsâAgent skills are packaged, task-specific instructions an agent loads only when relevant (for example, when you ask it to create a component). They keep the always-on rules file small while giving the agent deep guidance on demand.
The Angular team maintains official skills in the angular/skills repository:
| Skill | Use it for |
|---|---|
angular-developer | Generating Angular code and architecture guidance: components, services, reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling, testing and CLI tooling |
angular-new-app | Creating a new Angular app with the Angular CLI, following current guidelines for setup and structure |
Install them with the community skills tool:
npx skills add https://github.com/angular/skillsOr follow your toolâs own skills instructions (Gemini CLI, Antigravity and other agentic tools support skills). Once installed, you donât have to mention the skill â when you ask âadd a settings page with a formâ, a skill-aware agent loads angular-developer automatically.
The Angular AI tutor
Section titled âThe Angular AI tutorâThe Angular AI Tutor is an interactive course that runs inside your AI assistant through the MCP serverâs ai_tutor tool. You build a real app â a âSmart Recipe Boxâ â step by step. Instead of dumping code, the tutor explains a concept, shows a small example, gives you an exercise, then reads your project files to check your solution.
Start the tutor
Section titled âStart the tutorâ- Set up the Angular MCP server in your tool.
- Create a fresh project:
ng new recipe-boxand open it in your AI-enabled editor or CLI (VS Code, Gemini CLI, Claude CodeâŚ). - Type:
launch the Angular AI tutor.
Useful commands
Section titled âUseful commandsâ| You say | The tutor⌠|
|---|---|
| âSet my experience level to beginnerâ / âChange my rating to 8â | Adapts explanations (Beginner 1â3, Intermediate 4â7, Experienced 8â10) |
| âShow the table of contentsâ / âWhere are we?â | Shows the learning plan and your position |
| âhintâ | Gives a nudge without the full answer |
| âdetailed guideâ / âstep-by-step instructionsâ | Walks you through the exercise |
| âSkip this sectionâ | Confirms, then applies the solution and moves on |
| âTake me to the forms lessonâ | Jumps to a topic and updates your code to the right starting point |
| âproceedâ | Nudges the tutor if it seems stuck |
Your progress is your code: in a new session the tutor reads your files to find where you left off. Commit after each module (git commit -m "Complete module 8") so you have checkpoints.
What it covers
Section titled âWhat it coversâThe curriculum has five phases: Angular fundamentals (interpolation, events), state and signals (set, update, computed), component architecture (bindings, inputs, styling, @for, @if), advanced features (two-way binding, services and DI, routing, forms, Angular Material) and Signal Forms (submitting, resetting, validation, field state).
Troubleshooting
Section titled âTroubleshootingâ- Nothing happens? Make sure a project is open and the MCP server is running (in VS Code: MCP: List Running Servers should show
angular-cli; the.vscode/mcp.jsonfile has a Start button). - Tutor confused about your progress? Tell it: âIâm actually on module 8.â
- Still odd? Start a new chat â the tutor re-reads your files.
Key takeaways
Section titled âKey takeawaysâng new --ai-config=<tool>orng generate ai-config --tool=<tool>creates a rules file plus the Angular MCP config; it never overwrites an existing rules file.- Claude Code gets
CLAUDE.md, Gemini CLI gets.gemini/GEMINI.md, and Cursor, Codex and VS Code shareAGENTS.md. - Customise the rules file with your projectâs conventions â short and specific.
- Install the official skills with
npx skills add https://github.com/angular/skills. - The AI tutor (via MCP) is a hands-on way to learn modern Angular.
Next steps
Section titled âNext stepsâ- Connect the MCP server manually or tweak its options: Angular MCP Server
- Learn a reliable prompting workflow: Prompting Best Practices
- Point your assistant at this site: Use NG Guide with AI