testing
Skill0 starsChanged 8 days agoMITView on GitHub
Run, write, and debug tests — unit, integration, and end-to-end — in whatever framework the project already uses (Jest, Vitest, PHPUnit, Pytest, Go test, cargo test, RSpec, JUnit). Invoke when the user asks to test something, run the suite, add or fix tests, check coverage, or investigate a failing test. Skip when they want a code review rather than tests, or are asking how a test framework works in the abstract.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 172 edited versions we read keep these.
2
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 13
Never guess the runner or invent a command:
- Very specific: line 32
Use the project's own command — npm test, composer test, pytest, go test ./..., cargo test — not a hand-rolled invocation.
- Distinctive: line 85
Read the actual failure output before changing anything.
“Common” is measured: kept by at least 6 in 10 of the 172 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
Testing
Find the project's test setup, use it, and write tests that would actually catch a regression.
1. Find the setup before writing anything
Never guess the runner or invent a command:
ls package.json composer.json pyproject.toml pytest.ini Cargo.toml go.mod Gemfile pom.xml 2>/dev/null
sed -n '/"scripts"/,/}/p' package.json # JS/TS, then jest/vitest/playwright config
ls phpunit.xml* tox.ini setup.cfg 2>/dev/null # PHP / PythonRead CLAUDE.md / AGENTS.md, README.md, and CONTRIBUTING.md for test rules first. Projects
routinely have non-obvious requirements — a real database instead of an in-memory one, an
env file to source, serial execution, a fixture reset between cases. Those override every
default here.
Then read one existing test in full and match its structure, naming, helpers, and assertion style. A test that doesn't look like its neighbours is a worse test even when it passes.
2. Run the suite
Use the project's own command — npm test, composer test, pytest, go test ./...,
cargo test — not a hand-rolled invocation; the script usually carries required flags
(config path, serial workers, env loading).
Narrow down while iterating, then run the full suite before declaring done — a narrow run hides cross-test breakage.
npx jest --config test/jest-e2e.json -t "sends a friend request"
pytest tests/test_auth.py::test_login -x
go test ./internal/auth -run TestLogin -v3. What to write
Pick the level that matches what you're protecting:
- Unit — pure logic, edge cases, branching. Fast, no I/O. Validators, formatters, calculations, state machines.
- Integration — a service against a real database or dependency. Queries, transactions, locking — anything where the ORM's behaviour is the risk.
- End-to-end — a real request over the real stack. Status codes, response shape, auth, guard ordering, rate limits.
Where a project has one dominant style, follow it rather than introducing a parallel testing culture nobody maintains.
Test behaviour, not implementation. Assert on what a caller observes — return value, response body, status code, database state, emitted event. A test asserting a private method was called breaks on every refactor and catches nothing.
Cover what actually breaks: the happy path once, then every error path (invalid input, missing auth, wrong owner, not found, conflict), boundaries (empty/one/many, zero/negative/max, first and last page), idempotency (doing it twice, out of order, after it already happened), and concurrency where an invariant depends on it. Error paths are where the bugs are; a suite that only tests success is decorative.
Assertions: one behaviour per test, named for what it guarantees (rejects login for
an unverified email, not test login 2). Assert exact wire strings, status codes,
and shapes when they are a contract — loose matchers let breaking changes through. No
conditional logic in a test; an if tests two things badly.
Fixtures and isolation: each test must pass alone and in any order — shared mutable state is a defect in the suite. Follow the project's reset mechanism exactly (truncate helper, transaction rollback, fresh container); note that a wrapping transaction cannot work when the code under test runs over real HTTP on its own connection. Reset the things that produce mystifying failures elsewhere: rate limiters, caches, recorded mail, clocks, in-memory queues. Build fixtures with a factory, not copy-pasted literals. Mock at the system boundary — third-party HTTP, payments, clocks, randomness — and do not mock your own database into meaninglessness.
4. When a test fails
- Read the actual failure output before changing anything; the diff usually names it.
- Decide honestly which side is wrong. Fix the code when the test encodes the intended behaviour.
- Never weaken an assertion, add a retry, or bump a timeout to turn red green. If a test is genuinely obsolete, say so and delete it deliberately.
- Flaky? Find the shared state, ordering assumption, or real timing dependency. Do not paper over it with a sleep.
- Reproduce with the narrowest run, fix, then re-run the full suite.
5. Report
The command and the pass/fail counts. If anything failed, the failing test names and the real output — never round a failing run up to "done". What you added coverage for, what you deliberately left uncovered and why, and anything you could not run (missing database, absent credentials) with what it would take to run it.
Other versions192 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 192
- modelcontextprotocol/servers★ 92ksame name
- lobehub/lobe-chat★ 84ksame name
- lobehub/lobehub★ 84ksame name
- penpot/penpot★ 62ksame name
- meteor/meteor★ 45ksame name
- iOfficeAI/AionUi★ 34ksame name
- garrytan/gbrain★ 31ksame name
- OpenZeppelin/openzeppelin-contracts★ 27ksame name
- tursodatabase/turso★ 25ksame name
- redis/go-redis★ 22ksame name
182 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.
Used alongsideProjects with it also use bundle-dependency-prs, update-library-template and 8 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.
MicrosoftSkillbundle-dependency-prs
Fix broken dependency update PRs and aggregate the ones that work into one PR.
Also in 6 projects that use this
MicrosoftSkillupdate-library-template
Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.
Also in 6 projects that use this
zetaloopSkillassign-copilot
Assigns a GitHub issue to the Copilot coding agent, optionally specifying a custom agent. Use this when asked to assign an issue to Copilot or delegate an issue to CCA.
Also in 3 projects that use this
timmo001Skillchangeset-scope
Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.
Also in 3 projects that use this
JetBrainsSkillmodule-dependencies
Add or modify IntelliJ module dependencies in `.iml` files.
Also in 3 projects that use this
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
In this repository11 other files it gives its agents.
- add-designpatternSkill
- add-owasptoptenSkill
- add-spring-structureSkill
- askSkill
- checkout-commitSkill
- check-performanceSkill
- check-securitySkill
- design-uiSkill
- discussSkill
- generate-api-docsSkill
- release-versionSkill
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.

