test-driven-development

Enforce test-first development with failing tests, minimal code, and safe refactoring.

Updated Dec 22, 2025
One-click install
npx skills add https://github.com/acho1833/spreadline2 --skill test-driven-development-acho1833
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/acho1833/spreadline2/tree/main/.claude/commands/test-driven-development
Command: npx skills add https://github.com/acho1833/spreadline2 --skill test-driven-development-acho1833

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents unverified code changes by enforcing a test-first workflow, so features, bug fixes, and refactors are implemented with confidence instead of guesswork.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Define behavior with a failing test, implement the smallest change to pass, then clean up safely.
  • Bug Fix Discipline: Reproduce defects with tests before changing code, ensuring regressions stay covered.
  • Testing Guardrails: Avoid common mistakes like testing mocks instead of real behavior or adding test-only methods to production code.

Quick Start

Use the test-driven-development skill to write a failing test for my change first, then guide me through implementing the minimum code to make it 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 write a failing test before implementing new code?

To write a failing test before implementing new code, define the desired behavior with a test that fails initially, then implement the smallest code change required to pass it. This enforces a strict test-first workflow for reliable software changes.

What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow is a test-driven development cycle where you write a failing test, implement the minimal code to make it pass, and then safely clean up the code. It ensures verified behavior and regression coverage.

How do I reproduce a bug fix with a test before changing the code?

To reproduce a bug fix with a test, write a test that exposes the defect and fails against the current codebase before making any changes. This ensures the regression stays covered once the minimal code fix is applied.

What are common testing anti-patterns to avoid with mocks?

Common testing anti-patterns to avoid with mocks include testing the mocks instead of real behavior, or adding test-only methods to production code. Testing guardrails prevent these mistakes by enforcing real-behavior verification.

Does test-driven development work for safe refactoring?

Test-driven development works for safe refactoring by ensuring existing behavior is covered by verification tests before you clean up the code. This prevents unverified code changes and maintains regression coverage during structural improvements.