agentleFS
VercelKnown publishervercel-labs/fast-link/.agents/skills/testing/SKILL.md

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
  1. Distinctive:

    Keep exhaustive cases with their owner:

    line 23
  2. Distinctive:

    Test adapter failures without replaying core's eligibility matrix.

    line 28
  3. Distinctive:

    Keep observable ordering and counts that detect early or duplicate navigation, or broken cleanup.

    line 29
  4. Distinctive:

    Use the cheapest layer that exposes the regression.

    line 33
  5. Very specific:

    Read package scripts, Vitest configs, and turbo.json for environments and build prerequisites.

    line 34
  6. Very specific:

    Use browser input for native activation claims.

    line 48
  7. Distinctive:

    Keep cases whose browser boundary adds proof.

    line 49
  8. Very specific:

    Use fixtures/react to verify SSR through the built public React package without DOM globals.

    line 57
  9. Distinctive:

    Prefer exact outcomes over truthiness or existence.

    line 66
  10. Distinctive:

    Test through the owning module or consumer so behavior-preserving refactors retain coverage.

    line 69
  11. Distinctive:

    Keep helpers local; add production exports or options only for production needs.

    line 70
  12. Distinctive:

    Check static contracts against the actual artifact structurally when runtime execution is impractical.

    line 71
  13. Distinctive:

    Keep arrange, act, and assert visible.

    line 78
  14. Distinctive:

    Prefer local setup over mutable suite state or helpers with many switches.

    line 80
  15. Very specific:

    Use teardown or finally to clean up even after assertion failure.

    line 82
  16. Distinctive:

    Wait for observable readiness or completion with bounded timeouts.

    line 86
  17. Distinctive:

    Use fake timers for timer contracts in specs.

    line 87
  18. Distinctive:

    Before negative assertions, establish completion of the relevant event or operation.

    line 88
  19. Distinctive:

    Use Playwright Test fixtures and locator assertions for browser scenarios.

    line 92
  20. Distinctive:

    Use uncovered branches to find missing contracts.

    line 98
  21. Very specific:

    Run pnpm coverage to measure package production files with the configured V8 provider.

    line 99
  22. Very specific:

    After edits, run focused owner tests, then required pnpm validate.

    line 105
  23. Distinctive:

    Follow root AGENTS.md for release and tarball checks when public packages change.

    line 106
  24. Distinctive:

    Keep mocked or skipped checks distinct from real-browser and production-app proof.

    line 109

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.json for 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 replace argument; a production fixture checks back-stack behavior.

Specs

  • Prove decisions, controller state, adapter arguments, React rerenders, and cleanup.
  • Colocate *.test.ts / *.test.tsx with the owner; root tooling uses scripts/**/*.spec.mjs.
  • Package specs use Vitest's unit project 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.mjs tests built core with Playwright Test cases in Chromium, Firefox, and WebKit.
  • Use browser input for native activation claims; dispatchEvent remains 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-16 and scripts/browser/next.pw.mjs; keep the production app pinned.
  • Router mocks cannot establish real framework behavior.
  • Preserve fixtures/core to verify the built public core package in Node without framework or browser globals.
  • Use fixtures/react to 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 finally to 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 coverage to 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.md for 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.

Download now (ZIP)

  • Other versions191 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 191

    1. modelcontextprotocol/servers★ 92ksame name
    2. lobehub/lobe-chat★ 84ksame name
    3. lobehub/lobehub★ 84ksame name
    4. penpot/penpot★ 62ksame name
    5. meteor/meteor★ 45ksame name
    6. iOfficeAI/AionUi★ 34ksame name
    7. garrytan/gbrain★ 31ksame name
    8. OpenZeppelin/openzeppelin-contracts★ 27ksame name
    9. tursodatabase/turso★ 25ksame name
    10. 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.
    • MicrosoftSkill

      bundle-dependency-prs

      Fix broken dependency update PRs and aggregate the ones that work into one PR.

      Also in 6 projects that use this

    • MicrosoftSkill

      update-library-template

      Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.

      Also in 6 projects that use this

    • zetaloopSkill

      assign-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

    • timmo001Skill

      changeset-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

    • JetBrainsSkill

      module-dependencies

      Add or modify IntelliJ module dependencies in `.iml` files.

      Also in 3 projects that use this

    • CES-LtdSkill

      oss-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 repository2 other files it gives its agents.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.