Skip to content

docs(claude): accept the Next.js agent-rules block - #329

Merged
jfrench9 merged 1 commit into
mainfrom
chore/next-agent-rules
Aug 31, 2026
Merged

docs(claude): accept the Next.js agent-rules block#329
jfrench9 merged 1 commit into
mainfrom
chore/next-agent-rules

Conversation

@jfrench9

Copy link
Copy Markdown
Member

Summary

Commit the managed nextjs-agent-rules block that Next 16.3.1 writes into CLAUDE.md on its own.

This is not a new convention being introduced — next dev calls writeAgentFiles() (node_modules/next/dist/server/lib/generate-agent-files.js) on startup and appends the block whenever it is missing, then re-adds it on every subsequent run. It will therefore land in this repo the first time anyone starts the dev server. Committing it deliberately now keeps it from showing up later as an unexplained modification in the middle of unrelated work, which is how it was noticed in robosystems-app.

It also earns its place. The block points at the full Next.js documentation bundled under node_modules/next/dist/docs/ — 444 files, version-matched to the installed 16.3.1. For an agent working in this repo that is a better source for Next 16 conventions than model recollection (Next 16 moved Turbopack to default, changed 'use client' / 'use cache' boundaries, and made request APIs async) or a web search that may resolve to a different major.

Companion to the same change in robosystems-app (RoboFinSystems/robosystems-app#350).

Changes

  • CLAUDE.md — appended the 10-line managed block, delimited by <!-- BEGIN:nextjs-agent-rules --> / <!-- END:nextjs-agent-rules -->. No existing content was altered.

Generated by invoking Next's own writeAgentFiles() rather than transcribing the text by hand, so the block is byte-identical to the one in robosystems-app (verified by checksum across all three repos). The generator is idempotent and replaces the block in place on a version bump, so a future Next release that revises the wording will produce a clean one-block diff rather than a duplicate.

Deploy Notes

None. Documentation only — no source, config, dependency or infrastructure change.

Testing

npm run test:all — passing, via the pre-commit hook (format check, lint, typecheck, test suite, cf-lint). Nothing executable changed, so there is no behavior to exercise beyond the repo gate.

`next dev` appends this block to CLAUDE.md itself (Next 16.3.1,
generate-agent-files.js) and re-adds it on every run, so it will land
here the first time anyone starts the dev server. Committing it now
keeps it from surfacing later as an unexplained diff mid-task.

It is worth keeping on its merits: it points at the complete, version-
matched Next.js docs bundled at node_modules/next/dist/docs/, which is a
better source for Next 16 conventions than either model recollection or
a web search that may resolve to a different major.

Written by invoking the same writeAgentFiles() the dev server calls, so
the block is byte-identical to the one in robosystems-app.
@jfrench9

Copy link
Copy Markdown
Member Author

@claude please review this PR

@claude

claude Bot commented Aug 31, 2026

Copy link
Copy Markdown

Claude finished @jfrench9's task in 46s —— View job


Review: docs(claude): accept the Next.js agent-rules block

  • Gather context (diff, CLAUDE.md conventions)
  • Verify the appended block matches Next's generated output
  • Provide review feedback

Summary: Clean, low-risk documentation-only change. The 10-line block is appended after the existing "Core Library" section in CLAUDE.md with no other content altered, matching the PR description exactly.

Verification:

  • Confirmed package-lock.json resolves next to exactly 16.3.1 (node_modules/next entry, line 9208), matching the version the PR claims the block was generated from.
  • The block is properly delimited (/), which is what makes the "idempotent, clean diff on version bump" claim credible — next dev's writeAgentFiles() replaces content between those markers in place rather than appending a duplicate block.
  • Couldn't independently verify the byte-for-byte checksum match across robosystems-app/roboinvestor-app or re-run writeAgentFiles() myself, since this sandbox checkout has no node_modules installed. This isn't a concern for merging — worst case a stray whitespace difference, easily caught by next dev re-writing the block on next local run — just noting it as a check I couldn't fully close the loop on.

Assessment:

  • No source, config, or behavior change — nothing to functionally test beyond what the PR description states.
  • Preemptively committing a file the tooling would otherwise write unprompted is a reasonable call — avoids it surfacing as a confusing unstaged diff in a future unrelated PR, and mirrors the companion change already merged in robosystems-app (#350).
  • No concerns. Looks good to merge.

@jfrench9
jfrench9 merged commit 73acad7 into main Aug 31, 2026
6 checks passed
@jfrench9
jfrench9 deleted the chore/next-agent-rules branch August 31, 2026 03:36
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