Skip to content

Conversation

@iiio2
Copy link
Contributor

@iiio2 iiio2 commented Dec 22, 2025

Actually I'm seeing such thing in many oss projects recently on ai agent guide. I thought maybe such thing we can also implement.

@iiio2 iiio2 requested a review from pi0 as a code owner December 22, 2025 16:09
@vercel
Copy link

vercel bot commented Dec 22, 2025

@iiio2 is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Dec 22, 2025

📝 Walkthrough

Walkthrough

Added two documentation files: AGENTS.md (Nitro AI Agent Guide) and CLAUDE.md (which references AGENTS.md). No executable code, logic, or public API changes were introduced.

Changes

Cohort / File(s) Summary
Documentation — Agent guide
AGENTS.md
New comprehensive Nitro AI Agent Guide covering project identity, setup, key scripts, repo structure, code patterns, runtime constraints, testing strategy, presets, workflows, contribution principles, gotchas, error/logging guidance, documentation expectations, collaboration notes, and best practices.
Documentation — Claude reference
CLAUDE.md
New file containing a reference to AGENTS.md (content: @AGENTS.md). No code or public API changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'chore: add initial AGENTS.md' follows conventional commits format with 'chore' type prefix, but does not align with the PR's primary objective of providing an AI agent guide documentation. Update the title to reflect the main objective, e.g., 'docs: add AI agent guide' or 'docs: add initial AGENTS.md guide' to better match conventional commits and the PR's intent to provide AI agent documentation.
✅ Passed checks (2 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is related to the changeset, explaining the motivation for adding an AI agent guide based on similar implementations in other open source projects.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
CLAUDE.md (1)

7-7: Hyphenate compound modifier for consistency.

Line 7 uses "next generation" where the hyphenated form "next-generation" is more appropriate for compound adjectives modifying "server toolkit."

🔎 Proposed fix
- Nitro is a next generation server toolkit. This is a monorepo using pnpm workspaces.
+ Nitro is a next-generation server toolkit. This is a monorepo using pnpm workspaces.
AGENTS.md (2)

7-7: Hyphenate compound modifier for consistency.

Line 7 uses "next generation" where the hyphenated form "next-generation" is more appropriate for compound adjectives modifying "server toolkit."

🔎 Proposed fix
- Nitro is a next generation server toolkit. This is a monorepo using pnpm workspaces with the following key characteristics:
+ Nitro is a next-generation server toolkit. This is a monorepo using pnpm workspaces with the following key characteristics:

32-48: Code style guidelines and workflows are practical.

The documentation emphasizes ESM-first approach, automatic linting with pnpm lint:fix, and pattern-following conventions. The Common Workflows section effectively explains the documentation workflow, though it could potentially be expanded with examples of other common tasks (e.g., adding features, testing, releasing) if you anticipate different use cases.

Consider expanding the "Common Workflows" section with additional scenarios (e.g., adding a feature, running tests, handling breaking changes) if AI agents frequently work on tasks beyond documentation. This would reduce context-gathering time for more complex workflows.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f3740d and b552d73.

📒 Files selected for processing (2)
  • AGENTS.md
  • CLAUDE.md
🧰 Additional context used
🪛 LanguageTool
CLAUDE.md

[grammar] ~7-~7: Use a hyphen to join words.
Context: .... ## Codebase Overview Nitro is a next generation server toolkit. This is a mon...

(QB_NEW_EN_HYPHEN)

AGENTS.md

[grammar] ~7-~7: Use a hyphen to join words.
Context: ...e. ## Project Overview Nitro is a next generation server toolkit. This is a mon...

(QB_NEW_EN_HYPHEN)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: tests-rollup (windows-latest)
  • GitHub Check: tests-rollup (ubuntu-latest)
  • GitHub Check: tests-rolldown (windows-latest)
🔇 Additional comments (2)
CLAUDE.md (1)

3-11: Document structure and references look good.

The file appropriately introduces Claude Code users to the codebase and directs them to the comprehensive AGENTS.md guide for detailed workflows and conventions.

AGENTS.md (1)

14-31: Setup and directory documentation is well-organized.

The project structure, required Node versions, and key scripts are clearly documented. This provides essential context for AI agents to understand the build environment and common development tasks.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b552d73 and 5c4d29f.

📒 Files selected for processing (2)
  • AGENTS.md
  • CLAUDE.md
🧰 Additional context used
🪛 LanguageTool
AGENTS.md

[style] ~17-~17: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...npm installto install dependencies. - Runpnpm build --stub` to prepare developm...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: tests-rolldown (windows-latest)
  • GitHub Check: tests-rollup (windows-latest)
  • GitHub Check: tests-rollup (ubuntu-latest)
🔇 Additional comments (2)
AGENTS.md (1)

1-75: Comprehensive and well-organized AI agent guide.

The guide effectively covers project identity, setup, repository structure, and development conventions. It provides clear, actionable guidance for AI agents contributing to Nitro. The structure is logical and information is appropriately scoped to support informed decision-making during development and code review.

Please verify that the technical instructions are current and accurate:

  • Node version requirement (>= 22)
  • Package manager (pnpm) and corepack setup
  • Key scripts and their purposes
  • Build process (pnpm build --stub)
  • Repository structure paths

If any details have changed since documentation creation, please update accordingly to prevent AI agents from receiving stale guidance.

CLAUDE.md (1)

1-1: Clarify the purpose and mechanism of the @AGENTS.md reference.

The file contains only a reference to AGENTS.md. Please clarify:

  • What system or mechanism does @AGENTS.md use (e.g., Markdown reference, documentation system feature, custom convention)?
  • Why is a separate CLAUDE.md file needed instead of directly documenting in AGENTS.md or linking via standard Markdown/HTML?
  • Is this pattern consistent with other reference files in the repository?

This will help ensure the approach is aligned with the project's documentation conventions and that the intent is clear to contributors and AI agents.

Comment on lines +15 to +17
- Run `corepack enable` to ensure `pnpm` is available.
- Run `pnpm install` to install dependencies.
- Run `pnpm build --stub` to prepare development mode.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reduce repetition of "Run" at the beginning of consecutive sentences.

Lines 15–17 each start with "Run". Consider varying the phrasing to improve readability and flow.

🔎 Suggested revision
- Run `corepack enable` to ensure `pnpm` is available.
- Run `pnpm install` to install dependencies.
- Run `pnpm build --stub` to prepare development mode.
+ First, run `corepack enable` to ensure `pnpm` is available.
+ Then, run `pnpm install` to install dependencies.
+ Finally, run `pnpm build --stub` to prepare development mode.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Run `corepack enable` to ensure `pnpm` is available.
- Run `pnpm install` to install dependencies.
- Run `pnpm build --stub` to prepare development mode.
- First, run `corepack enable` to ensure `pnpm` is available.
- Then, run `pnpm install` to install dependencies.
- Finally, run `pnpm build --stub` to prepare development mode.
🧰 Tools
🪛 LanguageTool

[style] ~17-~17: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...npm installto install dependencies. - Runpnpm build --stub` to prepare developm...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🤖 Prompt for AI Agents
In AGENTS.md around lines 15 to 17, the three consecutive lines all start with
"Run", creating repetitive phrasing; reword them so each instruction varies in
verb/structure while keeping the same meaning — for example, use "Enable
corepack to make pnpm available.", "Install dependencies with pnpm install.",
and "Build for development with pnpm build --stub." — ensure tone and imperative
style remain consistent with the surrounding document.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
AGENTS.md (2)

56-60: Optional refactoring: Reduce "Changes in" repetition for improved flow.

The bullet points repeat "Changes in" at the start of each line, which can be condensed for brevity while maintaining clarity.

🔎 Suggested revision
- Changes in `src/runtime` are bundled and run across all deployment targets.
- Changes in `src/build` affect build output and performance.
- Changes in `src/presets` affect specific deployment platforms.
- Changes in `src/config` affect default behavior.
+ `src/runtime` changes are bundled and run across all deployment targets.
+ `src/build` changes affect build output and performance.
+ `src/presets` changes affect specific deployment platforms.
+ `src/config` changes affect default behavior.

109-111: Optional: Vary sentence structure in development workflow steps.

Lines 4–6 start with "Run", creating slight repetition. Consider varying phrasing while maintaining the imperative instruction style.

🔎 Suggested revision
  4. Run `pnpm lint:fix`.
- 5. Run `pnpm test:types`.
- 6. Run `pnpm vitest run`.
+ 5. Execute `pnpm test:types`.
+ 6. Complete the final test run with `pnpm vitest run`.

Alternatively, renumber and consolidate where appropriate:

  4. Run `pnpm lint:fix`.
- 5. Run `pnpm test:types`.
- 6. Run `pnpm vitest run`.
+ 5. Type-check with `pnpm test:types` and run final tests via `pnpm vitest run`.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c4d29f and c8d03a6.

📒 Files selected for processing (1)
  • AGENTS.md
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-03T19:09:13.905Z
Learnt from: medz
Repo: nitrojs/nitro PR: 3834
File: src/presets/cloudflare/server-entry.ts:63-63
Timestamp: 2025-12-03T19:09:13.905Z
Learning: In the Nitro Cloudflare preset (src/presets/cloudflare/server-entry.ts), native errors from oxc-parser and Node.js readFile operations should be allowed to bubble up naturally without wrapping, as their native error messages are more user-friendly and provide better diagnostic information.

Applied to files:

  • AGENTS.md
🪛 LanguageTool
AGENTS.md

[style] ~17-~17: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...npm installto install dependencies. - Runpnpm build --stub` to prepare developm...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... affect build output and performance. - Changes in src/presets affect specific deploy...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~58-~58: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...affect specific deployment platforms. - Changes in src/config affect default behavior...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[grammar] ~76-~76: Use a hyphen to join words.
Context: ...Keep bundle size minimal and side-effect free. ## Testing Strategy ### Test Str...

(QB_NEW_EN_HYPHEN)


[style] ~111-~111: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...lint:fix. 5. Run pnpm test:types. 6. Run pnpm vitest run`. ## Contribution Pri...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~136-~136: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...consoleonly insrc/runtime/` code. - Use warnings for recoverable situations; th...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: tests-rollup (ubuntu-latest)
  • GitHub Check: tests-rollup (windows-latest)
🔇 Additional comments (1)
AGENTS.md (1)

15-17: Address the previously flagged repetition of "Run" at the start of each line.

This issue was raised in the past review but not resolved. Vary the sentence structure to improve readability.

🔎 Suggested revision
- Run `corepack enable` to ensure `pnpm` is available.
- Run `pnpm install` to install dependencies.
- Run `pnpm build --stub` to prepare development mode.
+ First, run `corepack enable` to ensure `pnpm` is available.
+ Then, run `pnpm install` to install dependencies.
+ Finally, run `pnpm build --stub` to prepare development mode.

- **Don't use Node.js-specific APIs** (unless behind runtime checks).
- Prefer **Web APIs** (fetch, Request, Response, URL, etc.).
- Only use `console` for logging (no `consola` in runtime).
- Keep bundle size minimal and side-effect free.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Fix hyphenation in compound adjective.

Compound adjectives should be hyphenated when modifying a noun. Change "side-effect free" to "side-effect-free".

🔎 Suggested fix
- Keep bundle size minimal and side-effect free.
+ Keep bundle size minimal and side-effect-free.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Keep bundle size minimal and side-effect free.
- Keep bundle size minimal and side-effect-free.
🧰 Tools
🪛 LanguageTool

[grammar] ~76-~76: Use a hyphen to join words.
Context: ...Keep bundle size minimal and side-effect free. ## Testing Strategy ### Test Str...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In AGENTS.md around line 76, the compound adjective "side-effect free" should be
hyphenated when modifying a noun; change the phrase to "side-effect-free" so the
line reads "Keep bundle size minimal and side-effect-free."

@pi0 pi0 changed the title docs: provide ai agent guide chore: add initial AGENTS.md Dec 24, 2025
@pi0 pi0 merged commit 0daf29e into nitrojs:main Dec 24, 2025
5 of 10 checks passed
@pi0
Copy link
Member

pi0 commented Dec 24, 2025

Thanks!

@iiio2
Copy link
Contributor Author

iiio2 commented Dec 24, 2025

Thanks @pi0 . ❤️

@iiio2 iiio2 deleted the docs/provide-ai-agent-guide branch December 24, 2025 12:01
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.

2 participants