agentleFS
icoretechicoretech/airbroke/__tests__/AGENTS.md

airbroke / __tests__

AGENTS.md221 starsChanged 6 months agoMITView on GitHub

All Vitest tests live here and mirror runtime boundaries. Tests run serially in the dedicated test service against testdb, never the development database. - Use // @vitest-environment node for server-only route, auth, or SDK tests; the default environment is jsdom. - Run deterministic checks with docker compose -f docker-compose.yml --profile test run --rm test yarn test --run; the test service is one-shot and starts its dedicated database through the profile. - Keep tests under this tree rather than beside Next…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 1 is common, 4 are distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All Vitest tests live here and mirror runtime boundaries.

    line 5
  2. Very specific:

    Use // @vitest-environment node for server-only route, auth, or SDK tests.

    line 31
  3. Very specific:

    Run deterministic checks with docker compose -f docker-compose.yml --profile test run --rm test yarn test --run.

    line 33
  4. Distinctive:

    Keep tests under this tree rather than beside Next application source.

    line 37
  5. Very specific:

    Prefer real NextRequest, parser, generated client, or narrow collaborator calls at drift-prone boundaries.

    line 40
  6. Very specific:

    Do not execute tests through web.

    line 48
  7. Distinctive:

    Do not rely on file concurrency or test order.

    line 49
  8. Common:

    Do not test only accepted input when changing auth, origin/CORS, collector, MCP, payload-limit, or credential behavior.

    line 51
  9. Distinctive:

    Do not assert redirect behavior by replacing the repository navigation helper with a one-off incompatible mock.

    line 53
  10. Distinctive:

    Do not treat coverage inclusion as proof of behavioral coverage.

    line 55

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md 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.

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

TEST GUIDE

OVERVIEW

All Vitest tests live here and mirror runtime boundaries. Tests run serially in the dedicated test service against testdb, never the development database.

STRUCTURE

api/         # Collector, completion, and MCP route contracts
components/  # Maintained React component behavior
lib/         # Auth, actions, queries, intake, routing, and SDK contracts
pages/       # Page-level rendering and authentication behavior
factories/   # Prisma-backed unique fixture builders
helpers/     # Next navigation and HTTP capture boundaries
proxy.test.ts

WHERE TO LOOK

TaskLocationNotes
Configuration../vitest.config.mjsjsdom, serial execution
Navigationhelpers/nextNavigation.tsnext/navigation alias
DB fixturesfactories/prismaFactories.tsUnique attributes
Collectorsapi/ and lib/Accepted/rejected flows

CONVENTIONS

  • Use // @vitest-environment node for server-only route, auth, or SDK tests; the default environment is jsdom.
  • Run deterministic checks with docker compose -f docker-compose.yml --profile test run --rm test yarn test --run; the test service is one-shot and starts its dedicated database through the profile.
  • Keep tests under this tree rather than beside Next application source.
  • Match the touched runtime boundary: route handlers under api/, domain logic under lib/, components under components/, and pages under pages/.
  • Prefer real NextRequest, parser, generated client, or narrow collaborator calls at drift-prone boundaries. Mock database or external services only where the test's subject is the surrounding contract.
  • Factories must preserve uniqueness across the whole serial suite; continue using UUID-backed values for unique columns.

ANTI-PATTERNS

  • Do not execute tests through web; its DATABASE_URL targets development.
  • Do not rely on file concurrency or test order; shared database state has no global transaction/truncation harness.
  • Do not test only accepted input when changing auth, origin/CORS, collector, MCP, payload-limit, or credential behavior.
  • Do not assert redirect behavior by replacing the repository navigation helper with a one-off incompatible mock.
  • Do not treat coverage inclusion as proof of behavioral coverage; there is no configured coverage threshold.

Download now (ZIP)

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.