-
Notifications
You must be signed in to change notification settings - Fork 15
Add AGENTS.md #1647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add AGENTS.md #1647
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,62 @@ | ||||||
| # ENSNode | ||||||
|
|
||||||
| ENSNode is a multichain ENS indexer monorepo. It indexes ENS names across multiple chains (mainnet, Basenames, Lineanames, 3DNS) and exposes them via GraphQL and REST APIs. | ||||||
|
|
||||||
| ## Monorepo Structure | ||||||
|
|
||||||
| - `apps/ensindexer` — Blockchain indexer powered by Ponder | ||||||
| - `apps/ensapi` — ENS API server (GraphQL and REST, Hono) | ||||||
| - `apps/ensadmin` — Dashboard for navigating indexed ENS state (Next.js) | ||||||
| - `apps/ensrainbow` — Label healing service: recovers labels from labelHashes (Hono) | ||||||
| - `apps/fallback-ensapi` — AWS Lambda fallback that proxies ENS Subgraph requests when ENSApi is unhealthy | ||||||
| - `packages/ensnode-sdk` — SDK for interacting with ENSNode | ||||||
| - `packages/ensnode-react` — React hooks and providers for ENSNode API | ||||||
| - `packages/ensnode-schema` — Shared Drizzle schema definitions | ||||||
| - `packages/ensrainbow-sdk` — SDK for interacting with ENSRainbow | ||||||
| - `packages/datasources` — Catalog of chain datasources (contracts, start blocks, event filters) | ||||||
| - `packages/ponder-subgraph` — Hono middleware for Subgraph-compatible GraphQL | ||||||
| - `packages/ponder-sdk` — Utility library for interacting with Ponder apps and data | ||||||
| - `packages/ponder-metadata` — Hono middleware that exposes Ponder app metadata to clients | ||||||
| - `packages/ens-referrals` — Utilities for ENS Referrals | ||||||
| - `packages/namehash-ui` — UI components for NameHash Labs apps | ||||||
| - `packages/shared-configs` — Shared TypeScript configurations | ||||||
| - `docs/ensnode.io` — Documentation site (Astro/Starlight) | ||||||
|
|
||||||
| ## Tech Stack | ||||||
|
|
||||||
| - **Language:** TypeScript | ||||||
| - **Package manager:** pnpm (workspaces with catalog for dependency versioning) | ||||||
| - **API framework:** Hono | ||||||
| - **Indexer framework:** Ponder | ||||||
| - **Validation:** Zod | ||||||
| - **ORM:** Drizzle | ||||||
| - **Linting/formatting:** Biome | ||||||
| - **Testing:** Vitest | ||||||
| - **Build:** tsup, tsx | ||||||
|
|
||||||
| ## 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`. | ||||||
|
|
||||||
| ## Documentation & DRY | ||||||
|
|
||||||
| - Do not duplicate definitions across multiple locations. Duplication creates a significant maintenance burden. | ||||||
| - Ensure documentation resides at the correct place and the correct layer of responsibility. | ||||||
| - Use type aliases to document invariants. Each invariant MUST be documented exactly once, on its type alias. | ||||||
|
|
||||||
| ## Code Comments | ||||||
|
|
||||||
| - Do not add JSDoc `@returns` tags that merely restate the method summary (e.g. "returns the X" when the description already says "Get the X"). Remove such redundancy during PR review. | ||||||
| - Maintain comment consistency within a file: if most types, schemas, or declarations lack comments, do not add a comment to a single one. Address the inconsistency during PR review. | ||||||
|
|
||||||
| ## Error Handling | ||||||
|
|
||||||
| - Fail fast and loudly on invalid inputs. | ||||||
lightwalker-eth marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
|
||||||
| ## Workflow | ||||||
|
|
||||||
| - All changes require changesets: https://ensnode.io/docs/contributing/prs/#changesets | ||||||
|
||||||
| - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djstrong This looks like good feedback from Copilot.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: namehash/ensnode
Length of output: 71
🏁 Script executed:
Repository: namehash/ensnode
Length of output: 2122
🏁 Script executed:
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
Adjust exact commands to match the root
package.jsonscripts 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djstrong Appreciate your advice on this suggestion from coderabbit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.