|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is the official documentation website for Foundry, a smart contract development toolchain for Ethereum. The documentation is built using Vocs (a React-based documentation framework) and deployed to Cloudflare Pages. |
| 8 | + |
| 9 | +## Essential Commands |
| 10 | + |
| 11 | +### Development |
| 12 | +```bash |
| 13 | +cd vocs |
| 14 | +bun install # Install dependencies |
| 15 | +bun dev # Start development server (default: http://localhost:5173) |
| 16 | +bun build # Build documentation for production |
| 17 | +bun preview # Preview production build locally |
| 18 | +bun check-links # Validate all internal documentation links |
| 19 | +``` |
| 20 | + |
| 21 | +### Generating CLI Output |
| 22 | +```bash |
| 23 | +# From project root - generates auto-generated CLI command outputs |
| 24 | +./scripts/gen_output.sh # Requires Foundry tools (forge, cast, anvil, chisel) installed |
| 25 | +``` |
| 26 | + |
| 27 | +## Architecture & Structure |
| 28 | + |
| 29 | +### Key Directories |
| 30 | +- `/vocs/` - Main documentation source directory |
| 31 | + - `/docs/pages/` - All documentation content in MDX format, organized by tool: |
| 32 | + - `/forge/` - Smart contract compilation and testing documentation |
| 33 | + - `/cast/` - Ethereum RPC client documentation |
| 34 | + - `/anvil/` - Local Ethereum node documentation |
| 35 | + - `/chisel/` - Solidity REPL documentation |
| 36 | + - `/docs/public/` - Static assets (images, diagrams) |
| 37 | + - `/sidebar/` - Navigation configuration (sidebar.ts and modular sections) |
| 38 | + - `/docs/snippets/` - Code examples and auto-generated outputs |
| 39 | + |
| 40 | +### Configuration Files |
| 41 | +- `vocs/vocs.config.ts` - Main Vocs configuration (theme, navigation, sponsors) |
| 42 | +- `vocs/sidebar/sidebar.ts` - Main sidebar navigation structure |
| 43 | +- `vocs/package.json` - Dependencies and scripts |
| 44 | + |
| 45 | +### Documentation Patterns |
| 46 | +- MDX files support frontmatter for metadata |
| 47 | +- Code snippets are pulled from `/docs/snippets/projects/` test projects |
| 48 | +- Auto-generated CLI outputs stored in `/docs/snippets/output/` |
| 49 | +- Images and assets organized by topic in `/docs/public/` |
| 50 | + |
| 51 | +## Contributing Guidelines |
| 52 | + |
| 53 | +When adding or modifying documentation: |
| 54 | +1. Chapters start with second-level headings (`##`) |
| 55 | +2. Use "we" not "I" in documentation |
| 56 | +3. Use auto-generated CLI output where possible (run `./scripts/gen_output.sh`) |
| 57 | +4. Include source files from the projects folder rather than inline code |
| 58 | +5. Run `bun check-links` before committing to ensure all links are valid |
| 59 | + |
| 60 | +## Deployment |
| 61 | + |
| 62 | +The documentation automatically deploys to Cloudflare Pages via GitHub Actions on push to the main branch. The deployment workflow handles building and publishing to the "foundry-book" Cloudflare Pages project. |
0 commit comments