@AGENTS.md
Routerly is a self-hosted LLM API gateway (TypeScript ESM monorepo, Node ≥20, Fastify 5, React 18 + Vite 6, Commander 14).
Full context is in ai/. Read AGENTS.md first, then the agent file for your current scope.
AGENTS.md contains the full bootstrap procedure: if AGENTS.local.md is absent, create it automatically from ~/.routerly/config/ without asking the developer.
| Working in | Read first |
|---|---|
packages/service/ |
ai/agents/service.md |
packages/dashboard/ |
ai/agents/frontend.md |
packages/cli/ |
ai/agents/cli.md |
docs/ |
ai/agents/docs.md |
- TypeScript imports must use
.jsextension —import { x } from './foo.js' - Node builtins must use
node:prefix —import { readFile } from 'node:fs/promises' - No
require()anywhere - Config writes go through
writeConfig()— neverfs.writeFiledirectly - Test files are
*.test.ts— never*.spec.ts afterEach(() => vi.clearAllMocks())whenevervi.mock()is used- Never alter the OpenAI/Anthropic wire format forwarded to clients
- No new npm dependencies without ESM compatibility check
- Test before done: every feature added, modified, or deleted must pass
npm test --workspace=packages/<affected>+npm run typecheckbefore the task is complete. If tests fail, fix them — do not close the task with a red test suite. - Autoimprove: run Hook 1 (pre-task review) and Hook 2 (post-task capture) — see
ai/skills/autoimprove/SKILL.md.
feat(scope): description — lowercase, conventional commits.