Angular Cursor Rules Template
Generate production-ready Angular Cursor rules for Project Rules (.mdc), AGENTS.md, or legacy .cursorrules. This template encodes stack-specific conventions for projects using Angular. Full-featured TypeScript framework with dependency injection, RxJS, and strong conventions.
The Complete Angular Cursor Rules
The full rule set in all three formats Cursor understands — copy the one your project uses. Project Rules (.mdc) load per-file via globs, AGENTS.md is portable across AI tools, and .cursorrules is the legacy single-file format.
Replacing a legacy file? Read the guide to migrate .cursorrules to Cursor Project Rules (.mdc) before copying this template into your project.
---
description: "Component Architecture"
alwaysApply: false
---
- Use standalone components by default (no NgModules).
- Use the new control flow syntax (@if, @for, @switch).
- Use spaces for indentation.
- Use camelCase for property and method names.
- Keep components small and focused on presentation logic.
- Delegate business logic to services.---
description: "Services & Dependency Injection"
alwaysApply: false
---
- Use providedIn: 'root' for singleton services.
- Use inject() function instead of constructor injection.
- Keep services focused on a single concern.
- Use signals (signal(), computed(), effect()) for reactive state.
- Use HttpClient with typed response generics.
- Use interceptors for cross-cutting concerns (auth, logging, error handling).---
description: "Routing & Navigation"
alwaysApply: false
---
- Use lazy loading with loadComponent for route-level code splitting.
- Use routerLink for internal navigation.
- Use route resolvers for pre-fetching data.
- Use route guards (canActivate, canDeactivate) for access control.
- Use withComponentInputBinding() for route params as component inputs.
- Define routes in a dedicated routes.ts file per feature module.---
description: "Forms & Validation"
alwaysApply: false
---
- Use Reactive Forms for complex forms with dynamic validation.
- Use Template-driven Forms for simple forms.
- Use FormBuilder to create form groups concisely.
- Implement custom validators as standalone functions.
- Use async validators for server-side validation.
- Provide clear error messages with form control state tracking.Customize These Rules
The generator below is preloaded with the Angular template. Adjust indentation, quotes, naming, add your own rules, then download — no need to start from scratch on the homepage.
What This Template Covers
Required guidance
- - Component Architecture
- - Services & Dependency Injection
- - Routing & Navigation
- - Forms & Validation
Default style
- - Indentation: 2 spaces
- - Quotes: single
- - Semicolons: enabled
- - Naming: camelCase
Frequently Asked Questions
- What does the Angular Cursor rules template include?
- It includes 4 rule sections covering component architecture, services & dependency injection, routing & navigation and other Angular development conventions.
- Can I generate Angular Project Rules and AGENTS.md from the same template?
- Yes. The generator can export the same stack-specific guidance as modern Project Rules (.mdc), AGENTS.md, or a legacy .cursorrules file.
- Should I combine Angular with other Cursor rules templates?
- Yes. You can combine Angular with related templates such as TypeScript, Tailwind CSS, Docker, or backend frameworks when your project uses multiple technologies.