This is the source for Golem's official documentation at learn.golem.cloud.
- Framework: Nextra v2 (docs theme) on top of Next.js 14
- Package manager: Bun (use
bunfor install/run, notnpm/yarn) - Styling: Tailwind CSS, PostCSS
- Language: TypeScript, MDX
- Linting/Formatting: ESLint + Prettier (with Tailwind plugin), enforced via Lefthook pre-commit hooks
- Syntax highlighting: Shiki, with custom grammars for
witandriblanguages (seewit-grammar.json,rib-grammar.json) - API docs: Auto-generated from OpenAPI spec (
openapi/golem-service.yaml) viaopenapi/gen-openapi.ts - How-To Guides: Auto-generated from the Golem skill catalog via
skills/sync-skills.ts
src/
pages/ # MDX documentation pages (file-based routing)
components/ # React components used in MDX pages
lib/ # Shared utilities (e.g., release version info)
styles/ # Global CSS (Tailwind)
context/ # React context providers
openapi/ # OpenAPI spec and code generation script
skills/ # How-To Guides sync script
check-links/ # Link-checking tool for MDX files
public/ # Static assets (images, favicon)
theme.config.tsx # Nextra docs theme configuration
bun install— Install dependenciesbun run dev— Start dev server (http://localhost:3001)bun run build— Production buildbun run lint— Lint and auto-fixbun run format— Format with Prettierbun run fix— Lint + format togetherbun run check-links— Validate links in MDX filesbun run generate-prod— Regenerate REST API docs from OpenAPI specbun run update-skills— Sync How-To Guides from the Golem skill catalog (fetches from GitHub)bun run update-skills-local -- --local <path>— Sync How-To Guides from a local golem repo checkout
- Each page is an
.mdxfile undersrc/pages/. The file path determines the URL. - Sidebar order and titles are controlled by
_meta.jsonfiles in each directory. - Use Nextra built-in components (
Callout,Tabs,Cards,Steps, etc.) — import fromnextra/components. - Use the custom
<MultiPlatformCommand>component for commands that differ by OS/platform. - Icons come from
lucide-react.
- Standard fenced code blocks with language identifiers work out of the box.
- Use
witorribas language identifiers for Golem-specific WIT interface definitions and Rib expressions — custom Shiki grammars are configured.
- Create a
.mdxfile undersrc/pages/at the desired path. - Add an entry in the corresponding
_meta.jsonto set title and sidebar position.
REST API reference pages are auto-generated. Do not edit them manually.
- To update from a local copy of the spec: copy the YAML from the golem repo (
../golem/openapi/golem-service.yaml) intoopenapi/golem-service.yaml, then runbun run generate-local. bun run generate-prodandbun run generate-devfetch the OpenAPI spec from the respective deployed environments — they do not use the local YAML file.
The generated MDX files under src/pages/rest-api/ will be updated and auto-formatted.
How-To Guide pages are auto-generated from the Golem skill catalog. Do not edit files under src/pages/how-to-guides/ manually.
bun run update-skillsfetches the latest skills from GitHub.bun run update-skills-local -- --local <path>reads from a local checkout of the golem repo.
The sync script (skills/sync-skills.ts) strips AI-agent frontmatter, converts cross-references between skills into doc links, and generates MDX pages organized by category (General, Rust, TypeScript, Scala). Set GITHUB_TOKEN env var to avoid GitHub API rate limits when fetching remotely.
Lefthook runs the following on staged files before each commit:
- ESLint (fix mode)
- Prettier (write mode)
- TypeScript type checking (
tsc) - Link validation (
check-links)
Ensure all four pass before committing. Run bun run fix to auto-fix lint and format issues.