name: ship-feature description: Ship feature end-to-end: design → plan → implement (TDD) → review → finish argument-hint: disable-model-invocation: true
$ARGUMENTS
Load $HOME/.claude/agents/plugin-advisor.md. Feed request.
✅ Plugin check passed — [active plugins] — complexity: <score>%, continue.Verify the project has a CLAUDE.md and print a brief orientation summary:
ls CLAUDE.md .claude/CLAUDE.md 2>/dev/null | head -1
git branch --show-current 2>/dev/null || echo "not a git repo"
git log --oneline -3 --format="%h %<(50,trunc)%s" 2>/dev/null || true
ls .gsd/ROADMAP.md 2>/dev/null | head -1
CLAUDE.md found → read it silently, then print orientation header (informational, not a gate):
📋 PROJECT CONTEXT
Project : <name from CLAUDE.md>
Stack : <stack from CLAUDE.md>
Branch : <current git branch>
Recent : <last 3 commit messages>
GSD : <current milestone if .gsd/ROADMAP.md exists, else "not initialized">
Continue to STEP 1.
Not found →
Print: "⚠️ No CLAUDE.md found in this directory.
This project has not been onboarded into claude-config.
Run /onboard first to generate CLAUDE.md and project settings,
then re-run /ship-feature."
STOP.
Check if the project uses fast-evolving libs (scan package.json for next, react, prisma, supabase, drizzle, expo):
.ctx7-cache/ exists with recent files (<7 days old) → print `📚 ctx7 cache found: ` and continue.
If .ctx7-cache/ missing or stale AND ctx7 is installed AND fast-libs detected:
mkdir -p .ctx7-cache
# Fetch docs for each detected fast-lib (adapt to actual deps):
ctx7 docs /vercel/next.js "app router middleware routing" > .ctx7-cache/nextjs-core.md 2>/dev/null || true
ctx7 docs /prisma/prisma "schema client queries" > .ctx7-cache/prisma-core.md 2>/dev/null || true
Print: 📚 ctx7 docs pre-fetched for: <libs>
If no fast-libs or ctx7 not installed → skip silently.
During implementation (STEP 4), when making decisions about fast-lib APIs:
.ctx7-cache/<lib>.md file before writing code.Invoke superpowers:brainstorming. Refine request into validated design via Socratic questioning. Don't proceed until design approved.
Invoke superpowers:writing-plans. Break design into tasks (2-5 min each). Each task: exact file paths, full code, verification steps.
SHIP FEATURE — VALIDATION GATE
FEATURE: <n> | TASKS: <count>
<numbered task list>
Approve and execute? (yes / request changes)
Changes → back to STEP 2. Approved → continue.
Invoke superpowers:subagent-driven-development. Isolated subagents. 2-stage review per task: spec compliance → code quality.
If a subagent returns a build error, failing test, or type error:
$HOME/.claude/agents/analyzer.md in DEBUG MODE on the exact error output.
Produce: root cause hypotheses (ordered), affected files, what NOT to touch.Present gate:
SHIP FEATURE — ERROR IN STEP 4
TASK : <task name that failed>
ERROR : <one-line summary>
HYPOTHESES:
1. [HIGH] <cause> — evidence: <…>
2. [MED] <cause> — evidence: <…>
OPTIONS :
A) Apply fix for hypothesis 1 and re-run this task
B) Skip this task and continue with remaining tasks
C) Abort feature — preserve work done so far
Wait for user choice. Do NOT auto-fix. Do NOT proceed without explicit approval.
If A → apply minimal fix, re-run STEP 4 for the failed task only. Max 2 retry attempts. If still failing after 2 → fall back to options B or C. If B → before skipping: scan remaining task list for tasks that depend on the failed task (look for references to the same file or function in subsequent tasks). If dependents found → present: "Tasks [N, M] depend on the skipped task. Skip them too? (yes / keep and accept partial implementation)" If no dependents → skip cleanly and continue.
Load $HOME/.claude/agents/analyzer.md. Check: no regressions, no stale code, no plan deviations.
Invoke superpowers:requesting-code-review. Fix all CRITICAL before proceeding.
Invoke superpowers:finishing-a-development-branch. Tests pass, build clean, ready to merge.
Load $HOME/.claude/agents/doc-syncer.md.
Execute in automatic mode:
auto-mode scope: <list of files modified during this session>
Feature shipped implies at least one design decision worth capturing. Run this before declaring done:
decisions.md (BDR-XXX).learnings.md (LRN-XXX).blockers.md (BLK-XXX).Present them grouped:
CAPITALIZE — registres proposés
[ decisions.md ]
BDR-XXX — <titre> — <1-line why>
[ learnings.md ]
LRN-XXX — <pattern>
[ blockers.md ]
(aucun)
Valider lesquels ? (all / <IDs> / edit / skip)
Append approved entries to the registries. Update the Index table at the top of each file.
Append a one-line entry to .claude/memory/journal.md under today's date heading (## YYYY-MM-DD).
Language rule: written entries are ALWAYS in English (see CLAUDE.md "Memory registries" § Language). The interactive gate above may mirror the user's language; the appended entries must not.
If nothing substantive to log → print CAPITALIZE: nothing substantive to log and skip.
The pipeline must handle these without aborting silently:
| Situation | Behavior |
|---|---|
STEP 0b — CLAUDE.md missing |
STOP with the printed message ("Run /onboard first…"). Do not proceed. |
STEP 0c — ctx7 not installed but fast-libs detected |
Skip pre-fetch silently. During STEP 4, log 📚 ctx7 cache miss for <lib> and continue with vanilla model knowledge. |
| STEP 1 — brainstorming returns "design unclear" twice | Escalate: ask user "Switch to /init-project (greenfield-style design) or refine the feature request?" |
| STEP 3 — user replies "request changes" | Loop back to STEP 2 with user's notes. Cap at 3 iterations; on the 3rd "request changes" without approval, ask "Pause and rescope this feature?" |
| STEP 4 — subagent crashes (tool error, not test failure) | Treat as STEP 4b error path, present hypothesis-led gate. |
| STEP 4b — option A retried 2× still failing | Force fall-through to B or C. Do not loop a 3rd time. |
| STEP 6 — review returns CRITICAL items | Loop back to STEP 4 for those items only. Cap at 2 review-cycle iterations; if still CRITICAL, escalate. |
STEP 9 — .claude/memory/ missing |
Create the registry files from ~/.claude/templates/memory/ first, then proceed. |
FEATURE SHIPPED: <n>
TASKS: <N>/<N> | TESTS: ✅/❌ | REVIEW: APPROVED/CHANGES REQUIRED
REMAINING ISSUES: <list or none>