test-driven-development

Enforces red-green-refactor test-driven development before writing any production code.

Updated Jun 20, 2026
One-click install
npx skills add https://github.com/dchavez3395/Puchica-hydrogen --skill test-driven-development-dchavez3395
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/dchavez3395/Puchica-hydrogen/tree/main/docs/superpowers/skills/openclaw-ports/test-driven-development
Command: npx skills add https://github.com/dchavez3395/Puchica-hydrogen --skill test-driven-development-dchavez3395

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written before tests often ships with undetected bugs, and tests written after implementation only confirm what was built rather than what was required. This Skill enforces a strict test-first discipline so every feature and bugfix is proven by a failing test before implementation begins. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full cycle of writing a failing test, verifying it fails for the right reason, writing minimal code to pass, and refactoring while staying green. - Anti-Rationalization Guardrails: Provides explicit rebuttals to common excuses for skipping TDD, plus red flags that signal when to delete code and start over. - Testing Anti-Pattern Reference: A companion guide covering mock misuse, test-only production methods, incomplete mocks, and tests written as an afterthought. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, and confirm the whole suite passes. ## Quick Start Ask the AI to implement a new feature or bugfix using strict test-driven development with a failing test written first.

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 and confirm it fails for the expected reason, then write the simplest code that makes it pass. Refactor only while all tests stay green, then repeat the cycle for the next behavior.

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

Write a test that reproduces the bug by asserting the correct behavior, then run it to confirm it fails because the bug exists. Implement the minimal fix, verify the test passes, and keep it as a permanent regression guard.

Can I skip TDD for prototypes or generated code?▼

Throwaway prototypes, generated code, and configuration files are recognized exceptions, but only with explicit approval from your human partner. Treating normal feature work as an exception is listed as a rationalization to reject.

Why should I delete code written before the test?▼

Code written first cannot be proven correct by tests added afterward, since those tests pass immediately and test nothing real. Deleting it and reimplementing from failing tests is the only way to verify the tests actually cover the required behavior.

What testing anti-patterns should I avoid with mocks?▼

Never assert on mock existence, never add test-only methods to production classes, and never mock without understanding the real method's side effects. Mocks must mirror the complete real API structure, or downstream code fails silently.