You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two tracked files churned on every dev command, so the tree was dirty after any pnpm dev or pnpm build. Both are files Next.js owns, so I went to the official docs rather than picking a tidy-looking option.
What the official docs say
Agent rules block → commit it.nextjs.org/docs/app/guides/ai-agents: next dev auto-generates/upserts the managed block when it detects an agent, "content outside the managed block is preserved", and the block's own text says "committing it with your work keeps the tree clean." There is an opt-out (agentRules: false in next.config.ts), but the docs argue against it: "We believe leaving auto-generation on is a good default. Benchmark results on nextjs.org/evals show agents do better when they read the bundled docs." This repo relies on agents reading version-matched guidance, so the block stays.
next-env.d.ts → gitignore it, generate on demand.typescript config reference: "next-env.d.ts is managed by Next.js. Its contents are an implementation detail and may change over time. Add it to .gitignore."next CLI reference: "To ensure next-env.d.ts is present before type-checking run next typegen." The Next team confirmed the same in vercel/next.js#58877 — including this exact dev-vs-build import-path flip.
Changes
File
Change
AGENTS.md
managed block committed, produced by calling Next's own writeAgentFiles() (the function next dev calls) so it is byte-identical
.gitignore
next-env.d.ts added, with the doc citation in a comment
next-env.d.ts
untracked (git rm --cached)
package.json
typecheck → next typegen && tsc --noEmit -p tsconfig.app.json
Not changed: agentRules: false (docs recommend against), and lint/test (neither needs the file — verified by deleting it and running both).
Verification
Check
Result
hasCurrentAgentRules(repo) before → after
false → true (so next dev skips the write entirely)
writeAgentFiles(repo) re-run
unchanged
git status after next build
clean — no AGENTS.md, no next-env.d.ts
pnpm run typecheck with the file deleted
regenerates via next typegen (0.95 s), tsc exit 0
pnpm run lint, vitest type-tested files, both without the file
exit 0 / 146 passed, no type errors
Fresh-checkout simulation (git worktree add from this branch, shared node_modules, no .next, no next-env.d.ts)
typecheck ✓, lint ✓, hasCurrentAgentRules ✓, full quality gate ✓
pnpm run build
✓
The fresh-checkout run is the one that matters: CI starts from a clone with neither file present, and now regenerates what it needs instead of relying on a committed artifact.
Plan: plans/150-next-generated-files-official-practice-2026-09-24.md. Post-merge check: the next Vercel production deploy runs next build, which writes its own next-env.d.ts (plans/098's lesson — verify the deployed commit, not the PR).
📝 Summary by GitNexus
Summary
This appears to be a build and repository-configuration maintenance change, centered on generated Next.js files and project guidance. Its graph reach is contained, with no dependent or execution-flow impact reported.
🟡 MEDIUM blast radius. A build-configuration and repository-maintenance change across .gitignore, next-env.d.ts, package.json, AGENTS.md, and plans/150-next-generated-files-official-practice-2026-09-24.md, with no graph dependents.
The symbol changes are concentrated in AGENTS.md, specifically Verify build passes locally, Skills, and Available Skills. Review the managed-agent guidance alongside the generated-file handling in .gitignore, next-env.d.ts, and package.json.
No affected flows or cross-repo consumers were found. The file-level risk is MEDIUM, with no HIGH or CRITICAL risk files.
Added by GitNexus for PR #816. Edit freely — this block is replaced on the next review, everything above it is left untouched.
This appears to be a build and repository-configuration maintenance change, centered on generated Next.js files and project guidance. Its graph reach is contained, with no dependent or execution-flow impact reported.
🟡 MEDIUM blast radius. A build-configuration and repository-maintenance change across .gitignore, next-env.d.ts, package.json, AGENTS.md, and plans/150-next-generated-files-official-practice-2026-09-24.md, with no graph dependents.
The symbol changes are concentrated in AGENTS.md, specifically Verify build passes locally, Skills, and Available Skills. Review the managed-agent guidance alongside the generated-file handling in .gitignore, next-env.d.ts, and package.json.
No affected flows or cross-repo consumers were found. The file-level risk is MEDIUM, with no HIGH or CRITICAL risk files.
🟡 MEDIUM blast radius — no downstream dependents were found in the code graph; a spot-check of the dependents should cover it.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two tracked files churned on every dev command, so the tree was dirty after any
pnpm devorpnpm build. Both are files Next.js owns, so I went to the official docs rather than picking a tidy-looking option.What the official docs say
Agent rules block → commit it. nextjs.org/docs/app/guides/ai-agents:
next devauto-generates/upserts the managed block when it detects an agent, "content outside the managed block is preserved", and the block's own text says "committing it with your work keeps the tree clean." There is an opt-out (agentRules: falseinnext.config.ts), but the docs argue against it: "We believe leaving auto-generation on is a good default. Benchmark results on nextjs.org/evals show agents do better when they read the bundled docs." This repo relies on agents reading version-matched guidance, so the block stays.next-env.d.ts→ gitignore it, generate on demand. typescript config reference: "next-env.d.tsis managed by Next.js. Its contents are an implementation detail and may change over time. Add it to.gitignore." next CLI reference: "To ensurenext-env.d.tsis present before type-checking runnext typegen." The Next team confirmed the same in vercel/next.js#58877 — including this exact dev-vs-build import-path flip.Changes
AGENTS.mdwriteAgentFiles()(the functionnext devcalls) so it is byte-identical.gitignorenext-env.d.tsadded, with the doc citation in a commentnext-env.d.tsgit rm --cached)package.jsontypecheck→next typegen && tsc --noEmit -p tsconfig.app.jsonNot changed:
agentRules: false(docs recommend against), andlint/test(neither needs the file — verified by deleting it and running both).Verification
hasCurrentAgentRules(repo)before → afterfalse→true(sonext devskips the write entirely)writeAgentFiles(repo)re-rununchangedgit statusafternext buildAGENTS.md, nonext-env.d.tspnpm run typecheckwith the file deletednext typegen(0.95 s), tsc exit 0pnpm run lint, vitest type-tested files, both without the filegit worktree addfrom this branch, sharednode_modules, no.next, nonext-env.d.ts)typecheck✓,lint✓,hasCurrentAgentRules✓, full quality gate ✓pnpm run buildThe fresh-checkout run is the one that matters: CI starts from a clone with neither file present, and now regenerates what it needs instead of relying on a committed artifact.
Plan:
plans/150-next-generated-files-official-practice-2026-09-24.md. Post-merge check: the next Vercel production deploy runsnext build, which writes its ownnext-env.d.ts(plans/098's lesson — verify the deployed commit, not the PR).📝 Summary by GitNexus
Summary
This appears to be a build and repository-configuration maintenance change, centered on generated Next.js files and project guidance. Its graph reach is contained, with no dependent or execution-flow impact reported.
🟡 MEDIUM blast radius. A build-configuration and repository-maintenance change across
.gitignore,next-env.d.ts,package.json,AGENTS.md, andplans/150-next-generated-files-official-practice-2026-09-24.md, with no graph dependents.The symbol changes are concentrated in
AGENTS.md, specificallyVerify build passes locally,Skills, andAvailable Skills. Review the managed-agent guidance alongside the generated-file handling in.gitignore,next-env.d.ts, andpackage.json.No affected flows or cross-repo consumers were found. The file-level risk is
MEDIUM, with noHIGHorCRITICALrisk files.Added by GitNexus for PR #816. Edit freely — this block is replaced on the next review, everything above it is left untouched.