testing
Skill7 starsChanged 6 days agoMITView on GitHub
Write, change, or review Fast Link tests, choose between specs, browser tests, and real app fixtures, or audit and clean up test suites. Use when assessing test value, duplication, reliability, or coverage in this repository.
We split this skill into the rules it gives an agent
24 rules. 0 are common, 18 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 171 edited versions we read keep these.
18
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Keep exhaustive cases with their owner:
- Distinctive: line 28
Test adapter failures without replaying core's eligibility matrix.
- Distinctive: line 29
Keep observable ordering and counts that detect early or duplicate navigation, or broken cleanup.
- Distinctive: line 33
Use the cheapest layer that exposes the regression.
- Very specific: line 34
Read package scripts, Vitest configs, and turbo.json for environments and build prerequisites.
- Very specific: line 48
Use browser input for native activation claims.
- Distinctive: line 49
Keep cases whose browser boundary adds proof.
- Very specific: line 57
Use fixtures/react to verify SSR through the built public React package without DOM globals.
- Distinctive: line 66
Prefer exact outcomes over truthiness or existence.
- Distinctive: line 69
Test through the owning module or consumer so behavior-preserving refactors retain coverage.
- Distinctive: line 70
Keep helpers local; add production exports or options only for production needs.
- Distinctive: line 71
Check static contracts against the actual artifact structurally when runtime execution is impractical.
- Distinctive: line 78
Keep arrange, act, and assert visible.
- Distinctive: line 80
Prefer local setup over mutable suite state or helpers with many switches.
- Very specific: line 82
Use teardown or finally to clean up even after assertion failure.
- Distinctive: line 86
Wait for observable readiness or completion with bounded timeouts.
- Distinctive: line 87
Use fake timers for timer contracts in specs.
- Distinctive: line 88
Before negative assertions, establish completion of the relevant event or operation.
- Distinctive: line 92
Use Playwright Test fixtures and locator assertions for browser scenarios.
- Distinctive: line 98
Use uncovered branches to find missing contracts.
- Very specific: line 99
Run pnpm coverage to measure package production files with the configured V8 provider.
- Very specific: line 105
After edits, run focused owner tests, then required pnpm validate.
- Distinctive: line 106
Follow root AGENTS.md for release and tarball checks when public packages change.
- Distinctive: line 109
Keep mocked or skipped checks distinct from real-browser and production-app proof.
“Common” is measured: kept by at least 6 in 10 of the 171 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
Fast Link testing
Protect observable contracts with the smallest maintainable test surface. Adapted from Eve's test-audit.
- For audits or cleanup, read Audit and cleanup.
- Apply the shared rules below to authoring and auditing.
Authoring gate
Inspect the production owner, callers, and neighboring tests. State:
- Contract: observable inputs and outcomes, with source evidence.
- Regression: name a production fault and trace the exact assertion it breaks.
- Placement: the test layer and failure existing tests cannot catch.
Keep exhaustive cases with their owner:
- Core: eligibility, event ordering, click suppression, cleanup.
- React: refs and controller lifecycle.
- Next: Link and region adaptation to App Router.
- Test adapter failures without replaying core's eligibility matrix.
- Keep observable ordering and counts that detect early or duplicate navigation, or broken cleanup.
Choose the surface
- Use the cheapest layer that exposes the regression.
- Read package scripts, Vitest configs, and
turbo.jsonfor environments and build prerequisites. - Give each contract one primary test owner. Additional layers need a distinct failure to catch.
- Example: a spec checks the router's
replaceargument; a production fixture checks back-stack behavior.
Specs
- Prove decisions, controller state, adapter arguments, React rerenders, and cleanup.
- Colocate
*.test.ts/*.test.tsxwith the owner; root tooling usesscripts/**/*.spec.mjs. - Package specs use Vitest's
unitproject in jsdom. Synthetic events prove supplied-event handling, not native activation.
Browser tests
- Prove native targeting, capture/bubbling, trusted press/release sequences, default navigation, and browser differences.
scripts/browser/core.pw.mjstests built core with Playwright Test cases in Chromium, Firefox, and WebKit.- Use browser input for native activation claims;
dispatchEventremains synthetic in a browser. - Keep cases whose browser boundary adds proof.
Real app fixtures
- Prove actual Next Link/router behavior, hydration, history, scroll, base paths, prefetch, and composed navigation.
- Extend
fixtures/next-16andscripts/browser/next.pw.mjs; keep the production app pinned. - Router mocks cannot establish real framework behavior.
- Preserve
fixtures/coreto verify the built public core package in Node without framework or browser globals. - Use
fixtures/reactto verify SSR through the built public React package without DOM globals.
Assertion value
- Exercise production behavior; derive expected outcomes independently from its contract.
- Reject self-comparisons, assertion-free probes, and expectations copied from the tested algorithm.
- Mock only the unavailable boundary; keep the asserted behavior real.
- A mock supplying its own asserted result proves setup. Next's hand-written Link/router mocks prove adapter wiring only (
packages/next/src/testing/setup.ts). - Give each test one scenario and enough assertions to distinguish its failure.
- Prefer exact outcomes over truthiness or existence. Avoid asserting a whole value and every field without a distinct failure to catch.
- Extend tables for equivalent input/output cases; keep distinct lifecycle or event sequences separate.
- Give each table row a meaningful boundary or failure.
- Test through the owning module or consumer so behavior-preserving refactors retain coverage.
- Keep helpers local; add production exports or options only for production needs.
- Check static contracts against the actual artifact structurally when runtime execution is impractical.
- Example: retain real release-workflow prerequisite guards. Synthetic mutations testing a test-local validator add no production proof unless it is production validation code.
- For bug fixes, observe failure on pre-fix behavior for the intended reason, then a pass after repair.
- Exclude unrelated exceptions, missing servers, or mock rejections as regression proof. Report unavailable pre-fix checks.
Setup and isolation
- Keep arrange, act, and assert visible.
- Share small setup helpers; leave scenarios and expectations at call sites.
- Prefer local setup over mutable suite state or helpers with many switches.
- Reset mocks, DOM, listeners, controllers, and browser resources for independent, order-insensitive tests.
- Use teardown or
finallyto clean up even after assertion failure.
Waits and browser runners
- Wait for observable readiness or completion with bounded timeouts.
- Use fake timers for timer contracts in specs.
- Before negative assertions, establish completion of the relevant event or operation.
- Explain the limits of necessary observation windows; elapsed sleep alone does not establish completion.
- Give browser scenarios separate identities and fresh contexts where state can leak.
- Share builds and production servers when appropriate.
- Use Playwright Test fixtures and locator assertions for browser scenarios.
- The Next global setup reuses
startFixture; preserve one production server per invocation and the benchmark consumer. - See browser suite commands and diagnostics.
Coverage
- Use uncovered branches to find missing contracts; executed lines alone do not prove behavior.
- Run
pnpm coverageto measure package production files with the configured V8 provider; inspect includes and exclusions before interpreting results. - Base scoped thresholds on that baseline and risk. Avoid invented percentages or assertions added to satisfy a number.
- Report measurement limits. A missing threshold alone is not a test-quality defect.
Verify and report
- After edits, run focused owner tests, then required
pnpm validate. - Follow root
AGENTS.mdfor release and tarball checks when public packages change. - For read-only advice or review, report the checks supporting each conclusion.
- Report commands, observed results, and untested browser/app contracts.
- Keep mocked or skipped checks distinct from real-browser and production-app proof.
Other versions191 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 191
- 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
181 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
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.

