mcpField
W
workflow-clean-code-angular

workflow-clean-code-angular

github.com/neogenzTesting & quality096 installsUpdated 29w ago
Repository

About workflow-clean-code-angular

A Claude Code skill for auditing and improving Angular code in a chosen scope, aimed at developers reviewing architecture, signal patterns, and ViewModel separation. It uses focused specialist analysis and can carry findings through fixes and verification.

Key features

  1. 01Review Angular architecture and dependencies
  2. 02Check signals and store patterns
  3. 03Analyze components, templates, and styling
  4. 04Detect AI-generated code bloat
  5. 05Run quick, deep, or adversarial reviews
  6. 06Apply fixes and verify code quality

Use cases

  1. 01Audit Angular code in a feature directory
  2. 02Review changes against main
  3. 03Find signal and ViewModel issues
  4. 04Run an in-depth review of critical code

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/neogenz/skills --skill workflow-clean-code-angular

After installing, type/workflow-clean-code-angularin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

evals/
evals.json
references/
ai-slop-detection.md
angular-anti-patterns.md
angular-architecture.md
angular-clean-code.md
angular-style-guide.md
testing-patterns.md
viewmodel-patterns.md
steps/
step-01-scan.md
step-02-apply.md
step-03-verify.md

Details

From the project README
Guarantee 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. This isn't a linter. Linters catch syntax. This skill catches **design decisions** — the kind of issues only a senior engineer spots during code review.

Three things that separate senior-crafted code from AI-generated code:

  1. Nothing unnecessary — no defensive checks for impossible scenarios, no abstractions with one consumer, no comments that restate the code
  2. Right responsibility in the right place — stores own data transformations, components coordinate UI, templates just bind
  3. Consistent patterns — every store follows the same anatomy, every component follows the same structure, no surprise conventions

<quick_start>

/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

</quick_start>

FlagDescription
-aAuto mode — skip confirmations
-eEconomy mode — no subagents, direct analysis only
-sSave — output reports to .claude/output/clean-code-angular/
-rResume — continue from a previous run
--quickSurface scan only (grep patterns, no semantic analysis)
--deepFull depth: all domains including AI slop + ViewModel + cross-file
--archForce architecture analysis
--signalsForce signal patterns analysis
--stylingForce styling analysis
--testingForce testing analysis
--slopForce AI slop detection
--vmForce ViewModel/DataModel analysis
--advAdversarial review — after team lead, a devil's advocate agent challenges every finding for false positives, missed issues, and severity inflation
--ultraMaximum 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.

``` SCAN ─────────────────► APPLY ─────────────► VERIFY │ │ │ ├─ Parse scope ├─ Load docs/refs ├─ Lint + type-check ├─ Launch specialists ├─ Apply fixes ├─ Run tests │ (up to 10 agents) │ (parallel agents) ├─ Team lead final ├─ Team lead review ├─ Team lead │ craftsman review ├─ Adversarial review │ coherence check ├─ Adversarial final │ (if --adv) └─ Track progress │ challenge (if --adv) └─ Consolidated issues └─ Commit ```

<agent_model>

Agent Architecture

The skill scales agent count based on flags:

ModeAgentsStructure
Economy (-e)0Direct tools only, no subagents
Standard3-10 + leadFlat: specialists → team lead
Deep (--deep)14 + lead8 single + 3 signal lenses + 3 slop lenses → consensus → team lead
Deep + Adv (--deep --adv)14 + lead + advDeep + adversarial review
Ultra (--ultra)15 + 5 leads + grand lead + adv = 225 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:

ScopeAgentsCoverage
1-4 files3 + leadArchitecture, Angular/Signals, TypeScript/Styling
5-15 files5 + lead+ Store patterns, Component design
16-30 files7 + lead+ Templates, AI slop
31+ files10 + leadAll 10 domains
The 10 Domains
#DomainFocus
1Architecture & DependenciesLayer violations, cross-feature imports, dependency direction
2Signals & Reactivityeffect() misuse, computed() opportunities, linkedSignal(), cleanup
3Store Patterns6-section anatomy, cache-first, optimistic updates, resource usage
4Component DesignOnPush, responsibility, size, input()/output(), inject()
5Template QualityControl flow, expression complexity, wrapper bloat, accessibility
6TypeScript Qualityany types, # fields, modern APIs, dead code
7Styling::ng-deep, Material M3 tokens, Tailwind v4, !important
8AI SlopOver-engineering, unnecessary comments, defensive theater, verbose naming
9ViewModel & Data FlowDataModel vs ViewModel, transformation location, duplicate derivations
10Security, Performance & Code HealthXSS, 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

