test-driven-development

Enforce a Red-Green-Refactor cycle with failing tests before implementation.

Updated Nov 22, 2025
One-click install
npx skills add https://github.com/tom-xs/nixos-dotfiles --skill test-driven-development-tom-xs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/tom-xs/nixos-dotfiles/tree/main/ai/kimi-skills/skills/test-driven-development
Command: npx skills add https://github.com/tom-xs/nixos-dotfiles --skill test-driven-development-tom-xs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the uncertainty of untested code and prevents regressions by enforcing a strict Red-Green-Refactor cycle, ensuring that every feature is verified by a failing test before implementation.

Core Features & Use Cases

  • Cycle Enforcement: Guides the user through the mandatory Red-Green-Refactor workflow to ensure high-quality, testable code.
  • Quality Guardrails: Provides clear criteria for writing effective tests and avoiding common rationalizations that lead to technical debt.
  • Use Case: When implementing a new API endpoint, use this skill to define the expected behavior via a failing test first, ensuring the subsequent implementation is minimal and correct.

Quick Start

Initiate the test-driven-development skill to begin the cycle for your current feature or bug fix.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce a strict test-driven development workflow for new features?▼

You can enforce a strict test-driven development workflow by following the Red-Green-Refactor cycle, writing a failing test for the expected behavior before implementing any production code.

What is the best way to prevent code regressions during refactoring tasks?▼

The best way to prevent regressions during refactoring is to maintain rigorous test-driven development cycles, ensuring all existing and new behaviors are verified by real-world behavioral assertions.

How does the Red-Green-Refactor cycle work in software engineering?▼

The Red-Green-Refactor cycle works by first writing a failing test for a specific behavior, implementing the minimal code to pass that test, and then cleaning up the code without changing its behavior.

Can I use mock-based testing when following a TDD workflow?▼

This approach steers away from mock-based testing, instead requiring the use of real-world behavioral assertions to verify production code and ensure high-quality, testable software engineering outcomes.

How do I apply TDD principles to bug fixes?▼

To apply TDD to bug fixes, you write a failing test that reproduces the specific bug, implement the fix to make the test pass, and then refactor the code to eliminate technical debt.

When should I not use test-driven development for my project?▼

You should avoid this strict TDD approach if your task requires rapid prototyping without immediate test verification, or if your environment cannot support real-world behavioral assertions.