test-driven-development

Enforce a red-green-refactor cycle requiring failing tests before production code.

Updated Nov 13, 2025
One-click install
npx skills add https://github.com/466852675/TISHICIKU-2025 --skill test-driven-development-466852675
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/466852675/TISHICIKU-2025/tree/main/07-Skill%E5%BA%93/test-driven-development
Command: npx skills add https://github.com/466852675/TISHICIKU-2025 --skill test-driven-development-466852675

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous development process by ensuring that tests are written before any implementation code, preventing bugs and ensuring code reliability.

Core Features & Use Cases

  • Enforces Test-First Development: Mandates writing a failing test before writing production code.
  • Red-Green-Refactor Cycle: Guides users through the iterative process of writing tests, minimal code, and refactoring.
  • Use Case: When developing a new feature, use this Skill to write a test that describes the desired behavior. Then, write the smallest amount of code necessary to make that test pass, followed by cleaning up the code.

Quick Start

Always write a failing test before writing any new implementation code.

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 prevent bugs in new features?

Test-driven development prevents bugs by enforcing a strict red-green-refactor cycle where you write a failing test before any production code, then write minimal code to pass the test, and finally refactor while ensuring tests stay green.

What is the red-green-refactor cycle in TDD?

The red-green-refactor cycle in TDD is an iterative process: write a failing test describing desired behavior, write the smallest amount of code necessary to make it pass, and then clean up the implementation through refactoring.

How do I write a failing test before writing implementation code?

To write a failing test first, describe the desired behavior for your new feature or bug fix before writing any production code. This ensures the test fails initially, proving the feature is not yet implemented and preventing regressions.

Can I fix bugs without writing a failing test first?

Fixing bugs without a failing test violates the iron law of test-driven development. All behavior changes and bug fixes must be preceded by a failing test to ensure code reliability and prevent future regressions.

Does test-driven development work for refactoring existing code?

Test-driven development supports refactoring by ensuring existing tests remain green while you clean up code. The strict red-green-refactor cycle guarantees that structural improvements do not introduce regressions or alter behavior.

When should I not use test-driven development?

Test-driven development may not suit exploratory prototyping where behavior is undefined, as the methodology requires a strict test-first approach and mandates adherence to writing a failing test before any production code.