Skip to content

Commit b592e6d

Browse files
fix: add AGENTS.md at package root for agent discovery (#92376)
### What? Add an `AGENTS.md` file at the npm package root (`node_modules/next/AGENTS.md`) so AI agents can discover the bundled documentation. ### Why? AI coding agents naturally check the package root for `AGENTS.md` before searching subdirectories. Without a file at the root, `cat node_modules/next/AGENTS.md` fails and agents hit a dead end. The bundled docs at `dist/docs/` are already shipped with the package but are not discoverable from the root. ### How? - Add `packages/next/AGENTS.md` mirroring the same content `create-next-app` generates for the project root, with the path adjusted to point at `dist/docs/` relative to the package root. - Add `"AGENTS.md"` to the `files` array in `package.json` so it ships with the npm package. ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. <!-- NEXT_JS_LLM_PR -->
1 parent b6017fa commit b592e6d

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

packages/next/AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!-- BEGIN:nextjs-agent-rules -->
2+
3+
# This is NOT the Next.js you know
4+
5+
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `dist/docs/` before writing any code. Heed deprecation notices.
6+
7+
<!-- END:nextjs-agent-rules -->

packages/next/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"homepage": "https://nextjs.org",
1010
"types": "index.d.ts",
1111
"files": [
12+
"AGENTS.md",
1213
"dist",
1314
"app.js",
1415
"app.d.ts",

0 commit comments

Comments
 (0)