test-first
Skill2 starsChanged 28 days agoMITView on GitHub
Builds a change one assertion at a time: state a testable claim, watch a test fail for the expected reason, write the smallest code that passes, then validate it on the real system, with script-checked proof of the order. Use when implementing a feature or fix from an approved plan, when the user says "TDD", "test first", "red green" or "/test-first", or when fixing a security finding. Not for docs, generated code, or research.
25 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 versions25 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 25
- JordanCoin/codemap★ 715same 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
15 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 repository13 other files it gives its agents.
- blind-pr-reviewSkill
- bug-huntSkill
- bug-reviewSkill
- context-firstSkill
- course-builderSkill
- mock-interviewSkill
- product-manager-reviewerSkill
- progress-logSkill
- repo-bootstrapSkill
- skill-verifierSkill
- staff-engineer-reviewerSkill
- token-auditSkill
- trip-itinerarySkill
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 21 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Run one bolt per assertion.
- Distinctive: line 33
Reason: Write one assertion in the ledger: a single claim that can be false.
- Distinctive: line 34
Act: write the test: Add only test code, then commit it alone.
- Distinctive: line 35
Observe: confirm red: Run the test. It must fail for the expected reason, not from a typo, import error or broken setup.
- Distinctive: line 36
Act: write the code: Add the smallest change that passes.
- Distinctive: line 37
Observe: confirm green: Run the test, then the full suite and linters.
- Distinctive: line 44
Record: Add the commits and the evidence to the ledger, then start the next bolt.
- Distinctive: line 52
No production code without a test seen failing first.
- Very specific: line 53
Don't weaken a test to pass.
- Distinctive: line 55
Stop and tell the user if an assertion turns out to need a plan change.
- Distinctive: line 57
Never claim "secure" or "bug-free".
“Common” is measured: kept by at least 6 in 10 of the 21 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
Test First
Move from assertion to validation, never from code to hope. Each change starts as a claim that can be false, and ends with evidence that it's true. Good output has a failing test that was seen to fail, and proof a reader can re-run.
This follows AI-DLC's Construction phase, with test-first as the test ordering: the approved plan is the Inception output, and each assertion is a small bolt. Inside each bolt the agent runs a ReAct loop: reason, act, observe. Observation means real output. An expected result is not an observation.
Inputs
$ARGUMENTS / the request:
- A plan or a list of assertions → use them in order.
- A finding from
blind-pr-review→ the assertion is that the attack is refused. - Neither → derive assertions from the request, and get approval before building, using the session's normal plan flow.
Workflow
Run one bolt per assertion. Read references/assertions.md before writing the first one.
- Reason. Write one assertion in the ledger: a single claim that can be false. For a security change, state what must be refused as well as what must work.
- Act: write the test. Add only test code, then commit it alone. This commit is the red commit.
- Observe: confirm red. Run the test. It must fail for the expected reason, not from a typo, import error or broken setup. Otherwise fix the test and repeat.
- Act: write the code. Add the smallest change that passes. Leave the test alone, and commit. This commit is the green commit.
- Observe: confirm green. Run the test, then the full suite and linters. Fix anything you broke.
- Refactor. Clean up with the tests green, in a separate commit.
- Validate. Prove the order:
Then exercise the real thing wherever a unit test mocks the part that matters, such as a real CLI run, and record the output.python3 scripts/verify_red_green.py --red RED_SHA --green GREEN_SHA --expect 'REGEX' -- TEST_COMMAND - Record. Add the commits and the evidence to the ledger, then start the next bolt.
Output
The ledger goes in the PR description, with a row per assertion. Reply with assertions proven, anything left unproven and why.
Rules
- No production code without a test seen failing first. If code came first, set it aside and write the test from the assertion.
- Don't weaken a test to pass.
verify_red_green.pyrejects any test that changed between red and green. - A test that can't fail proves nothing. If you can't make it fail, the assertion is wrong or already true, so say which.
- Stop and tell the user if an assertion turns out to need a plan change.
- Exceptions: docs, generated code, and configuration that has its own check. Name the exception in the ledger.
- Never claim "secure" or "bug-free". Report which assertions were proven.
- Python projects installed in editable mode import the main checkout, not the clean one: pass
env PYTHONPATH=src pytest …so the check tests the right commit.
Files
references/assertions.md: read before the first bolt. Holds the ledger format and how to write strong assertions.scripts/verify_red_green.py: run at step 7. Exit 0 means proven and 1 means rejected.scripts/test_verify_red_green.py: the script's own tests.
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.

