Skip to content
Back to skills

Angular Best Practices

ASecurity

Curated Angular best practices for building performant, maintainable applications. Library-specific rules available as optional skills.

  • 57 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 17, 2026
developmenttypescriptgoreactangulartestingapiperformance

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add diegosouzapw/awesome-omni-skill --skill angular-best-practices --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Angular Best Practices?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Angular Best Practices
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/diegosouzapw-angular-best-practices-0d0f6902/badge)](https://www.skillsdirectory.com/skills/diegosouzapw-angular-best-practices-0d0f6902)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: angular-best-practices
description: Curated Angular best practices for building performant, maintainable applications. Library-specific rules available as optional skills.
version: 1.0.0
author: alfredoperez
tags:
  - angular
  - typescript
  - signals
  - performance
  - testing
  - state-management
globs:
  - "**/*.ts"
  - "**/*.html"
  - "**/*.component.ts"
  - "**/*.service.ts"
---

# Angular Best Practices

Curated rules for building performant, maintainable Angular applications. Library-specific rules (NgRx, SignalStore, TanStack Query) available as optional skills.

## When to Use

Apply these practices when:
- Creating components, services, and directives
- Setting up state management with Signals
- Writing unit, component, and E2E tests
- Optimizing bundle size and runtime performance
- Implementing forms, routing, and SSR

## Categories

| Category | Rules | Impact |
|----------|-------|--------|
| Bundle Optimization | 5 | CRITICAL |
| Signals & Reactivity | 5 | HIGH |
| Change Detection | 5 | HIGH |
| Component Patterns | 4 | HIGH |
| RxJS Patterns | 5 | HIGH |
| Testing | 6 | HIGH |
| TypeScript | 14 | MEDIUM |

## Optional Library Skills

Install library-specific rules alongside this core skill:

| Library | Install Command |
|---------|----------------|
| NgRx | `npx skills add alfredoperez/angular-best-practices/skills/angular-best-practices-ngrx` |
| SignalStore | `npx skills add alfredoperez/angular-best-practices/skills/angular-best-practices-signalstore` |
| TanStack Query | `npx skills add alfredoperez/angular-best-practices/skills/angular-best-practices-tanstack` |

## Quick Reference

### Modern Angular Patterns

| Pattern | Use | Avoid |
|---------|-----|-------|
| Signal inputs | `input<T>()` | `@Input()` |
| Signal outputs | `output<T>()` | `@Output()` |
| Dependency injection | `inject()` | Constructor injection |
| Control flow | `@if`, `@for`, `@switch` | `*ngIf`, `*ngFor` |
| Class binding | `[class.active]` | `[ngClass]` |
| Change detection | `OnPush` | Default |
| Derived state | `computed()` | Getters |

### Component Template

```typescript
@Component({
  selector: 'app-user-card',
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    @if (user(); as u) {
      <h2>{{ u.name }}</h2>
      <button (click)="selected.emit(u)">Select</button>
    }
  `,
})
export class UserCardComponent {
  user = input.required<User>();
  selected = output<User>();
}
```

### Service Template

```typescript
@Injectable({ providedIn: 'root' })
export class UserService {
  private http = inject(HttpClient);

  getUsers(): Observable<User[]> {
    return this.http.get<User[]>('/api/users');
  }
}
```

### State with Signals

```typescript
export class CounterComponent {
  count = signal(0);
  doubled = computed(() => this.count() * 2);

  increment() {
    this.count.update(c => c + 1);
  }
}
```

## License

MIT

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.