test-first
Skill1 starsChanged 33 days agoMITView on GitHub
Implement specified new or changed software behavior and established bug corrections through test-driven development; protect behavior-preserving refactors with characterization tests. Use as direct development or support within an approved phase. Uncertain causes need diagnosis first; prose-only edits use document checks instead.
24 other projects use a version of this.
Adopted by
Most recently taken up by
- TheLunchTrae/claude-code-configstheir own version, first seen Nov 8, 2026
- sergvss/agents-best-teamstheir own version, first seen Nov 1, 2026
- JordanCoin/codemaptheir own version, first seen Nov 1, 2026
- claude-world/director-mode-litetheir own version, first seen Nov 1, 2026
- NoobyGains/godmodetheir own version, first seen Nov 1, 2026
- bmtrnavsky/disciplined-vibe-codingtheir own version, first seen Nov 1, 2026
Used with
Projects with it also use security-sweep, refactor and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
n24q02mSkillsecurity-sweep
Graph-driven security sweep -- scan for dangerous sinks, then rank each finding by whether an entry point can actually reach it, and triage the rest into suppressions.
Also in 3 projects that use this
GitHubSkillrefactor
Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.
Also in 4 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 4 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions24 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 24
- JordanCoin/codemap★ 710same name
- llopresto87/Cypress★ 119same name
- NoobyGains/godmode★ 118same name
- claude-world/director-mode-lite★ 80same name
- s-hiraoku/synapse-a2a★ 17same name
- bmtrnavsky/disciplined-vibe-coding★ 15same name
- dfedoryshchev/weftworks★ 5same name
- eeshsaxena/agent-skills★ 2same name
- sergvss/agents-best-teams★ 2same name
- atgreen/hackinator★ 1same name
14 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- craft-skillSkill
- debug-systematicallySkill
- design-modulesSkill
- execute-planSkill
- inspect-codeSkill
- plan-workSkill
- review-codeSkill
- strategizeSkill
- verify-workSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. 0 are common, 24 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
24
Distinctive
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 9
Use test-driven development by default for new and changed software behavior.
- Distinctive: line 15
Core cycle: test one contract → observe intended red → implement the outcome → observe green → refactor only when useful, retaining green.
- Distinctive: line 34
Read the requirement, actual caller, existing implementation, project instructions, and test commands.
- Distinctive: line 35
Write the contract as an input or condition and an observable result.
- Distinctive: line 43
Behavior-preserving refactor: run existing tests and add missing characterization coverage first.
- Distinctive: line 45
Host cannot be automated or accessed: test the reachable contract first and retain a repeatable live procedure.
- Distinctive: line 46
Prose-only or formatting-only change: use relevant document or formatting checks.
- Distinctive: line 50
Write one focused test with a clear setup, action, and assertion.
- Distinctive: line 52
Run the focused test before writing the behavior.
- Distinctive: line 53
If it fails at unrelated setup, imports, fixtures, or environment, repair the test setup and rerun.
- Distinctive: line 54
If it passes unexpectedly, inspect whether the behavior already exists or the assertion misses the distinction.
- Distinctive: line 61
Run the same test again. If it still fails, investigate the actual mismatch.
- Distinctive: line 62
Run nearby tests that share the changed rule or consumer.
- Distinctive: line 63
Keep existing expectations unless an intentional contract change justifies updating them.
- Distinctive: line 69
If cleanup improves the delivered code, make a behavior-preserving change and rerun affected tests after each meaningful edit.
- Distinctive: line 70
If a refactor breaks a test, establish whether it changed the public contract or exposed a test tied to private arrangement.
- Distinctive: line 78
Assert the contract: check returned values, observable state, errors, or externally meaningful effects.
- Distinctive: line 79
Make failure diagnostic: use behavior-based names, explicit expected values, and assertions whose output identifies the mismatch.
- Distinctive: line 82
Protect failure behavior: when an operation should fail safely, assert the intended error and absence of forbidden side effects, such as a …
- Distinctive: line 83
Use real owned logic: do not mock the function under test or all collaborating code and then claim the system works.
- Distinctive: line 85
Isolate state: use per-test fixtures, temporary directories, and explicit cleanup.
- Distinctive: line 88
Check test sensitivity: ask which plausible bug would fail this test.
- Distinctive: line 108
Keep secrets and private logs out of fixtures and reports.
- Distinctive: line 110
Before declaring the phase ready:
“Common” is measured: kept by at least 6 in 10 of the 20 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Develop behavior through tests
Use test-driven development by default for new and changed software behavior. Keep execution and review inline; preserve the user's scope and existing work. Within a plan, diagnosis, or migration, these cycles support the active task rather than replacing its tracking or handoff.
Entry route
- Inputs: specified behavior or established correction, current implementation, and inspected test commands.
- First action: choose the special-case route below, then select one input/condition and its independent expected result.
- Core cycle: test one contract → observe intended red → implement the outcome → observe green → refactor only when useful, retaining green.
- Stop condition: the promised behavior and affected checks are observed, with unavailable required checks still explicit. Do not claim a red-green cycle for an exception route.
Route card
Choose the current check route; linked examples are optional.
| Condition | Next action and minimum evidence | Stop or handoff |
| Specified new/change behavior or established fix | Select one independent expected result; observe intended red, implement, then run the same and affected checks. | Delivered contract with observed green, or an explicit gap. |
| Test fails before reaching behavior | Repair unrelated setup and rerun; inspect the actual failure. | No production change until meaningful red or an honest exception route. |
| Refactor or implementation already present | Preserve work; establish current/characterization coverage first. | Refactor stays green; missing pre-implementation red is disclosed. |
| Required host inaccessible | Test reachable contracts and retain setup/invocation/observation/cleanup for a live check. | Host requirement pending; mocks do not establish it. |
| Prose-only or cause uncertain | Use document checks, or diagnose the unknown cause before implementation. | No manufactured red or speculative fix. |
1. Select one behavior
Use acceptance examples in existing specs and plans as test inputs, checking them against current requirements. Record cycle evidence and missing observations in the active same-scope authorized plan when present, including cross-session work; do not create a planning file for every test cycle. Preserve closed task records; new work needs a linked successor only when persistence is warranted and authorized. Living canonical specs remain the owner of authorized contract updates. Permanent regression tests belong in the project's normal test locations, while disposable probes use temporary workspaces rather than a default .your/tests/.
- Read the requirement, actual caller, existing implementation, project instructions, and test commands. Reuse the established framework and test location.
- Write the contract as an input or condition and an observable result. Include errors and side effects when they are part of the promise.
- List meaningful examples: normal use, the relevant boundary, and failure or alternate supported input. Choose one example for the next cycle; do not implement all examples before running their tests.
- Choose the lowest-cost entrypoint that reaches this contract. Use a unit test for an owned rule, an integration test for collaborating components, and an actual host or rendered interaction for lifecycle or UI behavior.
- Record the focused test command and the affected consumer/regression checks. Establish existing failures before attributing them to new work.
Route special cases explicitly:
- Bug fix: reproduce the reported input or invocation in a failing regression test before changing the cause.
- Behavior-preserving refactor: run existing tests and add missing characterization coverage first. Then change structure while those tests stay green; do not invent a failure for behavior that should remain unchanged.
- Implementation already exists: preserve it. Test the contract and disclose that no pre-implementation failure was observed. Use an authorized isolated earlier-version reproduction when helpful; never delete user work to recreate red.
- Host cannot be automated or accessed: test the reachable contract first and retain a repeatable live procedure. Report the host check as pending or manually observed; a mock does not establish loading, registration, or rendered behavior.
- Prose-only or formatting-only change: use relevant document or formatting checks. If documentation contains executable examples or schemas, check those contracts where affected.
2. Red: make the contract fail visibly
- Write one focused test with a clear setup, action, and assertion. Name it for the behavior and condition it demonstrates.
- Derive the expected result from the requirement or an independent known example. Do not calculate it using the same algorithm as the implementation.
- Run the focused test before writing the behavior. Read the failure and confirm it exposes the missing or incorrect outcome.
- If it fails at unrelated setup, imports, fixtures, or environment, repair the test setup and rerun. A missing API can be the intended failure for a new contract; an unrelated dependency error cannot.
- If it passes unexpectedly, inspect whether the behavior already exists or the assertion misses the distinction. Correct the test or narrow the promised change; do not manufacture red by breaking working behavior.
Proceed to implementation only after the selected behavior has an understood failing observation, or the special-case route above has been recorded honestly.
3. Green: implement the selected outcome
- Make the smallest coherent production change that satisfies the contract across its supported inputs. Avoid speculative options and unrelated cleanup.
- Run the same test again. If it still fails, investigate the actual mismatch; do not weaken the requirement to accept the patch.
- Run nearby tests that share the changed rule or consumer. If they fail, determine whether the implementation broke a supported contract or the requirement intentionally changed it.
- Keep existing expectations unless an intentional contract change justifies updating them. Record that decision and verify its affected callers.
- Once the selected test and relevant checks pass, proceed to refactor or the next behavior. Do not pile additional functionality onto an unverified change.
4. Refactor: improve structure with green evidence
- Inspect the implementation and tests for duplication, unclear naming, avoidable coupling, or excessive setup introduced by the cycle.
- If cleanup improves the delivered code, make a behavior-preserving change and rerun affected tests after each meaningful edit. Otherwise continue without adding a routine no-cleanup note.
- If a refactor breaks a test, establish whether it changed the public contract or exposed a test tied to private arrangement. Fix the actual defect; do not discard an assertion that protects required behavior.
- Repeat red-green-refactor for the next meaningful example. Add boundary and failure cases that distinguish plausible wrong implementations.
- At the phase boundary, run required regression and consumer checks against the final state. Repeat the reported operation when focused tests cover a narrower layer.
Write tests that detect mistakes
Apply the checks relevant to the selected contract; do not turn every item below into an additional test or mandatory tool.
- Assert the contract: check returned values, observable state, errors, or externally meaningful effects. A test that merely checks non-null or no exception is insufficient when a precise result is promised.
- Make failure diagnostic: use behavior-based names, explicit expected values, and assertions whose output identifies the mismatch. Keep setup, action, and assertions visibly separate.
- Keep one scenario focused: several assertions may establish one result, such as an error plus unchanged state. Split unrelated behaviors instead of enforcing one assertion per test.
- Cover distinctions: choose cases at, below, and above a meaningful threshold, or empty, absent, malformed, repeated, and alternate supported inputs where the contract defines them. Do not add combinatorial cases without a distinct failure risk.
- Protect failure behavior: when an operation should fail safely, assert the intended error and absence of forbidden side effects, such as a partially written record or duplicate request.
- Use real owned logic: do not mock the function under test or all collaborating code and then claim the system works. Mock external boundaries or expensive/non-deterministic dependencies when necessary, and retain integration or contract checks for those boundaries.
- Assert interactions only when contractual: exact call counts, ordering, and payloads belong in a test when retry, lifecycle, transaction, or protocol behavior requires them. Do not freeze incidental helper calls.
- Isolate state: use per-test fixtures, temporary directories, and explicit cleanup. Tests must not depend on execution order, previous runs, a developer's credentials, or shared production data.
- Control nondeterminism: inject or control time, randomness, network responses, and scheduling where feasible. Wait for observable conditions with bounded timeouts rather than arbitrary sleeps; do not hide flaky behavior with retries.
- Choose useful fixtures: retain the failure-causing shape with minimal irrelevant data. Use generated properties or parameterized examples when they exercise distinct contracts; snapshots need stable contents and review of what changed.
- Check test sensitivity: ask which plausible bug would fail this test. When uncertainty matters, try a deliberate wrong implementation in an isolated disposable copy and confirm the test catches it. Never mutate user work merely to prove the test.
- Use coverage as a locator: unexercised branches can reveal missing scenarios, but high line coverage or test count does not establish correct assertions or host behavior.
The optional byte-budget walkthrough shows independent boundary expectations that catch plausible wrong implementations. Define invalid-input contracts before adding their cases.
Retain evidence and complete the phase
Keep concise evidence in the existing task notes without losing context or technical detail. Group cycles sharing a command or result, link detailed logs once, and use bullets where easier to scan. Do not create a ledger for every assertion or repeat the log at handoff. Adapt this record; omit irrelevant fields while retaining observed red/green results, exception routes, and material gaps:
Behavior: <input/condition and independent expected outcome>
Test/entrypoint: <focused command and boundary reached>
Red: <observed intended failure, or named special-case route>
Green: <same test and observed passing outcome>
Refactor: <cleanup and rerun, if performed>
Final checks: <affected consumers, regressions, original scenario>
Limits: <unobserved host/runtime behavior or existing failures>- Retain tests in the established test location; retain live setup, invocation, observation, and cleanup steps where automation cannot reach the host.
- Keep secrets and private logs out of fixtures and reports. Update related test instructions, affected docs, and changelog before handoff.
Before declaring the phase ready:
- New or changed behavior has an observed, understood red result before implementation, or an explicitly recorded special-case route.
- Expected outcomes are independent of the implementation; meaningful boundary and failure cases are covered.
- Tests exercise real relevant behavior, isolate state, and produce useful failure diagnostics.
- Green and any refactor checks were observed against the final relevant inputs.
- Required consumers, regressions, documentation, and live observations are established; pending checks remain visible and keep the affected requirement incomplete.
Return delivered behavior, a brief evidence summary or link, and material remaining gaps to the active task or phase. A green cycle satisfies its technical gate, not parent-phase reassessment, user acceptance, or commit/next-phase authority. Do not add human approval between test cycles unless requested, or claim a test-driven cycle or live-host result that was not actually observed.
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.

