zudo-circuit-doc

Type to search...

to open search from anywhere

Ownership and upgrades

What belongs to the package, the project, or the generator; why there is no update command; and how to refresh the scaffold by hand.

Who owns what

PathOwnerEdit by hand?
doc/src/content/docs/{project,architecture,research,decisions,verification}/ProjectYes
circuit/WORKFLOW.md, circuit/agent-task-examples.md, circuit/templates/ProjectYes
.claude/skills/component-*/ProjectYes, following the evidence contract
.claude/skills/component-spec-audit/references/*.jsonProjectYes
.claude/skills/circuit-spec-integration/references/rules.jsonProjectYes
circuit/publication/selection.json, circuit/publication/assets.jsonProjectYes, as a reviewed diff — see Publication
circuit/cad-receipts/ProjectYes, created when the first asset is acquired
circuit.config.tsProjectYes
doc/zfb.config.tsProjectYes — headerNav, headerRightItems, footer, claudeResources, etc. See Adding an authored section below before adding a nav entry
doc/src/chrome-bindings.tsx, doc/src/styles/global.css, and the rest of doc/src/** outside content/docs/components/ProjectYes
doc/public/**, excluding the generator-owned doc/public/assets/component-previews/** belowProjectYes, subject to the publication assets allowlist for anything that shouldn't be public
Root package.json scriptsProjectYes — a custom pre-build step, a deploy hook, or any other project-specific command goes here; see Workflows → Migrating an existing project for why this is the seam for things that can't be ported directly
doc/src/content/docs/components/**GeneratorNever
circuit/generated/preflight.jsonGeneratorNever
doc/public/assets/component-previews/**GeneratorNever
node_modules/@takazudo/zudo-circuit-doc/PackageNever

Generated MDX is never hand-edited: change the evidence or the selection, then regenerate. A hand-edited generated file is reported as drift by pnpm check; one with its generated-page marker removed entirely is reported as an ownership conflict — the emitter refuses to overwrite a marker-less target, and never partially writes on any conflict.

Create-only: there is no update command

create-zudo-circuit-doc scaffolds a project once. There is deliberately no zudo-circuit-doc update or create-zudo-circuit-doc upgrade command — a generated project's authored content (brief, architecture, decisions, evidence) is yours from the moment it's created, and an automatic in-place rewrite of project files is exactly the kind of silent mutation this project's evidence model is built to avoid elsewhere. Two things do get newer over time without an update command:

  • The runtime package (@takazudo/zudo-circuit-doc) — an ordinary pnpm update bumps it like any other dependency, because the CLI, validator and MDX renderer are code your project depends on, not files copied into your project.

  • The scaffold (the zudo-doc host glue under doc/, package.json, pnpm-workspace.yaml) — these files are copied at creation time, and upgrading them is a manual, reviewable scaffold-refresh, described next.

The scaffold-refresh procedure

The initializer's doc/ host glue is synced from a pinned create-zudo-doc release, with a few project-specific lines layered on top (the chrome-bindings import, the islands seed import, the package's styles.css import). ZUDO_DEPS_PINS.md, generated into every new project, records exactly which files came from where, at which pinned commit, and which lines were added on top of the vendored scaffold:

## create-zudo-doc
- pinned: <commit> (v10.0.3)
- files: doc/pages/docs/[[...slug]].tsx, doc/pages/index.tsx, doc/tsconfig.json,
  doc/src/styles/global.css, doc/scripts/check-links.js
- notes: doc/pages/docs/[[...slug]].tsx carries one added import beyond the upstream stub;
  doc/src/styles/global.css has one added @import line. Re-apply both after any re-copy.

To refresh a project's scaffold by hand after a new create-zudo-doc release:

  1. Run the pinned (or newer) create-zudo-doc into a scratch directory and diff its project output against the files ZUDO_DEPS_PINS.md lists.

  2. Apply the upstream diff to your project's copies.

  3. Re-apply the project-specific lines ZUDO_DEPS_PINS.md's notes call out (they are not part of the upstream scaffold, and a plain re-copy would silently drop them).

  4. Update ZUDO_DEPS_PINS.md's pinned:/updated: fields.

Migrating the 0.3 runtime family to 0.4

Runtime 0.4 moves to zudo-doc/history-server/create-zudo-doc 10.0.3 and ZFB/runtime/md-wasm 6.0.1. Its peer floors are @takazudo/zudo-doc ^10.0.3 and @takazudo/zfb ^6.0.1, so a host still on zudo-doc 9 does not satisfy them. A caret on runtime ^0.3.0 does not opt into 0.4. Keep runtime 0.3 with the 9.1.x / 5.2.2 family until you migrate the host deliberately.

  1. In doc/package.json, update the exact pins for zudo-doc, history-server and all three ZFB packages together, then raise the runtime range in both the root and doc/package.json. History-server 10 is required: zudo-doc 10 peers on ^10.0.0.

  2. In zudo-doc 10, themePack: "default" is an alias of Graphite, and Classic's slug is now classic. A project generated by initializer 0.2.0 that still has themePack: "default" switches to Graphite. To keep Classic, change both themePack and any themePacks entry to "classic". A themePacks list that names both "default" and "graphite" fails the build.

  3. ZFB 6 bundles with Rolldown. Leave any removed bundler selector unset in zfb.config.ts. Keep allowBuilds: esbuild: true in pnpm-workspace.yaml, as create-zudo-doc 10 still generates it.

  4. create-zudo-doc 10 generates typescript ^7.0.2 and diff ^8.0.4 || ^9.0.0 for the doc host. Follow those pins when you refresh the scaffold against the reference project. TypeScript 7 rejects command-line files beside a tsconfig.json unless you pass --ignoreConfig. Project-mode checking (pnpm --dir doc exec tsc --noEmit) is unaffected.

  5. ZFB 6 renders transcluded (:::include) files with the project's GFM, math, CJK and hard-break settings. If you transclude content, review it after the upgrade.

  6. Run the verification in step 7 of the 0.2 → 0.3 recipe below.

Migrating the 0.2 runtime family to 0.3

Runtime 0.3.0 and initializer 0.2.1 are published on npm. The selected published upstream family is zudo-doc/history-server/create-zudo-doc 9.1.4 and ZFB/runtime/md-wasm 5.2.2. It passes the direct strict packed MDX registration and unchanged LED publication scan that blocked the 6.0.0 attempt (TS2322 and 117 hits). The sidebar fix minimizes hydration payloads while preserving authored server content. A successful bundle alone does not establish type compatibility; run the full verification below after migrating.

The old pairing is runtime ^0.2.0, zudo-doc/history-server 5.27.0 and the aligned ZFB 2.21.0 family. A caret on runtime ^0.2.0 does not opt into 0.3. Keep that pairing until you deliberately migrate the entire host. The new pairing is runtime ^0.3.0, initializer 0.2.1, zudo-doc/history-server/create-zudo-doc 9.1.4 and ZFB/runtime/md-wasm 5.2.2. Runtime peer floors are ^9.1.3 and ^5.2.2, matching this verified family. Projects generated by initializer 0.2.0 keep zudo-doc's Classic look (themePack: "default"). To use Graphite, zudo-doc 9's default look that initializer 0.2.1 generates, set themePack: "graphite" and themePacks: ["graphite"] in doc/zfb.config.ts. Independently released packages need not share a patch version.

To migrate, apply this recipe on a project branch:

  1. Back up authored content, evidence, configuration and CAD receipts. Update the runtime range in both root and doc/package.json; update the exact zudo-doc/history-server and all three ZFB pins in the doc host together. Remove retired direct Preact and preact-render-to-string dependencies unless independently used by another explicitly owned renderer. Keep the existing pnpm and Python floors; use Node 24 LTS (>=24 <25) for zudo-doc 7. Reinstall and retain the generated lockfile.

  2. Generate a separate reference project from the recorded create-zudo-doc version. Never run an initializer over your existing app, and never add create-zudo-doc to app dependencies. Compare the docs route, root route, tsconfig, global CSS and link checker listed above.

  3. Extend @takazudo/zudo-doc/tsconfig.base.json. Remove React-to-Preact paths and JSX pragmas, remove baseUrl, preserve genuine aliases with explicitly relative targets such as "@/*": ["./src/*"], and inherit the base's top-level files. Keep TypeScript 5.9. Custom TSX imports Child/Description and the published intrinsic types from zudo-react. Interactive components use setup-owned signals/computed values, Show, native on:* handlers and scope activation/cleanup. A one-time .value read is not a reactive binding.

  4. Replace Tailwind directives, removed safelist.css and theme-no-reset.css with @layer zw-reset, zd-flow;, followed by the public theme.css, content.css, page-loading.css and features.css imports. Move token values to ordinary :root. Import @takazudo/zudo-circuit-doc/styles.css immediately after feature CSS. zudoDoc() registers its Wind manifest; do not scan package sources to recover old utilities.

  5. Use DocHistoryBoundary as DocHistory from @takazudo/zudo-doc/doc-history-area in chrome bindings. Keep the direct mdxExtras: { ...circuitDocMdxExtras } registration with its required props. Retain the docs route's import "../lib/_circuit-doc-islands"; and that seed file's package import. Named Island targets transport only strings and hydrate when visible. Custom dialog code uses modalDialog(scope, options) from the retained use-modal-dialog subpath; conditional model surfaces own abort and disposal, including pending initialization.

  6. Preserve base: "/", /docs/ paths, categories/locales, assets, strictContentBridge, history exclusions, agent-resource links, wide/TOC and llmsTxt choices. Keep circuit.config.ts separate. Header dropdowns group links; they do not define document ancestry. Check the actual sidebar's broader tree, focus/restore and filter behavior without duplicating parent rows.

  7. Run circuit checks, host TypeScript checking (pnpm --dir doc exec tsc --noEmit), builds, and the strict built-HTML link/anchor scanner. Source-only checking cannot see EvidenceAnchor output. Run pnpm --dir doc exec zfb wind audit --project-root . --fail-on error and inspect computed dialog stacking, focus, tables and themes. Exercise search, mobile drawer, history, footprint/model enlargement, Escape/backdrop, no-JS/error states, SPA/reload and delayed-load cleanup with shell/search browser assertions enabled. Update dependency provenance only after reviewing the generated diffs; never change evidence to hide a renderer regression.

The monorepo verifies local runtime and initializer tarballs in empty/minimal/LED consumers, including strict direct registration and host types. Publication is separate: publish the runtime first, pass verify:pack --fixture empty --published-runtime, then publish the initializer.

Adding an authored section

A new top-level section (a sibling of project/, architecture/, research/, decisions/, verification/) needs three things, all in doc/zfb.config.ts, which is project-owned:

  1. A content directory. doc/src/content/docs/<section>/ with its own index.mdx.

  2. A headerNav entry whose categoryMatch matches that directory name exactly. categoryMatch is how zudo-doc decides which sidebar to render for a given page — a section with no matching categoryMatch gets an empty sidebar, silently, with no build error. Copy an existing entry's shape rather than writing one from scratch:

    { label: "My Section", path: "/docs/my-section", categoryMatch: "my-section" }
  3. A slot in the scaffold's six-item header navigation. The scaffold's default headerNav already uses 6 items (Project, Architecture, Research, Decisions, Verification, Components) — the same number the generated site's own What you get page counts. Adding a 7th top-level entry means either removing one, or nesting the new section as a children entry under an existing one (see headerNav[].children — the scaffold's own Components entry nests "Catalog & Records" and "Raw agent resources" this way):

    {
      label: "Components",
      path: "/docs/components",
      categoryMatch: "components",
      children: [
        { label: "Catalog & Records", path: "/docs/components", categoryMatch: "components" },
        { label: "My Section", path: "/docs/my-section", categoryMatch: "my-section" },
      ],
    }

The project/ entry is required by the shared workflow entry: every workflow starts by reading the brief and next actions there, so removing or renaming it breaks the workflow text's own instructions, not just navigation. The other four scaffold sections (architecture, research, decisions, verification) are conventional, not load-bearing — rename or drop them if your project structures its authored docs differently, as long as project/ stays.

Revision History

Takeshi TakatsudoCreated: 2026-09-26T10:06:04+09:00Updated: 2026-11-12T13:20:26Z