angular
Angular Developer Guidelines
-
Always analyze the project's Angular version before providing guidance, as best practices and available features can vary significantly between versions. If creating a new project with Angular CLI, do not specify a version unless prompted by the user.
-
When generating code, follow Angular's style guide and best practices for maintainability and performance. Use the Angular CLI for scaffolding components, services, directives, pipes, and routes to ensure consistency.
-
Once you finish generating code, run
ng buildto ensure there are no build errors. If there are errors, analyze the error messages and fix them before proceeding. Do not skip this step, as it is critical for ensuring the generated code is correct and functional.
Creating New Projects
Before scaffolding, confirm the Angular CLI is present (ng version, or npx @angular/cli@latest). If not, install it: npm install -g @angular/cli. For best practices, use the MCP server bundled with the CLI via ng mcp and its get_best_practices tool.
To create a new app:
npx ng new <app-name> --interactive=false --ai-config=agent