Skip to content

Latest commit

 

History

History
61 lines (47 loc) · 7.05 KB

CLAUDE.md

File metadata and controls

61 lines (47 loc) · 7.05 KB

CLAUDE.md — RapiDoc Monorepo

AGENTS.md is the single source of project guidance (shared with other coding agents). It is imported in full below; keep edits there, and keep this file limited to Claude Code specifics and a quick reference.

@AGENTS.md


Quick Reference

Entry Points

Workspace Package Entry
packages/rapidoc rapidoc src/index.js → <rapi-doc> in src/rapidoc.ts; <rapi-flow> in src/rapi-flow.ts (rapidoc/flow); bundles dist/rapidoc-min.js, dist/rapidoc-flow-min.js; no runtime dependencies
packages/rapidoc-prerender @rapidoc/prerender src/index.js → dist/index.js (renderRapiDoc, getNavBarHtml, getNavCss, renderArazzoWorkflow; ./internal is for this repository's packages only): build-time renderer over the templates in packages/rapidoc/src; used by the portal and the prerender guide
packages/rapidoc-portal @rapidoc/portal src/index.js (+ ./config, ./search, ./components; ./internal/* is for the generated workspace only); build engine in src/engine/, portal pages in src/pages/
packages/rapidoc-cli @rapidoc/cli src/index.js dispatcher + src/commands/ (bin rapidoc: init, dev, build, serve, preview, mock, validate, lint, bundle, pdf, mcp, migrate, doctor, completion; loads @rapidoc/portal, @rapidoc/server, @rapidoc/mock, rapipdf and the MCP SDK, optional peers, only when needed)
packages/rapidoc-server @rapidoc/server src/index.js (createApp, startServer): serves a built portal with OIDC sign-in and the access zones from dist/rapidoc-server.json
packages/rapidoc-mcp @rapidoc/mcp src/index.js → dist/index.js (buildMcpManifest, createMcpRuntime, writeMcpProject, parseArazzo): re-exports the shared MCP and Arazzo code in packages/rapidoc/src, for the portal build and @rapidoc/server
packages/rapipdf rapipdf src/index.js → <rapi-pdf> in src/rapipdf.js; headless core in src/core/ (buildDocDefinition), src/load-spec.js (Scalar parser, with rapidoc/src/utils/spec-loader.js), schemas via schemaToAST of rapidoc/src/utils/schema-utils.js, src/render-browser.js (pdfmake); bundles dist/rapipdf-min.js (classic script), dist/rapipdf.js (ES module, generator loaded on first use) and dist/node.js (rapipdf/node: generatePdf, from src/node.js); pdfmake is the one runtime dependency, for the Node entry
packages/rapidoc-embed @rapidoc/embed src/index.js (+ ./core, ./node): renderHostPage, renderOAuthReceiverPage, embedRoutes; the integration contract, with conformance/fixtures/ for ports in other languages
packages/rapidoc-hono @rapidoc/hono src/index.js (+ ./edge): rapidoc(options), a Hono middleware over @rapidoc/embed; hono is a peer
packages/rapidoc-express, packages/rapidoc-fastify @rapidoc/express, @rapidoc/fastify src/index.js: rapidoc(options) middleware, and a Fastify plugin, over createResponder of @rapidoc/embed
packages/rapidoc-vitepress @rapidoc/vitepress src/index.js (withRapidoc, rapidocSidebar), src/client.js (RapidocReference); example/ is the site its tests build
packages/rapidoc-docusaurus @rapidoc/docusaurus src/index.js (plugin, rapidocSidebarSync), src/client.js (RapidocReference, React); Docusaurus is not installed here, the component is checked by hand
packages/rapidoc-starlight @rapidoc/starlight src/index.js: starlightRapidoc(options), a Starlight plugin; src/apis.js (resolveApis), src/ApiPage.astro; example/ is the site its tests build
integrations/rapidoc-python rapidoc (PyPI) src/rapidoc/fastapi.py and starlette.py (setup_rapidoc), contract.py (the contract in Python); own toolchain (uv, pytest), not an npm workspace
integrations/rapidoc-dotnet RapiDoc.AspNetCore (NuGet) src/RapiDoc.AspNetCore/RapiDocEndpointRouteBuilderExtensions.cs (MapRapiDoc), RapiDocContract.cs (the contract in C#); own toolchain (.NET SDK, xunit), not an npm workspace
packages/rapidoc-mock @rapidoc/mock src/index.js (createMockApp, startMockServer): mocks the portal's APIs under /<api id> (default port 4010); examples, generated data, request validation, JWT scope checks; libraries behind src/engine/
packages/create-rapidoc create-rapidoc src/index.js (bin create-rapidoc); src/scaffold.js (scaffoldProject, findOpenApiSpecs, also used by rapidoc init)
sites/rapidoc (not a workspace) rapidoc.config.yaml; docs in docs/, pages in pages/; rapidocui.com, built with RapiDoc Portal (also sites/rapi-flow, sites/rapi-mock, sites/rapi-portal)

Most-Used Commands (from repo root)

  • npm run dev — the four sites' dev servers (rapidocui.com on http://localhost:4329); npm run dev:rapidoc-site for rapidocui.com alone
  • npm run build:rapidoc — rebuild rapidoc bundles (never git checkout/git restore dist/rapidoc-min.js)
  • npm run build:prerender — rebuild @rapidoc/prerender after changing templates, components, styles or the renderer
  • npm run build:mcp — rebuild @rapidoc/mcp after changing MCP or Arazzo code the portal or server uses
  • npm run test:unit — run before and after parser/schema changes
  • npm run test:portal — portal, CLI, and create-rapidoc tests
  • npm run lint and npm run format-fix — after edits
  • npm run changeset — in any change to a published package; releases go through .github/workflows/release.yml, never npm publish (AGENTS.md §6)

The full command tables are in AGENTS.md §3.


Dogfood Repo

/Users/mrin/work/rapi-portal-demo is a working directory in this project (via .claude/settings.local.json). It is a separate git repo of example portals that consume @rapidoc/portal, one per folder: the Rapid Parcels demo (rapid-parcels/, with sign-in), the Cosmo Cargo test fixture (cosmo-cargo/), which the monorepo tests build, and the small Bookstore portal (bookstore/). When portal config structure, Markdoc tags, or CLI commands change, propose and make the matching edits there too (rules: packages/rapidoc-portal/AGENTS.md §7). Don't commit in either repo unless asked.

Claude Code Configuration

  • Package context: each workspace has a CLAUDE.md that imports its own AGENTS.md; Claude Code loads it when working on files in that package.
  • Subagents (.claude/agents/):
    • rapidoc-core — packages/rapidoc (component, parser, schema, bundle)
    • docs-maintainer — sites/ (rapidocui.com and the RapiFlow, RapiMock and RapiDoc Portal sites: docs pages, examples, page data, specs)
    • cli-portal — packages/rapidoc-cli, packages/rapidoc-portal, packages/rapidoc-server, packages/rapidoc-mock, packages/create-rapidoc
  • Skills:
    • rapidoc-prerender-navigation (packages/rapidoc-portal/.claude/skills/) — static getNavBarHtml sidebar + headless <rapi-doc> with independent scrolling. Loads once Claude touches files under packages/rapidoc-portal/.