test-driven-development

Enforces red-green-refactor TDD workflow with failing tests before production code.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/zhoulingxiao1216/testworkspace --skill test-driven-development-zhoulingxiao1216
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/zhoulingxiao1216/testworkspace/tree/main/all_Skills/software-development/test-driven-development
Command: npx skills add https://github.com/zhoulingxiao1216/testworkspace --skill test-driven-development-zhoulingxiao1216

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 a strict test-first discipline so every behavior is verified by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full cycle of writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that signal the process was violated, with instructions to delete and restart. - Verification Checklist: Provides a completion checklist covering test coverage, failure verification, regression checks, and edge cases. - Use Case: When fixing a bug, write a failing test that reproduces it first, then implement the minimal fix and confirm the test passes along with the full suite. ## Quick Start Ask the agent to implement a new feature using strict test-driven development with the red-green-refactor cycle.

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. Finally run the full test 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, since it may test existing behavior or the wrong thing. Watching it fail confirms the test actually exercises the missing feature and would catch the bug.

When is it acceptable to skip TDD?▼

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit user permission. Exploration is 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 is effectively testing after implementation, which biases tests toward what was built rather than what is required.