This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Always work on feature branches
- Create pull requests for all changes
- Use
git push origin <branch-name>to push to feature branches only - If on main branch, switch to a feature branch before making changes
- Direct pushes to main will bypass GitHub protections and break CI/CD workflows
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production server
pnpm test- Run unit testspnpm test:watch- Run unit tests in watch modepnpm test:coverage- Run unit tests with coveragepnpm e2e- Run stateless e2e tests (requirespnpm denvfirst)pnpm e2e:stateful- Run stateful e2e tests
pnpm lint- Run ESLint and Stylelintpnpm lint:types- Run TypeScript type checkingpnpm lint:fix- Auto-fix linting issues
pnpm denv- Start test environment with Dockerpnpm dev:glocal- Start dev server with local blockchainpnpm tenv- Start ENS test environment
- Next.js 13 - React framework with app router
- TypeScript - Type safety with path mapping (@app/, @public/)
- Styled Components - CSS-in-JS styling
- Tanstack Query - Data fetching and caching
- Viem - Ethereum interaction library
- wagmi - React hooks for Ethereum
The app uses a sophisticated transaction flow system centered around:
TransactionFlowProvider- Global transaction state managementTransactionDialogManager- Modal-based transaction UITransactionStore- Persistent transaction tracking- Flow types: input → intro → transaction → completed
- useQuery wrapper - Custom hook wrapping Tanstack Query with enhanced loading states
- ENS.js integration - Primary blockchain interaction layer
- Subgraph queries - GraphQL data from The Graph protocol
- Local storage persistence - Transaction and user data persistence
@atoms/- Reusable UI components (buttons, inputs, etc.)@molecules/- Composite components (search, dialogs, etc.)pages/- Route components (keep minimal, delegate to components)components/pages/- Page-specific components organized by route
ensjs/- ENS blockchain interaction hookstransactions/- Transaction management hooksabilities/- Permission and capability hooks- Domain-specific hooks organized by feature
input/- Form components for transaction flowsintro/- Information screens before transactionstransaction/- Transaction definition filesTransactionFlowProvider.tsx- Core transaction orchestration
query/- React Query utilities and providersanalytics/- Event tracking and monitoringvalidation/- Form and data validation utilities
- Legacy names - Original ENS names (not ERC-1155)
- Wrapped names - ERC-1155 compatible names via NameWrapper
- Subnames - Third-level domains (subdomain.name.eth)
- Name registration - Multi-step process with commitment/reveal
- Profile management - Records, avatar, social links
- Name wrapping - Converting legacy to wrapped names
- Subname management - Creating and managing subdomains
- DNS import - Importing traditional DNS names
- Unit tests - Pure functions and hooks (Vitest)
- Integration tests - User interaction flows (Playwright)
- makeName helper - E2E test utility for creating unique test names
- Test philosophy: User-centric testing focusing on real user interactions
- Use
ts-patternfor complex conditional logic - Prefer small, pure functions outside of React hooks
- Transaction logic should be in
transaction/files, not components - Use path aliases:
@app/for src/,@public/for public/ - No barrel exports for internal code - Do not create
index.tsfiles that re-export from other modules. Import directly from the specific file (e.g.,import { foo } from './utils/foo'notimport { foo } from './utils'). Barrel exports add unnecessary indirection and can cause circular dependency issues.
- Install Docker for test environment
- Use test mnemonic:
test test test test test test test test test test test junk - Connect MetaMask to localhost:8545 for local blockchain testing
- Run
pnpm denvthenpnpm dev:glocalfor full local development
- Never use
anytype - Strict TypeScript enforcement - Transaction flows follow input → intro → transaction → completed pattern
- makeName function critical for E2E tests - creates unique test names
- Subgraph sync may lag behind blockchain - account for eventual consistency
- Path aliases configured in tsconfig.json for clean imports