A Claude Code plugin that brings Test-Driven Development workflows to AI-assisted coding, following the Red-Green-Refactor cycle for systematic code generation.
TDG (Test-Driven Generation) enhances Claude Code with structured workflows for test-driven development. It helps you:
- Follow the Red-Green-Refactor TDD cycle systematically
- Write tests before implementation
- Maintain high test coverage
- Create atomic, well-organized commits
- Track work with issue numbers for full traceability
# Add the TDG marketplace
claude plugin marketplace add chanwit/tdg
# Install the plugin
claude plugin install tdg/tdg:init- Initialize TDG configuration for your project (detects language, framework, test commands)/tdg:version- Show the current TDG plugin version/tdg:atomic-commit- Create clean, atomic commits by analyzing and organizing your changes
-
TDG (Test-Driven Generation) - Complete TDD workflow following Red-Green-Refactor cycles
- Automatically detects current phase (red/green/refactor)
- Guides you through writing tests first
- Ensures commits follow TDD conventions
- Requires issue number for traceability
-
Atomic Commit - Create clean, atomic commits for non-TDD workflows
- Analyzes changes and detects mixed concerns
- Groups related changes into logical commits
- Ensures each commit is a complete unit of work
- Validates tests pass before committing
- Automation hooks (coming soon)
- Initialize TDG in your project:
/tdg:init- Use the TDG skill for test-driven development:
Use TDG to implement user authentication
- For organizing existing changes, use the Atomic Commit skill:
Create atomic commits for my changes
The TDG skill follows a strict Red-Green-Refactor cycle:
-
Red Phase - Write failing tests
- Commits prefixed with
red: test spec for ... - Include issue number:
red: test spec for user login (#42)
- Commits prefixed with
-
Green Phase - Implement code to pass tests
- Commits prefixed with
green: ... - Example:
green: implement user login (#42)
- Commits prefixed with
-
Refactor Phase - Optimize and clean up
- Commits prefixed with
refactor: ... - Example:
refactor: extract auth service (#42)
- Commits prefixed with
Chanwit Kaewkasi
MIT
- Repository: https://github.com/chanwit/tdg