Skip to content
SprecherEast
Issue 194

process: Keep Next 16's agent-docs block in AGENTS.md (or rule it out)

Back to our plan
Done
processtoolingpriority: medium

Type

process

Summary

From Next.js 16.2, next dev appends a block to AGENTS.md whenever a coding agent runs it. The block says to read the version-matched Next.js docs in node_modules/next/dist/docs/ before writing code. Until the block is committed, every agent that runs the dev server finds AGENTS.md modified, and could commit it by accident.

Problem

AGENTS.md is a policy file, so an agent can't add the block on its own. Removing it doesn't help: next dev writes it again. The writer is node_modules/next/dist/server/lib/generate-agent-files.js, and it only runs when an agent is detected. It has no setting to turn it off.

Proposed fix

Choose one:

  • Commit the block as Next writes it (recommended). Agents then read the docs for the installed Next.js version, and the tree stays clean. The block is about 8 lines and tool-neutral.
  • Leave AGENTS.md as it is, and add a line telling agents never to commit the generated block.

Acceptance criteria

  • Not done: The owner picks an option.
  • Not done: After next dev runs under an agent, git status shows AGENTS.md unchanged (option 1), or the rule is written down (option 2).

Depends on

#120 (Next 16)

Area

tooling

Priority

priority: medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab