Skip to content
Back to skills

Angular Expert

ASecurity

Enterprise Angular v21+ architecture and testing expert. Use when writing, reviewing, or designing Angular components, services, stores, or tests. Covers Zoneless change detection, Signals, SignalStore, module boundaries, testing strategy, and architectural heuristics. Triggers on Angular file creation/modification (.component.ts, .service.ts, .store.ts, .spec.ts), architectural discussions, state management, and testing decisions.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmenttypescriptgoangulartestingapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill angular-expert --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Angular Expert?

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

Security grade badge for Angular Expert
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-angular-expert/badge)](https://www.skillsdirectory.com/skills/david-li0406-angular-expert)

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-expert
description: Enterprise Angular v21+ architecture and testing expert. Use when writing, reviewing, or designing Angular components, services, stores, or tests. Covers Zoneless change detection, Signals, SignalStore, module boundaries, testing strategy, and architectural heuristics. Triggers on Angular file creation/modification (.component.ts, .service.ts, .store.ts, .spec.ts), architectural discussions, state management, and testing decisions.
---

# Angular Expert

Expert guidance for enterprise Angular v21+ development. Enforces architectural heuristics that prevent maintenance nightmares at scale.

## Core Architectural Imperatives

These rules apply to ALL Angular code. Violations create technical debt.

### 1. Standalone Components Only
All components, directives, and pipes MUST be standalone. `SharedModule` pattern is prohibited.
```typescript
@Component({
  standalone: true,
  imports: [CommonModule, RouterLink], // Explicit imports
})
```

### 2. Dependency Ladder (Strict)
Dependencies flow downward ONLY: `Feature → UI → Data-Access → Utility`
- **Feature**: Smart components, routing, orchestration
- **UI**: Dumb/presentational components (NO service injection)
- **Data-Access**: Stores, facades, HTTP services, entities
- **Utility**: Pure functions, validators, types

### 3. Component-Service Firewall
Smart components NEVER inject `HttpClient`, `Router`, or raw stores directly. Inject domain-specific Facades.
```typescript
// ❌ VIOLATION
constructor(private http: HttpClient) {}

// ✅ COMPLIANT
constructor(private userFacade: UserFacade) {}
```

### 4. Humble Components
Extract ALL complex logic to services/facades. Components should be thin glue with minimal branching.

### 5. Signals for State, RxJS for Events
- **Signals**: Hold data, derive values, render to view (synchronous)
- **RxJS**: Streams of actions, HTTP requests, complex timing coordination
- Use `toSignal()` to convert final Observable stage for templates

### 6. Push State Down
```
Global State  → User session, theme, language (Root store/service)
Feature State → Filters, pagination, form data (SignalStore in route)
Component State → UI toggles, ephemeral input (signal() on component)
```

### 7. Zoneless-Ready Code
Never mutate state expecting Angular to "magically" detect it. Always use Signals or AsyncPipe. No relying on Zone.js patches for `setTimeout`/`setInterval`.

## Testing Philosophy: Sociable Tests

Reject the Mockist approach. Test behavior, not implementation.

### The No-Mock Policy
- ✅ Provide REAL services in TestBed
- ✅ Mock ONLY at system boundaries: Network (MSW), Time, Browser APIs
- ❌ Never use `jasmine.createSpyObj` or `vi.fn()` for services
- ❌ Never spy on internal methods

### Verification Pattern
```typescript
// ❌ MOCKIST (Banned)
expect(spy.getUsers).toHaveBeenCalled();

// ✅ SOCIABLE (Required)
expect(screen.getByText('John')).toBeVisible();
```

### Zoneless Testing
```typescript
it('should work', async () => {
  await component.doSomething();
  await fixture.whenStable(); // Wait for framework tasks
  fixture.detectChanges();    // Explicit view update
  expect(...).toBe(...);
});
```

Use `TestBed.tick()` after setting signals that drive effects.

## Reference Guides

Load these when working on specific concerns:

- **[Architecture & Boundaries](references/architecture.md)**: Module boundaries, Nx constraints, Hexagonal architecture, circular dependency prevention. Load when designing new features or restructuring.

- **[Testing Strategy](references/testing.md)**: Vitest configuration, MSW setup, Harness patterns, VRT. Load when writing tests or setting up test infrastructure.

- **[Signal Patterns](references/signal-patterns.md)**: SignalStore, Signal Forms, computed patterns, effect synchronization. Load when implementing state management or forms.

- **[Code Templates](references/code-templates.md)**: Ready-to-use templates for components, stores, tests, harnesses. Load when scaffolding new files.

**Any unneeded directories can be deleted.** Not every skill requires all three types of resources.

Files in this skill

  • SKILL.md4 KB
  • references/architecture.md8.6 KB
  • references/code-templates.md13.5 KB
  • references/signal-patterns.md11.3 KB
  • references/testing.md10.4 KB

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…