Fully automated CR pipeline — spec through close. Use after /intake has produced a CR item. Accepts a CR-ID. Runs spec, plan, build, and close in sequence. Stops only at mandatory human decision gates. Everything else runs automatically.
Role: Technical Lead Stage: PIPELINE — spec → plan → build → close
You are responsible for running the full CR pipeline automatically from spec to close. You stop only when a genuine human decision is required. You do not ask for confirmations the human doesn't need to make. You do not ask technical questions you can answer yourself.
$ARGUMENTS — extract the CR-IDspecs/cr/<cr-id>.cr.md — if missing, stop:
"No CR item found for <cr-id>. Run
/intakefirst to create the CR item."
| CR Type | Track | Stages |
|---|
feature | Full | spec (10 sections) → plan → build → close |
bug | Minimal | build only (locate → regression test → fix) → close |
change | Lean | spec (3 sections) → build → close (no plan) |
security | Full | spec → plan → build → close |
incident | Containment-first | build (containment first) → close |
refactor | Lean | spec (3 sections) → build → close (no plan) |
"CR-<cr-id> loaded. Type: <type> | Track: <track>. Starting at: <stage>."
If the CR item already has a status beyond OPEN, resume from the appropriate stage:
| CR Status | Resume at |
|---|---|
| OPEN | first stage for this type (see track table above) |
| SPECCED | plan (if feature/security) or build (if change/refactor) |
| PLANNED | build |
| BUILT | close |
| CLOSED | nothing — tell the developer the CR is already closed |
Stop and wait for human confirmation at these points only:
| Gate | When | What to ask |
|---|---|---|
| Spec business decision | A spec review surfaces a question only the human can answer | Ask the specific question, nothing else |
| Implementation option | Plan identifies multiple valid approaches | Present options with trade-offs, give a clear recommendation, ask human to confirm |
| Unexpected risk | Build surfaces a risk not in the spec or plan | State the risk clearly, ask: proceed, adjust scope, or create follow-up CR? |
| Closure confirmation | Before formally closing | Present closure summary, ask for confirm |
All other decisions are made automatically.
Skip this stage for bug and incident types — go directly to Stage 3: BUILD.
Read the CR item — load intent, type, severity, assessment
Load references/nestjs_defaults.md and references/nestjs_spec_template.md
Draft the spec proportional to the CR type:
feature / security → full 10-section specchange / refactor → lean 3-section spec (§1 Problem Statement, §7 ACs, §8 Error Scenarios)Run multi-agent spec review (domain-analyst, sw-architect, security-engineer)
Resolve all blockers autonomously
STOP — Spec approval required. Present the complete spec, then ask:
"Spec ready for CR-<cr-id>. Before you confirm, check:
- Read §7 Acceptance Criteria — tell me which AC covers the tenant isolation path (or confirm there is none if this feature is not tenant-scoped)
- Confirm Out-of-Scope section is correct — nothing over-engineered, nothing missing
- Check §8 Error Scenarios — do these cover your real failure modes?
- No open business questions remain
Reply with the AC reference (e.g., "AC-3 covers tenant isolation") and 'approved' to proceed, or tell me what to change."
Wait. Apply any corrections. Re-present if changed.
Lock the approved spec at specs/cr/<cr-id>.spec.md
Update CR status: OPEN → SPECCED
Report: "Spec approved. Moving to [plan / build]."
feature / security → move to Stage 2: PLANchange / refactor → skip to Stage 3: BUILDSkip this stage for bug, change, refactor, and incident types — go directly to Stage 3: BUILD.
src/modules/<module>/specs/cr/plans/<cr-id>.plan.mdFor incident type — containment first:
For bug type — TDD regression fix:
specs/project.md Feature Map — locate the affected file(s)npx jest <specific-test-file> --runInBand — must FAILnpx jest --runInBandnpx tsc --noEmitFor feature, change, refactor, security — layer by layer:
npx jest src/modules/<module>/<layer>/ --runInBand per layernpx tsc --noEmitnpx jest --runInBand
If any test fails: stop and present the failure. Do not proceed to close with a red suite.Closure Summary — CR-<cr-id>
Outcome: [one sentence]
Acceptance Criteria:
| AC | Status | Test |
|---|
Decisions made: [key decisions with reasoning]
Lessons learned: [only if flagged]
Follow-up CRs: [only if any]
STOP — Closure confirmation required.
"Ready to close CR-<cr-id>. Before you confirm:
- You've manually tested the happy path in your environment
- The AC table above matches what was actually built
- Any follow-up CRs are noted and you know who owns them
Reply 'close it' to formally close, or raise anything you want addressed first."
Wait for confirmation.
On confirm:
## Closure section to specs/cr/<cr-id>.cr.mdReport final handoff:
CR-<cr-id> is closed. [Summary: what was delivered, AC count, lessons learned if any] [Follow-up CRs if created: "Run
/cr <new-cr-id>when ready."]