tdd

Enforce failing-first test-driven development for new features and bug fixes.

2|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/t0lab/harness-kit --skill tdd-t0lab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/t0lab/harness-kit/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/t0lab/harness-kit --skill tdd-t0lab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD prevents regressions and unclear requirements by making behavior explicit through failing-first tests. It reduces wasted implementation effort and improves confidence that changes match the intended observable behavior.

Core Features & Use Cases

  • Failing-first specification: Encourage writing the smallest failing test that captures the desired behavior before implementation.
  • Incremental development loop: Red-green-refactor cycles that keep changes minimal and well-protected by tests.
  • Use Cases: Implementing new features, changing APIs or CLIs, encoding business rules, and capturing regressions as durable tests.

Quick Start

Write the smallest failing test that reproduces the desired behavior and run the test suite to confirm it fails before implementing any production code.

Frequently Asked Questions about tdd

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does writing failing tests first improve developer workflow?

Failing-first tests make behavior explicit before implementation, reducing wasted effort and preventing regressions. Test-driven development improves confidence that code changes match intended observable behavior throughout the development workflow.

How do I start test-driven development for a new feature?

To start test-driven development, write the smallest failing test that captures the desired behavior, run the test suite to confirm it fails, then implement minimal code to make it pass. Repeat this red-green-refactor cycle incrementally.

Can I use test-driven development to fix regression bugs?

Yes, test-driven development is ideal for regression fixes. Create a focused, deterministic failing test that reproduces the bug, confirm the test fails, then implement the minimal code correction to make the test pass as a durable guardrail.

What is the best way to implement unit tests for changing API or CLI behavior?

The best way to implement unit tests for API or CLI changes is to write a failing test specifying the expected new behavior first, verify the failure, then implement the minimal production code required to pass that test.

When should I not use the test-driven development approach?

Test-driven development requires deterministic tests and clear behavioral requirements. It is not suitable when you cannot write focused, reproducible tests, or when exploring undefined business rules that lack observable, testable outcomes.