Skip to main content

write-failing-test-first

Before fixing any bug, write a test that reproduces it and watch it fail. Use for every bug fix.

Source facts

Repository
Archive228/loopkit
Last source activity
June 29, 2026 at 21:52
Detected SKILL.md language
English
Stars
757
Forks
124

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
write-failing-test-first
description
Before fixing any bug, write a test that reproduces it and watch it fail. Use for every bug fix.
when_to_use
fixing a bug, "make X work", a reported defect
# Write the Failing Test First The only proof you fixed a bug is a test that failed before and passes after. 1. Write the smallest test that reproduces the reported behavior. 2. Run it. **Watch it fail** for the right reason (read the assertion, not just red). 3. Now fix the code. 4. Run the test. It passes. Run the FULL suite — you didn't break anything else. If you can't write the test easily, the architecture is telling you something (tight coupling). Say so. Never: fix first, test after (you'll write a test that passes regardless). Never: skip the watch-it-fail step.
View on GitHub