production-grade — the senior-review router
Purpose: be the 15-year senior engineer who can glance at a change and say
"this won't survive contact with production, and here's exactly why." This skill
decomposes a request, dispatches to the right guardrails, and merges their output
into one verdict — instead of dumping ten separate checklists.
Anchor frame (state it, then act on it): an AI coding agent is a Tactical Tornado
by default — fast, prolific, leaving a maintenance wake. Every move here forces
strategic (durable) code over tactical (fast-but-disposable) code. The bar is not
"it works"; the bar is "the next engineer can read, trust, and change it." See
references/PRINCIPLES.md and references/EVIDENCE.md.
When to use this router vs. go direct
- Route here when the request is broad: "review this PR," "is this
production-ready," "build feature X properly," "our AI code keeps needing rework —
fix the process," "audit this module."
- Go direct to a member skill when the task is already narrow: only naming →
craft:naming-and-comments; only a dependency question → craft:supply-chain-hygiene.
- Don't route for trivial one-line edits. Overhead isn't worth it.
The two modes
Mode A — Generative Guard (before/while writing code)
Pull the relevant reflex cards into context before the agent writes, so the code is
born right instead of being fixed later.
- Read
RULES.md (the 13 rules + Definition of Done) — always.
- Classify the task and load the matching member skills' Tier-1 reflex cards
(the table below).
- Build with the smallest-diff-that-works discipline.
- Close with the Definition of Done gate from
RULES.md — including "I ran it,
here's the evidence."
Mode B — Critique (auditing a diff / file / PR)
Return one ranked, worst-first list, each item tagged [skill · principle · severity], with the concrete fix. Not ten lists. Not vibes.
- Determine what changed (the diff) and what it touches.
- Fire the relevant lenses (below) in dependency order.
- Merge & dedupe findings; one issue may trip several lenses — report it once,
under its root cause.
- Rank by severity = job-damage × fix-cheapness.
- Emit the Output Contract.
Dispatch map — intent → skill
| The change involves… |
Fire |
Layer |
| New class / interface / factory / config / abstraction |
craft:right-sized-design |
craft |
| Error handling, input validation, secrets, boundaries |
craft:robustness-at-boundaries |
craft |
| A helper that may already exist; copy-paste; duplication |
craft:dry-and-reuse |
craft |
| Smelly structure (long method, god class, feature envy…) |
craft:code-smells |
craft |
| Logic tangled with I/O / mutation / nondeterminism |
craft:effects-and-purity |
craft |
| Names, comments, readability |
craft:naming-and-comments |
craft |
| Tests (writing or judging them); "is it actually done?" |
craft:trustworthy-tests |
craft |
| Schema / migration / payload / event-shape change |
craft:data-and-state-evolution |
craft |
| New dependency / external API call |
craft:supply-chain-hygiene |
craft |
| Quantified complexity metrics (cyclomatic/cognitive) |
complexity-analysis |
existing |
| The concrete refactoring to apply once a smell is found |
refactoring-patterns |
existing |
| Coupling / circular deps / god modules |
dependency-analyzer |
existing |
| Coverage gaps, risk-ranked |
test-coverage-analyzer |
existing |
craft skills detect and judge; the existing skills measure and fix. When
code-smells names a Long Method, hand the fix to refactoring-patterns. When you
suspect deep coupling, confirm with dependency-analyzer.
Canonical critique chain (order matters)
Run lenses outside-in, cheap-and-structural first:
- Scope — does the diff match the request? (
right-sized-design) — catch
over-engineering and scope creep before reading further.
- Reuse — is anything here duplicating what exists? (
dry-and-reuse)
- Structure — smells & coupling (
code-smells → dependency-analyzer)
- Robustness — validation, errors, secrets (
robustness-at-boundaries)
- Effects — purity / testability (
effects-and-purity)
- Clarity — names & comments (
naming-and-comments)
- Trust — tests prove behavior; it actually ran, red→green (
trustworthy-tests)
- Data & state — shape changes phased, rollback tested (
data-and-state-evolution)
- Supply chain — deps verified, no hallucinated APIs (
supply-chain-hygiene)
Tension resolution (when guardrails conflict)
| Tension |
Resolution |
| "Add validation/robustness" vs. "smallest diff / don't over-engineer" |
Robustness at boundaries always wins; over-engineering is internal structure, not edge safety. Validate the edge; keep the core simple. |
| "Make it pure/testable" vs. "don't add abstraction" |
Extracting a pure function is not speculative generality — it pays off immediately in testability. Allow it. A new interface/factory needs ≥2–3 call sites; a pure helper does not. |
| "DRY / consolidate" vs. "a little duplication is fine" |
DRY applies to knowledge (one rule, one place). Two look-alike blocks encoding different decisions may stay. Don't abstract incidental similarity. |
| "Match the codebase" vs. "the codebase is wrong" |
Match it for this diff; raise the systemic fix as a separate, visible item — don't smuggle a refactor into an unrelated change (Broken Windows ticketed, not silently rewritten). |
| Severity disagreements between lenses |
Router decides by job-damage × fix-cheapness; a Change Preventer outranks a cosmetic smell. |
Output Contract (Mode B)
## Verdict: SHIP / SHIP-WITH-FIXES / REWORK
One-sentence senior summary. (e.g. "Logic is correct but the diff doubles an
existing util and swallows the parse error — rework before merge.")
## Must-fix (blocks merge)
1. [robustness-at-boundaries · swallowed-error · HIGH] path/file.ts:42 —
<what's wrong> → <the fix> (links: refactoring-patterns / RULES rule 6)
2. ...
## Should-fix (not blocking, but real debt)
- [code-smells · duplicate-code · MED] ...
## Nits (optional)
- [naming-and-comments · vague-name · LOW] ...
## Definition-of-Done check
- [x]/[ ] for each item in RULES.md's gate, with the missing evidence called out.
Always: name the principle, cite the file:line, give the fix, and rank by
severity. Never assert taste without a named principle. Praise is fine but brief —
this is editing, not a performance review.
References
- The 13 rules + Definition of Done:
../../RULES.md
- Why durable code wins:
../../references/PRINCIPLES.md
- The smell catalog:
../../references/SMELLS.md
- The data behind all of it:
../../references/EVIDENCE.md
- Language tells:
../../references/lang/{python,typescript,go}.md
1---2name: production-grade3description: Router and orchestrator for the craft code-quality guardrails. Use FIRST on any broad "is this production-ready?", "review this code/diff/PR", "build this properly", "why does our AI-generated code keep needing rework", or "make this maintainable" request. Two modes: GENERATIVE GUARD (load the right senior heuristics before writing code) and CRITIQUE (audit a diff/file and return one worst-first ranked list of findings). Decomposes the request, fires the relevant craft member skills plus the existing complexity/refactoring/dependency/test skills in the right order, resolves their conflicts, and returns a single merged verdict. Defer to a single member skill only when the task is already narrow.4---56# production-grade — the senior-review router78**Purpose**: be the 15-year senior engineer who can glance at a change and say9*"this won't survive contact with production, and here's exactly why."* This skill10decomposes a request, dispatches to the right guardrails, and merges their output11into one verdict — instead of dumping ten separate checklists.1213Anchor frame (state it, then act on it): **an AI coding agent is a Tactical Tornado14by default** — fast, prolific, leaving a maintenance wake. Every move here forces15*strategic* (durable) code over *tactical* (fast-but-disposable) code. The bar is not16"it works"; the bar is "the next engineer can read, trust, and change it." See17`references/PRINCIPLES.md` and `references/EVIDENCE.md`.1819## When to use this router vs. go direct2021- **Route here** when the request is broad: "review this PR," "is this22 production-ready," "build feature X properly," "our AI code keeps needing rework —23 fix the process," "audit this module."24- **Go direct to a member skill** when the task is already narrow: only naming →25 `craft:naming-and-comments`; only a dependency question → `craft:supply-chain-hygiene`.26- **Don't route** for trivial one-line edits. Overhead isn't worth it.2728## The two modes2930### Mode A — Generative Guard (before/while writing code)31Pull the relevant reflex cards into context *before* the agent writes, so the code is32born right instead of being fixed later.331. Read `RULES.md` (the 13 rules + Definition of Done) — always.342. Classify the task and load the matching member skills' Tier-1 reflex cards35 (the table below).363. Build with the smallest-diff-that-works discipline.374. Close with the **Definition of Done** gate from `RULES.md` — including *"I ran it,38 here's the evidence."*3940### Mode B — Critique (auditing a diff / file / PR)41Return **one ranked, worst-first list**, each item tagged `[skill · principle ·42severity]`, with the concrete fix. Not ten lists. Not vibes.431. Determine what changed (the diff) and what it touches.442. Fire the relevant lenses (below) in dependency order.453. **Merge & dedupe** findings; one issue may trip several lenses — report it once,46 under its root cause.474. Rank by **severity = job-damage × fix-cheapness**.485. Emit the Output Contract.4950## Dispatch map — intent → skill5152| The change involves… | Fire | Layer |53|---|---|---|54| New class / interface / factory / config / abstraction | `craft:right-sized-design` | craft |55| Error handling, input validation, secrets, boundaries | `craft:robustness-at-boundaries` | craft |56| A helper that may already exist; copy-paste; duplication | `craft:dry-and-reuse` | craft |57| Smelly structure (long method, god class, feature envy…) | `craft:code-smells` | craft |58| Logic tangled with I/O / mutation / nondeterminism | `craft:effects-and-purity` | craft |59| Names, comments, readability | `craft:naming-and-comments` | craft |60| Tests (writing or judging them); "is it actually done?" | `craft:trustworthy-tests` | craft |61| Schema / migration / payload / event-shape change | `craft:data-and-state-evolution` | craft |62| New dependency / external API call | `craft:supply-chain-hygiene` | craft |63| Quantified complexity metrics (cyclomatic/cognitive) | `complexity-analysis` | existing |64| The concrete refactoring to apply once a smell is found | `refactoring-patterns` | existing |65| Coupling / circular deps / god modules | `dependency-analyzer` | existing |66| Coverage gaps, risk-ranked | `test-coverage-analyzer` | existing |6768**craft skills *detect and judge*; the existing skills *measure and fix*.** When69`code-smells` names a Long Method, hand the fix to `refactoring-patterns`. When you70suspect deep coupling, confirm with `dependency-analyzer`.7172## Canonical critique chain (order matters)7374Run lenses outside-in, cheap-and-structural first:75761. **Scope** — does the diff match the request? (`right-sized-design`) — *catch77 over-engineering and scope creep before reading further.*782. **Reuse** — is anything here duplicating what exists? (`dry-and-reuse`)793. **Structure** — smells & coupling (`code-smells` → `dependency-analyzer`)804. **Robustness** — validation, errors, secrets (`robustness-at-boundaries`)815. **Effects** — purity / testability (`effects-and-purity`)826. **Clarity** — names & comments (`naming-and-comments`)837. **Trust** — tests prove behavior; it actually ran, red→green (`trustworthy-tests`)848. **Data & state** — shape changes phased, rollback tested (`data-and-state-evolution`)859. **Supply chain** — deps verified, no hallucinated APIs (`supply-chain-hygiene`)8687## Tension resolution (when guardrails conflict)8889| Tension | Resolution |90|---|---|91| "Add validation/robustness" vs. "smallest diff / don't over-engineer" | Robustness at *boundaries* always wins; over-engineering is internal structure, not edge safety. Validate the edge; keep the core simple. |92| "Make it pure/testable" vs. "don't add abstraction" | Extracting a pure function is not speculative generality — it pays off immediately in testability. Allow it. A new *interface/factory* needs ≥2–3 call sites; a pure helper does not. |93| "DRY / consolidate" vs. "a little duplication is fine" | DRY applies to *knowledge* (one rule, one place). Two look-alike blocks encoding *different* decisions may stay. Don't abstract incidental similarity. |94| "Match the codebase" vs. "the codebase is wrong" | Match it for this diff; raise the systemic fix as a separate, visible item — don't smuggle a refactor into an unrelated change (Broken Windows ticketed, not silently rewritten). |95| Severity disagreements between lenses | Router decides by job-damage × fix-cheapness; a Change Preventer outranks a cosmetic smell. |9697## Output Contract (Mode B)9899```100## Verdict: SHIP / SHIP-WITH-FIXES / REWORK101One-sentence senior summary. (e.g. "Logic is correct but the diff doubles an102existing util and swallows the parse error — rework before merge.")103104## Must-fix (blocks merge)1051. [robustness-at-boundaries · swallowed-error · HIGH] path/file.ts:42 —106 <what's wrong> → <the fix> (links: refactoring-patterns / RULES rule 6)1072. ...108109## Should-fix (not blocking, but real debt)110- [code-smells · duplicate-code · MED] ...111112## Nits (optional)113- [naming-and-comments · vague-name · LOW] ...114115## Definition-of-Done check116- [x]/[ ] for each item in RULES.md's gate, with the missing evidence called out.117```118119Always: name the **principle**, cite the **file:line**, give the **fix**, and rank by120severity. Never assert taste without a named principle. Praise is fine but brief —121this is editing, not a performance review.122123## References124- The 13 rules + Definition of Done: `../../RULES.md`125- Why durable code wins: `../../references/PRINCIPLES.md`126- The smell catalog: `../../references/SMELLS.md`127- The data behind all of it: `../../references/EVIDENCE.md`128- Language tells: `../../references/lang/{python,typescript,go}.md`