test-driven-development

Enforce a test-first workflow with feature, refactor, and bug fix modes.

2|1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/mattstruble/skills --skill test-driven-development-mattstruble
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/mattstruble/skills/tree/main/test-driven-development
Command: npx skills add https://github.com/mattstruble/skills --skill test-driven-development-mattstruble

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Test-driven development workflows guide teams to write tests before code, reducing bugs and enabling safer refactors by aligning expectations with implementation.

Core Features & Use Cases

  • Mode-based workflow: Feature Mode, Refactor Mode, and Bug Fix Mode to structure development.
  • Discipline and guidance: Emphasizes one-cycle tests, characterization tests for safe changes, and reduced risk during refactors.
  • Documentation references: Includes references on refactor mode and worked-example as learning material for practical scenarios.

Quick Start

Write a failing test for the smallest observable behavior, then implement only enough code to pass.

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?

Test-driven development reduces bugs and enables safer refactoring by enforcing a test-first workflow. It guides you to write tests before code, ensuring expectations align directly with the implementation.

Can I use characterization tests when refactoring legacy code?

Characterization tests are explicitly supported for safe changes during refactoring. They help capture the current behavior of existing code before you evolve it, reducing risk and ensuring safe evolution during refactors.

Does this test-driven development workflow support bug fixes and migrations?

This test-driven development workflow applies to building new features, refactors, bug fixes, and migrations. It enforces mode-guided development to ensure behavior is specified by tests across these scenarios.

What is the red-green-refactor cycle in software testing?

The red-green-refactor cycle is a test-driven development practice where you write a failing test, implement code to pass it, and then safely refactor. The workflow emphasizes one-cycle tests to structure this disciplined development.

How do I structure software testing for different development modes?

You can structure software testing using Feature Mode, Refactor Mode, and Bug Fix Mode. This mode-based workflow provides specific discipline and guidance for each scenario to reduce risk and align expectations.

When should I not use a test-first workflow?

You should not use a test-first workflow when you cannot define the smallest observable behavior upfront. The process relies on specifying behavior through tests before implementation for new features, refactors, bug fixes, and migrations.