# AGENTS.md Guidance for coding agents working in this repository — Claude Code, Codex, Cursor, Copilot, or anything else that reads this file. The same rules apply to humans; [CONTRIBUTING.md](CONTRIBUTING.md) covers setup and the PR flow. ## How to work **Build the smallest thing that covers today's behavior.** Don't add UI affordances nobody asked for. Don't parameterize or scope for cases the runtime never exercises (per-workspace state in a single-workspace extension, per-folder watchers with an identical glob). Don't add machinery for hypothetical futures. If you think generality will be needed later, say so and leave it out — it can be added when something actually requires it. **Verify before you recommend, not just before you implement.** "We should add X" is a claim about the current code. Read the code first: grep for the thing, check whether it already exists, confirm the bug is real. This applies to analysis and recommendations, not only to features. **Plan before code on anything non-trivial.** Write the approach to `.agent/current-plan.md` (gitignored) before changing anything and keep it updated as work progresses. Show the plan itself, not a narration of producing it. **Answer the question that was asked.** If the contributor is asking rather than instructing, answer and stop. Don't start editing because a question implies work. **Be honest and objective.** Evaluate suggestions on their technical merits. Don't be complimentary by reflex. If something doesn't make sense or could be better, say so directly and challenge the assumption — that's more useful than agreement. **Keep output short.** Terminal output and files alike. No preamble, no restating what you just did, no summary table for a three-line change. Every sentence must earn its place. **Prefer doing over delegating.** The test suite runs as one command and the codebase is small enough to read. Spawn subagents only when the work genuinely fans out across independent areas. **Never lose existing content.** Through rewrites, reverts, or unrelated changes — if you're replacing a document or backing something out, preserve what was there and say what you dropped. **Nothing leaves the machine unless the contributor says so.** No pushes, PRs, issues, comments, or releases unless explicitly asked for in that same exchange. Cut branches from `origin/main` (fetch first — a local `main` may carry unpushed work), commit locally, and hand over a ready-to-paste PR title and description. Reading GitHub with `gh` is fine. ## Specs Work that warrants acceptance criteria before code gets a spec in `specs//`. `spec.md` is what and why and is reviewer-visible; `plan.md` is how, and a code reviewer must not read it — a reviewer who knows the intended approach checks the code against the plan instead of checking whether it's right. `specs.local/` is the same layout, gitignored, for exploration that hasn't graduated. `` is the branch name minus its type prefix (`feature/`, `fix/`, `spike/`), so the active spec is the one matching the current branch. One branch and one PR carry a feature from spec to merge. Labelling an issue `agent:spec` opens that PR; from then on the stages run from `@claude` comments on it (`@claude plan`, `@claude implement`), because once the PR exists it is both the queue entry and the place to say what you want done differently. Not everything needs a spec — a bug whose failing test says it all doesn't. See [specs/README.md](specs/README.md) for the layout and the acceptance-criteria format. **Writing one is a procedure, not a blank page**: [.claude/skills/write-spec/SKILL.md](.claude/skills/write-spec/SKILL.md) has it — classify the work, research before claiming, keep solutions out of the spec, be honest about how each criterion gets verified. Read it whichever agent you are; Claude Code loads it as `/write-spec`. ## Environment Yarn v1 workspaces + Lerna. Node 22 (`.nvmrc`): `nvm use` from the repo root is enough — don't source `nvm.sh`, export `NVM_DIR`, or pin another version. Run `yarn` then `yarn build` from the root before anything else. **Prefer simple commands.** Compound, chained, or piped commands often need manual approval, which breaks autonomous runs. Default to one single-purpose command per call. Don't wrap things in `bash -c` or `eval`, and don't add defensive `|| true` or `2>/dev/null` unless an expected failure is actually being handled. Don't staple extra steps onto a request (no `git log` after a requested `git status`). Compound is fine where genuinely needed: atomic operations (`git add X && git commit`), pipes that are the interface (`find | xargs`, `cmd | jq`), heredocs, and loops over many items. ## Commands From the repo root, each runs across every package via Lerna: `yarn build`, `yarn watch`, `yarn clean`, `yarn reset` (clean, install, build), `yarn test:unit`, `yarn test:e2e`, `yarn test`, `yarn lint`, `yarn bench`, `yarn format`. Per package: `yarn workspace