test-driven-development

Enforces red-green-refactor test-driven development workflow before writing implementation code.

Updated Aug 8, 2026
One-click install
npx skills add https://github.com/wolfstar-project/code-zero --skill test-driven-development-wolfstar-project
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/wolfstar-project/code-zero/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/wolfstar-project/code-zero --skill test-driven-development-wolfstar-project

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by enforcing a strict test-first discipline, ensuring every feature and bugfix is proven by a failing test before implementation begins. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification that tests fail correctly before and pass after implementation. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that signal the process was violated, requiring a restart. - Test Quality Rules: A companion reference defines how to write honest tests that name the break they catch, avoid mock assertions, and pass a mutation check. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection, watch it fail, implement minimal validation, and verify the suite stays green. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first and following 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 on a new feature?▼

Write one minimal failing test describing the desired behavior, run it to confirm it fails for the right reason, then write the simplest code to pass. Refactor only while tests stay green, then repeat for the next behavior.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and confirm the test passes without breaking others.

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

Only for throwaway prototypes, generated code, or configuration files, and only with explicit approval from your human partner. Exploration is allowed, but the exploratory code must be discarded and rewritten test-first.

Why should tests avoid asserting on mocks?▼

Mock assertions only prove the mock exists, not that the component works. Assert on the real component's behavior, mock only slow or external dependencies, and mirror the complete real data structure in any mock responses.

What should I do if I already wrote code before the test?▼

Delete the implementation and start over with a failing test. Keeping it as reference or adapting it biases the tests toward the existing code, so you never prove the test can catch the bug.