This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Uniswap Universe is a monorepo containing all Uniswap front-end interfaces:
- Web (
apps/web/) - Decentralized exchange web interface - Mobile (
apps/mobile/) - React Native app for iOS/Android - Extension (
apps/extension/) - Browser wallet extension
# Initial setup (requires 1Password CLI)
yarn install
yarn local:check
yarn lfg # Sets up mobile and extensionyarn web dev # Web with Vite
yarn mobile ios # iOS app
yarn mobile android # Android app
yarn extension start # Extensionyarn g:build # Build all packages
yarn web build:production # Web production build
yarn mobile ios:bundle # iOS bundle
yarn mobile android:release # Android release
yarn extension build:production # Extension productionyarn g:test # Run all tests
yarn g:test:coverage # With coverage
yarn web playwright:test # Web E2E tests
yarn mobile e2e # Mobile E2E testsyarn g:lint:fix # Fix linting issues
yarn g:typecheck # Type check all packages
yarn g:format:fix # Fix formatting
yarn g:fix # Run both lint and format fix- Turborepo for build orchestration
- Yarn workspaces for package management
- Shared code in
packages/directory - App-specific code in
apps/directory
- TypeScript everywhere
- React for web/extension
- React Native for mobile
- Redux Toolkit for state management
- Tamagui for cross-platform UI components
- Ethers.js/Viem for blockchain interactions
- ALWAYS use
styledfromui/src(never styled-components or direct Tamagui) - Use theme tokens instead of hardcoded values
- Platform-specific files:
Component.ios.tsx,Component.android.tsx
- Redux for complex global state
- Jotai for simple state
- Keep state as local as possible
- No custom hooks for simple data fetching - use
useQuery/useMutationdirectly
- State declarations at top
- Event handlers after state
- Memoize properly, especially for anything that might be used in the React Native app
- JSX at the end
- Keep components under 250 lines
- Do not use
any, preferunknown - Always consider strict mode
- Use explicit return types
- PascalCase for types/interfaces
- camelCase for variables/functions
- String enums with initializers
- Test behaviors, not implementations
- Always update existing unit tests related to changes made
- Run tests before considering a task to be 'complete'
- Also run linting and typecheck before considering a task to be 'complete'
- Environment Variables: Override URLs in
.env.defaults.local(mobile) or.env(extension) - Pre-commit Hooks: Use
--no-verifyto skip or setexport HUSKY=0to disable - Python Setup: Run
brew install python-setuptoolsif you encounter Python module errors - Mobile Development: Always run
yarn mobile podafter dependency changes - Bundle Size: Monitor bundle size impacts when adding dependencies
Core shared packages:
packages/ui/- Cross-platform UI components and themepackages/uniswap/- Core business logic and utilitiespackages/wallet/- Wallet functionalitypackages/utilities/- Common utilities
- Support for multiple chains (Ethereum, Arbitrum, Optimism, etc.)
- Uniswap Protocol v2, v3, and v4 support
- Multiple wallet providers (WalletConnect, Metamask, etc.)
- Transaction building and gas estimation
Be cognizant of the app or package within which a given change is being made. Be sure to reference that app or package's respective CLAUDE.md file and other local configuration files, including (but not limited to): package.json, tsconfig.json, etc.