jutsu-tdd
Test-first workflow plugin that enforces red-green-refactor on new code, bug fixes, and refactors.
- CCM score
- 42 of 100
- GitHub stars
- 201
Own this plugin? Claim it
What it does
- Adds a
test-driven-developmentskill covering the red-green-refactor cycle for functions, features, bugs, and refactors - Includes
enforce-tdd.mdandhooks.jsonhooks that inject TDD reminders on every user prompt and after subagents stop - Guides Claude to write a failing test first, run it, make it pass with minimal code, then refactor while tests stay green
- Designed for teams practicing TDD and codebases with comprehensive test coverage
Test-Driven Development (TDD) principles and red-green-refactor cycle enforcement
Add marketplace
/plugin marketplace add TheBushidoCollective/hanRun it inside Claude Code once, then install the plugin below.
Install
/plugin install jutsu-tdd@hanRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceTest-Driven Development (TDD)
Red → Green → Refactor cycle for all code changes.
The TDD Cycle
- RED: Write failing test
- GREEN: Write minimal code to pass
- REFACTOR: Improve code quality
Repeat for each requirement
When to Apply TDD
✅ Always use TDD for:
- New functions/methods
- New features
- Bug fixes (reproduce first)
- Refactoring existing code
- API changes
❌ Skip TDD for:
- UI styling tweaks
- Configuration changes
- Documentation updates
Process
1. Write Failing Test First
# Start with test
test "calculates total with tax" do
result = Calculator.calculate_total([100, 200])
assert Money.equal?(result, Money.new(:USD, 324))
end
# Run test - should FAIL
mix test
2. Implement Minimal Code
# Just enough to pass
def calculate_total(prices) do
prices |> Enum.sum() |> Kernel.*(1.08) |> Money.new(:USD)
end
3. Refactor
Extract constants, improve naming, etc.
Test Patterns by Stack
Backend (Elixir)
- File:
test/path/module_test.exs - Pattern:
apps/api/test/your_app/task/task_test.exs
Frontend (TypeScript)
- File:
ComponentName.test.tsx - Pattern:
mobile/libraries/atorasu/atoms/Button/Button.test.tsx
Critical Rules
- Tests MUST fail first (verify test works)
- One test per requirement
- Test behavior, not implementation
- Run FULL test suite before commit
- NEVER skip failing tests
Common Pitfalls
- Writing implementation before test
- Tests that pass without implementation (false positive)
- Testing implementation details instead of behavior
- Not running test to verify it fails first
Verification
# Backend
mix test path/to/test.exs
# Frontend
yarn test path/to/test.tsx
Readme
TDD
Test-Driven Development (TDD) principles and red-green-refactor cycle enforcement.
Overview
This plugin provides comprehensive Test-Driven Development guidance and automatic enforcement through hooks. It ensures that Claude follows the TDD cycle when writing new code, fixing bugs, or adding features.
Features
- TDD Skill: Complete guidance on the red-green-refactor cycle
- Automatic Enforcement: Hooks that remind Claude to follow TDD on every user prompt
- Best Practices: Detailed examples and patterns for different technology stacks
What is TDD?
Test-Driven Development is a software development approach where you:
- RED: Write a failing test first
- GREEN: Write minimal code to make it pass
- REFACTOR: Improve the code while keeping tests green
When to Use
Install this plugin when working on:
- Projects that require high code quality
- Teams practicing TDD
- Codebases with comprehensive test coverage
- Any project where you want to ensure tests are written before implementation
Hooks
This plugin includes hooks that:
- Inject TDD reminders on every user prompt (
UserPromptSubmit) - Remind subagents to follow TDD when they complete (
SubagentStop)
Skills Included
test-driven-development: Complete TDD guidance with red-green-refactor cycle
Example Workflow
# User asks: "Add a function to calculate tax"
# 1. Claude writes failing test first
test "calculates tax on amount" do
result = Calculator.calculate_tax(100)
assert result == 8.0
end
# 2. Runs test - should FAIL
mix test
# 3. Implements minimal code
def calculate_tax(amount) do
amount * 0.08
end
# 4. Runs test - should PASS
mix test
# 5. Refactors if needed
def calculate_tax(amount) do
amount * @tax_rate
end
Installation
Install with npx (no installation required):
han plugin install tdd
Details
- Marketplace
- TheBushidoCollective/han
- Source
- plugins/patterns/tdd
- Category
- Pattern
- Keywords
- tdd, test-driven-development, testing, red-green-refactor, quality
- Listed since
- Apr 7, 2026
More from TheBushidoCollective/han
All 340Similar to jutsu-tdd
More Testing & QAtddPluginTheBushidoCollective/han201 starsTest-Driven Development (TDD) principles and red-green-refactor cycle enforcement
jutsu-bddPluginTheBushidoCollective/han201 starsComprehensive Behavior-Driven Development principles, practices, and collaboration patterns
tdd-workflowPlugindgalarza/claude-code-workflows74 starsTest-driven development skill that enforces red-green-refactor, one test at a time
testPluginudecode/dotai1.1K starsTest-driven development workflow for writing tests before implementation - red-green-refactor cycle with deterministic unit tests
test-driven-developmentSkillobra/superpowers291K installsTest-first development skill that enforces red-green-refactor and forbids production code without a failing test.
testing-strategiesPluginmiles990/claude-software-skills26 starsUnit, integration, E2E testing and TDD practices