Three things that separate senior-crafted code from AI-generated code:
- Nothing unnecessary — no defensive checks for impossible scenarios, no abstractions with one consumer, no comments that restate the code
- Right responsibility in the right place — stores own data transformations, components coordinate UI, templates just bind
- Consistent patterns — every store follows the same anatomy, every component follows the same structure, no surprise conventions
/clean-code-angular feature/budget/ # Standard audit
/clean-code-angular -a --deep feature/ # Deep audit, auto mode
/clean-code-angular --quick core/ # Quick surface scan
/clean-code-angular --slop --vm feature/ # Focus: AI slop + ViewModel
/clean-code-angular diff main # Audit changes vs main
/clean-code-angular pending # Audit uncommitted changes
| Flag |
Description |
-a |
Auto mode — skip confirmations |
-e |
Economy mode — no subagents, direct analysis only |
-s |
Save — output reports to .claude/output/clean-code-angular/ |
-r |
Resume — continue from a previous run |
--quick |
Surface scan only (grep patterns, no semantic analysis) |
--deep |
Full depth: all domains including AI slop + ViewModel + cross-file |
--arch |
Force architecture analysis |
--signals |
Force signal patterns analysis |
--styling |
Force styling analysis |
--testing |
Force testing analysis |
--slop |
Force AI slop detection |
--vm |
Force ViewModel/DataModel analysis |
--adv |
Adversarial review — after team lead, a devil's advocate agent challenges every finding for false positives, missed issues, and severity inflation |
--ultra |
Maximum depth: 15 specialists in 5 clusters, each with a cluster lead, plus grand tech lead and adversarial review. The nuclear option for critical code. |
Default depth (no flag): grep + targeted semantic analysis of key files.
--deep enables all specialist domains.
Agent Architecture
The skill scales agent count based on flags:
| Mode |
Agents |
Structure |
Economy (-e) |
0 |
Direct tools only, no subagents |
| Standard |
3-10 + lead |
Flat: specialists → team lead |
Deep (--deep) |
14 + lead |
8 single + 3 signal lenses + 3 slop lenses → consensus → team lead |
Deep + Adv (--deep --adv) |
14 + lead + adv |
Deep + adversarial review |
Ultra (--ultra) |
15 + 5 leads + grand lead + adv = 22 |
5 clusters → 5 cluster leads → grand tech lead → adversarial |
Standard/Deep Mode — Flat Architecture
Up to 10 domain-focused specialists launched in parallel. Count scales with scope size:
| Scope |
Agents |
Coverage |
| 1-4 files |
3 + lead |
Architecture, Angular/Signals, TypeScript/Styling |
| 5-15 files |
5 + lead |
+ Store patterns, Component design |
| 16-30 files |
7 + lead |
+ Templates, AI slop |
| 31+ files |
10 + lead |
All 10 domains |
The 10 Domains
| # |
Domain |
Focus |
| 1 |
Architecture & Dependencies |
Layer violations, cross-feature imports, dependency direction |
| 2 |
Signals & Reactivity |
effect() misuse, computed() opportunities, linkedSignal(), cleanup |
| 3 |
Store Patterns |
6-section anatomy, cache-first, optimistic updates, resource usage |
| 4 |
Component Design |
OnPush, responsibility, size, input()/output(), inject() |
| 5 |
Template Quality |
Control flow, expression complexity, wrapper bloat, accessibility |
| 6 |
TypeScript Quality |
any types, # fields, modern APIs, dead code |
| 7 |
Styling |
::ng-deep, Material M3 tokens, Tailwind v4, !important |
| 8 |
AI Slop |
Over-engineering, unnecessary comments, defensive theater, verbose naming |
| 9 |
ViewModel & Data Flow |
DataModel vs ViewModel, transformation location, duplicate derivations |
| 10 |
Security, Performance & Code Health |
XSS, workarounds/hacks, design smells, @defer, lazy loading |
Testing quality is checked when --testing or --deep or --ultra is enabled. The testing specialist reads .spec.ts files in scope and evaluates against references/testing-patterns.md.
Ultra Mode — Multi-Tier Cluster Architecture
15 specialists organized in 5 clusters, each with a dedicated cluster lead. Each specialist loads exactly the reference files it needs — no bloat.
Cluster 1: Architecture → Architecture Lead
| Agent |
Focus |
Loads |
| 1a |
Layer violations, cross-feature imports |
references/angular-architecture.md |
| 1b |
DI patterns, functional interceptors, providers |
references/angular-clean-code.md §3 |
| 1c |
Lazy loading, routing, @defer boundaries |
references/angular-anti-patterns.md §19-20 |
Cluster 2: Signals & State → Reactivity Lead
| Agent |
Focus |
Loads |
| 2a |
Signal patterns, computed, effect, afterRenderEffect |
references/angular-clean-code.md §2 |
| 2b |
Store anatomy, mutations, resource API |
references/angular-clean-code.md §2 + §13 |
| 2c |
RxJS valid vs anti-pattern, Observable/Signal bridge |
references/angular-anti-patterns.md §2 + Valid RxJS table |
Cluster 3: Code Quality → Quality Lead
| Agent |
Focus |
Loads |
| 3a |
TypeScript, types, modern APIs (toSorted, structuredClone) |
references/angular-anti-patterns.md §6 |
| 3b |
AI slop detection (all 9 categories) |
references/ai-slop-detection.md |
| 3c |
Error handling, catch typing, resource error state |
references/angular-clean-code.md §13 |
Cluster 4: UI & Templates → Frontend Lead
| Agent |
Focus |
Loads |
| 4a |
Control flow, @defer, template expressions |
references/angular-clean-code.md §4 |
| 4b |
Styling, accessibility, NgOptimizedImage |
references/angular-anti-patterns.md §7 + §20-21 |
| 4c |
Pipes, ViewModel separation, formatting |
references/viewmodel-patterns.md + references/angular-clean-code.md §15 |
Cluster 5: Testing & Security → Security Lead
| Agent |
Focus |
Loads |
| 5a |
Test quality, harnesses, coverage |
references/testing-patterns.md |
| 5b |
Security, workarounds, zoneless violations |
references/angular-anti-patterns.md §8 + §15-16 |
| 5c |
Signal Forms, API validation, forms patterns |
references/angular-clean-code.md §14 + §9 |
Flow:
15 specialists (parallel) → 5 cluster leads (parallel) → Grand Tech Lead → Adversarial
Team Lead (Standard/Deep)
Launched after specialists complete. A senior Angular architect who:
- Merges all specialist reports into one deduplicated list
- Removes false positives by reading the actual code
- Resolves contradictions between specialists
- Adds cross-cutting observations no single specialist caught
- Prioritizes the final issue list
- Verifies fix coherence in step-02
- Does final craftsman review in step-03
Cluster Leads (Ultra)
Each cluster lead receives ONLY its 3 specialists' reports. They:
- Deduplicate within their domain
- Resolve contradictions between their specialists
- Add domain-specific cross-cutting observations
- Output a focused domain report (max 10 issues per cluster)
Grand Tech Lead (Ultra)
Receives all 5 cluster lead reports. A principal Angular architect who:
- Merges all cluster reports into one unified list
- Resolves cross-cluster contradictions (e.g., Architecture says "move to core" but Quality says "inline it")
- Identifies systemic patterns across clusters (e.g., "every file has the same DI problem")
- Prioritizes by business impact, not just technical severity
- Caps at 30 issues, notes total if more
- Adds a "systemic diagnosis" section: what's the ROOT CAUSE behind the pattern of issues?
Adversarial Reviewer (--adv or --ultra)
Launched after the team/grand lead. A skeptical senior engineer who:
- Challenges each finding: "Is this really wrong? Could there be a valid architectural reason?"
- Hunts false positives: reads the actual code for each flagged issue and checks if context was missed
- Hunts missed issues: reads ALL files in scope looking for issues that ALL specialists + leads missed
- Questions severity: "Is this really Critical or just Important? Would a production user notice?"
- Checks RxJS false flags: verifies that valid RxJS patterns aren't flagged as signal anti-patterns
- Checks Angular version assumptions: verifies recommendations match Angular 21+
- Checks against project profile: verifies that no finding contradicts the project's documented conventions from {project_profile}
Output: a correction table listing upgrades, downgrades, removals, and additions to the lead's findings.
| Variable |
Type |
Description |
{task_description} |
string |
Scope to analyze |
{task_id} |
string |
Kebab-case identifier |
{auto_mode} |
boolean |
Skip confirmations |
{economy_mode} |
boolean |
No subagents |
{save_mode} |
boolean |
Save reports |
{depth} |
quick / standard / deep |
Analysis depth |
{force_*} |
boolean |
Per-domain force flags |
{scoped_files} |
string[] |
Files in scope |
{issues} |
array |
Consolidated issue list |
{workspace_path} |
string |
Path to angular.json |
{agent_count} |
number |
Specialists to launch |
{adversarial_mode} |
boolean |
Run adversarial review after team lead |
{ultra_mode} |
boolean |
Full 22-agent multi-tier architecture |
{project_profile} |
object |
Detected project conventions, libraries, and architecture decisions — used to filter false positives |
| File |
When Loaded |
references/angular-anti-patterns.md |
Always (scanning checklist) |
references/angular-clean-code.md |
Always (correct patterns) |
references/angular-style-guide.md |
Always (official Angular conventions) |
references/angular-architecture.md |
Architecture issues or --arch |
references/ai-slop-detection.md |
Deep mode, --slop |
references/viewmodel-patterns.md |
Deep mode, --vm |
references/testing-patterns.md |
Testing issues or --testing |
Load steps/step-01-scan.md
| Step |
File |
Purpose |
| 01 |
step-01-scan.md |
Parse scope, launch specialists, team lead consolidation |
| 02 |
step-02-apply.md |
Load docs, apply fixes, team lead coherence check |
| 03 |
step-03-verify.md |
Quality gate, craftsman review, commit |
1---2name: workflow-clean-code-angular3description: Deep Angular 21 clean code audit with parallel specialist agents and senior team lead. Scans architecture, signals, stores, AI slop, ViewModel patterns, and more. Guarantees craftsman-level output. Use whenever the user says 'clean code', 'audit Angular', 'review frontend', 'check quality', 'anti-patterns', wants Angular code reviewed, or needs senior-level code standards enforced — even if they don't say 'clean code' explicitly.4---56<objective>7Guarantee that Angular code in the target scope meets the standard of a senior developer who crafted it by hand — clean, clear, no AI slop, proper architecture, correct signal patterns, and clear ViewModel separation.8</objective>910<philosophy>11This isn't a linter. Linters catch syntax. This skill catches **design decisions** — the kind of issues only a senior engineer spots during code review.1213Three things that separate senior-crafted code from AI-generated code:141. **Nothing unnecessary** — no defensive checks for impossible scenarios, no abstractions with one consumer, no comments that restate the code152. **Right responsibility in the right place** — stores own data transformations, components coordinate UI, templates just bind163. **Consistent patterns** — every store follows the same anatomy, every component follows the same structure, no surprise conventions17</philosophy>1819<quick_start>2021```bash22/clean-code-angular feature/budget/ # Standard audit23/clean-code-angular -a --deep feature/ # Deep audit, auto mode24/clean-code-angular --quick core/ # Quick surface scan25/clean-code-angular --slop --vm feature/ # Focus: AI slop + ViewModel26/clean-code-angular diff main # Audit changes vs main27/clean-code-angular pending # Audit uncommitted changes28```2930</quick_start>3132<parameters>3334| Flag | Description |35|------|-------------|36| `-a` | Auto mode — skip confirmations |37| `-e` | Economy mode — no subagents, direct analysis only |38| `-s` | Save — output reports to `.claude/output/clean-code-angular/` |39| `-r` | Resume — continue from a previous run |40| `--quick` | Surface scan only (grep patterns, no semantic analysis) |41| `--deep` | Full depth: all domains including AI slop + ViewModel + cross-file |42| `--arch` | Force architecture analysis |43| `--signals` | Force signal patterns analysis |44| `--styling` | Force styling analysis |45| `--testing` | Force testing analysis |46| `--slop` | Force AI slop detection |47| `--vm` | Force ViewModel/DataModel analysis |48| `--adv` | Adversarial review — after team lead, a devil's advocate agent challenges every finding for false positives, missed issues, and severity inflation |49| `--ultra` | Maximum depth: 15 specialists in 5 clusters, each with a cluster lead, plus grand tech lead and adversarial review. The nuclear option for critical code. |5051Default depth (no flag): grep + targeted semantic analysis of key files.52`--deep` enables all specialist domains.5354</parameters>5556<workflow>57```58SCAN ─────────────────► APPLY ─────────────► VERIFY59 │ │ │60 ├─ Parse scope ├─ Load docs/refs ├─ Lint + type-check61 ├─ Launch specialists ├─ Apply fixes ├─ Run tests62 │ (up to 10 agents) │ (parallel agents) ├─ Team lead final63 ├─ Team lead review ├─ Team lead │ craftsman review64 ├─ Adversarial review │ coherence check ├─ Adversarial final65 │ (if --adv) └─ Track progress │ challenge (if --adv)66 └─ Consolidated issues └─ Commit67```68</workflow>6970<agent_model>7172## Agent Architecture7374The skill scales agent count based on flags:7576| Mode | Agents | Structure |77|------|--------|-----------|78| Economy (`-e`) | 0 | Direct tools only, no subagents |79| Standard | 3-10 + lead | Flat: specialists → team lead |80| Deep (`--deep`) | 14 + lead | 8 single + 3 signal lenses + 3 slop lenses → consensus → team lead |81| Deep + Adv (`--deep --adv`) | 14 + lead + adv | Deep + adversarial review |82| **Ultra (`--ultra`)** | **15 + 5 leads + grand lead + adv = 22** | **5 clusters → 5 cluster leads → grand tech lead → adversarial** |8384### Standard/Deep Mode — Flat Architecture8586Up to 10 domain-focused specialists launched in parallel. Count scales with scope size:8788| Scope | Agents | Coverage |89|-------|--------|----------|90| 1-4 files | 3 + lead | Architecture, Angular/Signals, TypeScript/Styling |91| 5-15 files | 5 + lead | + Store patterns, Component design |92| 16-30 files | 7 + lead | + Templates, AI slop |93| 31+ files | 10 + lead | All 10 domains |9495### The 10 Domains9697| # | Domain | Focus |98|---|--------|-------|99| 1 | Architecture & Dependencies | Layer violations, cross-feature imports, dependency direction |100| 2 | Signals & Reactivity | `effect()` misuse, `computed()` opportunities, `linkedSignal()`, cleanup |101| 3 | Store Patterns | 6-section anatomy, cache-first, optimistic updates, resource usage |102| 4 | Component Design | OnPush, responsibility, size, `input()`/`output()`, `inject()` |103| 5 | Template Quality | Control flow, expression complexity, wrapper bloat, accessibility |104| 6 | TypeScript Quality | `any` types, `#` fields, modern APIs, dead code |105| 7 | Styling | `::ng-deep`, Material M3 tokens, Tailwind v4, `!important` |106| 8 | AI Slop | Over-engineering, unnecessary comments, defensive theater, verbose naming |107| 9 | ViewModel & Data Flow | DataModel vs ViewModel, transformation location, duplicate derivations |108| 10 | Security, Performance & Code Health | XSS, workarounds/hacks, design smells, `@defer`, lazy loading |109110**Testing quality** is checked when `--testing` or `--deep` or `--ultra` is enabled. The testing specialist reads `.spec.ts` files in scope and evaluates against `references/testing-patterns.md`.111112### Ultra Mode — Multi-Tier Cluster Architecture11311415 specialists organized in 5 clusters, each with a dedicated cluster lead. Each specialist loads exactly the reference files it needs — no bloat.115116**Cluster 1: Architecture** → Architecture Lead117| Agent | Focus | Loads |118|-------|-------|-------|119| 1a | Layer violations, cross-feature imports | `references/angular-architecture.md` |120| 1b | DI patterns, functional interceptors, providers | `references/angular-clean-code.md` §3 |121| 1c | Lazy loading, routing, `@defer` boundaries | `references/angular-anti-patterns.md` §19-20 |122123**Cluster 2: Signals & State** → Reactivity Lead124| Agent | Focus | Loads |125|-------|-------|-------|126| 2a | Signal patterns, computed, effect, afterRenderEffect | `references/angular-clean-code.md` §2 |127| 2b | Store anatomy, mutations, resource API | `references/angular-clean-code.md` §2 + §13 |128| 2c | RxJS valid vs anti-pattern, Observable/Signal bridge | `references/angular-anti-patterns.md` §2 + Valid RxJS table |129130**Cluster 3: Code Quality** → Quality Lead131| Agent | Focus | Loads |132|-------|-------|-------|133| 3a | TypeScript, types, modern APIs (toSorted, structuredClone) | `references/angular-anti-patterns.md` §6 |134| 3b | AI slop detection (all 9 categories) | `references/ai-slop-detection.md` |135| 3c | Error handling, catch typing, resource error state | `references/angular-clean-code.md` §13 |136137**Cluster 4: UI & Templates** → Frontend Lead138| Agent | Focus | Loads |139|-------|-------|-------|140| 4a | Control flow, @defer, template expressions | `references/angular-clean-code.md` §4 |141| 4b | Styling, accessibility, NgOptimizedImage | `references/angular-anti-patterns.md` §7 + §20-21 |142| 4c | Pipes, ViewModel separation, formatting | `references/viewmodel-patterns.md` + `references/angular-clean-code.md` §15 |143144**Cluster 5: Testing & Security** → Security Lead145| Agent | Focus | Loads |146|-------|-------|-------|147| 5a | Test quality, harnesses, coverage | `references/testing-patterns.md` |148| 5b | Security, workarounds, zoneless violations | `references/angular-anti-patterns.md` §8 + §15-16 |149| 5c | Signal Forms, API validation, forms patterns | `references/angular-clean-code.md` §14 + §9 |150151**Flow:**152```15315 specialists (parallel) → 5 cluster leads (parallel) → Grand Tech Lead → Adversarial154```155156### Team Lead (Standard/Deep)157158Launched after specialists complete. A senior Angular architect who:159- Merges all specialist reports into one deduplicated list160- Removes false positives by reading the actual code161- Resolves contradictions between specialists162- Adds cross-cutting observations no single specialist caught163- Prioritizes the final issue list164- Verifies fix coherence in step-02165- Does final craftsman review in step-03166167### Cluster Leads (Ultra)168169Each cluster lead receives ONLY its 3 specialists' reports. They:170- Deduplicate within their domain171- Resolve contradictions between their specialists172- Add domain-specific cross-cutting observations173- Output a focused domain report (max 10 issues per cluster)174175### Grand Tech Lead (Ultra)176177Receives all 5 cluster lead reports. A principal Angular architect who:178- Merges all cluster reports into one unified list179- Resolves cross-cluster contradictions (e.g., Architecture says "move to core" but Quality says "inline it")180- Identifies systemic patterns across clusters (e.g., "every file has the same DI problem")181- Prioritizes by business impact, not just technical severity182- Caps at 30 issues, notes total if more183- Adds a "systemic diagnosis" section: what's the ROOT CAUSE behind the pattern of issues?184185### Adversarial Reviewer (--adv or --ultra)186187Launched after the team/grand lead. A skeptical senior engineer who:188- **Challenges each finding**: "Is this really wrong? Could there be a valid architectural reason?"189- **Hunts false positives**: reads the actual code for each flagged issue and checks if context was missed190- **Hunts missed issues**: reads ALL files in scope looking for issues that ALL specialists + leads missed191- **Questions severity**: "Is this really Critical or just Important? Would a production user notice?"192- **Checks RxJS false flags**: verifies that valid RxJS patterns aren't flagged as signal anti-patterns193- **Checks Angular version assumptions**: verifies recommendations match Angular 21+194- **Checks against project profile**: verifies that no finding contradicts the project's documented conventions from {project_profile}195196Output: a correction table listing upgrades, downgrades, removals, and additions to the lead's findings.197198</agent_model>199200<state_variables>201202| Variable | Type | Description |203|----------|------|-------------|204| `{task_description}` | string | Scope to analyze |205| `{task_id}` | string | Kebab-case identifier |206| `{auto_mode}` | boolean | Skip confirmations |207| `{economy_mode}` | boolean | No subagents |208| `{save_mode}` | boolean | Save reports |209| `{depth}` | quick / standard / deep | Analysis depth |210| `{force_*}` | boolean | Per-domain force flags |211| `{scoped_files}` | string[] | Files in scope |212| `{issues}` | array | Consolidated issue list |213| `{workspace_path}` | string | Path to angular.json |214| `{agent_count}` | number | Specialists to launch |215| `{adversarial_mode}` | boolean | Run adversarial review after team lead |216| `{ultra_mode}` | boolean | Full 22-agent multi-tier architecture |217| `{project_profile}` | object | Detected project conventions, libraries, and architecture decisions — used to filter false positives |218219</state_variables>220221<reference_files>222223| File | When Loaded |224|------|-------------|225| `references/angular-anti-patterns.md` | Always (scanning checklist) |226| `references/angular-clean-code.md` | Always (correct patterns) |227| `references/angular-style-guide.md` | Always (official Angular conventions) |228| `references/angular-architecture.md` | Architecture issues or `--arch` |229| `references/ai-slop-detection.md` | Deep mode, `--slop` |230| `references/viewmodel-patterns.md` | Deep mode, `--vm` |231| `references/testing-patterns.md` | Testing issues or `--testing` |232233</reference_files>234235<entry_point>236237Load `steps/step-01-scan.md`238239</entry_point>240241<step_files>242243| Step | File | Purpose |244|------|------|---------|245| 01 | `step-01-scan.md` | Parse scope, launch specialists, team lead consolidation |246| 02 | `step-02-apply.md` | Load docs, apply fixes, team lead coherence check |247| 03 | `step-03-verify.md` | Quality gate, craftsman review, commit |248249</step_files>250251<execution_rules>252- Discover project context BEFORE scanning — read CLAUDE.md, package.json, angular.json, eslint config to build {project_profile}253- Filter ALL findings through {project_profile} — never flag patterns that match documented project conventions254- Load one step at a time255- Scale agent count to scope size (economy mode = 0 agents, direct tools only)256- Use the Grep tool for pattern detection (not bash grep)257- Scope-aware: only touch files within the specified scope258- Every finding: `file:line` reference required259- Every fix: source citation required260- Team lead reviews after scan AND after apply261</execution_rules>262263<success_criteria>264After this workflow, the scoped code reads as if a senior Angular developer wrote it by hand:265- Zero architecture violations266- Modern signal patterns throughout267- Stores follow 6-section anatomy with proper ViewModel selectors268- No AI slop — no unnecessary comments, abstractions, or defensive code269- Clean ViewModel separation — stores transform, components bind, templates stay simple270- Consistent patterns across all files in scope271- Quality check passes (lint + type-check + format)272- Tests pass273- If --adv: adversarial review found no missed issues or false positives274</success_criteria>