test-driven-development

Enforces Red-Green-Refactor workflow by requiring failing tests before production code.

Updated Jun 16, 2026
One-click install
npx skills add https://github.com/xuithoi/Skill-for-Coding --skill test-driven-development-xuithoi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/xuithoi/Skill-for-Coding/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/xuithoi/Skill-for-Coding --skill test-driven-development-xuithoi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the technical debt and unverified code that results from writing implementation before testing, ensuring every feature is backed by a failing test that proves its necessity.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Provides a structured, mandatory workflow for feature development and bug fixes.
  • Anti-Pattern Prevention: Includes strict guidelines to avoid common testing pitfalls like mocking real behavior or polluting production code with test-only methods.
  • Use Case: When implementing a new authentication module, use this skill to define the expected behavior through failing tests before writing a single line of production logic, ensuring the final implementation is both minimal and correct.

Quick Start

Apply the test-driven-development skill to guide the implementation of the new user validation feature by writing a failing test first.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development for new feature development?

Test-driven development requires writing a failing test that defines expected behavior before writing any production code. You must adhere strictly to the Red-Green-Refactor cycle to ensure minimal, correct implementation.

What is the Red-Green-Refactor cycle in software engineering?

The Red-Green-Refactor cycle is a mandatory workflow where you write a failing test, create minimal production code to pass it, and then refactor. This prevents technical debt by ensuring code is always verified.

How do I apply TDD to bug fixes and refactoring tasks?

For bug fixes and refactoring tasks, TDD enforces writing a failing test that proves the bug or validates the new structure before altering production logic. This guarantees all changes are verified by tests.

How do I prevent testing anti-patterns when mocking behavior?

To prevent testing anti-patterns when mocking behavior, follow strict guidelines that prohibit mocking real behavior or polluting production code with test-only methods. This ensures tests validate actual requirements.

Why does writing implementation before testing create technical debt?

Writing implementation before testing creates technical debt because it produces unverified code. TDD eliminates this by requiring a failing test that proves the necessity of every feature before implementation begins.