This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Documentation website for the Swarm Bee client, built with Docusaurus 3 and deployed at docs.ethswarm.org. Content lives in docs/ as Markdown/MDX; everything else is site config, build tooling, and a few React components.
npm ci # install exact deps (preferred over npm install)
npm start # local dev server with live reload
npm run build # production build into build/ (runs prebuild first)
npm run build:quiet # build with noisy Node deprecation warnings suppressed
npm run serve # serve a built site locally
npm run check:links # check links against an existing local build
npm run build:check # build + check links in one stepLink checker flags pass through after --:
npm run check:links -- --mode local --no-external --threads 16
npm run check:links -- --mode live --site-domain docs.ethswarm.orgNode >=20, npm >=9.6 (see .nvmrc / package.json engines).
There is no test suite and no linter — validation is the build, the llms.txt validator (runs in prebuild), and the link checker.
The prebuild npm hook runs automatically before build and does three things, in order:
- Copies
openapi/Swarm.yaml→static/openapi.yaml. scripts/fetch-awesome-swarm.mjs— fetches external content at build time.scripts/validate-llms-txt.mjs— validatesstatic/llms.txtcoverage (informational, always exit 0, never blocks the build).
onBrokenLinks: 'warn' — broken internal links warn rather than fail the build. Use the link checker to catch them.
docs/— all documentation content, grouped into top-level sections:bee/,concepts/,desktop/,develop/,references/. Page ordering and the sidebar tree are defined manually insidebars.js(not auto-generated) — adding a doc file requires adding it tosidebars.js.docusaurus.config.mjs— single source of site config: plugins, presets, redirects (@docusaurus/plugin-client-redirects), the OpenAPI integration (redocusaurus), and threedocusaurus-plugin-llmsslice configs (llms-api.txt,llms-node-ops.txt, etc.).openapi/—Swarm.yaml+SwarmCommon.yaml. The API reference page is compiled from these at build time via redocusaurus. Kept in sync with the OpenAPI specs in the Bee repo by theupdate-openapiworkflow (see below) — they are not edited by hand..github/workflows/—build.yaml(build on push/PR),gh-pages.yaml(deploy onv*.*.*tag push), and two Bee-sync workflows:update-openapi.yaml(daily; pulls openapi specs + bumps version strings from the latest stable Bee tag and opens a PR labelledopenapi-auto-update) andtag-on-openapi-merge.yaml(tags the merge commitvX.Y.Zwhen that PR merges, triggering the deploy). Both need theBOT_PATsecret and fail loudly without it.src/components/— interactive calculators embedded in docs via MDX (e.g.AmountAndDepthCalc.js,RedundancyCalc.js,VolumeAndDurationCalc.js).src/config/globalVariables.jsholds shared constants.src/theme/SearchBar/— a swizzled component (ejected from the theme). See the README: upgrading the Docusaurus theme does NOT upgrade swizzled components and can break search; re-swizzle after theme upgrades.scripts/— TypeScript (tsx, no separate install) build/CI helpers: link checkers (check_links.ts,check_live_links.ts) and the build-time.mjsscripts above.
static/llms.txt— hand-curated index of every doc page, one line each. Edit by hand when pages are added/renamed/deleted./llms-full.txtand the sliced variants — auto-generated at build time; do not hand-edit.- When the prebuild validator warns about a stale link or missing coverage, fix
static/llms.txt(update the path or add a- [Title](url): descriptionline in the right section). A few navigation-only landing pages are intentionally excluded — those warnings are expected.
- One sentence per line — put a newline after every sentence instead of hard-wrapping at a fixed width; keeps git diffs small and reduces merge conflicts.
- Minimize unrelated edits (e.g. don't reflow a whole paragraph to fix one typo) for the same reason.
Swarmvsswarm: capitalSwarm= the project / main network; lowercaseswarm= a swarm of bee nodes (Bee supports running multiple). CapitalBee= the Go client; lowercasebee= any Swarm-protocol client.- Version bumps: automated by the
update-openapiworkflow on each new stable Bee release (literal find-and-replace of the semver in the install docs). Only bump by hand for out-of-band corrections, across the wholedocs/folder.