get-shit-done/references/execute-mvp-tdd.md
Loaded by
execute-phaseworkflow andgsd-executoragent only when bothMVP_MODE=trueANDTDD_MODE=truefor the phase. Defines the runtime gate that blocks behavior-adding tasks until a failing-test commit exists.
MVP_MODE is true (resolved from CLI flag → ROADMAP **Mode:** field → config; see references/planner-mvp-mode.md).TDD_MODE is true (resolved from --tdd flag → workflow.tdd_mode config).tdd="true" in its <task> frontmatter (set by the planner per Phase 1).<behavior> block lists at least one expected behavior.If any of these is false, the gate is inactive — execution proceeds normally.
For each task gated by MVP+TDD, the executor MUST verify (before running the implementation step):
test({phase}-{plan}) whose subject mentions the same plan as the current task. The commit must touch a test file (*.test.*, *.spec.*, tests/**).RED: prefix or (RED) tagFAIL or non-zero exit on the new test before any implementation commitfeat({phase}-{plan}) commit may exist for the same plan ID before the failing-test commit.If any check fails, the gate trips.
A task is behavior-adding when:
tdd="true" AND<behavior> block names at least one user-visible outcome (not a config-only or doc-only task) AND<files> list includes at least one source file (not exclusively docs/tests/config files such as *.md, *.json, *.test.*, *.spec.*, *.yml, *.yaml, *.toml, *.ini, .env*)Pure documentation, configuration, or test-only tasks are skipped by this gate even when both modes are active.
The executor MUST:
Halt before running the task's implementation step.
Emit a structured halt report:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MVP+TDD GATE TRIPPED — Plan {plan_id}, Task {task_id}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Reason: {missing_red_commit | red_commit_not_failing | feat_before_test}
Behavior expected to be tested:
- {first behavior bullet}
Required next step:
1. Write a failing test for the behavior above.
2. Commit it as: test({phase}-{plan}): {short description}
3. Re-run /gsd execute-phase
Exit the current execution wave cleanly. Do NOT roll back any prior commits in the same wave.
Update STATE.md with last_gate_trip: {plan_id}/{task_id} so the user can resume after writing the test.
The existing end-of-phase TDD review (in workflows/execute-phase.md's tdd_review_checkpoint step) is normally advisory — it surfaces gate violations but does not block phase completion.
Under MVP+TDD, escalate this to blocking:
"Phase blocked: {N} TDD plan(s) violate the RED→GREEN gate sequence under MVP+TDD. Resolve and re-run /gsd execute-phase, or override with
/gsd execute-phase {phase} --force-mvp-gateto ship anyway."
The --force-mvp-gate flag is documented but not introduced by this plan — it is the escape hatch the spec mentions; if the user later builds it, the workflow already references the contract.
references/tdd.md).This gate is additive to references/tdd.md. Tasks not under MVP+TDD continue to use the existing advisory TDD discipline (RED/GREEN/REFACTOR commits with end-of-phase review checkpoint). Only the runtime gate and the blocking escalation are new.