test-driven-development

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

Updated Sep 6, 2026
One-click install
npx skills add https://github.com/kangjuhyup/study --skill test-driven-development-kangjuhyup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/kangjuhyup/study/tree/main/scoped-superpowers-ab/workflow-code-benchmark/fixture/workflows/full/skills/test-driven-development
Command: npx skills add https://github.com/kangjuhyup/study --skill test-driven-development-kangjuhyup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by requiring a failing test before any implementation, eliminating the false confidence of tests written after the fact. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Guides writing a failing test, verifying it fails for the right reason, writing minimal code to pass, then refactoring while staying green. - Rationalization Countermeasures: Lists common excuses for skipping TDD and the red flags that mean you should delete code and start over. - Test Quality Rules: A companion reference defines how to name the break each test catches, avoid mock assertions, and run a mutation check. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection error, watch it fail, implement the validation, and confirm the 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 to confirm it fails for the right reason, then write the simplest code that passes. Refactor only while all tests stay green, and repeat the cycle for each new 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 watch it fail against current code. Then implement the minimal fix and confirm the test passes along with the rest of the suite.

Should I use mocks in unit tests?

Prefer real code and mock only slow or external dependencies after learning their side effects. Never assert on the mock itself, mirror the complete real data structure, and switch to integration tests when mock setup outgrows the test logic.

When is it acceptable to skip test-driven development?

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with your human partner's agreement. Exploration is allowed, but the exploratory code must be discarded and rewritten test-first.

Why must I delete code written before the test?

Code written first biases any tests added afterward, so they may pass immediately without proving they catch real bugs. Deleting it and reimplementing from failing tests ensures every behavior is verified by a test that was watched failing.