test-driven-development

Guide red-green-refactor cycles with failing tests, minimal code, and regression-guarded refactoring.

3|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/marcus-friction/agents --skill test-driven-development-marcus-friction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/marcus-friction/agents/tree/main/.agent/skills/test-driven-development
Command: npx skills add https://github.com/marcus-friction/agents --skill test-driven-development-marcus-friction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Red-Green-Refactor cycle helps teams enforce testing before implementation, reducing regression risk and clarifying design.

Core Features & Use Cases

  • Red — Write a Failing Test: Start from the requirement, and write the simplest test that captures one behavior to fail.
  • Green — Make It Pass: Implement the minimal code to satisfy the test and run the full suite.
  • Refactor — Clean Up: Improve structure and readability without altering behavior, guided by the tests. Typical use cases include adding new features, reproducing and fixing bugs with tests, and safely refactoring codebases.

Quick Start

Begin a Red-Green-Refactor cycle by writing a failing test, implementing the minimal code to pass, and then refactoring while keeping all tests green.

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 PHP feature?

Start test-driven development by writing a failing test that captures one behavior, implement the minimal code to pass it, then refactor while keeping the full test suite green.

What is the red-green-refactor workflow in JavaScript testing?

The red-green-refactor workflow in JavaScript testing involves writing a failing test, writing minimal code to pass the test, and cleaning up the structure without altering behavior.

Does this test-first approach work with Pest and Vitest frameworks?

Yes, this test-first approach works with Pest and Vitest frameworks, applying incremental validation to enforce test-first development across PHP and JavaScript environments.

How do I reproduce a bug using a red-green-refactor cycle?

Reproduce a bug using a red-green-refactor cycle by writing a failing test that replicates the bug, implementing the minimal code fix to pass the test, and refactoring with regression guards.

When should I use test-first development for refactoring?

Use test-first development for refactoring when you need to improve code structure and readability safely without altering behavior, using the test suite as a regression guard.