Guidance for Claude Code when working in this repository.
You must do the following every time you work on something:
- ALWAYS log meaningful changes as they are completed. Each branch gets its own file in
work-log/. Seework-log/CLAUDE.md. - After editing any files in
latest/, runnode scripts/sync-latest-to-next.js <file-or-dir>to apply the same changes tonext/.
Each product lives in its own top-level directory:
| Directory | Product |
|---|---|
evm/ |
Cosmos EVM |
sdk/ |
Cosmos SDK |
hub/ |
Cosmos Hub |
cometbft/ |
CometBFT |
ibc/ |
IBC Protocol |
skip-go/ |
Skip Go |
enterprise/ |
Cosmos Enterprise (not versioned) |
Each versioned product directory has:
latest/— current stable release, default for site visitors. Edit here for stable doc changes.next/— active development. Default working directory for new content.v0.53/,v10.1.x/, etc. — archived versions. Do not edit these.
After editing files in latest/, run node scripts/sync-latest-to-next.js <file-or-dir> to apply the same changes to next/.
- No bold or italic text in documentation content
- No em-dashes — use a comma, period, or rewrite the sentence instead
- Do not edit archived version directories (
v0.53/,v10.1.x/, etc.) - Do not run versioning or freeze scripts without explicit instruction
- Do not use emdashes in documentation
- When adding a page to
latest/, check whethernext/needs the same addition - Do not manually add
noindexorcanonicalfront matter to archived pages —tag-archived.jshandles that - Use absolute Mintlify paths for internal links, never relative paths or
.mdxextensions:- correct:
/sdk/next/tutorials/example/03-build-a-module - wrong:
./03-build-a-module.mdx
- correct:
- Cosmos SDK GitHub links: use
release/v{X}.{Y}.xbranch format (e.g.release/v0.50.x).blob/v0.50andblob/mainare wrong for stable-version links.
- All navigation is configured in
docs.json— every.mdxfile must be registered to appear in the sidebar - Navigation uses
navigation.dropdowns, notnavigation.versions— Mintlify docs show the latter but this repo uses the former - Each dropdown has a
versionsarray. Version entries use:tag: "Latest"anddefault: trueon thelatest/entrytag: "Unreleased"on thenext/entry- No tag on archived entries
- When adding, deleting, moving, or renaming any
.mdxfile:- Update the page entry in
docs.json - Add a redirect for deleted, renamed, or moved pages so existing links don't 404
- Fix all internal links pointing to the old path
- Update the page entry in
- Redirects go in the top-level
"redirects"array. Each entry has asourceanddestinationas root-relative paths without.mdxextensions. Wildcards are supported. No anchors (#) or query params (?) in redirects. No circular redirects.
"redirects": [
{ "source": "/ibc/next/old-page", "destination": "/ibc/next/new-page" },
{ "source": "/ibc/beta/:slug*", "destination": "/ibc/next/:slug*" }
]Use absolute Mintlify paths. Never relative paths or .mdx extensions.
correct: /sdk/next/tutorials/example/03-build-a-module
wrong: ./03-build-a-module.mdx
wrong: 03-build-a-module
The path is the file's location relative to the docs/ root, without the .mdx extension.
Mintlify preserves special characters in anchor IDs. Rules:
- Spaces become
- &,+,=,@,#,$,%are kept with surrounding hyphens (e.g.Gas & Feesbecomes#gas-&-fees)/is kept as-is, no surrounding hyphens (e.g.x/govbecomes#x/gov)?,!,(,),:,`,—,*,.are dropped (surrounding spaces still become-)-in a heading stays as-, spaces around it collapse (e.g.A - Bbecomes#a-b)- All characters lowercased
Reusable components — import with absolute paths (e.g. /snippets/icons.mdx), not relative paths.
| File | Purpose |
|---|---|
icons.mdx |
Icon library |
footnote.mdx |
Footnote component |
eip-compatibility-table.jsx |
EIP compatibility matrix (EVM) |
rpc-methods-viewer.jsx |
Interactive RPC method viewer |
doc-card.jsx |
Card component |
topic-card-component.jsx |
Topic card |
cosmos-stack-diagram.jsx |
Cosmos stack diagram |
cosmos-stack-learn.jsx |
Cosmos stack learn component |
code-highlighter.jsx |
Code highlighting |
blockchain-demo.jsx |
Blockchain demo |
docs-navigation-drawer.jsx |
Navigation drawer |
mobile-menu-drawer.jsx |
Mobile menu |
When a product is ready to release, complete these steps in order.
Update the changelog in next/ first, so it carries over when the freeze copies next/ to latest/. If the new version is still listed as ## Unreleased in the upstream CHANGELOG.md, use --unreleased-as to label it correctly.
# If the version is released in CHANGELOG.md
cd scripts/versioning && npm run changelogs -- --product <product> --target next --source <tag> --current-only
# If the version is still listed as Unreleased in CHANGELOG.md
cd scripts/versioning && npm run changelogs -- --product <product> --target next --source <tag> --unreleased-as <version> --current-onlyRun the freeze script from scripts/versioning/. This promotes next/ to latest/, rewrites all internal links, injects noindex into next/ pages, and updates versions.json.
cd scripts/versioning
NON_INTERACTIVE=1 SUBDIR=<product> NEW_DISPLAY_VERSION=<version> npm run freezeThen manually update docs.json for the product's dropdown:
- Add a new version entry cloned from
next/, with all paths rewritten from<product>/next/to<product>/latest/ - Set
"tag": "Latest"and"default": trueon thelatest/entry - Set
"tag": "Unreleased"on thenext/entry - Order:
latestfirst, thennext, then archived versions newest-first
If the product has pre-existing archived version directories (e.g. v0.53/, v10.1.x/), tag them with noindex and canonical:
node tag-archived.js --product <product> --allnpx mint broken-linksFix any broken links before committing.
Versioning, changelog, and migration scripts live in scripts/. See scripts/versioning/CLAUDE.md for full documentation on the versioning scripts.
npx mint dev # local preview with live reload
npx mint broken-links # check for broken internal links (run before committing)
npm run clean # remove build artifacts
npm run reset # clean + reinstallThe Cosmos SDK example chain tutorials (sdk/next/tutorials/example/, files 00-overview.mdx through 05-run-and-test.mdx) are kept in sync with the cosmos/example repo via a bidirectional GitHub Actions workflow. When either side merges a change, a PR is opened on the other repo with content transformed between formats.
The transform script lives at scripts/docs-sync/transform.py and is tracked in git. When editing these tutorial pages, title: is owned by the sync — other front matter (e.g. description:) is preserved.