Skip to content

feat(spec): per-spec development_flow (unit | tdd | tdd-e2e)#32

Merged
protonspy merged 5 commits into
mainfrom
feat/development-flow-modes
Jun 12, 2026
Merged

feat(spec): per-spec development_flow (unit | tdd | tdd-e2e)#32
protonspy merged 5 commits into
mainfrom
feat/development-flow-modes

Conversation

@protonspy

Copy link
Copy Markdown
Owner

Summary

Lets a spec choose its development discipline at spec init, so simple features skip disproportionate test-first ceremony while critical ones keep full rigor. TDD stays the defaultunit is a conscious opt-in that still requires test evidence.

spec.json gains development_flow:

  • unit — tests written after the code (no RED-first ritual; behavior still covered by a unit test).
  • tdd (default) — test-first RED→GREEN.
  • tdd-e2e — TDD plus end-to-end coverage of golden + top error flows.

What changed

  • Field + op: development_flow on SpecJSON (+ session mirror, omitempty); new exported SpecInit op is the single source of truth.
  • Three surfaces: spec init --flow, MCP csdd_spec_init flow enum, TUI wizard step — all call SpecInit.
  • Workspace default: resolved from steering frontmatter default_development_flow (absent ⇒ tdd); the steering validator flags an invalid value (exit 2).
  • Backward compatible: a legacy spec.json with no field reads as tdd; omitempty keeps untouched files byte-identical.
  • spec show prints the resolved flow.
  • Flow-aware guidance in the shipped baseline (tasks-generation, definition-of-done, tdd-cycle, implementer, tasks.md) + a one-test-per-observable-behavior rule to curb test bloat.

Design

Per-spec field (not per-surface logic) keyed off the command-surface invariant; the validator stays test-first-agnostic (it never enforced RED/GREEN). Flow-awareness lives in guidance prose the agent reads alongside spec.jsontasks.md is rendered statically, so it is not conditionally templated.

Verification

  • gofmt -l . ✅ clean
  • go vet ./...
  • go test -race ./... ✅ (455 pass, 1 unrelated skip; pre-push gate green)
  • tsc --noEmit (mcp-server) ✅
  • csdd spec validate development-flow-modes
  • csdd spec test-report … --run --lang go ✅ 455 pass · coverage 81.9%

Review

code-reviewer ran: no Blockers; nits applied (surface-neutral error message, MCP description fix, mirror-comment accuracy).

🤖 Generated with Claude Code

protonspy and others added 5 commits June 8, 2026 18:49
Let a spec choose its development discipline at `spec init` so simple features
skip disproportionate test-first ceremony while critical ones keep full rigor.

- spec.json gains `development_flow` (omitempty): unit (tests after code),
  tdd (test-first RED→GREEN, default), tdd-e2e (TDD + end-to-end).
- `spec init --flow` across CLI, the MCP `csdd_spec_init` tool, and the TUI
  wizard, all via one exported `SpecInit` op (single source of truth).
- Workspace default resolved from steering frontmatter `default_development_flow`
  (absent ⇒ tdd); the steering validator flags an invalid value (exit 2).
- Backward compatible: a legacy spec.json with no field reads as tdd, and
  omitempty keeps untouched files byte-identical.
- Flow-aware guidance prose in the shipped baseline (tasks-generation,
  definition-of-done, tdd-cycle, implementer, tasks.md), plus a
  one-test-per-observable-behavior rule to curb test bloat.

Verification: gofmt clean · go vet ./... · go test -race ./... green
(455 pass) · tsc --noEmit (mcp-server) · spec validate passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@protonspy protonspy merged commit 692f513 into main Jun 12, 2026
3 checks passed
@protonspy protonspy deleted the feat/development-flow-modes branch June 12, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant