mk-angular
Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 16
- Forks
- 3
01 前言 Front Matter
- name
- mk-angular
- description
- Angular v20+ patterns: components, signals, services, forms, routing, HTTP, testing, SSR. Auto-activates on .ts files in Angular projects (angular.json detected).
02 资源文件 11
- 参考文档references/component.md6.2 KB
- 参考文档references/di.md7.7 KB
- 参考文档references/directives.md10.2 KB
- 参考文档references/forms.md10.0 KB
- 参考文档references/gotchas.md4.2 KB
- 参考文档references/http.md8.2 KB
- 参考文档references/routing.md8.4 KB
- 参考文档references/signals.md6.9 KB
- 参考文档references/ssr.md10.5 KB
- 参考文档references/testing.md10.9 KB
- 参考文档references/tooling.md9.1 KB
03 SKILL.md 正文
Angular
Angular v20+ patterns — 10 topics consolidated with progressive disclosure.
v20+ Modern Defaults (apply always)
- Standalone components are default — no NgModule needed
- Signal-based inputs/outputs — use
input(),input.required(),output()(not@Input/@Output) - Signal-based state — use
signal(),computed(),linkedSignal()(not BehaviorSubject) - inject() function — use
inject()in field initializers (not constructor injection) - Native control flow — use
@if,@forwithtrack,@switch(not*ngIf/*ngFor) - OnPush change detection — always set
changeDetection: ChangeDetectionStrategy.OnPush - Functional guards/resolvers — use functions (not class-based guards)
- resource() / httpResource() — prefer over manual HttpClient subscribe for data loading
When to Read Each Reference
| Task involves | Read |
|---|---|
| Components, templates, host bindings, content projection | references/component.md |
| signal(), computed(), linkedSignal(), effect(), reactive state | references/signals.md |
| inject(), providers, injection tokens, services | references/di.md |
| Custom directives, DOM manipulation, host listeners | references/directives.md |
| Forms, validation, signal forms API | references/forms.md |
| HTTP calls, resource(), httpResource(), interceptors | references/http.md |
| Routes, lazy loading, guards, resolvers, navigation | references/routing.md |
| SSR, hydration, prerendering, browser-only APIs | references/ssr.md |
| Unit tests, integration tests, TestBed, Vitest | references/testing.md |
| Angular CLI, schematics, build config, project setup | references/tooling.md |
Read multiple references when task spans topics (e.g., component + signals + forms).
Gotchas (top 5 — most common Codex mistakes)
- Using @Input/@Output decorators: deprecated in v20+ → use
input(),output()signal functions - **Using ngIf/ngFor: deprecated template syntax → use
@if,@forwithtrackexpression - Constructor injection: outdated pattern → use
inject()in field initializers - BehaviorSubject for component state: over-complex → use
signal()+computed() - Class-based guards/interceptors: deprecated → use functional
CanActivateFn,HttpInterceptorFn
Full list: references/gotchas.md
Workflow Integration
Auto-activates during Phase 3 (Build) when Angular project detected (angular.json or @angular/core in package.json). Loaded by developer agent alongside mk:typescript.
04 同仓库更多 Skills
mk-worktree
Manages git worktrees for parallel agent isolation: creates parallel/{name}-{timestamp} branches, merges with conflict detection. NOT for user feature branches (use git worktree directly).
mk-workflow-orchestrator
Auto-invoked 7-phase workflow for complex-feature intent; fasttrack mode for pre-approved specs. NOT for explicit single tasks (mk:cook), green-field builds (mk:autobuild), or simple fixes (mk:fix).
mk-web-to-markdown
Fetch a URL and return clean markdown, for arbitrary external pages (blog, RFC, GitHub issue, vendor doc) not covered by mk:docs-finder. Static-only by default; opt-in JS rendering available.
mk-vulnerability-scanner
Vulnerability analysis: OWASP Top 10, current threat landscape, supply chain security, attack surface mapping, risk prioritization. Use for security audits. NOT for STRIDE/CSO infra audits (mk:cso).
mk-vue
Vue 3 authoring/review: components, composables, reactivity, Pinia, Pinia Colada, file routing, forms. Composition API + script setup. Auto-activates on .vue files. Deep review: mk:vue-best-practices.
mk-vue-testing-best-practices
Vue 3 testing best-practices review: Vitest + Vue Test Utils for components, composables, Pinia, Router, async/Suspense, forms, a11y, plus Playwright E2E strategy. Advisory only.