angular-architect by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill angular-architect提供企业级 Angular 开发专业知识,专注于 Angular 16+ 特性(Signals、独立组件)、RxJS 响应式编程以及大规模 NgRx 状态管理。设计具有性能优化和现代架构模式的大规模 Angular 应用程序。
What is the complexity level?
│
├─ **Local State (Component)**
│ ├─ Simple? → **Signals (`signal`, `computed`)**
│ └─ Complex streams? → **RxJS (`BehaviorSubject`)**
│
├─ **Global Shared State**
│ ├─ Lightweight? → **NgRx Signal Store** (Modern, functional)
│ ├─ Enterprise/Complex? → **NgRx Store (Redux)** (Strict actions/reducers)
│ └─ Entity Collections? → **NgRx Entity**
│
└─ **Server State**
└─ Caching/Deduplication? → **TanStack Query (Angular)** or **RxJS + Cache Operator**
| 模式 | 使用场景 | 优点 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 缺点 |
|---|
| 独立组件 | 15+ 版本的默认选择 | 样板代码少,可树摇优化 | 对传统开发者有学习曲线 |
| Nx 单仓库 | 多应用企业项目 | 共享库,受影响的构建 | 工具链复杂 |
| 微前端 | 不同团队/技术栈 | 独立部署 | 运行时复杂,共享依赖地狱 |
| 无 Zone.js | 高性能需求 | 无 Zone.js 开销 | 需要显式变更检测 |
危险信号 → 升级到 performance-engineer:
takeUntilDestroyed)目标: 以比 Redux 更少的样板代码管理功能状态。
步骤:
定义 Store
import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
export const UserStore = signalStore(
{ providedIn: 'root' },
withState({ users: [], loading: false, query: '' }),
withMethods((store) => ({
setQuery(query: string) {
patchState(store, { query });
},
async loadUsers() {
patchState(store, { loading: true });
const users = await fetchUsers(store.query());
patchState(store, { users, loading: false });
}
}))
);
在组件中使用
export class UserListComponent {
readonly store = inject(UserStore);
constructor() {
// 当查询变化时自动加载(Effect)
effect(() => {
this.store.loadUsers();
});
}
}
目标: 移除 Zone.js 以获得更小的包体积和更好的调试体验。
步骤:
引导配置
// main.ts
bootstrapApplication(AppComponent, {
providers: [
provideExperimentalZonelessChangeDetection()
]
});
状态管理(仅使用 Signals)
ApplicationRef.tick()。signal()。集成
AsyncPipe(仍然有效)或 toSignal。setInterval 不会自动触发变更检测。在定时器内部使用 signal 更新。表现形式:
this.route.params.subscribe(params => {
this.service.getData(params.id).subscribe(data => {
this.data = data; // 手动赋值
});
});
问题所在:
正确方法:
SwitchMap:
this.data$ = this.route.params.pipe(
switchMap(params => this.service.getData(params.id))
);
在模板中使用 AsyncPipe 或 toSignal。
表现形式:
<div *ngIf="user.roles.includes('ADMIN') && user.active && !isLoading">
问题所在:
正确方法:
计算 Signal / Getter:
isAdmin = computed(() => this.user().roles.includes('ADMIN'));
<div *ngIf="isAdmin()">
表现形式:
SharedModule 导入所有内容(Material、工具、组件)。问题所在:
正确方法:
imports: [] 数组中精确导入所需内容。架构:
NgModules。loadComponent)。性能:
OnPush。@defer。代码质量:
strict: true。AsyncPipe 或 toSignal 代替 .subscribe()。innerHTML。场景: 一家零售公司需要架构一个大规模电子商务平台,处理 10 万+并发用户,包含独立的商品目录、购物车、结账和用户管理模块。
架构决策:
关键实现细节:
场景: 一家金融服务公司有一个使用 NgModules 的 5 年历史 Angular 应用程序,希望现代化到 Angular 18 并使用独立组件。
迁移策略:
ng-dompurify 查找所有模块依赖迁移结果:
场景: 一家 SaaS 公司需要一个监控仪表板,以 1 秒更新频率显示实时指标,需要细粒度响应式且无 Zone.js 开销。
实现方法:
性能结果:
每周安装数
62
代码仓库
GitHub 星标数
42
首次出现
2026年1月24日
安全审计
安装于
opencode51
gemini-cli47
codex47
claude-code45
cursor42
github-copilot41
Provides enterprise Angular development expertise specializing in Angular 16+ features (Signals, Standalone Components), RxJS reactive programming, and NgRx state management at scale. Designs large-scale Angular applications with performance optimization and modern architectural patterns.
What is the complexity level?
│
├─ **Local State (Component)**
│ ├─ Simple? → **Signals (`signal`, `computed`)**
│ └─ Complex streams? → **RxJS (`BehaviorSubject`)**
│
├─ **Global Shared State**
│ ├─ Lightweight? → **NgRx Signal Store** (Modern, functional)
│ ├─ Enterprise/Complex? → **NgRx Store (Redux)** (Strict actions/reducers)
│ └─ Entity Collections? → **NgRx Entity**
│
└─ **Server State**
└─ Caching/Deduplication? → **TanStack Query (Angular)** or **RxJS + Cache Operator**
| Pattern | Use Case | Pros | Cons |
|---|---|---|---|
| Standalone | Default for 15+ | Less boilerplate, tree-shakable | Learning curve for legacy devs |
| Nx Monorepo | Multi-app enterprise | Shared libs, affected builds | Tooling complexity |
| Micro-Frontends | Different teams/stacks | Independent deployment | Runtime complexity, shared deps hell |
| Zoneless | High performance | No Zone.js overhead | Requires explicit Change Detection |
Red Flags → Escalate toperformance-engineer:
takeUntilDestroyed)Goal: Manage feature state with less boilerplate than Redux.
Steps:
Define Store
import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
export const UserStore = signalStore(
{ providedIn: 'root' },
withState({ users: [], loading: false, query: '' }),
withMethods((store) => ({
setQuery(query: string) {
patchState(store, { query });
},
async loadUsers() {
patchState(store, { loading: true });
const users = await fetchUsers(store.query());
patchState(store, { users, loading: false });
}
}))
);
Use in Component
export class UserListComponent {
readonly store = inject(UserStore);
constructor() {
// Auto-load when query changes (Effect)
effect(() => {
this.store.loadUsers();
});
}
}
Goal: Remove Zone.js for smaller bundles and better debugging.
Steps:
Bootstrap Config
// main.ts
bootstrapApplication(AppComponent, {
providers: [
provideExperimentalZonelessChangeDetection()
]
});
State Management (Signals Only)
ApplicationRef.tick() manually.signal() for all state.Integrations
AsyncPipe (still works) or toSignal.setInterval does NOT trigger CD automatically. Use signal updates inside the timer.What it looks like:
this.route.params.subscribe(params => {
this.service.getData(params.id).subscribe(data => {
this.data = data; // Manual assignment
});
});
Why it fails:
Correct approach:
SwitchMap:
this.data$ = this.route.params.pipe(
switchMap(params => this.service.getData(params.id))
);
Use AsyncPipe or toSignal in template.
What it looks like:
<div *ngIf="user.roles.includes('ADMIN') && user.active && !isLoading">
Why it fails:
Correct approach:
Computed Signal / Getter:
isAdmin = computed(() => this.user().roles.includes('ADMIN'));
<div *ngIf="isAdmin()">
What it looks like:
SharedModule importing everything (Material, Utils, Components).Why it fails:
Correct approach:
imports: [] array.Architecture:
NgModules for new features.loadComponent).Performance:
OnPush enabled everywhere.@defer used for heavy components below the fold.Code Quality:
strict: true in tsconfig.AsyncPipe or toSignal used instead of .subscribe().innerHTML without sanitization.Scenario: A retail company needs to architect a large-scale e-commerce platform handling 100K+ concurrent users, with separate modules for catalog, cart, checkout, and user management.
Architecture Decisions:
Key Implementation Details:
Scenario: A financial services company has a 5-year-old Angular application using NgModules and wants to modernize to Angular 18 with Standalone Components.
Migration Strategy:
ng-dompurify to find all module dependenciesMigration Results:
Scenario: A SaaS company needs a monitoring dashboard showing real-time metrics with 1-second updates, requiring fine-grained reactivity without Zone.js overhead.
Implementation Approach:
Performance Results:
Weekly Installs
62
Repository
GitHub Stars
42
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode51
gemini-cli47
codex47
claude-code45
cursor42
github-copilot41
TanStack Query v5 完全指南:React 数据管理、乐观更新、离线支持
2,500 周安装