test-driven-development

Guide test-first development with failing tests before production code.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yuquanliu1-dot/Test --skill test-driven-development-yuquanliu1-dot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/yuquanliu1-dot/Test/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/yuquanliu1-dot/Test --skill test-driven-development-yuquanliu1-dot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents untrustworthy code changes by forcing you to specify behavior with a failing test before writing production implementation.

Core Features & Use Cases

  • Red-Green-Refactor TDD cycle: Write a failing test, make minimal code changes to pass, then clean up without adding new behavior.
  • Strict “test-first” guardrails: Ensures each test fails for the expected reason (missing feature/behavior), and that you verify the test actually fails before implementing.
  • Anti-rationalization and reset discipline: Calls out common excuses (e.g., “test later”, “manual already”, “keep as reference”) and instructs you to delete and restart TDD when rules are violated.

Quick Start

Apply the TDD loop when implementing a feature or bugfix: write a minimal behavior-focused failing test, verify it fails for the right reason, implement the smallest code change to pass, verify again, then refactor only after it’s 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 test-driven development cycle for writing unit tests first?

The test-driven development process follows a Red-Green-Refactor loop: write a failing test first, verify it fails for the expected reason, implement minimal code to pass, re-verify, then refactor only while tests stay green to ensure software quality.

How do I implement a bug fix using test-first development?

To implement a bug fix using test-first development, write a minimal behavior-focused failing test that reproduces the bug, verify the test fails because the feature is missing, implement the smallest code change to pass the test, verify the pass, then refactor.

Why do I need to verify a unit test fails for the expected reason before writing code?

Verifying a unit test fails for the expected reason prevents untrustworthy code changes by ensuring the test actually targets the missing feature. This strict test-first guardrail confirms the test is valid before you implement any minimal production code to pass it.

When should I not use the test-driven development workflow for refactoring?

You should not use the test-driven development workflow for refactoring if your tests are not green first. The TDD workflow requires refactoring only after tests pass, ensuring you clean up code without adding new behavior while maintaining regression protection.

What should I do if I rationalize writing tests later instead of using test-first development?

If you rationalize writing tests later by claiming manual testing is sufficient or keeping code as reference, you should delete the code and restart the TDD loop. This anti-rationalization discipline enforces writing a failing unit test before any production implementation.