test-driven-development

Enforce test-first development with failing tests before implementation.

Updated Feb 17, 2026
One-click install
npx skills add https://github.com/tim-hub/role-based-skills --skill test-driven-development-tim-hub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/tim-hub/role-based-skills/tree/main/test-driven-development
Command: npx skills add https://github.com/tim-hub/role-based-skills --skill test-driven-development-tim-hub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-Driven Development (TDD) prevents shipping unverified or poorly specified behavior by forcing developers to define expected behavior as tests before writing implementation code, ensuring changes are validated and regressions are caught early.

Core Features & Use Cases

  • Red-Green-Refactor cycle: Write a failing test, implement the minimal code to make it pass, then refactor while keeping tests green.
  • Behavior-first verification: Ensures tests fail for the right reasons and that passing tests actually prove desired behavior.
  • When to use: New features, bug fixes, refactors, and behavior changes; avoid for throwaway prototypes or generated/configuration code where tests-first is counterproductive.

Quick Start

Write a failing test that captures the desired behavior, run the test suite to confirm it fails, implement the minimal code to pass, and then refactor while keeping all tests green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the red-green-refactor cycle in test-driven development?

The red-green-refactor cycle in test-driven development requires writing a failing test, implementing the minimal code to make it pass, and then refactoring while keeping all tests green to ensure reliable behavior.

How do I start writing tests first for a new software feature?

To start writing tests first, define the expected behavior as a failing automated test, verify the failure occurs for the right reason, implement the minimal passing code, and refactor safely while maintaining green tests.

When should I not use test-driven development?

You should not use test-driven development for throwaway prototypes or generated configuration code, because writing automated tests first is counterproductive and adds unnecessary overhead to these specific coding tasks.

Does test-driven development work for bug fixes and refactoring?

Test-driven development works effectively for bug fixes and refactoring by enforcing behavior-first verification, which catches regressions early and validates that code changes match the expected behavior before implementation.

How does test-first development prevent shipping unverified code?

Test-first development prevents shipping unverified code by forcing developers to define expected behavior as tests before writing implementation, ensuring all changes are validated and regressions are caught early.