[Feature]: Add Test-Driven Development (TDD) Support to the Framework
Problem Statement
The framework currently lacks built-in support for Test-Driven Development (TDD). Developers who want to follow TDD practices are frustrated by the absence of structured test scaffolding, spec-first workflows, and testing utilities natively integrated into the framework lifecycle.
Proposed Solution
Integrate TDD support natively into spec-kit by providing:
- A spec-first scaffolding command (e.g.
spec-kit tdd init) that generates failing test stubs before implementation - A built-in test runner hook that enforces the Red-Green-Refactor cycle
- Auto-generation of test skeletons from spec definitions
- Watch mode support for continuous TDD feedback loops
- Clear documentation and examples for TDD workflows within the framework
Alternatives Considered
Using third-party TDD libraries (e.g. Jest, RSpec) independently — but these lack integration with spec-kit's spec lifecycle and require additional configuration overhead.
Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
None
Use Cases
- When a developer wants to write a failing test before implementing a feature spec
- During spec review to validate each spec has a corresponding failing test
- When integrating with CI/CD pipelines that enforce TDD coverage gates
Acceptance Criteria
- [ ]
spec-kit tdd initcommand is available and generates failing test stubs from specs - [ ] Red-Green-Refactor cycle is enforced by the framework's test runner
- [ ] Watch mode runs tests automatically on file save
- [ ] TDD workflow is documented with examples in the official docs
- [ ] Existing specs remain unaffected (backwards compatible)
Additional Context
No response
Please see https://github.com/github/spec-kit/blob/main/templates/tasks-template.md for how it approaches testing.
"Tests: The examples below include test tasks. Tests are OPTIONAL - only include them if explicitly requested in the feature specification."
So asking for tests is already supported you just have to request it
Is that sufficient?
You can also use the superpowers (Claude Code Anthropic marketplace) and include the superpowers bridge. That works GREAT!! for me!
https://github.com/d0whc3r/spec-kit-tdd
Closing as there are multiple identified ways that you can use