feat(spec): per-spec development_flow (unit | tdd | tdd-e2e)#32
Merged
Conversation
…aged agents and skills
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 default —unitis a conscious opt-in that still requires test evidence.spec.jsongainsdevelopment_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
development_flowonSpecJSON(+ session mirror,omitempty); new exportedSpecInitop is the single source of truth.spec init --flow, MCPcsdd_spec_initflowenum, TUI wizard step — all callSpecInit.default_development_flow(absent ⇒tdd); the steering validator flags an invalid value (exit 2).spec.jsonwith no field reads astdd;omitemptykeeps untouched files byte-identical.spec showprints the resolved flow.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.json—tasks.mdis rendered statically, so it is not conditionally templated.Verification
gofmt -l .✅ cleango 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-reviewerran: no Blockers; nits applied (surface-neutral error message, MCP description fix, mirror-comment accuracy).🤖 Generated with Claude Code