|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Instructions for coding agents working in this repository, per the |
| 4 | +[agents.md](https://agents.md/) convention. Agents read the nearest AGENTS.md in |
| 5 | +the directory tree, so a package in a monorepo can add its own. |
| 6 | + |
| 7 | +> This file is hand-written and is never generated. The **public** agent routing |
| 8 | +> document — the one served at `/AGENTS.md` for external developers and their |
| 9 | +> agents — is `public/AGENTS.md`, generated by `scripts/agents.mjs`. Do not edit |
| 10 | +> that one by hand; your changes will be overwritten on the next commit that |
| 11 | +> mentions `agents.md`. |
| 12 | +
|
| 13 | +## Setup commands |
| 14 | + |
| 15 | +- Install deps: `npm install` |
| 16 | +- Start dev server: `npm run dev` |
| 17 | +- Build: `npm run build` |
| 18 | +- Install git hooks (once per clone): `./githooks/install.sh` |
| 19 | + |
| 20 | +## Generated files — do not edit |
| 21 | + |
| 22 | +These are written by `scripts/llms.mjs` and `scripts/agents.mjs`: |
| 23 | + |
| 24 | +- `public/llms.txt` |
| 25 | +- `public/llms-full.txt` |
| 26 | +- `public/AGENTS.md` |
| 27 | + |
| 28 | +To change their contents, edit the source instead: |
| 29 | + |
| 30 | +- **A page's title or description** → that route's `export const metadata` in |
| 31 | + its `page.tsx`. This is the same metadata Next uses for SEO, so there is one |
| 32 | + source of truth rather than two. |
| 33 | +- **Ordering, sections, network reference, routing rules, freshness** → |
| 34 | + `llms.config.mjs`. |
| 35 | +- **Hand-written prose inside `llms-full.txt`** → edit between the |
| 36 | + `<!-- LLMS_EXTRAS_START -->` and `<!-- LLMS_EXTRAS_END -->` markers directly |
| 37 | + in `public/llms-full.txt`. That region is preserved verbatim across |
| 38 | + regenerations; everything outside it is not. |
| 39 | + |
| 40 | +Check whether they are current: `npm run llms -- --check` |
| 41 | + |
| 42 | +## Regenerating |
| 43 | + |
| 44 | +Include `llms.txt` or `agents.md` in your commit message and the post-commit |
| 45 | +hook regenerates and creates one follow-up commit: |
| 46 | + |
| 47 | +``` |
| 48 | +git commit -m "feat: add snapshots page; updates llms.txt" |
| 49 | +``` |
| 50 | + |
| 51 | +Adding, deleting, or renaming a `page.tsx` triggers it automatically. To opt out |
| 52 | +of a single commit, use `SKIP_DOCS_HOOK=1` or put `[skip-docs]` in the message. |
| 53 | + |
| 54 | +## Code style |
| 55 | + |
| 56 | +<!-- Replace with this project's real conventions. --> |
| 57 | + |
| 58 | +- TypeScript strict mode |
| 59 | +- Follow the existing formatter config; do not reformat unrelated files |
| 60 | + |
| 61 | +## Testing |
| 62 | + |
| 63 | +- Run the llms-kit suite: `node --test tests/` |
| 64 | +- Include liveness checks against the deployed site: `LLMS_LIVE=1 node --test tests/` |
| 65 | + |
| 66 | +## Pull requests |
| 67 | + |
| 68 | +- Keep the generated-file commit separate from your own work — the hook already |
| 69 | + does this for you. Do not squash it away; it is what makes the generated diff |
| 70 | + reviewable. |
0 commit comments