Skip to content
Skills Library
Programming · Building & coding

test-first

/test-first

Write a failing test that pins the behavior, make it pass, then refactor. Use when the user asks for TDD or a regression test, or when a bug has an obvious reproduction; not for skill or prompt eval loops (use eval-runs or eval-hillclimb).

Licence
MIT
Last repository change
10.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Write a failing test that pins the behavior, make it pass, then refactor. Use when the user asks for TDD or a regression test, or when a bug has an obvious reproduction; not for skill or prompt eval loops (use eval-runs or eval-hillclimb).

Original author description

Write a failing test that pins the behavior, make it pass, then refactor. Use when the user asks for TDD or a regression test, or when a bug has an obvious reproduction; not for skill or prompt eval loops (use eval-runs or eval-hillclimb).

How it works

  1. Steps
  2. When a test is impractical
  3. Guardrails
  4. Done when
Original SKILL.md headings · 31 lines, 337 words
SKILL.md preview
---
name: test-first
description: "Write a failing test that pins the behavior, make it pass, then refactor. Use when the user asks for TDD or a regression test, or when a bug has an obvious reproduction; not for skill or prompt eval loops (use eval-runs or eval-hillclimb)."
license: MIT
compatibility: droid
---

# Test first

Make the intended behavior executable before changing production code. The test fails before the change and passes after it.

## Steps

1. **Pin the behavior.** State the intended behavior, the current behavior, and the smallest observable case.
2. **Pick the narrowest test.** Use the closest unit, component, or integration test the codebase already has for that path. Do not build a new harness just to satisfy this skill.
3. **Write the test.** Drive the code through the interface its users touch. Derive the expected value from the requirement, not from a run of the code. See `engineering-principles` (test-behavior-not-implementation).
4. **Watch it fail.** Run it. It must fail for the intended reason. If it passes, or fails for another reason, fix the test first.
5. **Make it pass.** Write the smallest production change that satisfies the test.
6. **Rerun.** The new test passes, and the nearby tests still pass.
7. **Refactor.** Clean up with the tests green. Rerun after each step.
8. **Order the commits.** The failing test lands before the fix, so a reviewer can watch it go red, then green.

## When a test is impractical

If the only test would need broad harness setup, brittle mocks, production-only state, or large fixture churn, use the closest executable check instead: a script, a repro command, or an app drive through `prove-it-works`. No new test beats a bad test.

## Guardrails

- Never change a test to match a wrong implementation.
- Never weaken an existing assertion unless the expected behavior changed, and say why.
- Keep the test on this behavior. No unrelated coverage.
- For a flaky bug, make the test deterministic and name the signal it locks down.

## Done when

The reply names the test, pastes its failing output from before the change and its passing output after, lists the nearby checks you ran, and confirms the production change is limited to what the test required. If no failing test was practical, it says why and shows the check used instead.

Versions

RepositoryScoreLicence
This page · Cynnamoroll/factory-stack100MIT
NoobyGains/godmode100MIT
tojim00d/Orbit-skills100MIT
claude-world/director-mode-lite100MIT
duthaho/claudekit100MIT
DemonPalace/DoneCheck90MIT

Database snapshot: 13.11.2026 · package version ccb074877b33 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100eng-tdd
    Fix a bug test-first when there is a clear, cheap regression test path. Use when the user asks for TDD, a failing test, or a regression test, or when the bug has an obvious cheap local test target.
  • 100tdd
    Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
  • 100tdd
    Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
  • 100tdd
    Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.
  • 100tdd-pstack
    TDD bug fix: write the failing regression test before the fix. Use only when the user explicitly asks for TDD or a failing/regression test, or when a bug has an obvious cheap local test target; use the full tdd workflow for feature TDD. Skip when the test path is unclear,…
  • 100tdd
    Test-first work in two modes: build a feature red → green at agreed seams, or fix a bug by writing the failing regression test first. Use when the user asks for TDD, red-green-refactor, a failing test, or a regression test, when `implement` builds a ticket, OR when a bug has an…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.