agentRules
Configure whether Next.js creates instructions for AI coding agents.
The agentRules option controls whether next dev creates and updates version-matched documentation instructions for detected AI coding agents. It is enabled by default.
Set agentRules to false to disable this behavior:
Generated agent instructions
When agentRules is enabled and next dev detects an AI coding agent, Next.js creates or updates this managed block in AGENTS.md:
The managed block directs agents to documentation bundled with the installed Next.js version. Next.js updates only the content between the markers and preserves the rest of the file.
Disable agent rules
Set agentRules to false to stop next dev from creating or updating the managed block. The next next dev run removes the existing agent rules block and preserves all other content, even when no agent is detected. If the file contained only the managed block, Next.js deletes the file instead of leaving it empty.
To prevent create-next-app from creating agent files in a new project, pass the --no-agents-md option.
agentRules and experimental.agentFeedback work independently. Changing one option does not affect the other.
Version History
| Version | Changes |
|---|---|
v16.4.0 | Setting agentRules to false removes an existing managed block on next dev. |
v16.3.0 | agentRules configuration option added. |