agentleFS
mcowgermcowger/plexus/AGENTS.md

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

    Use the listed command/workflow exactly.

    line 9
  2. Very specific:

    Use the built-in search tool to query .repomap.txt by symbol, keyword, or path.

    line 11
  3. Very specific:

    NEVER: use --no-verify or LEFTHOOK=0 without user permission.

    line 15
  4. Very specific:

    NEVER: run tsc/tsgo directly. Type checking is bun run typecheck (backed by bun check).

    line 17
  5. Very specific:

    Before editing schema files, read the db-schema-migrations skill.

    line 25
  6. Distinctive:

    Before writing code, read packages/backend/AGENTS.md for the end-to-end checklist (auth module, facade registration, dispatch, quota …

    line 30
  7. Very specific:

    Before editing tests, read docs/TESTING.md for Plexus test placement, mocks, spies, and singleton resets.

    line 34
  8. Very specific:

    All test files share one process under plain bun test, so a leak in one file fails others.

    line 36
  9. Very specific:

    Never mock.module() first-party code: Use spyOn in a top-level beforeEach (auto-restored).

    line 38
  10. Very specific:

    Fake timers: use advanceTimersByTimeAsync from test/test-utils.ts for async code.

    line 41
  11. Very specific:

    Frontend DOM tests: call useHappyDom() (packages/frontend/test/happydom.ts).

    line 42
  12. Distinctive:

    Before editing frontend code, read packages/frontend/AGENTS.md for CSS, assets, and component rules.

    line 47
  13. Very specific:

    After editing anything a user sees in the browser (React, routes, forms, CSS, layout, or any file under packages/frontend/src), use the …

    line 49
  14. Distinctive:

    Run these commands from the repository root:

    line 53
  15. Very specific:

    Stop the agent dev stack: bun run dev:stop

    line 57
  16. Distinctive:

    After code changes, run relevant tests, typecheck, and format check using the commands above.

    line 69

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

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

Plexus agent rules

This file is a guardrail, not general documentation.

Use order:

  1. Read Critical rules.
  2. Match the task in Task triggers.
  3. 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-verify or LEFTHOOK=0 without user permission.
  • NEVER manually create or edit migration artifacts.
  • NEVER run tsc/tsgo directly. Type checking is bun run typecheck (backed by bun 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-cli skill for the fallback workflow: MCP first, CLI second, REST API last. For live CLI debugging of staging, use the worktree .env values PLEXUS_STAGING_URL and PLEXUS_ADMIN_KEY. This is separate from scripts/prep-dev.ts, which uses PLEXUS_STAGING_ADMIN_KEY for staging imports and PLEXUS_ADMIN_KEY for 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. Use spyOn in a top-level beforeEach (auto-restored). Shared logger/pi-ai mocks live in packages/backend/test/mocks.ts.
  • Never assign global.fetch (use spyOn(globalThis, 'fetch').mockImplementation(asFetch(…)) with real Response objects). Undo any other global, process.env value, fake timer, or system date you change.
  • Don't create expect(p).rejects / .resolves before the statement that settles p — it deadlocks the run at 100% CPU. Trigger first, assert after (or capture with .then).
  • Fake timers: use advanceTimersByTimeAsync from test/test-utils.ts for async code; setSystemTime() (not toFake) to freeze the date; never Bun.sleep/waitFor under fake timers.
  • Frontend DOM tests call useHappyDom() (packages/frontend/test/happydom.ts); never register happy-dom as an import side effect.
  • Run plain bun test before 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=HEAD for affected-only)
  • Type check: bun run typecheck (uses bun check; never tsc)
  • Format: bun run format (or bun fmt directly)
  • 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).

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.