{"owner":"GitbookIO","repo":"gitbook","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md"],"files":{"AGENTS.md":"# AGENTS Instructions\n\n## Commands\n\n```bash\nbun install          # Install dependencies\nbun dev              # Start dev server (all packages)\nbun run build        # Build all packages\nbun run lint         # Lint with Oxlint\nbun run format       # Format with Oxfmt (run after every change)\nbun run typecheck    # Type-check all packages\nbun run unit         # Run unit tests\n```\n\n## Development\n\nThe dev server proxies published GitBook sites locally. After `bun dev`, access any published site at:\n\n```\nhttp://localhost:3000/url/<published-gitbook-url>\n```\n\nExamples:\n- `http://localhost:3000/url/gitbook.com/docs`\n- `http://localhost:3000/url/open-source.gitbook.io/midjourney`\n\n## Architecture\n\n```\npackages/\n  gitbook/          # Main Next.js app\n    src/\n      app/          # Next.js App Router (sites/)\n      components/   # React components\n      lib/          # Server utilities, data fetching\n      intl/         # Internationalization (translations/)\n  openapi-parser/   # OpenAPI 3.0/3.1/Swagger parser\n  react-openapi/    # OpenAPI rendering components\n  react-contentkit/ # ContentKit component rendering\n  embed/            # Embeddable GitBook components\n  shared/           # Shared utilities\n  icons/            # Icon assets\n  fonts/            # Font assets\n  colors/           # Color tokens\n  expr/             # GitBook expression evaluator\n  cache-do/         # Cloudflare DO cache\n  cache-tags/       # Cache tag utilities\n```\n\n## Testing\n\n```bash\nbun run unit         # Unit tests via bun test (not vitest)\nbun run e2e          # Playwright e2e tests (requires built app)\n```\n\nRun a specific test file:\n```bash\ncd packages/gitbook && bun test src/lib/cache.test.ts\n```\n\n## Changesets\n\nAfter committing code changes, create a changeset for the affected package:\n\n```md\n---\n\"gitbook\": patch\n---\n\nProvide a short description of the change.\n```\n\nSave as `.changeset/<name>.md`, then commit it separately with message: `changeset`\n\n## Formatting\n\nLinting uses Oxlint and formatting uses Oxfmt. Always run `bun run format` before committing.\n\n## Comments\n\nComment to explain *why*, not *what* — the code already shows what it does. Keep comments short, ideally a single line. Avoid multi-line block comments that narrate mechanics a reader can follow from the code; they add noise and go stale. Reserve longer comments for genuinely non-obvious rationale: a subtle invariant, or a workaround and the reason it exists.\n"}}