test-driven-development

Enforce red-green-refactor cycles with failing tests before implementation.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill test-driven-development-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/superpowers/skills/test-driven-development
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill test-driven-development-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a test-first workflow to prevent untested production code, reduce regressions, and increase confidence in behavioral correctness.

Core Features & Use Cases

  • Red-Green-Refactor cycle: Drive development by writing a minimal failing test, implementing the smallest change to pass, then safely refactoring while keeping tests green.
  • Verification discipline: Ensure developers observe failing tests before implementation and confirm passing after, catching regressions early.
  • Use Cases: Ideal for new feature development, bug fixes, refactors, and any change that requires a reliable, repeatable verification path.

Quick Start

Write a failing test that expresses the desired behavior, run the test to confirm it fails, then implement the minimal code to make the test pass and re-run the suite.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development prevent untested production code?

The red-green-refactor cycle drives development by first writing a minimal failing test (red), implementing the smallest code change to pass it (green), then safely refactoring while keeping the test suite green.

When should I use unit testing for bug fixes and refactoring?

Unit testing for bug fixes and refactoring is ideal when you need a reliable, repeatable verification path. You write failing tests to catch the bug, implement the fix to turn them green, and refactor safely under test coverage.

Can I use test-first development for integration tests?

Yes, you can apply test-first development to integration tests. The workflow accommodates any development task where integration tests can verify behavior, requiring you to observe failing tests before implementation and confirm passing after.

How do I start writing a failing test for new feature development?

To start new feature development with TDD, write a failing test that expresses the desired behavior, run the test runner to confirm it fails, implement the minimal code to make it pass, and re-run the suite to verify.

Why observe failing tests before implementing the code fix?

Observing failing tests before implementing code fixes ensures verification discipline. It confirms the test accurately detects the issue and catches regressions early, increasing confidence in behavioral correctness before minimal passing code is added.

What are the limitations of test-driven development for software engineering?

Test-driven development is limited to changes where unit or integration tests can verify behavior. It enforces strict test-first discipline, which may not suit exploratory coding or tasks where reliable, repeatable verification paths are impossible.