test-driven-development

Enforce Red-Green-Refactor workflow with failing tests before production code.

2|1|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/xbklairith/kisune --skill test-driven-development-xbklairith
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/xbklairith/kisune/tree/main/dev-workflow/skills/test-driven-development
Command: npx skills add https://github.com/xbklairith/kisune --skill test-driven-development-xbklairith

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces strict red-green-refactor conventions for software tasks, ensuring tests govern production code and preventing "test after" habits.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Explicit phases with checks.
  • Anti-patterns: Guidance on common rationalizations to avoid.
  • Verification: Ensures tests fail before implementation and pass after.

Quick Start

Activate the TDD workflow, then write a failing test, implement minimal code, and refactor while tests stay green.

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 to write better code?

Test-driven development enforces writing failing tests before production code, then implementing minimal code to pass tests, and refactoring while tests stay green. This Red-Green-Refactor cycle prevents test-after habits and ensures tests govern your implementation from the start.

What's the Red-Green-Refactor workflow and why does it matter?

Red-Green-Refactor is a three-phase cycle: write a failing test (Red), implement minimal code to pass it (Green), then improve code quality without breaking tests (Refactor). This discipline ensures tests precede production code and guards against skipping tests or writing inadequate ones.

Can I use TDD for bug fixes and refactoring, or just new features?

TDD applies to new features, bug fixes, and refactors. For each task, write a failing test first, then implement or fix code to pass it, ensuring all tests stay green throughout. This maintains consistent test coverage across your entire codebase.

How do I avoid common TDD anti-patterns and the test-after trap?

Enforce strict discipline: write failing tests before any production code, avoid rationalizing incomplete test coverage, and verify tests fail before implementation and pass after. This Skill provides guidance on recognizing and preventing test-after habits that undermine TDD benefits.

What does minimal code to pass mean in the Green phase?

Minimal code is the smallest implementation that makes the failing test pass, nothing more. This prevents over-engineering, keeps code focused on requirements, and ensures refactoring stays purposeful during the Refactor phase.