test-driven-development

Enforce a Red-Green-Refactor cycle requiring failing tests before code implementation.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the common pitfalls of writing code without verification, such as untested edge cases, technical debt, and the inability to refactor safely.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the agent through the mandatory cycle of writing a failing test, implementing minimal code, and refactoring.
  • Quality Guardrails: Prevents the inclusion of production code that lacks a corresponding failing test.
  • Use Case: When tasked with a new feature or bug fix, this skill ensures the agent writes a test that fails first, proving the test is valid and the requirement is understood before any implementation begins.

Quick Start

Use the test-driven-development skill to guide the implementation of the new user authentication module starting with a failing test.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce a strict test-driven development cycle when writing new code?

To enforce test-driven development, you must follow a strict Red-Green-Refactor cycle. This requires writing a failing test first to verify the requirement, implementing minimal production code to pass it, and then refactoring safely.

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

The Red-Green-Refactor cycle is a test-driven development process where you write a failing test, implement minimal code to make it pass, and then refactor the code. This ensures all production code is verified by failing tests before implementation.

How do I prevent untested edge cases and technical debt during software development?

You can prevent untested edge cases and technical debt by applying quality guardrails that prohibit production code implementation until a corresponding failing test case is established and verified, ensuring safe refactoring and high code quality.

Can I use a test-first approach for both bug fixes and feature development?

Yes, a test-first approach applies to both bug fixes and feature development. By establishing a failing test case that proves the requirement is understood, you verify the test is valid before any implementation begins, preventing regressions.

When should I not use a test-first development approach?

You should avoid a test-first approach when implementation must precede verification, as this method strictly prohibits writing production code until a failing test case is established and verified to ensure high code quality.

What's the best way to ensure safe refactoring without introducing regressions?

The best way to ensure safe refactoring is to enforce a rigorous Red-Green-Refactor development cycle. This verifies all production code against failing tests before implementation, maintaining high code quality and preventing regressions.