focused-tdd
Skill130 starsChanged 11 months agoMITView on GitHub
Use when the user asks for test-first development, TDD, or a regression test before a fix, or when implementing deterministic business rules, state transitions, authorization boundaries, idempotency, and other behavior where observing a focused failing test would materially reduce risk. Selects strict TDD, regression-first, or proportional validation.
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
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 8
Treat test-first development as a risk-reduction technique, not a universal ceremony.
- Distinctive: line 14
Use strict RED-GREEN-REFACTOR only when all apply:
- Distinctive: line 21
Use regression-first for a confirmed bug when one focused test can reproduce its failure mechanism.
- Distinctive: line 23
Use proportional validation for exploratory, behavior-preserving, generated, documentation-only, configuration-heavy, primarily visual, or …
- Distinctive: line 27
create a test for every function, branch, or implementation detail.
- Distinctive: line 37
Write one minimal test for one independently observable behavior.
- Distinctive: line 38
Prefer real domain or application code.
- Distinctive: line 39
Run the narrowest command that exercises the test.
- Distinctive: line 41
If the test passes, determine whether the behavior already exists.
- Distinctive: line 46
Run the same focused test.
- Distinctive: line 57
Run the focused test during the loop.
- Distinctive: line 58
Stop strict cycling after two environment or harness failures unrelated to the behavior.
- Distinctive: line 59
Test rules at their owning layer: transport mapping at the boundary, business rules in domain/application code, persistence contracts …
- Distinctive: line 60
Add negative authorization, tenant, idempotency, concurrency, or transition cases only when the changed risk requires them.
- Distinctive: line 61
Follow repository-specific commands and verification guidance instead of inventing a parallel test workflow.
≈ “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
Focused TDD
Treat test-first development as a risk-reduction technique, not a universal ceremony.
Choose the workflow
Inspect the changed behavior, nearby code, existing tests, and repository instructions. State the selected approach briefly before editing.
Use strict RED-GREEN-REFACTOR only when all apply:
- The change has an observable behavioral contract.
- A deterministic automated test can exercise the owning layer.
- The focused test is expected to run quickly enough for repeated feedback.
- Watching the test fail would materially increase confidence in the implementation.
Use regression-first for a confirmed bug when one focused test can reproduce its failure mechanism.
Use proportional validation for exploratory, behavior-preserving, generated, documentation-only, configuration-heavy, primarily visual, or externally dependent work. Add tests after implementation only when they protect meaningful behavior.
Do not:
- create a test for every function, branch, or implementation detail;
- build a new test harness whose cost exceeds the changed risk;
- rewrite existing user code merely because it predates a test;
- manufacture a RED step when the behavior already exists;
- claim TDD when the new test was never observed failing for the intended reason.
Run a focused cycle
RED
- Write one minimal test for one independently observable behavior.
- Prefer real domain or application code. Mock only slow, nondeterministic, or external boundaries.
- Run the narrowest command that exercises the test.
- Confirm an assertion fails because the behavior is missing. Fix setup or fixture failures until the signal is meaningful.
- If the test passes, determine whether the behavior already exists. Adjust the scenario or stop; do not force a failure.
GREEN
- Implement the smallest coherent change that satisfies the contract.
- Run the same focused test.
- Fix production code when the contract is correct; change the test only when the asserted contract was wrong.
REFACTOR
Refactor only when it improves the changed design enough to justify another cycle. Keep the focused test green and do not expand scope under the label of cleanup.
Repeat once per observable behavior, not once per method or file.
Keep validation proportional
- Run the focused test during the loop; run broader checks once after behavior stabilizes.
- Stop strict cycling after two environment or harness failures unrelated to the behavior. Continue with the best proportional validation and report the blocker.
- Test rules at their owning layer: transport mapping at the boundary, business rules in domain/application code, persistence contracts against the real adapter or database when needed, and user interaction in frontend tests.
- Add negative authorization, tenant, idempotency, concurrency, or transition cases only when the changed risk requires them.
- Follow repository-specific commands and verification guidance instead of inventing a parallel test workflow.
Report evidence
Approach: strict TDD | regression-first | proportional validation
RED: [test and expected failure, or why RED was not valuable]
GREEN: [focused passing command]
Broader validation: [commands and results]
Remaining gap: [only a material unverified risk]In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- branch-cleanerSkill
- bug-triageSkill
- ci-fixSkill
- commit-workSkill
- create-prSkill
- dependency-upgraderSkill
- docs-syncSkill
- manage-product-ideasSkill
- pr-visual-explainerSkill
- rebase-assistantSkill
- regex-builderSkill
- release-notesSkill
- review-architecture-scopeSkill
- review-backend-changeSkill
- review-frontend-changeSkill
- review-security-privacySkill
- review-test-coverageSkill
- vps-checkupSkill
- write-ui-copySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

