What does this skill do?

The TDD Skill Workflow ensures that all code development strictly follows the principles of Test-Driven Development, achieving a minimum coverage of 80% through unit, integration, and E2E tests. It automatically detects the project’s package manager and test runner, executes the RED-GREEN-Refactor cycle, and generates an evidence report that maps each task to its corresponding tests.

New Features
Write the tests first, implement the minimum amount of code needed, and refactor while keeping the tests passing.
Bug fixes
Create a test that reproduces the error, verify that it fails, and then fix the code until the test passes.
Safe Refactoring
Improve names and performance, and eliminate duplicates—all while ensuring that tests continue to pass.
Coverage Verification
Run the coverage command and verify that the minimum threshold of 80% is met before closing the task.

Usage examples

🚀 New feature
Implement a Button component with color variations using the TDD workflow. Write the tests first using Vitest.
🐛 Fix bug
There's a bug in the search endpoint: it doesn't filter by category. Create a test that reproduces the issue, and then fix it using TDD.
📊 Check coverage
Run the test coverage for the authentication module and let me know if it exceeds 80%. If not, add the missing tests.
📋 From a plan
Continue implementing the plan outlined in docs/auth.plan.md by applying TDD to each task and generating the evidence report.

Features

Automatic Environment Detection Identify the package manager (npm, pnpm, yarn, bun) and the test runner for the project.
RED-GREEN-Refactor Cycle Follow the complete TDD workflow: write tests that fail, implement the minimum amount of code, and refactor safely.
Minimum coverage of 80% Automatically verifies that code coverage meets the configured threshold before marking the task as valid.
End-to-End Testing with Playwright Generate and run end-to-end tests to validate complete user flows.
Evidence Report Document the RED/GREEN/Refactor process, the commands executed, and the performance guarantees in a Markdown file.

Frequently asked questions

It automatically detects Vitest, Jest, Playwright, and other common runners based on the project's package manager (npm, pnpm, yarn, bun).
Yes. The skill checks coverage after each cycle and does not mark the task as complete until the minimum threshold of 80% is exceeded.
Yes. If you have a *.plan.md file, the skill continues from that plan, applying TDD to each task and mapping the corresponding tests.
Yes. Create an evidence report in Markdown (e.g., docs/testing/task.tdd.md) with the RED and GREEN results, the commands executed, and the system guarantees.
TDD Workflow — Test-Driven Development with Claude AI

¿Prefieres escuchar el contenido? Genera la narración de audio con un clic.