test-driven-development

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

Updated May 28, 2026
One-click install
npx skills add https://github.com/mpmf/SDD_Base --skill test-driven-development-mpmf
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/mpmf/SDD_Base/tree/main/.opencode/skills/superpowers/test-driven-development
Command: npx skills add https://github.com/mpmf/SDD_Base --skill test-driven-development-mpmf

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers often write production 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 feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full TDD cycle with mandatory verification steps, including watching each test fail for the right reason before writing minimal code to pass it. - Rationalization Countermeasures: Provides explicit rebuttals to common excuses like "I'll test after" or "deleting code is wasteful", plus red flags that signal when to delete code and start over. - Testing Anti-Pattern Reference: Ships a companion reference covering mock-behavior testing, test-only production methods, incomplete mocks, and over-mocking, with gate functions to catch violations. - Use Case: When fixing a bug where empty emails are accepted, write a failing test asserting the rejection error, watch it fail, implement the minimal validation, verify all tests pass, then refactor. ## Quick Start Use the test-driven-development skill to implement this feature by writing a failing test first, then the minimal code to make it pass.

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 watch it fail for the expected reason, then write the simplest code that makes it pass. After all tests pass, refactor while keeping tests green, and repeat 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 along with the rest of the suite, and the test now prevents regression.

Why should tests be written before implementation code?▼

Tests written after code pass immediately, which proves nothing since they may test the wrong thing or mirror the implementation. Watching a test fail first proves it actually exercises the missing behavior and catches real defects.

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

Exceptions are limited to throwaway prototypes, generated code, and 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.

What are common mocking anti-patterns in unit tests?▼

Common anti-patterns include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses. Test real behavior and mock minimally at the correct level.