Skip to main content

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

GoldRush API documentation site built with Mintlify. Content is authored in MDX (Markdown + JSX). The site documents multiple products: Foundational API (REST), CLI, x402 protocol, and MCP Server.

Commands

Content Architecture

Hand-authored vs Generated content

Hand-authored (safe to edit directly):
  • goldrush-foundational-api/ - API overview, quickstart, authentication
  • goldrush-cli/ - CLI documentation
  • goldrush-x402/ - x402 protocol docs
  • resources/ - Feature-specific guides
  • overview.mdx, faq.mdx, error-handling.mdx, root-level pages
  • snippets/ - Reusable MDX components (some are generated, see below)
Auto-generated (do NOT edit directly - regenerate instead):
  • api-reference/foundational-api/**/*.mdx - from OpenAPI + DatoCMS metadata
  • api-reference/openapi.json - compiled OpenAPI spec
  • chains/*.mdx (except chains/overview.mdx) - from DatoCMS chain data
  • changelog/*.mdx - from DatoCMS
  • snippets/latest-updates.mdx - from DatoCMS (latest 3 changelog entries, rendered on overview.mdx)
  • llms.txt, llms-full.txt - LLM context files
  • skills/*/references/*.md - per-product skill reference files for AI agents
  • data/*.json - intermediate data files
docs.json is the source of truth for site structure. Generation scripts read from and write to it. Keep it in sync with page files.

Data Flow

Generation Pipeline (7 steps, order matters)

  1. ./s/build-conjure - compile Conjure YAML schemas
  2. ./s/get-apiendpoints - fetch endpoint metadata from DatoCMS
  3. node ./s/get-chains.js - fetch chain metadata from DatoCMS
  4. node ./s/convert-openapi.js - generate Foundational API MDX pages
  5. node ./s/generate-chain-docs.js - generate per-chain MDX pages
  6. node ./s/generate-llm-txt.js - generate LLM context files and skills reference files
  7. node ./s/populate-changelog.js - generate changelog (optional)
Steps 1-3 fetch external data; steps 4-6 generate content. Use npm run generate for the interactive runner.

MDX Conventions

Frontmatter format:
Common Mintlify components used: <Card>, <CardGroup>, <CodeGroup>, <Accordion>, <AccordionGroup>, <Tip>, <Info>, <Warning>, <Note>, <Steps>, <Columns>.

Agent Skills (skills/)

Per-product reference files for AI agent consumption, generated by step 6 of the pipeline. Each product has a hand-authored SKILL.md routing index and auto-generated references/*.md files.
SKILL.md files are hand-crafted - edit them directly. references/ files are auto-generated - regenerate with node s/generate-llm-txt.js. Key conventions for skills content:
  • SKILL.md must have YAML frontmatter with name and description fields (per agent skills spec)
  • description is the primary trigger mechanism - include what the skill does, trigger contexts, and cross-routing to sibling skills
  • SKILL.md body should stay generic (no hardcoded endpoint counts/chain lists); delegate specifics to auto-generated reference files
  • Reference file tables use “When to read” column to guide the model
  • Reference files must be self-contained: no links to repo MDX pages, only external URLs and #section anchors
  • MDX imports and [Read more] links are stripped during generation; local links [text](/path)**text** (bold)
  • Foundational API reference files include structured parameter and response field tables extracted from the OpenAPI spec (api-reference/openapi.json)
  • Content headings from source MDX files are bumped down one level in formatEndpointSection() to nest correctly under the endpoint H2

Key Files

  • docs.json - Mintlify site config and navigation tree
  • s/run.js - TUI orchestrator for generation pipeline
  • s/generate-llm-txt.js - generates llms.txt, llms-full.txt, and skills/*/references/*.md
  • s/sdk-methods-mapping.json - maps TypeScript SDK methods to OpenAPI operations
  • api-defn/src/ - Conjure YAML schema definitions (base, balances, nft, transactions)
  • data/ - intermediate JSON data files consumed by generation scripts