Back to Skills

tdd

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

14,769stars1,207forksUpdated 4/14/2026

Security Assessment

Low Risk(75/100)

Detected risks:

Data Exfiltration([mocking.md] fetch('/orders', { method: 'POST)
Sensitive File Access([mocking.md] .env)
Security Score75/100

About tdd

The 'tdd' skill supports test-driven development (TDD), focusing on the red-green-refactor loop to build and fix software with integration tests. It helps developers by guiding them through a structured process where tests are written first, then code is implemented incrementally to pass those tests. This approach ensures that tests remain behavior-driven, providing a robust and maintainable testing suite. The skill emphasizes a clean, non-coupled testing methodology, allowing for flexibility in code changes without breaking the tests. By using this skill, developers avoid common pitfalls like testing implementation details or writing excessive, unhelpful tests that aren't reflective of actual system behavior. TDD with this skill helps avoid wasting time on irrelevant edge cases by focusing on high-priority behaviors that matter most to users. It encourages developers to test early and often, ensuring that each piece of code has a solid foundation for continued development and improvement.

FAQ

How does the tdd skill help in test-driven development?

The tdd skill guides developers through the red-green-refactor cycle, helping them write tests first and implement minimal code to pass those tests. This results in clear, behavior-focused tests that are resilient to code refactors.

What types of tests does this skill recommend?

The skill recommends integration-style tests, which verify system behavior through public interfaces rather than testing implementation details or private methods. This approach ensures that tests remain valid even as code undergoes significant changes.

Can I use this skill for all types of software projects?

Yes, the tdd skill can be applied to any software project where behavior verification is crucial. It's particularly useful for developers focused on building or fixing features incrementally while ensuring tests are aligned with user-facing behavior.

What are the limitations of the tdd skill?

While the skill promotes writing minimal tests for each piece of functionality, developers must carefully prioritize which behaviors to test. It isn't designed to handle exhaustive edge case testing, and focusing on every possible scenario could lead to inefficient testing.

Does the tdd skill support specific programming languages?

The skill is language-agnostic and can be used in any development environment where test-driven development principles apply. It focuses on the methodology rather than any specific programming language or framework.

All Files

6 files
SKILL.md4.1 KB
View
interface-design.md0.6 KB
View
deep-modules.md0.8 KB
View
refactoring.md0.4 KB
View
tests.md1.6 KB
View
mocking.md1.4 KB
View

Install tdd

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill