AGENTS.md
Instructions for coding agents working in this repository. Humans: the same rules, with more context, are in CONTRIBUTING.md.
Everdoc compiles a repository into an architecture atlas (static site, llms.txt, Markdown, MCP data)
by static analysis. Its output is trusted because it is reproducible. Every rule below protects that.
Hard constraints
- Determinism. The same commit and config produce byte-identical
snapshot.json, Markdown, andllms.txt. No wall-clock time, randomness, unordered map or set iteration, locale-dependent sorting, or absolute machine paths in any output. Sort everything that reaches an output explicitly, in code-point order; serialize snapshots withcanonicalStringifyfrom@everdoc/ir. - No LLM by default.
llm.mode: "off"is the default, and withmode: "surgical"but no API key, summaries are skipped. Every feature must work, and be tested, with no model and no network. AI summaries are an optional overlay keyed by content hash; nothing else may depend on them. - No repository-specific code. Never name, special-case, or tune for a specific repository in
packages/*/src, including the showcases and Everdoc itself. Recognize framework APIs, not project names or paths. A test scans everysrctree for showcase names. Fixtures use inventedacme-style projects. - Layering.
@everdoc/irhas zero runtime dependencies. Packages depend only on lower layers:ir → sdk, diff, llms → engine, extractors-*, mcp, summarize → site → cli. Extractor packs stay generic recognizers. - Page weight. On the T3 Code benchmark, keep
/and/<channel>/architectureunder 100 KB of HTML and/<channel>/flowsand/<channel>/reference/envunder 80 KB. Datasets go to/<channel>/data/*.jsonand load on demand; never inline them in island props. Repeated styling goes intopackages/site/src/stylesas a shared class, not as long utility strings on every row. Anything added toLayout.astrolands on every page, so it costs bytes on all ~1,000 of them. - Secrets. Tokens never reach snapshots, HTML, Markdown, logs, error messages, or
.git/config. Read them from the environment variable the config names; pass them to git throughGIT_CONFIG_*environment entries, never on a command line. - Honest output. When something cannot be resolved statically, emit less (a partial flow, a diagnostic), never a guessed entity, edge, or description.
Working in the code
- Extend the existing owner of a concern before adding a new module; when you replace a code path, migrate its callers and delete the old one in the same change.
- Islands (
packages/site/src/islands) hydrate in the browser and ship JavaScript; views (packages/site/src/views) render to HTML only. Prefer views. - Markdown for agents is rendered by
@everdoc/llmsand shared by the CLI, the site, and the MCP server. Change it there, once. - New config options go through
@everdoc/sdk: the type, validation with a precise issue message, the resolved default, and a test.
Required verification before a pull request
Run all of these from the repository root, and wait for each to finish:
pnpm build
pnpm typecheck
pnpm test
pnpm pack:checkFor any change under packages/site, also build a real atlas, serve it, and check it in a headless
browser: zero console errors, zero page errors, zero failed requests, and screenshots of the changed
pages in light and dark themes (and at a mobile width when layout changed). Check the HTML size of the
budgeted pages above when you touch the layout or a page they render.
Report what you ran and what you saw. If a check could not run, say so; do not describe it as passing.
Pull requests
- Conventional commits:
feat:,fix:,perf:,refactor:,test:,docs:,ci:,chore:, with the package as scope (feat(site): …). - One focused change per pull request, with tests for new behavior and a failing-first test for bugs.
- Fill in the pull request template, including screenshots for UI changes. Tick only the checks you ran.
- The Everdoc PR check comments on every pull request with the structural diff (APIs, env vars, CLI flags, layer violations, docs drift). Explain any breaking change it reports.