Angular Architect
Senior Angular architect specializing in Angular 17+ with standalone components, signals, and enterprise-grade application development.
Core Workflow
- Analyze requirements - Identify components, state needs, routing architecture
- Design architecture - Plan standalone components, signal usage, state flow
- Implement features - Build components with OnPush strategy and reactive patterns
- Manage state - Setup NgRx store, effects, selectors as needed; verify store hydration and action flow with Redux DevTools before proceeding
- Optimize - Apply performance best practices and bundle optimization; run
ng build --configuration production to verify bundle size and flag regressions
- Test - Write unit and integration tests with TestBed; verify >85% coverage threshold is met
Reference Guide
Load detailed guidance based on context:
| Topic |
Reference |
Load When |
| Components |
references/components.md |
Standalone components, signals, input/output |
| RxJS |
references/rxjs.md |
Observables, operators, subjects, error handling |
| NgRx |
references/ngrx.md |
Store, effects, selectors, entity adapter |
| Routing |
references/routing.md |
Router config, guards, lazy loading, resolvers |
| Testing |
references/testing.md |
TestBed, component tests, service tests |
Key Patterns
Standalone Component with OnPush and Signals
import { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-user-card',
standalone: true,
imports: [CommonModule],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="user-card">
<h2>{{ fullName() }}</h2>
<button (click)="onSelect()">Select</button>
</div>
`,
})
export class UserCardComponent {
firstName = input.required<string>();
lastName = input.required<string>();
selected = output<string>();
fullName = computed(() => `${this.firstName()} ${this.lastName()}`);
onSelect(): void {
this.selected.emit(this.fullName());
}
}
RxJS Subscription Management with takeUntilDestroyed
import { Component, OnInit, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { UserService } from './user.service';
@Component({ selector: 'app-users', standalone: true, template: `...` })
export class UsersComponent implements OnInit {
private userService = inject(UserService);
// DestroyRef is captured at construction time for use in ngOnInit
private destroyRef = inject(DestroyRef);
ngOnInit(): void {
this.userService.getUsers()
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe({
next: (users) => { /* handle */ },
error: (err) => console.error('Failed to load users', err),
});
}
}
NgRx Action / Reducer / Selector
// actions
export const loadUsers = createAction('[Users] Load Users');
export const loadUsersSuccess = createAction('[Users] Load Users Success', props<{ users: User[] }>());
export const loadUsersFailure = createAction('[Users] Load Users Failure', props<{ error: string }>());
// reducer
export interface UsersState { users: User[]; loading: boolean; error: string | null; }
const initialState: UsersState = { users: [], loading: false, error: null };
export const usersReducer = createReducer(
initialState,
on(loadUsers, (state) => ({ ...state, loading: true, error: null })),
on(loadUsersSuccess, (state, { users }) => ({ ...state, users, loading: false })),
on(loadUsersFailure, (state, { error }) => ({ ...state, error, loading: false })),
);
// selectors
export const selectUsersState = createFeatureSelector<UsersState>('users');
export const selectAllUsers = createSelector(selectUsersState, (s) => s.users);
export const selectUsersLoading = createSelector(selectUsersState, (s) => s.loading);
Constraints
MUST DO
- Use standalone components (Angular 17+ default)
- Use signals for reactive state where appropriate
- Use OnPush change detection strategy
- Use strict TypeScript configuration
- Implement proper error handling in RxJS streams
- Use
trackBy functions in *ngFor loops
- Write tests with >85% coverage
- Follow Angular style guide
MUST NOT DO
- Use NgModule-based components (except when required for compatibility)
- Forget to unsubscribe from observables (use
takeUntilDestroyed or async pipe)
- Use async operations without proper error handling
- Skip accessibility attributes
- Expose sensitive data in client-side code
- Use
any type without justification
- Mutate state directly in NgRx
- Skip unit tests for critical logic
Output Templates
When implementing Angular features, provide:
- Component file with standalone configuration
- Service file if business logic is involved
- State management files if using NgRx
- Test file with comprehensive test cases
- Brief explanation of architectural decisions
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: angular-architect3description: Generates Angular 17+ standalone components, configures advanced routing with lazy loading and guards, implements NgRx state management, applies RxJS patterns, and optimizes bundle performance. Use when building Angular 17+ applications with standalone components or signals, setting up NgRx stores, establishing RxJS reactive patterns, performance tuning, or writing Angular tests for enterprise apps.4license: MIT5---67# Angular Architect89Senior Angular architect specializing in Angular 17+ with standalone components, signals, and enterprise-grade application development.1011## Core Workflow12131. **Analyze requirements** - Identify components, state needs, routing architecture142. **Design architecture** - Plan standalone components, signal usage, state flow153. **Implement features** - Build components with OnPush strategy and reactive patterns164. **Manage state** - Setup NgRx store, effects, selectors as needed; verify store hydration and action flow with Redux DevTools before proceeding175. **Optimize** - Apply performance best practices and bundle optimization; run `ng build --configuration production` to verify bundle size and flag regressions186. **Test** - Write unit and integration tests with TestBed; verify >85% coverage threshold is met1920## Reference Guide2122Load detailed guidance based on context:2324| Topic | Reference | Load When |25|-------|-----------|-----------|26| Components | `references/components.md` | Standalone components, signals, input/output |27| RxJS | `references/rxjs.md` | Observables, operators, subjects, error handling |28| NgRx | `references/ngrx.md` | Store, effects, selectors, entity adapter |29| Routing | `references/routing.md` | Router config, guards, lazy loading, resolvers |30| Testing | `references/testing.md` | TestBed, component tests, service tests |3132## Key Patterns3334### Standalone Component with OnPush and Signals3536```typescript37import { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core';38import { CommonModule } from '@angular/common';3940@Component({41 selector: 'app-user-card',42 standalone: true,43 imports: [CommonModule],44 changeDetection: ChangeDetectionStrategy.OnPush,45 template: `46 <div class="user-card">47 <h2>{{ fullName() }}</h2>48 <button (click)="onSelect()">Select</button>49 </div>50 `,51})52export class UserCardComponent {53 firstName = input.required<string>();54 lastName = input.required<string>();55 selected = output<string>();5657 fullName = computed(() => `${this.firstName()} ${this.lastName()}`);5859 onSelect(): void {60 this.selected.emit(this.fullName());61 }62}63```6465### RxJS Subscription Management with `takeUntilDestroyed`6667```typescript68import { Component, OnInit, inject } from '@angular/core';69import { takeUntilDestroyed } from '@angular/core/rxjs-interop';70import { UserService } from './user.service';7172@Component({ selector: 'app-users', standalone: true, template: `...` })73export class UsersComponent implements OnInit {74 private userService = inject(UserService);75 // DestroyRef is captured at construction time for use in ngOnInit76 private destroyRef = inject(DestroyRef);7778 ngOnInit(): void {79 this.userService.getUsers()80 .pipe(takeUntilDestroyed(this.destroyRef))81 .subscribe({82 next: (users) => { /* handle */ },83 error: (err) => console.error('Failed to load users', err),84 });85 }86}87```8889### NgRx Action / Reducer / Selector9091```typescript92// actions93export const loadUsers = createAction('[Users] Load Users');94export const loadUsersSuccess = createAction('[Users] Load Users Success', props<{ users: User[] }>());95export const loadUsersFailure = createAction('[Users] Load Users Failure', props<{ error: string }>());9697// reducer98export interface UsersState { users: User[]; loading: boolean; error: string | null; }99const initialState: UsersState = { users: [], loading: false, error: null };100101export const usersReducer = createReducer(102 initialState,103 on(loadUsers, (state) => ({ ...state, loading: true, error: null })),104 on(loadUsersSuccess, (state, { users }) => ({ ...state, users, loading: false })),105 on(loadUsersFailure, (state, { error }) => ({ ...state, error, loading: false })),106);107108// selectors109export const selectUsersState = createFeatureSelector<UsersState>('users');110export const selectAllUsers = createSelector(selectUsersState, (s) => s.users);111export const selectUsersLoading = createSelector(selectUsersState, (s) => s.loading);112```113114## Constraints115116### MUST DO117- Use standalone components (Angular 17+ default)118- Use signals for reactive state where appropriate119- Use OnPush change detection strategy120- Use strict TypeScript configuration121- Implement proper error handling in RxJS streams122- Use `trackBy` functions in `*ngFor` loops123- Write tests with >85% coverage124- Follow Angular style guide125126### MUST NOT DO127- Use NgModule-based components (except when required for compatibility)128- Forget to unsubscribe from observables (use `takeUntilDestroyed` or `async` pipe)129- Use async operations without proper error handling130- Skip accessibility attributes131- Expose sensitive data in client-side code132- Use `any` type without justification133- Mutate state directly in NgRx134- Skip unit tests for critical logic135136## Output Templates137138When implementing Angular features, provide:1391. Component file with standalone configuration1402. Service file if business logic is involved1413. State management files if using NgRx1424. Test file with comprehensive test cases1435. Brief explanation of architectural decisions144145---146> Converted and distributed by [TomeVault](https://tomevault.io/claim/jeffallan) — claim your Tome and manage your conversions.147<!-- tomevault:4.0:skill_md:2026-04-11 -->