|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Repository Overview |
| 6 | + |
| 7 | +This is the **Base Documentation** repository, a comprehensive documentation site for Base (Ethereum Layer 2 blockchain) built with **Mintlify**. The repository covers blockchain development from basics to advanced topics including smart contracts, onchain apps, and Base ecosystem tools. |
| 8 | + |
| 9 | +## Key Commands |
| 10 | + |
| 11 | +### Local Development |
| 12 | +```bash |
| 13 | +# Install Mintlify CLI globally (required for local development) |
| 14 | +npm i -g mintlify |
| 15 | + |
| 16 | +# Run local development server |
| 17 | +mintlify dev |
| 18 | + |
| 19 | +# Reinstall dependencies if mintlify dev fails |
| 20 | +mintlify install |
| 21 | +``` |
| 22 | + |
| 23 | +### Storybook Development |
| 24 | +```bash |
| 25 | +cd storybook |
| 26 | +npm install |
| 27 | +npm run storybook # Runs on port 6006 |
| 28 | +npm run build-storybook |
| 29 | +``` |
| 30 | + |
| 31 | +## Architecture and Structure |
| 32 | + |
| 33 | +### Documentation Organization |
| 34 | +- **Tab-based navigation** with 7 main sections in `docs.json`: |
| 35 | + - Get Started (introduction, quickstarts) |
| 36 | + - Base Chain (network info, node operations) |
| 37 | + - Smart Wallet (account abstraction) |
| 38 | + - OnchainKit (React components) |
| 39 | + - Wallet App (MiniKit development) |
| 40 | + - Cookbook (use-case guides) |
| 41 | + - Learn (educational content) |
| 42 | + |
| 43 | +### File Structure |
| 44 | +- **Main content**: All documentation files are in `/docs` directory as `.mdx` files |
| 45 | +- **Configuration**: `docs.json` defines navigation structure and site settings |
| 46 | +- **Images**: Organized in `/images` with subdirectories by topic |
| 47 | +- **Custom components**: React components available in `/snippets` |
| 48 | +- **Styling**: `custom.css` for site-wide styles, `iframe-theme.js` for theme handling |
| 49 | + |
| 50 | +### Content Types |
| 51 | +- **Educational tutorials** (Learn section with Solidity, Ethereum basics) |
| 52 | +- **Practical guides** (Cookbook with real-world implementation examples) |
| 53 | +- **API documentation** (OnchainKit components and utilities) |
| 54 | +- **Tool documentation** (Smart Wallet, development frameworks) |
| 55 | + |
| 56 | +## Development Workflow |
| 57 | +- Use sub-agents to help complete tasks |
| 58 | +- Leverage the Github CLI tool to create commits for changes and to read the history of changes |
| 59 | +- If you create scratch files for problem solving, remove them when you are done with them. |
| 60 | + |
| 61 | +### Content Editing |
| 62 | +- Edit `.mdx` files directly in `/docs` directory (NOT `/_pages`) |
| 63 | +- Use Mintlify syntax for enhanced documentation features |
| 64 | +- Changes are automatically deployed via Mintlify GitHub App when pushed to default branch |
| 65 | + |
| 66 | +### Component Development |
| 67 | +- Storybook setup in `/storybook` directory for UI component development |
| 68 | +- Components integrated into documentation via iframe embedding |
| 69 | +- Chromatic integration for visual testing and regression detection |
| 70 | + |
| 71 | +### Important Rules |
| 72 | +- **Never edit files in `/_pages` directory** - all documentation files are in `/docs` |
| 73 | +- Use Mintlify CLI for local development and testing |
| 74 | +- Follow existing navigation structure defined in `docs.json` |
| 75 | +- Images should be placed in appropriate `/images` subdirectories |
| 76 | + |
| 77 | +## Special Features |
| 78 | + |
| 79 | +### AI Integration |
| 80 | +- Contextual AI options (ChatGPT, Claude) available in documentation interface |
| 81 | +- Large `llms-full.txt` file (11,496 lines) provides comprehensive AI context |
| 82 | +- AI prompting guides integrated throughout documentation |
| 83 | + |
| 84 | +### Interactive Components |
| 85 | +- Storybook components embedded via iframes for interactive examples |
| 86 | +- Dark/light mode support with custom theme handling |
| 87 | +- Custom React components available for enhanced documentation experiences |
| 88 | + |
| 89 | +### Cross-referencing |
| 90 | +- Extensive internal linking between related topics |
| 91 | +- Progressive learning paths from beginner to advanced |
| 92 | +- Use-case driven organization alongside technical reference material |
| 93 | + |
| 94 | +## Deployment |
| 95 | + |
| 96 | +- **Automatic deployment** via Mintlify GitHub App when changes are pushed to default branch |
| 97 | +- **Storybook deployment** to Chromatic for component library hosting |
| 98 | +- No manual deployment steps required for documentation updates |
0 commit comments