AgentFocusLoads
1aLayer violations, cross-feature importsreferences/angular-architecture.md
1bDI patterns, functional interceptors, providersreferences/angular-clean-code.md §3
1cLazy loading, routing, @defer boundariesreferences/angular-anti-patterns.md §19-20

Cluster 2: Signals & State → Reactivity Lead

AgentFocusLoads
2aSignal patterns, computed, effect, afterRenderEffectreferences/angular-clean-code.md §2
2bStore anatomy, mutations, resource APIreferences/angular-clean-code.md §2 + §13
2cRxJS valid vs anti-pattern, Observable/Signal bridgereferences/angular-anti-patterns.md §2 + Valid RxJS table

Cluster 3: Code Quality → Quality Lead

AgentFocusLoads
3aTypeScript, types, modern APIs (toSorted, structuredClone)references/angular-anti-patterns.md §6
3bAI slop detection (all 9 categories)references/ai-slop-detection.md
3cError handling, catch typing, resource error statereferences/angular-clean-code.md §13

Cluster 4: UI & Templates → Frontend Lead

AgentFocusLoads
4aControl flow, @defer, template expressionsreferences/angular-clean-code.md §4
4bStyling, accessibility, NgOptimizedImagereferences/angular-anti-patterns.md §7 + §20-21
4cPipes, ViewModel separation, formattingreferences/viewmodel-patterns.md + references/angular-clean-code.md §15

Cluster 5: Testing & Security → Security Lead

AgentFocusLoads
5aTest quality, harnesses, coveragereferences/testing-patterns.md
5bSecurity, workarounds, zoneless violationsreferences/angular-anti-patterns.md §8 + §15-16
5cSignal Forms, API validation, forms patternsreferences/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.

</agent_model>

<state_variables>

VariableTypeDescription
{task_description}stringScope to analyze
{task_id}stringKebab-case identifier
{auto_mode}booleanSkip confirmations
{economy_mode}booleanNo subagents
{save_mode}booleanSave reports
{depth}quick / standard / deepAnalysis depth
{force_*}booleanPer-domain force flags
{scoped_files}string[]Files in scope
{issues}arrayConsolidated issue list
{workspace_path}stringPath to angular.json
{agent_count}numberSpecialists to launch
{adversarial_mode}booleanRun adversarial review after team lead
{ultra_mode}booleanFull 22-agent multi-tier architecture
{project_profile}objectDetected project conventions, libraries, and architecture decisions — used to filter false positives

</state_variables>

<reference_files>

FileWhen Loaded
references/angular-anti-patterns.mdAlways (scanning checklist)
references/angular-clean-code.mdAlways (correct patterns)
references/angular-style-guide.mdAlways (official Angular conventions)
references/angular-architecture.mdArchitecture issues or --arch
references/ai-slop-detection.mdDeep mode, --slop
references/viewmodel-patterns.mdDeep mode, --vm
references/testing-patterns.mdTesting issues or --testing

</reference_files>

<entry_point>

Load steps/step-01-scan.md

</entry_point>

<step_files>

StepFilePurpose
01step-01-scan.mdParse scope, launch specialists, team lead consolidation
02step-02-apply.mdLoad docs, apply fixes, team lead coherence check
03step-03-verify.mdQuality gate, craftsman review, commit

</step_files>

<execution_rules>

  • Discover project context BEFORE scanning — read CLAUDE.md, package.json, angular.json, eslint config to build {project_profile}
  • Filter ALL findings through {project_profile} — never flag patterns that match documented project conventions
  • Load one step at a time
  • Scale agent count to scope size (economy mode = 0 agents, direct tools only)
  • Use the Grep tool for pattern detection (not bash grep)
  • Scope-aware: only touch files within the specified scope
  • Every finding: file:line reference required
  • Every fix: source citation required
  • Team lead reviews after scan AND after apply </execution_rules>

<success_criteria> After this workflow, the scoped code reads as if a senior Angular developer wrote it by hand:

  • Zero architecture violations
  • Modern signal patterns throughout
  • Stores follow 6-section anatomy with proper ViewModel selectors
  • No AI slop — no unnecessary comments, abstractions, or defensive code
  • Clean ViewModel separation — stores transform, components bind, templates stay simple
  • Consistent patterns across all files in scope
  • Quality check passes (lint + type-check + format)
  • Tests pass
  • If --adv: adversarial review found no missed issues or false positives </success_criteria>

Comments

Markdown supported