Found while running the docs dev server to render-verify a sidebar change (#10209). Filed unassigned; not fixed there — out of that card's file surface.
What happens
Booting the documented docs dev server (pnpm docs:dev → next dev, Next 16.3.1) creates two files that are untracked and not gitignored:
?? apps/docs/AGENTS.md
?? apps/docs/CLAUDE.md
The server announces it:
✓ Generated AGENTS.md and CLAUDE.md for AI agents. Set `agentRules: false` in next.config to disable.
Content is a Next.js-authored block, self-describing:
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
... Read the relevant guide in `node_modules/next/dist/docs/` ...
This block is written and re-added by `next dev` — verify at
`node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff
only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->
Verified on origin/main @ 502dc6fe7135:
git ls-files apps/docs | grep -iE 'AGENTS|CLAUDE' → nothing trackedgit check-ignore -v apps/docs/AGENTS.md apps/docs/CLAUDE.md → not ignoredgrep -n agentRules apps/docs/next.config.mjs → not set- Neither file exists in a checkout that has not run
next dev
Why it is worth a card
AGENTS.md and CLAUDE.md are load-bearing filenames in this repo — the root ones are the binding playbook, and agents are instructed to read the AGENTS.md governing the files they touch. A tool-generated stub at apps/docs/AGENTS.md that says "read node_modules/next/dist/docs/" is not this repo's discipline, and an agent working in apps/docs may read it as if it were.
The delivery risk is the ordinary one: any agent that boots the docs dev server and then runs git add -A (or git commit -a) lands both files in an unrelated PR. Nothing currently prevents that — no ignore rule, no gate. Note Next's own text actively argues for committing them, so an agent that reads the file before deciding is nudged the wrong way for this repo.
Options (not decided here — taxonomy call)
- Ignore them — add both paths to
.gitignore (or apps/docs/.gitignore). Cheapest; keeps the tree clean for every agent; loses the Next guidance. - Disable generation —
agentRules: false in apps/docs/next.config.mjs. Removes the surprise at the source; the files never appear. - Track them deliberately — commit both, with a repo-authored header pointing at the real
AGENTS.md so the stub cannot mislead. Highest effort; only worth it if the Next guidance is judged useful here.
My read is 2 or 1: the docs app is not where agents need Next-version guidance, and neither option costs anything to maintain. But which one is a devx-seat preference, not something to settle inside an unrelated nav card.
Repro: pnpm --filter @objectstack/docs dev (any port), then git status --porcelain.
Found while running the docs dev server to render-verify a sidebar change (#10209). Filed unassigned; not fixed there — out of that card's file surface.
What happens
Booting the documented docs dev server (
pnpm docs:dev→next dev, Next16.3.1) creates two files that are untracked and not gitignored:The server announces it:
Content is a Next.js-authored block, self-describing:
Verified on
origin/main@502dc6fe7135:git ls-files apps/docs | grep -iE 'AGENTS|CLAUDE'→ nothing trackedgit check-ignore -v apps/docs/AGENTS.md apps/docs/CLAUDE.md→ not ignoredgrep -n agentRules apps/docs/next.config.mjs→ not setnext devWhy it is worth a card
AGENTS.mdandCLAUDE.mdare load-bearing filenames in this repo — the root ones are the binding playbook, and agents are instructed to read theAGENTS.mdgoverning the files they touch. A tool-generated stub atapps/docs/AGENTS.mdthat says "readnode_modules/next/dist/docs/" is not this repo's discipline, and an agent working inapps/docsmay read it as if it were.The delivery risk is the ordinary one: any agent that boots the docs dev server and then runs
git add -A(orgit commit -a) lands both files in an unrelated PR. Nothing currently prevents that — no ignore rule, no gate. Note Next's own text actively argues for committing them, so an agent that reads the file before deciding is nudged the wrong way for this repo.Options (not decided here — taxonomy call)
.gitignore(orapps/docs/.gitignore). Cheapest; keeps the tree clean for every agent; loses the Next guidance.agentRules: falseinapps/docs/next.config.mjs. Removes the surprise at the source; the files never appear.AGENTS.mdso the stub cannot mislead. Highest effort; only worth it if the Next guidance is judged useful here.My read is 2 or 1: the docs app is not where agents need Next-version guidance, and neither option costs anything to maintain. But which one is a devx-seat preference, not something to settle inside an unrelated nav card.
Repro:
pnpm --filter @objectstack/docs dev(any port), thengit status --porcelain.