test-driven-development

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

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill test-driven-development-anderhonorato
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/AnderHonorato/Mem-rias-IA---Infinity/tree/main/Manus/Skills/snapshots/superpowers-test-driven-development
Command: npx skills add https://github.com/AnderHonorato/Mem-rias-IA---Infinity --skill test-driven-development-anderhonorato

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested or over-engineered production code by enforcing a strict test-first discipline, ensuring every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing a minimal failing test, verifying the failure, implementing minimal code to pass, and refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD (e.g., "too simple to test", "I'll test after") and explains why each is invalid. - 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 error, watch it fail, implement the validation, and confirm all tests pass. ## Quick Start Ask the agent 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 step by step?

Write one minimal failing test for a single behavior, run it and confirm it fails for the expected reason, write the simplest code that makes it pass, verify all tests pass, then refactor while keeping tests green. Repeat for each new behavior.

How do I write good unit tests that catch real bugs?

Name the production change that would make the test fail before writing it, derive expected values by hand rather than from the code under test, and assert on real behavior instead of mocks. Finish with a mutation check to confirm each realistic bug would fail a test.

When is it acceptable to skip TDD?

Only for throwaway prototypes, generated code, or configuration files, and only with explicit approval from your human partner. Exploratory code is allowed if it is deleted and rewritten test-first afterward.

Why should tests be written before implementation code?

Tests written after implementation pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it can actually catch the bug or missing feature it targets.

When should I use mocks in unit tests?

Mock only slow or external dependencies after learning the real method's side effects, keep everything the test depends on real, and never assert on the mock itself. If mock setup outweighs test logic, switch to an integration test with real components.