Skip to content

[Feature]: Add Test-Driven Development (TDD) Support to the Framework #2634

Closed as not planned

Description

@atpaawej

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

  1. When a developer wants to write a failing test before implementing a feature spec
  2. During spec review to validate each spec has a corresponding failing test
  3. When integrating with CI/CD pipelines that enforce TDD coverage gates

Acceptance Criteria

  • spec-kit tdd init command 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

Activity

  1. mnriem commented on May 21, 2026

    @mnriem
    Collaborator

    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?

  2. Pewejekubam commented on May 23, 2026

    @Pewejekubam

    You can also use the superpowers (Claude Code Anthropic marketplace) and include the superpowers bridge.
    That works GREAT!! for me!

  3. d0whc3r commented on Aug 4, 2026

    @d0whc3r
  4. mnriem commented on Aug 4, 2026

    @mnriem
    Collaborator

    Closing as there are multiple identified ways that you can use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions