CursorAngularArchitecture

Angular Cursor Rules

Cursor rules for Angular: standalone components, signals, OnPush strategy, and modern Angular 17+ patterns.

.cursorrules
- Use standalone components; avoid NgModule for new code in Angular 17+
- Use signals (signal(), computed(), effect()) for reactive state management
- Apply ChangeDetectionStrategy.OnPush to all components for performance
- Use inject() function instead of constructor injection in new code
- Use the new control flow syntax (@if, @for, @switch) over structural directives
- Use NgRx SignalStore or plain services with signals over complex NgRx for simple state
- Lazy load all feature routes; never import feature modules in AppModule
- Use trackBy (or track in new syntax) for all @for loops

How to use with Cursor

Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.

#angular#signals#typescript#cursor#coding-rules

Related Rules