test-driven-development

Enforce RED-GREEN-REFACTOR workflows with failing tests and minimal code changes.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MarbleSodas/Mavis --skill test-driven-development-marblesodas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/MarbleSodas/Mavis/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/MarbleSodas/Mavis --skill test-driven-development-marblesodas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-Driven Development (TDD) prevents shipping unverified code by forcing you to write failing tests before implementing behavior, reducing regressions and improving confidence in changes.

Core Features & Use Cases

  • Failing-test first workflow: RED-GREEN-REFACTOR enforces “watch it fail” and “keep tests meaningful” so tests verify real behavior.
  • Minimal implementation discipline: Writes the smallest code needed to pass the test, then refactors only after GREEN.
  • Regression-proof development: Uses systematic re-running of targeted tests and the full suite to catch breakages early.
  • Use case: When adding a new feature or fixing a bug, write a test that reproduces the expected behavior, confirm it fails, implement the minimal fix, and rerun the full suite to ensure nothing else broke.

Quick Start

Start a TDD cycle by writing the failing test that defines the behavior you want, then run the specific test until it fails for the expected reason.

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 a new feature?

To start test-driven development, write a failing test that defines the expected behavior, confirm it fails for the correct reason, implement the minimal code to pass it, and rerun the full test suite. This RED-GREEN-REFACTOR cycle ensures your new feature is regression-proof.

What is the RED-GREEN-REFACTOR workflow in test-first development?

The RED-GREEN-REFACTOR workflow in test-first development forces you to watch a test fail, write the minimal code to make it pass, and then refactor without changing behavior. This mechanism prevents shipping unverified code and improves software quality.

How do I fix a bug using a test-first development approach?

To fix a bug using test-first development, write a unit test that reproduces the bug, verify the test fails, implement the minimal fix to make it pass, and rerun the full suite to catch any new regressions early.

Can I use test-driven development for refactoring existing code?

Yes, you can use test-driven development for refactoring. The workflow enforces writing or running targeted tests to verify existing behavior before changing code, ensuring post-GREEN refactoring introduces no new behavior and prevents regressions.

Does test-driven development require running the full test suite every time?

Test-driven development requires systematically re-running targeted tests during the cycle and the full suite after changes. This verifies that the minimal implementation passes and ensures no other behavior broke during the update.

Why write the minimal implementation during the GREEN phase of TDD?

Writing the minimal implementation during the GREEN phase of TDD ensures you only add code necessary to pass the failing test. This discipline keeps tests meaningful, reduces code bloat, and defers structural changes to the refactoring phase.