eng-tdd
Skill23 starsChanged 11 days agoMITView on GitHub
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.
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 11 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
When the test path is clear and cheap, make the broken behavior executable before changing production code.
- Distinctive: line 12
Do not force a test when it is impractical: broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, …
- Distinctive: line 18
Write the failing test first: Add the smallest test that would have caught the bug.
- Distinctive: line 25
Use the closest executable check: a targeted script, a manual reproduction command, browser automation, a snapshot comparison, or a focused …
- Distinctive: line 27
Prefer no new test over a bad test.
- Distinctive: line 31
Do not change tests to match a wrong implementation.
- Distinctive: line 32
Do not weaken assertions unless the expected behavior genuinely changed and you can say why.
- Distinctive: line 33
Keep the test focused on the bug.
- Distinctive: line 34
If the bug is flaky, make the test deterministic and document the signal it locks down.
- Distinctive: line 35
If the bug exposes a broader class of failures, land the focused regression first, then consider sibling coverage.
- Distinctive: line 41
If failing-before evidence is missing, say why and name the closest check used.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TDD bug fix
Repo facts (from AGENTS.md or CLAUDE.md): the test policy (some repos require coverage for every behavior change, others allow a test only where a branch's behavior is uncertain), the test runner per package, and the single-test command. Follow the policy; when it rules out a new test, skip to the closest executable check below.
When the test path is clear and cheap, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.
Do not force a test when it is impractical: broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, vague reproduction steps, or large unrelated fixture churn. Use the closest useful verification instead.
Workflow
- Understand the bug. Identify intended behavior, current behavior, the affected path, and the smallest observable reproduction.
- Choose the narrowest executable check. Prefer the unit, component, or integration test style already used for that code, in the location the repo uses (often colocated as
foo.test.ts), run with the repo's single-test command. If no practical path is obvious, do not create one just to satisfy the workflow. - Write the failing test first. Add the smallest test that would have caught the bug. It encodes intended behavior, not the current implementation.
- Run it before fixing. Confirm it fails for the intended reason. If it passes or fails for an unrelated reason, correct the test first.
- Fix the bug. Make the smallest production change that satisfies the intended behavior and keeps nearby contracts.
- Rerun the test. Confirm it passes.
If a failing test is impractical
Use the closest executable check: a targeted script, a manual reproduction command, browser automation, a snapshot comparison, or a focused integration check.
Prefer no new test over a bad test. A bad test mostly tests mocks, encodes implementation details, depends on timing or global state, needs expensive infrastructure for a small fix, or would be deleted right after proving the fix.
Guardrails
- Do not change tests to match a wrong implementation.
- Do not weaken assertions unless the expected behavior genuinely changed and you can say why.
- Keep the test focused on the bug. No fixture churn or unrelated coverage.
- If the bug is flaky, make the test deterministic and document the signal it locks down.
- If the bug exposes a broader class of failures, land the focused regression first, then consider sibling coverage.
Verify
- Name the check that failed before the fix and the failure it produced.
- Name the passing run after the fix and any nearby validation.
- If failing-before evidence is missing, say why and name the closest check used.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-correctSkill
- agents-create-verification-skillSkill
- agents-reflectSkill
- agents-swarmSkill
- alchemy-infraSkill
- comms-howSkill
- comms-impactSkill
- comms-interrogateSkill
- comms-technical-writingSkill
- comms-unslopSkill
- comms-whySkill
- effect-boundary-validationSkill
- effect-seam-migrationSkill
- effectSkill
- eng-agent-dx-cli-scaleSkill
- eng-benchmark-checklistSkill
- eng-blast-radiusSkill
- eng-change-checklistSkill
- eng-cutover-verificationSkill
- eng-state-machineSkill
- eng-testingSkill
- gh-ci-triageSkill
- gh-pr-commit-reviewSkill
- gh-pr-feedback-loopSkill
- nix-darwinSkill
- sentry-bugfixSkill
- sentry-perfSkill
- svelte-shadcnSkill
- svelte-ui-deliverySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

