test-driven-development

Enforce the Red-Green-Refactor cycle for new features and bug fixes.

Updated Dec 1, 2025
One-click install
npx skills add https://github.com/Come0520/L2C --skill test-driven-development-come0520
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Come0520/L2C/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/Come0520/L2C --skill test-driven-development-come0520

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) methodology to ensure code quality, prevent regressions, and build robust software by requiring tests to be written before implementation code.

Core Features & Use Cases

  • Enforces TDD: Mandates writing failing tests before any production code.
  • Red-Green-Refactor Cycle: Guides users through the core TDD loop.
  • Bug Fixes: Ensures bugs are reproduced with a failing test before fixing.
  • Use Case: When developing a new user authentication feature, you would first write tests for login, logout, and password reset scenarios. Only after these tests fail would you write the minimal code to make them pass, followed by refactoring.

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 start test-driven development for new software features?

Test-driven development starts by writing a failing test before any production code. You then write minimal code to pass the test and refactor, completing the Red-Green-Refactor cycle to ensure robust implementation.

What is the Red-Green-Refactor cycle in TDD?

The Red-Green-Refactor cycle is the core TDD loop: write a failing test, write minimal code to pass it, then refactor. This enforces strict testing principles and prevents regressions in software development.

How do I fix bugs using TDD methodology?

To fix bugs using TDD, first reproduce the bug by writing a failing test. Only after confirming the test fails should you write the minimal production code required to make it pass, ensuring verifiable software development.

Can I write production code without a preceding failing test?

No, TDD mandates that no production code is written without a preceding failing test. This strict testing principle ensures verifiable software development, prevents regressions, and promotes robust code quality.

Does TDD work for agile software development and refactoring?

TDD integrates seamlessly with agile software development by enforcing the Red-Green-Refactor cycle. It promotes code quality through minimal code writing, followed by safe refactoring to maintain robust and verifiable software.