test-driven-development

Enforces RED-GREEN-REFACTOR test-driven development workflow for writing tests before production code.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. This Skill enforces strict test-driven development so every piece of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Guides the agent through writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") with concrete rebuttals and red flags that trigger a restart. - Subagent Integration: Shows how to enforce TDD when dispatching implementation work via delegate_task and how to pair with systematic-debugging for bug fixes. - Use Case: When fixing a bug, write a failing test that reproduces it first, verify the failure, implement the minimal fix, and confirm the full suite passes without regressions. ## Quick Start Ask the agent to implement a new feature using strict TDD with pytest, writing and verifying a failing test before any production code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development with pytest?▼

Write one minimal failing test for a single behavior, run it with pytest to confirm it fails for the expected reason, then write the simplest code to pass it. Re-run the specific test and then the full suite to check for regressions before refactoring.

What is the RED-GREEN-REFACTOR cycle in TDD?▼

RED means writing a failing test that defines the desired behavior. GREEN means writing the minimal code to make it pass, even hardcoding values. REFACTOR means cleaning up duplication and names while keeping all tests green.

Why must I watch the test fail before writing code?▼

A test that passes immediately proves nothing—it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and would catch the bug it targets.

When is it acceptable to skip test-driven development?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user explicitly. Exploration spikes are allowed, but the exploratory code must be discarded and rewritten test-first.

What should I do if I already wrote code before tests?▼

Delete the code and start over with a failing test. Keeping it as reference or adapting it while writing tests biases the tests toward the implementation, which defeats the purpose of test-first development.