Claude-skill-registry angular-frontend
Build and implement Angular 18 standalone components, TypeScript services with Signals and RxJS, routing with guards, and Tailwind CSS styling for Photo Map MVP. Use when creating, developing, or implementing TypeScript components, services, guards, forms, HTTP calls, map integration (Leaflet.js), or responsive UI layouts with Tailwind utilities. File types: .ts, .html, .css, .scss
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/angular-frontend" ~/.claude/skills/majiayu000-claude-skill-registry-angular-frontend && rm -rf "$T"
manifest:
skills/data/angular-frontend/SKILL.mdsource content
Angular Frontend Development - Photo Map MVP
Project Context
Photo Map MVP - Single Page Application (SPA) for managing photos with geolocation.
Frontend Stack:
- Angular: 18.2.0+ (standalone components, NO NgModules!)
- TypeScript: 5.5.2+ (strict mode)
- Styling: Tailwind CSS 3.4.17 (NOT v4 - Angular 18 incompatibility!)
- Map: Leaflet.js 1.9.4 + marker clustering
- State: RxJS 7.8.0 (BehaviorSubject pattern, no NgRx)
- Build: Angular CLI 18.2.0 (esbuild)
Core Features:
- Authentication: Login/Register with JWT storage, route guards
- Gallery: Responsive grid with lazy loading, rating, filtering
- Map View: Leaflet integration with GPS markers, popups, clustering
- Admin Panel: User management (ADMIN role only)
Key Constraints:
- Standalone components ONLY - NO NgModules anywhere!
- Tailwind 3.4.17 - NOT 4.x (incompatibility with Angular 18)
- inject() function - NOT constructor injection (modern Angular 18)
- Signals - reactive state (Angular 16+)
- BehaviorSubject - service state management (no NgRx)
Architecture Principles
Standalone Components
ALL components MUST be standalone (
standalone: true). Explicitly import dependencies in imports array. NO @NgModule anywhere.
Check:
references/angular-patterns.md for complete patterns.
State Management Strategy
Decision Tree:
- Component-local state → Use Signals (
,signal()
,computed()
)effect() - Shared state (cross-component) → Use BehaviorSubject in Services
Pattern:
private BehaviorSubject → public Observable → Component subscribes
Check:
references/state-management.md for detailed patterns.
Dependency Injection
Use
inject() function (modern Angular 18), NOT constructor injection. Make all injected services readonly.
Example:
private readonly photoService = inject(PhotoService);
When to Use What
Signals vs BehaviorSubject
| Use Case | Solution |
|---|---|
| Component-local state (counters, UI flags, filters) | Signals |
| Computed values (derived state) | Signals () |
| Shared state (cross-component, services) | BehaviorSubject |
| Async operations (HTTP, timers) | BehaviorSubject |
| Complex RxJS pipelines | BehaviorSubject |
Smart vs Dumb Components
| Type | Characteristics |
|---|---|
| Smart (Container) | Inject services, manage state, business logic, fetch data |
| Dumb (Presentational) | NO service injection, @Input/@Output only, pure presentation |
Check:
references/component-patterns.md for detailed examples.
Implementation Workflows
Creating Component
- Use checklist:
templates/component-template.md - Standalone setup:
@Component({ standalone: true })- Import dependencies:
,CommonModule
, child componentsRouterLink
- Dependency injection: Use
, make servicesinject()readonly - State: Signals for local state, BehaviorSubject consumption for shared state
- Template: Use @if, @for (NOT *ngIf, *ngFor), add
attributesdata-testid - Examples:
- Smart component →
examples/photo-gallery.component.ts - Dumb component →
examples/photo-card.component.ts
- Smart component →
Check:
references/component-patterns.md for Smart vs Dumb patterns.
Creating Service
- Use checklist:
templates/service-template.md - State management:
- Private:
private readonly itemsSubject = new BehaviorSubject<T>([]) - Public:
readonly items$ = itemsSubject.asObservable()
- Private:
- HTTP methods: All return
with explicit typesObservable<T> - Error handling: Use
, log errors, transform to user-friendly messagescatchError - Example:
(BehaviorSubject + HTTP)examples/photo.service.ts
Check:
references/service-patterns.md for HTTP patterns and interceptors.
Routing Setup
- Use checklist:
templates/route-template.md - Configure routes:
with flat Routes arrayapp.routes.ts - Functional guards: Use
, inject services withCanActivateFninject() - Register:
inprovideRouter(routes)app.config.ts - Examples:
- Routes →
examples/app.routes.ts - Guards →
examples/auth.guard.ts
- Routes →
Check:
references/angular-patterns.md for routing and guards.
Patterns and Best Practices
- TypeScript quality: Check
(readonly, const, strict mode)references/typescript-quality.md - RxJS patterns: Check
(operators, async pipe, error handling)references/rxjs-patterns.md - Tailwind CSS: Check
(utility-first, responsive, constraints)references/tailwind-patterns.md - Leaflet integration: Check
(map setup, markers, clustering)references/leaflet-integration.md - SOLID principles: Check
(when complexity justifies it)references/solid-principles.md - Testing: Check
(Jasmine + Karma, test IDs)references/testing-patterns.md - Responsive design: Check
(mobile-first, touch-friendly)references/responsive-design.md
Key Reminders
Critical Constraints:
- ✅ ALWAYS
(NO NgModules!)standalone: true - ✅ Use
NOT constructor injectioninject() - ✅ Tailwind 3.4.17 (NOT 4 - incompatibility!)
- ✅
on all interactive elements (kebab-case)data-testid - ✅
for services,readonly
for variablesconst - ✅ Explicit return types (TypeScript strict)
State Management:
- ✅ Signals → component-local state
- ✅ BehaviorSubject → service state (shared)
- ✅ Async pipe in templates (automatic cleanup)
Component Structure:
- ✅ Smart components: inject services, manage state
- ✅ Dumb components: @Input/@Output only
- ✅ Use @if, @for, @switch (NOT *ngIf, *ngFor)
Routing:
- ✅ Functional guards (
)CanActivateFn - ✅ Return
true | false | UrlTree - ✅ Use
in guardsinject()
Quick Reference
Pattern Lookup
| Need | Check |
|---|---|
| Angular patterns (standalone, control flow, inject) | |
| State management (Signals vs BehaviorSubject) | |
| TypeScript quality (readonly, const, strict) | |
| RxJS patterns (operators, async pipe) | |
| Tailwind styling (utility-first, responsive) | |
| Leaflet maps (setup, markers, clustering) | |
| Component patterns (Smart vs Dumb) | |
| Service patterns (HTTP, BehaviorSubject) | |
| SOLID principles | |
| Testing (Jasmine, Karma) | |
| Responsive design (mobile-first, RWD) | |
Example Lookup
| Need | Check |
|---|---|
| Smart component (with Signals + Services) | |
| Dumb component (@Input/@Output) | |
| Service (BehaviorSubject + HTTP) | |
| Filter service (state management) | |
| Map component (Leaflet integration) | |
| Functional guards | |
| Route configuration | |
| TypeScript interfaces | |
| HTTP interceptors | |
Template Lookup (Checklists)
| Need | Check |
|---|---|
| Creating standalone component | |
| Creating service with state | |
| Routing + guards setup | |
| Writing tests (Jasmine + Karma) | |