test-driven-development

Guide developers through the Red-Green-Refactor cycle for test coverage.

793|52|Updated Nov 22, 2025
One-click install
npx skills add https://github.com/corvo007/MioSub --skill test-driven-development-corvo007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/corvo007/MioSub/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/corvo007/MioSub --skill test-driven-development-corvo007

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traditional development often results in late bug discovery and fragile refactoring. This skill guides engineers to adopt test-driven development by outlining the Red-Green-Refactor cycle, when to write tests, and how to avoid pushing production code without tests.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement the minimal code to pass, then refactor for clarity.
  • Clear guidance for feature development, bug fixes, and refactors to ensure test coverage.
  • Real-world practice: consistent naming, incremental changes, and guardrails to prevent production without tests.

Quick Start

Start by writing a failing test that captures the desired behavior, then implement the simplest production code to make the test pass.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the Red-Green-Refactor cycle in test-driven development?

The Red-Green-Refactor cycle in test-driven development involves writing a failing test, implementing minimal production code to pass the test, and then refactoring the code for clarity and maintainability.

How do I start writing tests before production code?

To start writing tests before production code, begin by writing a failing test that captures the desired behavior, then implement the simplest possible code to make that test pass successfully.

Can I use test-driven development for bug fixes and refactoring?

Yes, you can apply test-driven development to bug fixes and refactoring by ensuring explicit test coverage that captures desired behavior before altering existing production code.

How do I prevent pushing production code without failing tests?

You prevent pushing production code without failing tests by enforcing TDD guardrails that require early failing tests and consistent naming alongside incremental changes during feature work.

When should I refactor my code in the TDD workflow?

You should refactor your code in the TDD workflow immediately after writing minimal production code to pass a failing test, ensuring disciplined improvements for long-term maintainability.