Enforces a strict TDD cycle to ensure code quality and functionality through iterative testing.
Install
mkdir -p .claude/skills/tdd-diego-tobalina && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15614" && unzip -o skill.zip -d .claude/skills/tdd-diego-tobalina && rm skill.zipInstalls to .claude/skills/tdd-diego-tobalina
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Test-Driven Development workflow. Write failing test first, then implement minimum code to pass.Key capabilities
- →Write a single failing test for expected behavior
- →Implement the minimum code to make the test pass
- →Repeat the cycle for subsequent requirements
- →Ask for requirements if they are not clear
- →Show the written test to the user before proceeding
How it works
This skill guides development through the Test-Driven Development (TDD) workflow, starting with a failing test, then implementing minimal code to pass it, and finally refactoring.
Inputs & outputs
When to use tdd
- →Implement feature using tdd
- →Write failing unit tests
- →Refactor existing code
- →Follow tdd process
About this skill
TDD Workflow
Implement using strict Test-Driven Development.
Process
1. RED - Write Failing Test First
- Write ONE test that describes expected behavior
- Run test - confirm it FAILS for the right reason
- Show test to user before proceeding
2. GREEN - Minimum Code to Pass
- Write the MINIMUM code to make test pass
- No extra features, no optimization
- Run test - confirm it PASSES
3. REFACTOR - Improve Code
- Clean up code while keeping tests green
- Apply patterns and best practices
- Run tests after each change
4. REPEAT
- Move to next requirement
- Write next failing test
- Continue cycle
My Role
When asked to implement a feature:
- Ask for requirements if not clear
- Write the test first - show it to user
- Run the test - confirm it fails
- Implement minimum code to pass
- Refactor if needed
- Repeat for next requirement
Rules
- NEVER write production code without a failing test
- ONE test at a time
- Tests must fail before implementation
- Keep cycles short (< 10 minutes each)
Test Naming
methodName_scenario_expectedResult
Examples:
create_withValidData_returnsUserfindById_notFound_throwsException
Test Quality Checks
- Test name follows:
method_scenario_expected - Test has Given-When-Then structure
- One concept per test
- No logic in tests
- Tests are independent
Commands
# Java/Maven
mvn test -Dtest=ClassName#methodName
# Node.js/Vitest
npx vitest run --reporter=verbose
# Run specific test
npx vitest run path/to/test.ts
Never Do
- Write production code before tests
- Write multiple tests before implementing
- Skip the refactor phase
- Leave tests incomplete
Start by asking: "What behavior should we test first?"
When not to use it
- →When writing production code without a failing test first
- →When writing multiple tests before implementing code
- →When skipping the refactor phase of development
Limitations
- →Only one test should be written at a time
- →Tests must fail before implementation of production code
- →Cycles of RED-GREEN-REFACTOR should be kept short
How it compares
This workflow strictly enforces writing tests before any production code, ensuring that every piece of functionality is covered by a test, unlike traditional development where tests might be written after implementation.
Compared to similar skills
tdd side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| tdd (this skill) | 0 | 6mo | Review | Intermediate |
| python-testing-patterns | 77 | 2mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| test-cases | 57 | 7mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
python-testing-patterns
wshobson
Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
test-cases
cexll
This skill should be used when generating comprehensive test cases from PRD documents or user requirements. Triggers when users request test case generation, QA planning, test scenario creation, or need structured test documentation. Produces detailed test cases covering functional, edge case, error handling, and state transition scenarios.
reviewing-code
CaptainCrouton89
Systematically evaluate code changes for security, correctness, performance, and spec alignment. Use when reviewing PRs, assessing code quality, or verifying implementation against requirements.
wcag-audit-patterns
wshobson
Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.
code-coverage-with-gcov
gadievron
Add gcov code coverage instrumentation to C/C++ projects