eng-testing
Skill23 starsChanged 11 days agoMITView on GitHub
Decide whether a change needs a test, where it lives, what it asserts, and which check to run before calling it done. Use when adding, moving, or reviewing a unit, component, integration, story, or end-to-end test, or choosing the smallest check to run before a PR.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
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 8
Add a test when it would catch a regression a reviewer would miss.
- Very specific: line 29
No focused or skipped tests (.only, .skip) in a commit.
- Distinctive: line 35
Test failure paths, retries, cancellation, and cleanup where their behavior is uncertain.
- Distinctive: line 39
Keep component stories bounded: one gallery or matrix story for visual variants and at most one interaction story for state, keyboard, or …
- Distinctive: line 44
Run one file, then the changed packages, then the repo's pre-PR suite.
- Distinctive: line 50
Every assertion names a value or contract.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Testing
Add a test when it would catch a regression a reviewer would miss. Types, lint, a rendered component, or a run of the app prove most changes without one.
Repo facts (from AGENTS.md): the test policy (when a test is required, allowed, or discouraged), the runner and file pattern per package, shared test helpers and in-memory fakes, the lint rules that enforce test hygiene, the story or visual-test limits, which CI stage runs which tests, and the check commands from one file up to the pre-PR suite. The repo's policy wins over this skill. Before writing a test, search the installed skills for one that covers testing in the framework or runtime the code uses, and follow its helpers and patterns alongside this one.
Decide whether to write one
- Write a test where a branch's behavior is uncertain or a past bug could return. Before writing it, ask whether the code can be split until the branch is obvious, or flagged for manual review in the PR. Prefer either when the repo's policy discourages tests.
- Skip tests that restate the implementation, check that something exists, cover a state the type system already forbids, or mostly exercise mocks.
- For a bug fix with a cheap regression path, follow
eng-tdd.
Where it lives
- Beside the code it covers (
foo.tsandfoo.test.ts), unless the repo puts tests in one tree. - In the package or module that owns the code. Tests left at the app level cover integration and runtime boundaries (wiring, startup manifests, routing), not another package's internals. When code moves, its tests move in the same change.
- A pure lookup or format module gets one table test of accepted and rejected inputs.
What it asserts
- Arrange, Act, Assert; one behavior per test.
- Assert a specific value, status, error type, or schema contract. "Is defined" and "is not null" pass for the wrong value.
- Component tests assert behavior, contracts, and accessibility semantics (roles, names, states), never CSS classes, styling, or raw markup. Visual checks belong in rendered stories or screenshot tests.
- No focused or skipped tests (
.only,.skip) in a commit.
Make it deterministic
- Provide dependencies as in-memory fakes that behave like the real ones, not hand-built mocks of client calls.
- Control time and randomness through an injected clock and random source, not by stubbing globals.
- Test failure paths, retries, cancellation, and cleanup where their behavior is uncertain; do not test the framework's own behavior.
Stories and end-to-end tests
- Keep component stories bounded: one gallery or matrix story for visual variants and at most one interaction story for state, keyboard, or focus. No story per minor variant.
- End-to-end tests cover critical user journeys only. Know which CI stage runs them and how to force a run.
Run the smallest check
Run one file, then the changed packages, then the repo's pre-PR suite. Use the repo's task runner rather than a bare test binary when it builds dependencies or generated types first. Know which tests the PR's CI skips.
Review checklist
- Each new test covers an uncertain branch or a past bug; otherwise it is deleted or the code is simplified.
- Tests sit beside the code, in the module that owns it, and move with it.
- Every assertion names a value or contract; none is vacuous, styling-based, focused, or skipped.
- Time, randomness, and services come from fakes and an injected clock.
- Story count stays bounded.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agents-correctSkill
- agents-create-verification-skillSkill
- agents-reflectSkill
- agents-swarmSkill
- alchemy-infraSkill
- comms-howSkill
- comms-impactSkill
- comms-interrogateSkill
- comms-technical-writingSkill
- comms-unslopSkill
- comms-whySkill
- effect-boundary-validationSkill
- effect-seam-migrationSkill
- effectSkill
- eng-agent-dx-cli-scaleSkill
- eng-benchmark-checklistSkill
- eng-blast-radiusSkill
- eng-change-checklistSkill
- eng-cutover-verificationSkill
- eng-state-machineSkill
- eng-tddSkill
- gh-ci-triageSkill
- gh-pr-commit-reviewSkill
- gh-pr-feedback-loopSkill
- nix-darwinSkill
- sentry-bugfixSkill
- sentry-perfSkill
- svelte-shadcnSkill
- svelte-ui-deliverySkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

