plexus
AGENTS.md238 starsChanged 10 days agoMITView on GitHub
This file is a guardrail, not general documentation. Use the built-in search tool to query .repomap.txt by symbol, keyword, or path; never load the whole index. Read the matching source files to verify the implementation. For broader architectural questions, search the repository directly. Before editing schema files, read the db-schema-migrations skill. Local validation with bun run generate-migrations is optional. Leave generated artifacts in place and uncommitted; follow the skill for the full workflow. Before writing code, read packages/backend/AGENTS.md for the…
- Reads credentials
We split this AGENTS.md into the rules it gives an agent
16 rules. About 0 are common, 5 are distinctive, and 11 are 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.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use the listed command/workflow exactly.
- Very specific: line 11
Use the built-in search tool to query .repomap.txt by symbol, keyword, or path.
- Very specific: line 15
NEVER: use --no-verify or LEFTHOOK=0 without user permission.
- Very specific: line 17
NEVER: run tsc/tsgo directly. Type checking is bun run typecheck (backed by bun check).
- Very specific: line 25
Before editing schema files, read the db-schema-migrations skill.
- Distinctive: line 30
Before writing code, read packages/backend/AGENTS.md for the end-to-end checklist (auth module, facade registration, dispatch, quota …
- Very specific: line 34
Before editing tests, read docs/TESTING.md for Plexus test placement, mocks, spies, and singleton resets.
- Very specific: line 36
All test files share one process under plain bun test, so a leak in one file fails others.
- Very specific: line 38
Never
mock.module()first-party code: Use spyOn in a top-level beforeEach (auto-restored). - Very specific: line 41
Fake timers: use advanceTimersByTimeAsync from test/test-utils.ts for async code.
- Very specific: line 42
Frontend DOM tests: call useHappyDom() (packages/frontend/test/happydom.ts).
- Distinctive: line 47
Before editing frontend code, read packages/frontend/AGENTS.md for CSS, assets, and component rules.
- Very specific: line 49
After editing anything a user sees in the browser (React, routes, forms, CSS, layout, or any file under packages/frontend/src), use the …
- Distinctive: line 53
Run these commands from the repository root:
- Very specific: line 57
Stop the agent dev stack: bun run dev:stop
- Distinctive: line 69
After code changes, run relevant tests, typecheck, and format check using the commands above.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 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.
Files
Plexus agent rules
This file is a guardrail, not general documentation.
Use order:
- Read Critical rules.
- Match the task in Task triggers.
- Use the listed command/workflow exactly.
Use the built-in search tool to query .repomap.txt by symbol, keyword, or path; never load the whole index. Read the matching source files to verify the implementation. For broader architectural questions, search the repository directly.
Critical rules
- NEVER use
--no-verifyorLEFTHOOK=0without user permission. - NEVER manually create or edit migration artifacts.
- NEVER run
tsc/tsgodirectly. Type checking isbun run typecheck(backed bybun check). - NEVER produce implementation or summary documents unless specifically requested.
- DEBUGGING / ADMINISTERING Plexus instances: prefer the Plexus MCP tools when available for the target instance and required operation; they are more efficient than CLI or raw REST calls. Read the
plexus-cliskill for the fallback workflow: MCP first, CLI second, REST API last. For live CLI debugging ofstaging, use the worktree.envvaluesPLEXUS_STAGING_URLandPLEXUS_ADMIN_KEY. This is separate fromscripts/prep-dev.ts, which usesPLEXUS_STAGING_ADMIN_KEYfor staging imports andPLEXUS_ADMIN_KEYfor the local instance.
Task triggers
If the task changes database schema
Before editing schema files, read the db-schema-migrations skill.
Local validation with bun run generate-migrations is optional. Leave generated artifacts in place and uncommitted; follow the skill for the full workflow.
If the task adds an OAuth provider
Before writing code, read packages/backend/AGENTS.md for the end-to-end checklist (auth module, facade registration, dispatch, quota checker, model discovery, live-server verification). A working auth flow alone does not surface the provider anywhere.
If the task writes or updates tests
Before editing tests, read docs/TESTING.md for Plexus test placement, mocks, spies, and singleton resets. Tests use Bun's native test runner (bun:test); project rules take precedence over generic examples.
All test files share one process under plain bun test, so a leak in one file fails others. Hard rules (details and examples in TESTING.md):
- Never
mock.module()first-party code. UsespyOnin a top-levelbeforeEach(auto-restored). Shared logger/pi-ai mocks live inpackages/backend/test/mocks.ts. - Never assign
global.fetch(usespyOn(globalThis, 'fetch').mockImplementation(asFetch(…))with realResponseobjects). Undo any other global,process.envvalue, fake timer, or system date you change. - Don't create
expect(p).rejects/.resolvesbefore the statement that settlesp— it deadlocks the run at 100% CPU. Trigger first, assert after (or capture with.then). - Fake timers: use
advanceTimersByTimeAsyncfromtest/test-utils.tsfor async code;setSystemTime()(nottoFake) to freeze the date; neverBun.sleep/waitForunder fake timers. - Frontend DOM tests call
useHappyDom()(packages/frontend/test/happydom.ts); never register happy-dom as an import side effect. - Run plain
bun testbefore handing work back (CI uses--parallel, which hides leaks).
If the task changes frontend code
Before editing frontend code, read packages/frontend/AGENTS.md for CSS, assets, and component rules.
After editing anything a user sees in the browser (React, routes, forms, CSS, layout, or any file under packages/frontend/src), use the frontend-testing skill. Boot the worktree-safe dev stack, auto-log in, and verify rendering and behavior with a real browser before handing the work back.
Canonical project commands
Run these commands from the repository root:
- Dev server:
bun run dev - Dev stack for agents (background, worktree-safe):
bun run dev:agent --detach - Stop the agent dev stack:
bun run dev:stop - Tests:
bun test(Bun's native runner; add--changed=HEADfor affected-only) - Type check:
bun run typecheck(usesbun check; nevertsc) - Format:
bun run format(orbun fmtdirectly) - Format check:
bun run format:check - Format only changed files:
bun run format:changed
For lifecycle targets, ports, and FRP tunnels, read Development. For optional review commands, read Manual OpenCodeReview review; never invoke OpenCodeReview automatically during commits or install it just for a review.
Before handing work back
- After code changes, run relevant tests, typecheck, and format check using the commands above.
- For browser-visible changes, also complete the frontend verification workflow.
- For documentation-only changes, check links, command references, and formatting; don't boot the application or run unrelated tests.
- Report the checks run and their results. State any failures, skipped checks, or blockers explicitly; blocked verification is not a passing check.
Project overview
Plexus is a unified API gateway for LLMs built on Bun + Fastify. It exposes OpenAI- and Anthropic-compatible endpoints and routes requests to backend providers while handling request/response transformation. Stack: Bun, Fastify, Drizzle ORM (SQLite/Postgres), Zod, React frontend (Tailwind v4).
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 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 repository10 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-provider-presetSkill
- add-quota-checkerSkill
- agent-browserSkill
- batch-grill-meSkill
- db-schema-migrationsSkill
- frontend-testingSkill
- plexus-cliSkill
- plexus-rest-apiSkill
- to-ticketsSkill
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.

