unit-test
Skill0 starsChanged 4 months agoMITView on GitHub
Ensures every source file edit has a corresponding unit test — writing one if missing, extending one if the changed behaviour is uncovered. Apply automatically when creating, editing, implementing, fixing, refactoring, or modifying any function, class, component, handler, service, or module.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- moveju112/skill_verifytheir own version, first seen Oct 5, 2026
- neomjs/neo-agent-skillstheir own version, first seen Oct 3, 2026
- lldwb/lldwb-claude-skillstheir own version, first seen Sep 28, 2026
- ivyfan-toowell/IvyClawtheir own version, first seen Sep 13, 2026
- oprogramadorreal/optimus-claudetheir own version, first seen Sep 4, 2026
- DongDuong2001/pudo-code-systemtheir own version, first seen Jun 18, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- oprogramadorreal/optimus-claude★ 75same name
- ivyfan-toowell/IvyClaw★ 61same name
- neomjs/neo-agent-skills★ 11same name
- DongDuong2001/pudo-code-system★ 5same name
- kevinaimonster/skill-hub★ 4same name
- lldwb/lldwb-claude-skills★ 1same name
- moveju112/skill_verify★ 1same name
- ijufumi/claude-skills★ 0same name
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.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When any code change is made, follow this checklist before marking the task done:
- Distinctive: line 14
Check for an existing test file covering that unit.
- Distinctive: line 15
If no test exists → write one.
- Very specific: line 45
No comments inside tests either — the it(...) sentence is the documentation.
- Distinctive: line 56
Before marking any test done:
- Distinctive: line 69
Write the failing test first (it must fail before the fix).
“Common” is measured: kept by at least 6 in 10 of the 4 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
Unit Test Skill
When any code change is made, follow this checklist before marking the task done:
- Identify the unit(s) of code that changed (function, class, or module).
- Check for an existing test file covering that unit.
- If no test exists → write one. If a test exists but misses the changed behaviour → add a case.
Philosophy
London School TDD with strict Osherove AAA — makeFactory() owns the entire
Arrange phase, mock<T>() replaces every collaborator, one expect() per test.
See reference/principles.md for detailed rules, worked examples, and the fallback
reasoning source for any case not explicitly covered here.
No code comments — a comment is a missing test title
Production code (and test code) carries no explanatory comments. Anything you would write as a comment to describe what the code does or why it behaves a certain way must instead be expressed as a test title — a behavioural spec that asserts that behaviour.
Why: a code comment is static prose that silently drifts out of sync with the code — nothing fails when it becomes wrong, so it rots. A test title is living documentation: it is bound to an assertion, so if the behaviour changes the test goes red. The docs cannot go stale, because the suite enforces them.
- Tempted to write
// falls back to eu-west-1 when no region is set? Delete it and writeit("falls back to eu-west-1 when no region is set", ...). - A comment explaining a branch is a signal that the branch lacks a named test. Add the test and let its title carry the intent.
- No comments inside tests either — the
it(...)sentence is the documentation.
The only permitted comment is an irreducible external constraint that no test can express — e.g. a link to an upstream bug the code works around, or a regulatory/protocol note. It is rare (~1%); when you reach for one, add it and flag it for a decision, never silently.
Test quality checklist
Before marking any test done:
[ ] Test describes behaviour, not implementation
[ ] Test calls makeFactory() and destructures only what it needs
[ ] Test has exactly one expect()
[ ] No code comments anywhere — intent lives in test titles, not proseRegression tests for bug fixes
- Write the failing test first (it must fail before the fix).
- Fix the bug.
- Confirm the test now passes.
- The test is the bug's permanent tombstone — never delete it.
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.

