/CLAUDE.md
CLAUDE.md at /CLAUDE.md
Path: CLAUDE.md
Docs
Documentation site built with zudo-doc — a zfb-based documentation framework with MDX, Tailwind CSS v4, and Preact islands.
Tech Stack
zfb — static site engine (Rust binary + JS plugin host)
MDX — content format
Tailwind CSS v4 — via
@tailwindcss/vitePreact — for interactive islands only
Shiki — code highlighting
Setup
Two scripts in docs/scripts/ each install a Claude Code skill that symlinks this docs tree (src/ + docs-ja) into the user-scope skills dir (~/.claude/skills/) for AI lookup access. They produce distinct skills:
zfb-wisdom skill — run
bash docs/once. Fixed skill namescripts/ setup- zfb- wisdom. sh zfb-wisdom(seesrc/).content/ docs/ claude- skills/ zfb- wisdom. mdx {project}-wisdom skill — run
pnpm --filter docs setup:doc-skill(wired tobash scripts/). Interactive; default skill name issetup- doc- skill. sh <package.json name>-wisdom(currentlydocs-wisdom).
Commands
All commands run from the repo root with the --filter docs workspace flag, or directly inside docs/:
pnpm docs:dev— zfb dev server (port 4321)pnpm docs:build— static HTML export todocs/dist/pnpm docs:check— zfb type checking (tsc --noEmitoverzfb.config.ts, collection schemas, andsrc/). Note:pages/is excluded intsconfig.json, so page modules are NOT type-checked here — they are checked whenzfb buildbundles them.pnpm docs:preview— serve the builtdocs/dist/locally
Key Directories
docs/
├── pages/ # File- based routing (zfb page modules)
│ └── lib/ # Shared page utilities (nav, locale merge, doc props)
├── plugins/ # zfb integration plugins (doc- history, search- index, llms- txt, etc. )
├── public/ # Static assets copied flat to dist/ (favicons, img/ )
└── src/
├── components/ # Preact components
├── config/ # settings. ts + i18n config
├── content/
│ ├── docs/ # EN MDX content
│ └── docs- ja/ # Japanese MDX content (mirrors docs/ structure)
├── hooks/ # zfb lifecycle hooks
├── styles/ # global. css (design tokens + Tailwind config)
└── utils/ # Shared utilities (base URL, docs helpers, etc. )Content Conventions
Frontmatter
Required:
title(string)Optional:
description,sidebar_position(number),sidebar_label,category,tagsSidebar order is driven by
sidebar_positionSidebar category label comes from the
index.mdxfrontmatter in each directory, or from a_category_.jsonfile when there is noindex.mdx_category_.jsonfiles are NOT disposable: the zfb content-collection loader skips them as data files (emitting a benign build warning — silenced when the collection'sinclude/excludeglobs already filter the file out, see zfb#1032), but the docs app's nav layer (loadCategoryMetaviaresolveNavSource) still reads them for categorylabel,position,description,sortOrder, andnoPage. Deleting them can regress sidebar/category nav (e.g.api,architecture, generated Claude sections).
Links
Use relative
.mdxpaths for cross-doc links:[label](.— zfb's. / other- dir/ page. mdx) resolveMarkdownLinksconverts these to root-relative route URLs at build time (the only fully reliable form).For links to pages that don't exist in the current locale collection (e.g., JA docs pointing to EN-only sections that
resolveMarkdownLinkscan't resolve), use root-relative absolute paths that the base rewriter prependsbaseto:/(keeps JA locale shell) orja/ docs/ markdown- features/ /(EN). Do NOT use bare relative paths likedocs/ recipes/ admonitions .: zfb leaves them unrewritten, and under Cloudflare Pages' trailing-slash redirect (. / markdown- features/ /→x /) the browser resolves them from the wrong base, producing 404s.x/
Admonitions
Available in all MDX files without imports: <Note>, <Tip>, <Info>, <Warning>, <Danger>, <Caution>, <Details>
Each accepts an optional title prop.
Headings
Do NOT use h1 (#) in doc content — the page title from frontmatter is rendered as h1. Start content headings from h2 (##).
i18n
English (default):
/— content indocs/ . . . src/content/ docs/ Japanese:
/— content inja/ docs/ . . . src/content/ docs- ja/ Pages missing from
docs-ja/are served with EN content (locale-first merge with EN fallback)defaultLocaleOnlyPrefixesinsettings.tslists sections built only in EN (e.g.,/,docs/ claude- md/ /)docs/ claude- skills/
Active Settings Flags
The following flags are set in src/ and are currently enabled:
mermaid — Renders Mermaid diagrams in MDX content
sitemap — Generates
sitemap.xmldocMetainfo — Shows document metadata (word count, reading time) below the title
cjkFriendly — Applies
remark-cjk-friendlyfor better CJK line-breakingllmsTxt — Generates
llms.txtfor LLM consumptiondocHistory — Shows document edit history on each page
sidebarResizer — Draggable sidebar width
sidebarToggle — Show/hide desktop sidebar button
claudeResources — Auto-generated docs for Claude Code resources (skills, claude-md); value is
{ claudeDir: ".claude" }(reads fromdocs/.claude/)headingIdStrategy — Set to
"flat"(github-slugger flat IDs) to preserve existing#anchordeep links from the pre-migration site
Package CSS generation (@takazudo/zudo-doc)
@takazudo/zudo-doc 0.2.0 ships safelist.css (zudolab/zudo-doc#1996), which lists every
Tailwind class the package emits as @source inline values. Importing it in global.css is all
that is needed for Tailwind v4 to generate the package utilities:
@import "@takazudo/zudo-doc/safelist.css";History note: before 0.2.0, the package shipped no precompiled CSS and Tailwind v4 deliberately
excluded node_modules from scanning, so this repo used a vendor-copy workaround
(scripts/ + @source "./.zudo-doc-tw/**") to make the package classes
available. That machinery was deleted when the safelist mechanism landed (zudolab/zudo-doc#1996).