tdd

Enforce test-first development with a Red-Green-Refactor loop and strict stop rules.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/xz1220/oh-my-kimi --skill tdd-xz1220
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/xz1220/oh-my-kimi/tree/main/skills/tdd
Command: npx skills add https://github.com/xz1220/oh-my-kimi --skill tdd-xz1220

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents teams from drifting into writing production code before validating behavior with failing tests, reducing bugs and rework.

Core Features & Use Cases

  • Test-first execution loop: Red-Green-Refactor with an explicit requirement that each cycle starts with a newly failing test.
  • Strict “no shortcuts” rules: Stops the workflow if tests pass on first run, if production code is written first, or if multiple features are bundled into one iteration.
  • Clear output structure: Provides a required reporting format for RED/GREEN/REFACTOR phases to keep iterations auditable and consistent.

Quick Start

Tell your AI to run a single TDD loop for the next small feature by first designing a failing test, then implementing only the minimal code to make that test pass, and finally refactoring while keeping all tests green.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I enforce test-first development discipline in my workflow?

Test-first development discipline is enforced by requiring a newly failing test before any production implementation, ensuring you validate behavior before writing code. This prevents drifting into code-first habits and reduces bugs.

What is the Red-Green-Refactor loop in unit testing?

The Red-Green-Refactor loop is an iterative unit testing cycle that starts with a failing test, implements minimal code to pass it, and then refactors while keeping tests green. This enforces strict test-first execution and repeatable verification.

How to stop writing production code before unit tests?

To stop writing production code first, apply strict stop rules that halt the workflow if tests pass on the initial run or if implementation is written before tests. This enforces test-first discipline and prevents feature drift.

Why do my unit tests pass on the first run during software development?

Unit tests passing on the first run usually means the test is not validating newly written behavior. A test-first workflow stops execution if this happens, ensuring every Red-Green-Refactor cycle starts with a genuinely failing test.

Can I bundle multiple features into one test-first iteration?

No, bundling multiple features violates test-first discipline. Each iteration must decompose features into small steps with repeatable verification, stopping the workflow if multiple features are bundled into one cycle to maintain strict validation.

How do I keep TDD iterations auditable and consistent?

TDD iterations are kept auditable by using a clear output structure that provides a required reporting format for the RED, GREEN, and REFACTOR phases. This enforces consistent cycle-based test execution tracking across the development workflow.