test-writing
Skill1 starsChanged 6 months agoMITView on GitHub
Write tests that catch real regressions — behavior-focused, minimal mocking, edge cases chosen from the code's actual branches. Use when adding tests for new code or backfilling tests for a fix.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- wilbeibi/wilbeibi-skillstheir own version, first seen Sep 7, 2026
- NVIDIA/torch-harmonicstheir own version, first seen Jul 13, 2026
- kumar303/pietheir own version, first seen Jun 8, 2026
- andreaswasita/copilot-agents-dojotheir own version, first seen Jun 4, 2026
- kwhorne/elyra-skillstheir own version, first seen May 22, 2026
- plipowczan/claude-piv-skeletontheir own version, first seen Jan 22, 2026
Used with
Projects with it also use code-review.
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.
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
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- NVIDIA/torch-harmonics★ 710same name
- andreaswasita/copilot-agents-dojo★ 54same name
- plipowczan/claude-piv-skeleton★ 4same name
- wilbeibi/wilbeibi-skills★ 2same name
- kumar303/pie★ 1same name
- kwhorne/elyra-skills★ 1same 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.
In this repository9 other files it gives its agents.
- changelogSkill
- conventional-commitsSkill
- engram-memorySkill
- incident-postmortemSkill
- pr-descriptionSkill
- repo-onboardingSkill
- self-evolveSkill
- systematic-debuggingSkill
- tracelet-instrumentSkill
The file
Files
test-writing
A test's value is the bug it catches later. Test behavior through the public surface, not implementation details — a good test survives a refactor; a bad one breaks with it.
Procedure
- Match the house style first: open 2–3 existing test files; copy their runner, naming, setup helpers and assertion idioms exactly.
- One behavior per test, named as a claim:
install skips a broken entry and installs the rest— readable as a spec when the suite prints. - Choose cases from the code's branches, not from imagination. Read the
function: every
if, every early return, everycatchis a candidate. Priority order:- the happy path (one test, not five variations)
- each error/edge branch (empty input, missing file, duplicate, too-long, zero/negative, unicode)
- the bug you just fixed (regression test that fails without the fix — verify it actually fails by stashing the fix once)
- Real objects over mocks. Mock only true boundaries (network, clock,
randomness). If a test needs four mocks, the unit is wrong — test one level
higher. For clock/randomness, inject (
now,seed) rather than patching globals. - Make failure diagnosable: assert on specific values, not just
truthiness; add a message when the assertion isn't self-explanatory
(
assert.ok(hit1 >= 0.88, 'ranking change regressed recall')). - Independence: each test builds its own state (tmp dirs via
mkdtemp, fresh fixtures) and cleans up. Order-dependence is a flake factory.
Anti-patterns
- Asserting a function was called instead of what it did.
- Snapshot tests for logic (they assert "nothing changed", not "it's correct").
- Testing private helpers directly — route through the public API.
- A test that can't fail (asserting the mock you just configured).
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.

