test-driven-development

Enforces RED-GREEN-REFACTOR test-first workflow for writing production code.

38|6|Updated Aug 14, 2026
One-click install
npx skills add https://github.com/7757/Fan-Browser-Agent --skill test-driven-development-7757
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/7757/Fan-Browser-Agent/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/7757/Fan-Browser-Agent --skill test-driven-development-7757

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 one failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that trigger a delete-and-restart response. - Subagent Integration: Provides templates for delegating implementation tasks with TDD requirements embedded via delegate_task and terminal test commands. - Use Case: When fixing a bug, the agent first writes a failing test that reproduces the bug, then implements the minimal fix, proving the fix works and preventing regression. ## Quick Start Implement the new retry feature using strict test-driven development with pytest, writing 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. 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 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 should tests be written before production code?▼

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature and catches the intended bug.

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

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit user permission. Exploratory code is allowed if it is deleted and rewritten fresh using TDD afterward.

What should I do if a test passes immediately on the first run?▼

A test that passes immediately is testing existing behavior, not new functionality. Fix the test so it targets the missing feature, verify it fails for the expected reason, then proceed with implementation.