Skip to content

chore: commit the AGENTS.md that next dev generates - #44

Merged
guarzo merged 1 commit into
mainfrom
chore/commit-nextjs-agent-rules
Aug 3, 2026
Merged

chore: commit the AGENTS.md that next dev generates#44
guarzo merged 1 commit into
mainfrom
chore/commit-nextjs-agent-rules

Conversation

@guarzo

@guarzo guarzo commented Aug 3, 2026

Copy link
Copy Markdown
Owner

next dev writes AGENTS.md from node_modules/next/dist/server/lib/generate-agent-files.js on every start — including the dev server Playwright boots for npm run test:e2e. Because it isn't tracked, it shows up as a stray ?? in every worktree and gets silently swept into unrelated PRs by git add -A.

That is not hypothetical: it happened on #41, alongside Next's rewrite of tsconfig.json, and cost a CI cycle on a Format check failure in files that PR never touched.

Why commit rather than gitignore

  • Regeneration becomes a no-op. Next rewrites only the content between the BEGIN:nextjs-agent-rules / END:nextjs-agent-rules markers, and it emits the same bytes each time, so a regenerated file is diff-clean. (Prettier is not a factor either way here — .prettierignore already excludes *.md, so this file is never format-checked. An earlier version of this description claimed prettier agreed with the formatting; it simply never looks at it.)
  • The guidance stays under review. The block tells agents that this Next version has breaking changes and to read node_modules/next/dist/docs/ before writing code. If a future Next bump changes that text, the diff surfaces in review instead of silently altering what every agent working in this repo is told. Gitignoring it would hide those changes.
  • It is also what the generated file itself recommends.

Committed verbatim — no edits to Next's text.

The other half

next dev also rewrites tsconfig.json on start. That is handled separately in #45 (a .prettierignore entry), kept apart from this one so each judgment call can be accepted or rejected on its own.

🤖 Generated with Claude Code

`next dev` writes this file from
node_modules/next/dist/server/lib/generate-agent-files.js on every start,
including the dev server Playwright boots for the e2e suite. Untracked, it
shows up as a stray `??` in every worktree and gets silently swept into
unrelated PRs by `git add -A` — which is exactly what happened on #41.

Committed verbatim so Next's regeneration is a no-op: it rewrites only the
content between the BEGIN/END markers, and prettier --check already agrees
with the formatting, so there is no reformat-then-regenerate churn.

Tracking it rather than ignoring it also keeps the guidance itself under
review: the block tells agents that this Next version has breaking changes
and to read node_modules/next/dist/docs/ before writing code. If a future
Next bump changes that text, the diff will show up in review instead of
silently altering what every agent working in this repo is told.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 2 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 39c18a58-6507-4ca3-809c-0c1f9afa0d58

📥 Commits

Reviewing files that changed from the base of the PR and between aeff20b and b0f0049.

📒 Files selected for processing (1)
  • AGENTS.md

Comment @coderabbitai help to get the list of available commands.

@guarzo
guarzo merged commit 81d539b into main Aug 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant