Conversation
…stack, testing guidelines, and workflow
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughA new monorepo overview document (AGENTS.md) has been added to the ENSNode project. It outlines the project structure, technology stack, testing conventions, documentation standards, error handling philosophy, and development workflow expectations using changesets. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a new root-level AGENTS.md to document high-level ENSNode repository context and contribution conventions for automated agents and contributors working in the monorepo.
Changes:
- Introduces
AGENTS.mddescribing monorepo layout, tech stack, testing conventions, and review guidance. - Adds workflow guidance around changesets (currently contains a policy mismatch vs existing contributing docs).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ## Workflow | ||
|
|
||
| - All changes require changesets: https://ensnode.io/docs/contributing/prs/#changesets |
There was a problem hiding this comment.
The statement "All changes require changesets" is inconsistent with the repo’s documented changeset policy. The contributing docs explicitly say changesets should not be created for every PR/logical change, and that a PR with no qualifying logical changes should not include a changeset. Please reword this bullet to match the criteria (e.g., “Add a changeset when your PR includes a logical change that should bump versions or be communicated in release notes”).
| - All changes require changesets: https://ensnode.io/docs/contributing/prs/#changesets | |
| - Add a changeset when your PR includes a logical change that should bump versions or be communicated in release notes: https://ensnode.io/docs/contributing/prs/#changesets |
There was a problem hiding this comment.
@djstrong This looks like good feedback from Copilot.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@AGENTS.md`:
- Around line 56-58: Update the "Error Handling" section (the "Fail fast and
loudly" guidance) to be explicit and actionable: specify the preferred
validation approach (e.g., use zod.parse(...) to throw on invalid input vs
zod.safeParse(...) when a non-throwing flow is required), state whether to use
plain Error or a typed/custom error hierarchy (e.g., AppError / ValidationError
classes) and when to instantiate them, and define how errors must surface at API
boundaries (HTTP status codes mapping, structured JSON error responses with
fields like code/message/details). Include short examples of the expected
pattern for validation, throwing, and API response handling so agents have
concrete behavior to implement.
- Around line 37-43: Add a new "Commands" section to AGENTS.md that provides
explicit, runnable commands for agents and devs to validate changes: include
install (pnpm install), run all tests (pnpm test), run package-scoped tests
(pnpm --filter <package-name> test), lint/format with Biome (pnpm lint and pnpm
lint:ci), and type checking (pnpm typecheck); ensure the section header is
"Commands" and mention Biome as the linter/formatter so agents know which script
to call and adjust any commands to match the root package.json script names if
they differ.
| ## Testing | ||
|
|
||
| - Tests are colocated with source files (e.g. `foo.test.ts` next to `foo.ts`). | ||
| - Use the `*.test.ts` naming convention. Do not use `*.spec.ts`. | ||
| - Use `describe`/`it` blocks with `expect` assertions. | ||
| - Use `vi.mock()` for module mocking and `vi.fn()` for function stubs. | ||
| - Each app and package has its own `vitest.config.ts`. |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
# First, locate and examine the AGENTS.md file
find . -name "AGENTS.md" -type fRepository: namehash/ensnode
Length of output: 71
🏁 Script executed:
# Get root package.json scripts
cat package.json | head -50Repository: namehash/ensnode
Length of output: 2122
🏁 Script executed:
# Look at app package examples
fd "package.json" apps/ | head -3 | xargs -I {} sh -c 'echo "--- {} ---"; head -30 {}'Repository: namehash/ensnode
Length of output: 3023
🏁 Script executed:
# Read the full AGENTS.md file
cat AGENTS.mdRepository: namehash/ensnode
Length of output: 3031
🏁 Script executed:
# Count lines to confirm structure
wc -l AGENTS.mdRepository: namehash/ensnode
Length of output: 72
Add a "Commands" section — AI agents need explicit commands to self-verify changes.
AGENTS.md is consumed by AI coding agents that need executable commands to validate their work. The testing conventions are documented but there's no guidance on how to invoke them, and Biome is listed in the tech stack but never explained how to run.
Add a section like:
Suggested Commands section
## Commands
# Install dependencies
pnpm install
# Run all tests
pnpm test
# Run tests for a specific package
pnpm --filter <package-name> test
# Lint and format (Biome)
pnpm lint # auto-fix all files
pnpm lint:ci # CI mode (fails if changes needed)
# Type check
pnpm typecheckAdjust exact commands to match the root package.json scripts or add per-package examples if needed. The key is making invocation explicit so agents (and developers) don't have to guess.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@AGENTS.md` around lines 37 - 43, Add a new "Commands" section to AGENTS.md
that provides explicit, runnable commands for agents and devs to validate
changes: include install (pnpm install), run all tests (pnpm test), run
package-scoped tests (pnpm --filter <package-name> test), lint/format with Biome
(pnpm lint and pnpm lint:ci), and type checking (pnpm typecheck); ensure the
section header is "Commands" and mention Biome as the linter/formatter so agents
know which script to call and adjust any commands to match the root package.json
script names if they differ.
There was a problem hiding this comment.
@djstrong Appreciate your advice on this suggestion from coderabbit.
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
lightwalker-eth
left a comment
There was a problem hiding this comment.
@djstrong Thank you. Happy to get started with whatever you suggest here and then we can continue refining in the future.
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
AGENTS.mdto the repository root with coding conventions and project context for AI agents.Why
Testing
Notes for Reviewer (Optional)
Pre-Review Checklist (Blocking)