From spec-superflow
Governs implementation from an approved execution contract with TDD, batch modes, and git worktree isolation. Used after execution-contract.md is approved.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-superflow:build-executorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Controls the implementation phase. Uses `execution-contract.md` as the workflow authority.
Controls the implementation phase. Uses execution-contract.md as the workflow authority.
Read: execution-contract.md, tasks.md, relevant specs/, relevant design.md. (Skip contract/spec requirements when workflow is tweak.)
Check workflow mode first: node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state get <change-dir> workflow. If tweak → direct edit mode. If hotfix or full → standard contract-first discipline.
Config check: bash "${CLAUDE_PLUGIN_ROOT}/scripts/get-config" execution.inlineThreshold (default: 3).
Branch/worktree preflight before ANY implementation edit (mandatory — do not skip):
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" isolate <change-dir>
This script enforces git isolation: if you are on main/master it creates a
git worktree (preferred) or a new branch, and exits non-zero if it cannot and you
have not approved --force.node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" isolate exits non-zero: STOP. Do not edit main/master in place.
Ask the user for explicit approval (and re-run with node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" isolate <change-dir> --force
only after they approve).The execution contract is the approved handoff artifact, not chat history.
RED (write test, see it fail) → GREEN (write minimal code, see it pass) → REFACTOR (clean up, suite stays green).
Red Flags: "Quick implementation first, test later" / "Skip the test, manually verify" / "I already know it works" / "Just this one time without tests." ALL mean STOP and write the test first.
Block on: logic defects, spec violations, missing required tests, unintended scope expansion.
Return to specifying or bridging if: new behavior appears, interfaces change materially, design assumptions fail, artifacts no longer define intended implementation.
Auto-selection based on: task count, cross-module dependencies, risk indicators (new API/schema/config, open questions, unimplemented dependencies).
| Mode | Criteria |
|---|---|
| Inline | ≤3 tasks, no cross-module deps |
| Batch Inline | >3 tasks, same module, no risk indicators, ≤15 min effort |
| SDD (default) | Everything else |
Report mode + reasoning before executing. User can override: "use SDD", "use inline", or "use batch inline".
For low-risk, same-module tasks. Current agent executes directly. TDD Iron Law still applies.
Procedure: announce mode → write failing test → confirm failure → implement → run suite → refactor → lightweight checkpoint (files exist, no placeholders, test passed, no unintended changes) → report.
Boundaries: if any task touches >1 module, involves schema/API/config changes, or has open questions → downgrade to Inline or SDD.
For changes with multiple execution batches. Dispatch implementer subagent per task, review each task, final broad review after all batches.
${CLAUDE_PLUGIN_ROOT}/skills/build-executor/implementer-prompt.md template. Extract task brief with scripts/task-brief PLAN_FILE N. Include: where task fits, brief path, interfaces from prior tasks, report file path.skills/build-executor/task-reviewer-prompt.md. Reviewer returns spec compliance + code quality verdicts..superpowers/sdd/progress.md: Task N: complete (commits <base7>..<head7>, review clean)Use least powerful model per role: mechanical (cheap), integration/judgment (standard), architecture/design (most capable), review (match diff), final review (most capable). Always specify model explicitly.
Track in .superpowers/sdd/progress.md. Check for existing ledger — completed tasks are done. After each batch: node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> batches_completed <N>.
For ≤3 tasks, no cross-module deps. Executes in current session.
Per-task: extract brief → write failing test → confirm failure → implement → confirm green → checkpoint review (done-when criteria, SHALL/MUST verification) → commit → save a task-level recovery checkpoint when another task remains → append to progress ledger.
After a task is committed and reviewed, when another task remains, save the recovery context with real evidence:
node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" checkpoint save <change-dir> \
--task <completed-task-id> --next "<next task>" --completed "<completed work>" \
--verification "<verification report path>" --review "<review report path>" \
--risk "<open risk or None>" --commit-start <base-sha> --commit-end <head-sha>
This augments .superpowers/sdd/progress.md; it does not replace the progress
ledger or add a new core workflow state. Do not claim a checkpoint is current
when ssf checkpoint list reports it as stale.
If task hits BLOCKED (3+ fix failures or changes outside declared scope), escalate to SDD.
Skip TDD. Apply changes directly. Verify file integrity (exists, non-empty, valid syntax). No batch execution — sequential changes.
DP-4 (execution mode): node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_4_result "<mode>: <rationale>" + timestamp.
DP-5 (debug escalation): node "${CLAUDE_PLUGIN_ROOT}/scripts/spec-superflow.mjs" state set <change-dir> dp_5_result "<resolution>" + timestamp.
Don't report completion until: tests pass, contract obligations satisfied, review blockers resolved, all batches reviewed (per-task + final), workflow ready for release-archivist.
contract-builder.npx claudepluginhub magebyte-zero/spec-superflow --plugin spec-superflowScope-aware implementation workflow with TDD and continuous quality checks. Automatically scales planning ceremony from inline plans to full task-by-task execution.
Executes implementation plans by dispatching a fresh subagent per independent task, with built-in two-stage self-review per task and global review after all tasks complete. Use when tasks are mostly independent and you want to stay in the current session.
Use when you have a written implementation plan to execute in a separate session with review checkpoints