/shipwright-build:shipwright-buildfrom shipwright-build
Implements code from planned sections using TDD, code review, Conventional Commits, and feature branch workflow. Includes decision logging, session handoff, and migration safety.
Ships in shipwright-build. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TDD implementation with code review, Conventional Commits, and feature branch workflow. Enhanced fork of deep-implement with decision logging, session handoff, and migration safety.
Autonomous orchestrated mode: When invoked by
/shipwright-runin autonomous or unattended mode, sections are delegated to thesection-buildersubagent (seeagents/section-builder.md). Each subagent gets a fresh context window and runs the full TDD cycle independently. This skill is still used directly in guided mode and for standalone invocations.
| Section | Reference |
|---|---|
| First Actions C/D/D2/E/F/G detail | first-actions |
| Step 3 TDD (Integration / pgTAP / E2E) | tdd-tests |
| Step 4 Implementation loop, Migration apply, Vite DX | implementation-loop · migrations-apply · migration-safety |
| Step 4.5 Browser Verify | browser-verify · debugging-protocol |
| Step 6 Code Review (Self / Full / External) | code-review · self-review-checklist · code-review-protocol · code-review-interview |
| Step 7 Apply review fixes | apply-interview-fixes |
| Step 8 Commit (Conventional Commits) | git-operations · pre-commit-handling |
| Step 9 Decision log | section-doc-update |
| Step 10 Section state, record_event, split-done canon · requirement write-back (Step 1 detects the mockup contradiction, Step 10b records it + the shared-touch carve-out) | section-state · requirement-writeback |
| Step 10a Reflection | reflection |
| Autonomous Section Loop | autonomous-loop |
| Error handling (tests / hooks / context) | error-handling |
| Performance / Simplification / Finalization | performance-checklist · simplification-patterns · finalization |
Governing rules: Read and follow shared/constitution.md (ALWAYS / ASK FIRST / NEVER boundaries).
BEFORE using any other tools, do these in order:
================================================================================
SHIPWRIGHT-BUILD: TDD Implementation
================================================================================
Implements code from /shipwright-plan section files.
Usage: /shipwright-build @path/to/sections/01-auth.md [--review-model opus|sonnet|haiku|inherit|fable] [--finalization-model ...] [--execution-model ...]
or: Invoked by /shipwright-run (orchestrator)
Workflow per section:
1. Read section spec
2. Write tests first (TDD)
3. Implement until tests pass
4. Code review (subagent)
5. Fix review findings
6. Commit (Conventional Commits)
7. Update decision log + docs
Features:
- Auto feature branch (build/{slug}-{session-id}, derived from run config)
- Conventional Commits (feat:, fix:, refactor:, etc.)
- Migration safety (down.sql + destructive change detection)
- Session handoff before context limits
================================================================================
Check if user provided @file argument pointing to a section markdown file. If NO argument or invalid, print the "Section File Required" notice and stop and wait for user to re-invoke with correct path.
================================================================================
SHIPWRIGHT-BUILD: Section File Required
================================================================================
This skill requires a path to a section markdown file.
Example: /shipwright-build @sections/01-auth.md
Section files are generated by /shipwright-plan.
================================================================================
Resolve it with {shared_root}/scripts/tools/get_phase_context.py --phase-task-id "{phaseTaskId}" --phase build (omit --phase-task-id entirely if the orchestrator did not hand you one — that is what selects standalone) and store the returned mode as invocation_mode (pipeline | standalone | error → STOP). The dispatch token the orchestrator hands you is the authority — never re-derive the mode from run-config state. See first-actions for the full decision tree (incl. the out-of-sequence warning + the Single-Session Gate Discipline).
SHIPWRIGHT_PLUGIN_ROOT comes from the SessionStart hook. Then run setup_implementation_session.py and parse its JSON (success, mode == "resume", etc.). Full procedure: first-actions.
Run validate_env.py --init then validate_env.py (no --init). Handle created / updated / unchanged / success == false / optional_missing per first-actions. action: "error" (or a non-zero exit) is a profile problem: stop and show the message, do not retry or edit project code.
Always feature-branch before changes. Resume path: git checkout {branch_name}. Create path: anchor on the default branch first. Full snippet + naming fallbacks in first-actions.
Read shipwright_build_config.json from project root; defaults in first-actions (auto_push false, conventional_commits true, decision_log true, session_handoff true, migration_safety true).
Resolve model tiers first (Model tiers in first-actions). Print the SESSION REPORT block (Mode / Section / Branch / Auto-push / Migration safe / Resume from / Model tiers). Template in first-actions.
If the orchestrator handed you a phaseTaskId — i.e. /shipwright-run dispatched
you as a phase-runner subagent — you are part of an active pipeline. Run this as your
very first action:
uv run "${SHIPWRIGHT_PLUGIN_ROOT}/../../shared/scripts/tools/get_phase_context.py" \
--phase-task-id <phaseTaskId-from-context>
The tool prints structured JSON with runId, phase, splitId, prerequisites,
runConditions, and a skill_artifacts_to_read list. Read those artifacts
before proceeding so this phase session has full context for what came before.
If NO phaseTaskId was handed to you, this is a standalone invocation —
continue with Step 1.
Goal: Understand what to implement.
Read the section file. Identify prerequisites, test strategy, implementation steps, files to create/modify.
Design Reference (mandatory for UI sections): If the section contains a ## Design Reference block, you MUST read the referenced mockup HTML file before writing any implementation code. The mockup is the visual truth — match layout, component hierarchy, colors/spacing/typography from .shipwright/designs/visual-guidelines.md, and responsive behavior. If no ## Design Reference exists but .shipwright/designs/screens/ contains relevant mockups, read them anyway. When in doubt, the mockup wins over your assumptions.
A recorded Design decision: line in the section is resolved — implement its winner, do not stop or ask (Plan wrote it under the autonomous rule: screen wins over section text, an explicit brief override wins over the screen; requirement-writeback). Only an unresolved Design contradiction: line, or a mockup/section difference no Design decision: covers, stops Build. Mockup-vs-Section Contradiction — STOP and put it to a person. When the approved mockup and the section's own description contradict each other, implement exactly what the section specified and never ignore the mockup cannot both be satisfied — and whichever one you happen to follow wins silently, discarding the reason mockups exist. Stop building, and put it to a person, quoting both sides. The expected resolution is that the requirement is corrected to match the mockup, because the mockup is the thing someone looked at and judged against real use. Record the outcome at Step 10b via --contradiction. Detecting the contradiction is a human read with no deterministic check (Plan has a narrow one for autonomous runs); full rule in requirement-writeback. A section with Size decision: split allowed (soft target) (autonomous run): "under ~N lines" is a soft target; split into more modules, never cut behaviour — decide, do not ask (requirement-writeback). Autonomous run, two more rules — decide, do not ask: an explicit brief value wins over plan text and screens (also one no screen shows; "shown" is not a tooltip) and two constraints that cannot both hold keep the hard one (no layout shift or height change) over a visible extra; record each with uv run "{shared_root}/scripts/tools/record_autonomous_decision.py" --project-root "$(pwd)" --kind brief-wins|hard-constraint ... (it logs the ADR and the known difference; hard-constraint needs measured widths). Read .shipwright/designs/known-differences.md first: an entry there is already decided. Only a case with no ranking is put to a person (requirement-writeback).
If prerequisites reference other sections, verify those are complete (commits on the branch or main).
uv run "{shared_root}/scripts/tools/update_build_dashboard.py" \
--project-root "$(pwd)" --section "{section_name}" --step 1 --detail "Reading section spec" --session-id "{SHIPWRIGHT_SESSION_ID}"
If section spec lists npm/pip packages: npm install {packages} or uv add {packages} (an autonomous run always adds --ignore-scripts to every npm/pnpm/yarn install; a package that needs its install script is a question). Do NOT commit package changes yet — they'll be part of the section commit. Dev tooling the project already declares (npm install --ignore-scripts of package.json, npx playwright install <browser> when Playwright is in package.json or the stack profile, uv sync): in an autonomous run run uv run "{shared_root}/scripts/tools/record_autonomous_decision.py" --project-root "$(pwd)" --kind dev-tooling --phase Build --scope "{section_name}" --command "<cmd>" ... first; exit 0 = ADR recorded, run exactly that command and do not ask; exit 1 = undeclared, a JavaScript install without --ignore-scripts, a manifest changed since the section started (setup's boundary_baseline), or an interactive run: ask.
See implementation-loop for the TDD cycle and tdd-tests for Integration / pgTAP / E2E test selection (incl. the decision table).
Red phase: write failing tests, run npm test or uv run pytest, verify they fail. A red test never runs delete code on real folders: a test of anything that deletes, cleans or resets (rmtree, rm -rf, unlink, --fresh, a cleanup helper) works only in a temp copy, with every path built from that copy, never . or the project root; read an unguarded helper, do not run it on real paths (safe-delete-tests).
See implementation-loop for guidance.
Goal: Write code to make tests pass (green phase).
Migration Safety (if enabled): when creating up.sql, also generate down.sql. See migration-safety. The PostToolUse hook will warn on destructive operations automatically.
Vite DX scaffold (Vite profiles only): see migrations-apply "Vite DX Scaffold" section.
Apply migrations immediately if migration files were created — preflight / apply / verify / post-apply manual steps per migrations-apply.
Checkpoint: All tests pass. Run integration / pgTAP tests if files exist. Capture tests_passed / tests_total for Step 10. Dashboard update + context pressure check per migrations-apply.
See browser-verify.
Detect frontend changes with detect_frontend_changes.py. If has_frontend_changes == false, skip. Otherwise: prerequisite self-healing, Playwright setup, dev server, run browser_verify.py, auto-fix loop (max 3 retries) per debugging-protocol. Missing dev_server config is a RESOLUTION problem, not a skip trigger.
Remove duplication, improve naming, extract utilities if warranted. Run tests after each refactor.
See code-review for the full cascade (incl. its "Dispatch rule" for a Codex-driving session), the spec-reviewer HARD-GATE re-review loop, and the doubt-reviewer trigger heuristic.
spec-reviewer (HARD-GATE): spec-compliance gate; runs whenever 6b runs (same trigger, so Stage 1 always precedes Stage 2). On REJECT, fix and re-review; 6b does NOT run until PASS.code-reviewer (Stage 2, conditional): triggered when diff > 100 lines, section risk: high, or security-sensitive files. Full flow per code-review-protocol; user interaction per code-review-interview.external_code_review.enabled: false in shipwright_build_config.json (same default as iterate). Generic code-quality second opinion only — the internal spec-reviewer/doubt-reviewer do NOT cascade externally. See code-review.doubt-reviewer (conditional, advisory): after 6b passes, a fresh-context disprove pass for non-trivial touches (migrations, async/concurrency, cross-plugin imports, irreversible ops). Implementer must address each doubt.See apply-interview-fixes. Autonomous mode: all findings arrive as "accepted" — apply all fixes, re-run tests, mark resolved. Track findings for Step 10 with statuses fixed / declined / deferred.
See git-operations.
Format: <type>(<scope>): <description>\n\n<body>\n\nCo-Authored-By: Claude <[email protected]>. Types: feat / fix / refactor / test / docs / chore. Scope = section name.
git add -A
git commit -m "<message>"
Auto-push (if enabled): git push -u origin {branch_name}.
Dashboard update + context pressure check (same pattern as Step 4 — see migrations-apply). Pre-commit hook failures: see error-handling + pre-commit-handling.
See section-doc-update. If .shipwright/agent_docs/decision_log.md exists, log each significant decision via write_decision_log.py:
uv run "{plugin_root}/../../shared/scripts/tools/write_decision_log.py" \
--section "Build — {section_name}" \
--commit "$(git rev-parse HEAD)" \
--title "{short title}" \
--context "{why needed}" --decision "{what decided}" \
--consequences "{impact}" --rationale "{reasoning}" \
--rejected "{alternatives}" --project-root "$(pwd)"
Log architecture choices, accepted/declined review findings, deviations from the section spec.
See section-state for the full procedure: update_section_state.py, record_event.py (per section — do NOT batch), dashboard update, phase-complete trigger, and the canon-hybrid split-done finalization (C3 handoff + C5 changelog entries + phase_history once per split — both all_done == true and all_done == false branches).
Commands + carve-out: requirement-writeback. Runs after the Step 8 commit, so HEAD^..HEAD is exactly this section's own range — never pass the branch base, which would sweep in every earlier section. record_requirement_impact.py --phase build --scope "{section_name}" records one declaration per section (--impact none needs a one-line --reason; --impact modify --fr FR-XX.YY is refused unless a .shipwright/planning/**/spec.md was actually edited; add --contradiction when Step 1's rule fired). Then check_section_file_attribution.py verifies every changed file is either in the section's ## Files to Create/Modify block or a recorded --extra "PATH=why". Shared-touch carve-out: a section that cannot be built without touching something shared may make the smallest such change, provided it is recorded as belonging to that section — "nothing outside the section" forbids unrequested extra work, not the work the section needs to function.
Apply the reflection protocol (reflection): decisions -> ADR; observations -> conventions.md; cross-project insights -> Memory.
If conversation is long:
uv run "{shared_root}/scripts/tools/generate_session_handoff.py" \
--project-root "$(pwd)" --preserve-canon-marker \
--reason "mid-build handoff: section {section_name} {complete|in_progress}"
Do NOT pass --canon-marker here — a mid-build handoff is not a canon closure (the marker is reserved for the split-level C3 closure in section-state). DO pass --preserve-canon-marker: this writes to the same tracked session_handoff.md that closure marked, and without the flag it DROPS that marker, so Canon C3 reports "no canon marker" for every phase until the next split closes (iterate-2026-07-27-c3-phase-history-join).
When invoked with --autonomous (or run autonomy: unattended), build all pending sections sequentially. Full procedure: autonomous-loop. When NOT autonomous: skip this section, proceed to Step 12.
Verify: all tests pass, code review complete, commit on feature branch, decision log updated; for a profile with architecture-rule lint blocks (supabase-nextjs) run the check-only form uv run {shared_root}/scripts/tools/check_eslint_architecture_rules.py --project-root . from the project root once the app exists (create-next-app replaces the scaffold's eslint config) and report every finding in the summary, never drop one. The tool changes nothing without --apply: only when the check reports lost blocks, run it again with --apply as a deliberate repair, show the resulting diff in the summary and commit message, and never apply without a finding. Print the SHIPWRIGHT-BUILD COMPLETE summary block (Section / Branch / Commit / Tests / Review counts / Next steps).
See error-handling for test failures, pre-commit hook failures, and context-window-pressure checkpoint procedure (Steps 4 and 8 fire estimate_context_pressure.py).
references/apply-interview-fixes.md (opens in a new tab)references/autonomous-loop.md (opens in a new tab)references/browser-verify.md (opens in a new tab)references/code-review-interview.md (opens in a new tab)references/code-review-protocol.md (opens in a new tab)references/code-review.md (opens in a new tab)references/debugging-protocol.md (opens in a new tab)references/error-handling.md (opens in a new tab)references/finalization.md (opens in a new tab)references/first-actions.md (opens in a new tab)references/git-operations.md (opens in a new tab)references/implementation-loop.md (opens in a new tab)references/local-server-tests.md (opens in a new tab)references/migration-safety.md (opens in a new tab)references/migrations-apply.md (opens in a new tab)references/mockup-to-shadcn-mapping.md (opens in a new tab)references/performance-checklist.md (opens in a new tab)references/pre-commit-handling.md (opens in a new tab)references/reflection.md (opens in a new tab)references/requirement-writeback.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub svenroth-ai/shipwright --plugin shipwright-buildOther plugins' skills for the same job