unit-test
Skill1 starsChanged 6 days agoMITView on GitHub
Writes isolated unit tests for a named file using Arrange-Act-Assert. Use when user requests unit tests, test coverage, or missing test cases for a file.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- neomjs/neo-agent-skillstheir own version, first seen Nov 15, 2026
- eyssette/js-templatetheir own version, first seen Nov 1, 2026
- kudeerliu48-web/CloseCodetheir own version, first seen Nov 1, 2026
- DongDuong2001/pudo-code-systemtheir own version, first seen Oct 13, 2026
- ivyfan-toowell/IvyClawtheir own version, first seen Oct 13, 2026
- phatysddev/skillstheir own version, first seen Oct 9, 2026
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- xtermjs/xterm.js★ 21ksame name
- oprogramadorreal/optimus-claude★ 75same name
- ivyfan-toowell/IvyClaw★ 66same name
- johnqtcg/awesome-skills★ 30same name
- kudeerliu48-web/CloseCode★ 14same name
- neomjs/neo-agent-skills★ 11same name
- phatysddev/skills★ 8same name
- DongDuong2001/pudo-code-system★ 5same name
- kevinaimonster/skill-hub★ 4same name
- lldwb/lldwb-claude-skills★ 1same name
4 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 repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- behavioural-testSkill
- breakdownSkill
- commitSkill
- e2e-testSkill
- find-rcSkill
- rubberduckSkill
- specSkill
- terseSkill
- unit-testSkill
- behavioural-testSkill
- breakdownSkill
- behavioural-testSkill
- breakdownSkill
- commitSkill
- e2e-testSkill
- find-rcSkill
- rubberduckSkill
- specSkill
- terseSkill
- unit-testSkill
- commitSkill
- e2e-testSkill
- find-rcSkill
- mobile-web-fixesSkill
- rubberduckSkill
- specSkill
- terseSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
7
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 12
Read target file, its direct collaborators, nearest existing unit tests.
- Distinctive: line 18
Test public behaviour, not private internals or call order, unless call itself is contract.
- Distinctive: line 21
No logic in tests: no loops, conditionals, or recomputing expected value with production algorithm.
- Distinctive: line 23
No fixed sleeps; await condition or use fake timers.
- Distinctive: line 24
Do not change production code to make tests pass.
- Distinctive: line 25
Run new tests alone; show invocation + result.
- Distinctive: line 26
Run project lint and type checks on test file.
“Common” is measured: kept by at least 6 in 10 of the 9 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
Short evidence, no emojis. No target file named: reply "Please mention the file that you want me to help you write the unit tests for." and stop.
Sphere: one function, class, or component; most isolated of three. Cross-layer data flow belongs in behavioural-test; full user journey in e2e-test. Case fits another sphere: say so, do not write it here.
- Read target file, its direct collaborators, nearest existing unit tests. Reuse project's runner, assertion library, file naming, test location, helpers, mock style. No existing tests: use runner in project config; none configured: ask user, add no dependency without approval.
- List cases before writing: every exported function/method, each branch, boundary values (empty, zero, one, max, null/undefined), invalid input, thrown/rejected errors, async ordering. Unreachable or untestable case: state why, do not fake coverage.
- Write tests. Rules:
- Arrange-Act-Assert: three blocks in that order, blank line between. Label with
// Arrange,// Act,// Assertonly if project tests already do. One Act per test. - One behaviour per test. Several asserts allowed only when they describe same outcome.
- Name states unit, condition, expected result. Group by unit under test.
- Test public behaviour, not private internals or call order, unless call itself is contract.
- Mock every collaborator outside unit: network, filesystem, clock, randomness, environment, other modules with side effects. Pure helpers stay real. Pin time and randomness. Never mock unit under test.
- Independent tests: no shared mutable state, no order dependence, reset mocks between tests. Setup hooks only for identical Arrange.
- No logic in tests: no loops, conditionals, or recomputing expected value with production algorithm. Literal expected values. Table-driven cases allowed when runner supports them.
- Assert specific value or error type/message, not merely truthy or "did not throw".
- No fixed sleeps; await condition or use fake timers.
- Do not change production code to make tests pass. Suspected bug: keep failing test, report to user, ask before fixing.
- Arrange-Act-Assert: three blocks in that order, blank line between. Label with
- Run new tests alone; show invocation + result. Failure: decide whether test or code wrong, fix test only when test wrong. Rerun until green.
- Run project lint and type checks on test file; fix every error. Run full relevant suite; new tests must not break others.
- Repeat 4-5 after each edit. Report cases covered, cases skipped with reason, suspected bugs, commands run. Never claim passing without run output.
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.

