create-zudo-circuit-doc 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/bin/create-zudo-circuit-doc.js +6 -0
- package/dist/args.d.ts +21 -0
- package/dist/args.js +71 -0
- package/dist/cli.d.ts +27 -0
- package/dist/cli.js +101 -0
- package/dist/errors.d.ts +4 -0
- package/dist/errors.js +7 -0
- package/dist/git.d.ts +11 -0
- package/dist/git.js +69 -0
- package/dist/help.d.ts +2 -0
- package/dist/help.js +21 -0
- package/dist/install.d.ts +3 -0
- package/dist/install.js +17 -0
- package/dist/next-steps.d.ts +10 -0
- package/dist/next-steps.js +24 -0
- package/dist/plan.d.ts +17 -0
- package/dist/plan.js +59 -0
- package/dist/prompt.d.ts +3 -0
- package/dist/prompt.js +12 -0
- package/dist/scaffold.d.ts +22 -0
- package/dist/scaffold.js +187 -0
- package/dist/shell-quote.d.ts +2 -0
- package/dist/shell-quote.js +7 -0
- package/dist/validate.d.ts +18 -0
- package/dist/validate.js +85 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +13 -0
- package/package.json +49 -0
- package/templates/default/.claude/skills/circuit-spec-integration/SKILL.md +22 -0
- package/templates/default/.claude/skills/circuit-spec-integration/references/rules.json +4 -0
- package/templates/default/.claude/skills/component-spec-audit/SKILL.md +36 -0
- package/templates/default/.claude/skills/component-spec-audit/references/contract.md +21 -0
- package/templates/default/.claude/skills/component-spec-audit/references/direct-routing.json +5 -0
- package/templates/default/.claude/skills/component-spec-audit/references/external-vendor-qualifiers.json +4 -0
- package/templates/default/.claude/skills/component-spec-audit/references/inventory.json +11 -0
- package/templates/default/.claude/skills/component-spec-audit/references/new-component-workflow.md +113 -0
- package/templates/default/AGENTS.md +7 -0
- package/templates/default/CLAUDE.md +7 -0
- package/templates/default/README.md +49 -0
- package/templates/default/ZUDO_DEPS_PINS.md +48 -0
- package/templates/default/_gitignore +25 -0
- package/templates/default/circuit/WORKFLOW.md +361 -0
- package/templates/default/circuit/agent-task-examples.md +178 -0
- package/templates/default/circuit/checks/README.md +37 -0
- package/templates/default/circuit/generated/preflight.json +625 -0
- package/templates/default/circuit/publication/assets.json +9 -0
- package/templates/default/circuit/publication/selection.json +13 -0
- package/templates/default/circuit/templates/README.md +33 -0
- package/templates/default/circuit/templates/cad-asset-receipt.json +58 -0
- package/templates/default/circuit/templates/cad-asset-receipt.md +33 -0
- package/templates/default/circuit/templates/project-docs/architecture/interfaces.mdx +52 -0
- package/templates/default/circuit/templates/project-docs/architecture/overview.mdx +55 -0
- package/templates/default/circuit/templates/project-docs/decisions/decision.mdx +66 -0
- package/templates/default/circuit/templates/project-docs/decisions/sourcing.mdx +57 -0
- package/templates/default/circuit/templates/project-docs/project/change-impact.mdx +61 -0
- package/templates/default/circuit/templates/project-docs/project/index.mdx +62 -0
- package/templates/default/circuit/templates/project-docs/project/next-actions.mdx +58 -0
- package/templates/default/circuit/templates/project-docs/project/task-request.mdx +56 -0
- package/templates/default/circuit/templates/project-docs/research/component-candidate.mdx +60 -0
- package/templates/default/circuit/templates/project-docs/verification/bring-up.mdx +55 -0
- package/templates/default/circuit.config.ts +36 -0
- package/templates/default/doc/package.json +37 -0
- package/templates/default/doc/pages/docs/[[...slug]].tsx +68 -0
- package/templates/default/doc/pages/index.tsx +6 -0
- package/templates/default/doc/pages/lib/_circuit-doc-islands.ts +4 -0
- package/templates/default/doc/public/favicon-16x16.png +0 -0
- package/templates/default/doc/public/favicon-32x32.png +0 -0
- package/templates/default/doc/public/favicon.ico +0 -0
- package/templates/default/doc/public/favicon.svg +4 -0
- package/templates/default/doc/scripts/check-links.js +969 -0
- package/templates/default/doc/src/chrome-bindings.tsx +11 -0
- package/templates/default/doc/src/content/docs/architecture/index.mdx +11 -0
- package/templates/default/doc/src/content/docs/architecture/overview.mdx +55 -0
- package/templates/default/doc/src/content/docs/components/catalog/index.mdx +12 -0
- package/templates/default/doc/src/content/docs/components/index.mdx +49 -0
- package/templates/default/doc/src/content/docs/components/integration/index.mdx +34 -0
- package/templates/default/doc/src/content/docs/components/records/index.mdx +14 -0
- package/templates/default/doc/src/content/docs/decisions/index.mdx +9 -0
- package/templates/default/doc/src/content/docs/project/how-we-work.mdx +67 -0
- package/templates/default/doc/src/content/docs/project/index.mdx +60 -0
- package/templates/default/doc/src/content/docs/project/next-actions.mdx +58 -0
- package/templates/default/doc/src/content/docs/research/index.mdx +9 -0
- package/templates/default/doc/src/content/docs/verification/index.mdx +9 -0
- package/templates/default/doc/src/styles/global.css +31 -0
- package/templates/default/doc/tsconfig.json +13 -0
- package/templates/default/doc/zfb.config.ts +78 -0
- package/templates/default/package.json +23 -0
- package/templates/default/pnpm-workspace.yaml +9 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# __SITE_TITLE__
|
|
2
|
+
|
|
3
|
+
A circuit-development project documented with [zudo-circuit-doc](https://github.com/Takazudo/zudo-circuit-doc) on top of [zudo-doc](https://github.com/zudolab/zudo-doc).
|
|
4
|
+
|
|
5
|
+
It keeps two kinds of knowledge side by side:
|
|
6
|
+
|
|
7
|
+
- **Authored documentation** under `doc/src/content/docs/`: the project brief, architecture, research, decisions, verification plans and the next-actions handoff.
|
|
8
|
+
- **Exact-component evidence** under `.claude/skills/`: one owner bundle per exact component, with sources, facts, verdicts, coverage and pin maps. The component pages under `/docs/components/` are generated from it and never edited by hand.
|
|
9
|
+
|
|
10
|
+
The project starts empty on purpose: no component, board, CAD file or firmware is preselected, and nothing is marked verified. The site builds and explains what to do next.
|
|
11
|
+
|
|
12
|
+
## Commands
|
|
13
|
+
|
|
14
|
+
| Command | What it does |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `pnpm install` | Install dependencies |
|
|
17
|
+
| `pnpm dev` | Dev server, regenerating component pages as evidence changes |
|
|
18
|
+
| `pnpm build` | Publish selected models, generate component pages, build the site |
|
|
19
|
+
| `pnpm check` | Validate evidence, check generated output is current, type-check the site |
|
|
20
|
+
| `pnpm check:site` | Post-build checks: references, publication scope, links |
|
|
21
|
+
| `pnpm circuit:check` | Validate the component evidence (offline) |
|
|
22
|
+
| `pnpm circuit:generate` | Regenerate the component pages and the preflight report |
|
|
23
|
+
| `pnpm circuit:doctor` | Report required and optional tools |
|
|
24
|
+
| `pnpm previews:generate` | Render footprint previews (optional; needs Docker) |
|
|
25
|
+
|
|
26
|
+
Agent-facing commands (new component bundles, online source refresh) are listed in [circuit/WORKFLOW.md](circuit/WORKFLOW.md).
|
|
27
|
+
|
|
28
|
+
## Your first circuit task
|
|
29
|
+
|
|
30
|
+
1. Run `pnpm install`, `pnpm circuit:doctor` and `pnpm dev`, and open the site.
|
|
31
|
+
2. Describe the idea to your agent in a sentence or two and ask it to fill the project brief. It follows Workflow A in [circuit/WORKFLOW.md](circuit/WORKFLOW.md): the brief, a first architecture overview and the next actions, with unknowns left as unknowns.
|
|
32
|
+
3. When you know the first exact part, ask for it by manufacturer and full part number, for example "add this part and download its datasheet". More short requests, in English and Japanese, are in [circuit/agent-task-examples.md](circuit/agent-task-examples.md).
|
|
33
|
+
|
|
34
|
+
## Tool requirements
|
|
35
|
+
|
|
36
|
+
| Tool | Required | Used for |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Node.js ≥22.18 | Yes | Everything |
|
|
39
|
+
| pnpm 11 (via corepack) | Yes | Install and scripts |
|
|
40
|
+
| Python ≥3.10 | Yes | Evidence validation (standard library only) |
|
|
41
|
+
| git | Yes | History and review diffs |
|
|
42
|
+
| Docker with the pinned KiCad image | No | Footprint previews |
|
|
43
|
+
| Chrome | No | Browser smoke check |
|
|
44
|
+
| Network | No | Downloading sources and assets only; the build is offline |
|
|
45
|
+
| easyeda2kicad | No | Importing CAD assets for LCSC-listed parts |
|
|
46
|
+
|
|
47
|
+
## Package status
|
|
48
|
+
|
|
49
|
+
`@takazudo/zudo-circuit-doc` and `create-zudo-circuit-doc` are **not yet published on npm**. Until a release is published, install them from packed tarballs built in the zudo-circuit-doc repository.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# ZUDO_DEPS_PINS
|
|
2
|
+
|
|
3
|
+
Provenance for artifacts vendored or generated from first-party (Takazudo/zudolab) upstreams.
|
|
4
|
+
Updated by `/dev-bump-zudo-deps` on every sync — keep `pinned:` accurate.
|
|
5
|
+
|
|
6
|
+
## create-zudo-doc
|
|
7
|
+
|
|
8
|
+
- repo: zudolab/zudo-doc
|
|
9
|
+
- what: doc-site host scaffold, copied with the `doc/` host-glue lines (chrome bindings import,
|
|
10
|
+
islands seed import, `@takazudo/zudo-circuit-doc/styles.css` import) layered on top — see
|
|
11
|
+
`circuit/WORKFLOW.md` and this project's own `zfb.config.ts`/`chrome-bindings.tsx` for what was
|
|
12
|
+
added beyond the scaffold
|
|
13
|
+
- files: `doc/pages/docs/[[...slug]].tsx`, `doc/pages/index.tsx`, `doc/tsconfig.json`,
|
|
14
|
+
`doc/src/styles/global.css` (the `@import`/`@source` chain; the `@theme` override slot is empty
|
|
15
|
+
by design), `doc/scripts/check-links.js`
|
|
16
|
+
- source: `packages/create-zudo-doc/templates/default/app/{pages/docs/[[...slug]].tsx,pages/index.tsx,tsconfig.json,src/styles/global.css,scripts/check-links.js}`
|
|
17
|
+
(the pinned `create-zudo-doc@5.27.0` output, probed during planning and re-derived by the zudo-circuit-doc monorepo's upstream-scaffold parity check)
|
|
18
|
+
- track: releases
|
|
19
|
+
- pinned: 50cbd5c6c9e5a795d72a74a855e105e4939d4eab (v5.27.0)
|
|
20
|
+
- updated: 2026-09-26
|
|
21
|
+
- sync: run `create-zudo-doc@5.27.0` into a scratch dir and diff its `app/` output against the
|
|
22
|
+
files listed above; `/dev-bump-zudo-deps` performs the upstream-scaffold parity check (#24) the
|
|
23
|
+
same way
|
|
24
|
+
- notes: `doc/scripts/check-links.js` is byte-identical to upstream — it resolves paths from
|
|
25
|
+
`process.cwd()`, so this project's root `check:site` script invokes doc's own `check:links`
|
|
26
|
+
script with pnpm's `--dir doc` flag (cwd becomes `doc/`) rather than pointing `node` at the
|
|
27
|
+
script's path from the project root, to keep the vendored file unmodified.
|
|
28
|
+
`doc/pages/docs/[[...slug]].tsx` carries one added line beyond the upstream docHistory-patched
|
|
29
|
+
stub: `import "../lib/_circuit-doc-islands";` (ADR-016). `doc/src/styles/global.css` has one
|
|
30
|
+
added `@import "@takazudo/zudo-circuit-doc/styles.css";` line after the upstream
|
|
31
|
+
`@takazudo/zudo-doc/features.css` import (ADR-015). Re-apply both after any re-copy.
|
|
32
|
+
|
|
33
|
+
## zfb family (registry-pinned, not vendored)
|
|
34
|
+
|
|
35
|
+
- repo: Takazudo/zfb
|
|
36
|
+
- what: `@takazudo/zfb`, `@takazudo/zfb-runtime`, `@takazudo/zfb-md-wasm` — exact-pinned
|
|
37
|
+
`dependencies` in `doc/package.json` (ADR-003), not a file copy; `/dev-bump-zudo-deps`'s
|
|
38
|
+
registry-dep resolver already tracks these. This entry exists only so a `ZUDO_DEPS_PINS.md`
|
|
39
|
+
sweep surfaces the fallback rule below instead of silently skipping the family.
|
|
40
|
+
- files: `doc/package.json`
|
|
41
|
+
- source: n/a (registry release, not a vendored file copy)
|
|
42
|
+
- track: releases
|
|
43
|
+
- pinned: 2.21.0
|
|
44
|
+
- updated: 2026-09-26
|
|
45
|
+
- sync: bump `doc/package.json` (registry dep edit), not a file sync
|
|
46
|
+
- notes: fallback rule (ADR-003) — if the build or island hydration ever fails on zfb 2.21.0 but
|
|
47
|
+
passes on 2.20.3, pin the whole family (`@takazudo/zfb`, `-runtime`, `-md-wasm`) to 2.20.3 here
|
|
48
|
+
and in `doc/package.json`, and file `/dev-upstream-report`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Dependencies and build output
|
|
2
|
+
node_modules
|
|
3
|
+
doc/dist
|
|
4
|
+
doc/.zfb
|
|
5
|
+
doc/.zfb-build/
|
|
6
|
+
|
|
7
|
+
# Runtime caches (never committed; generated MDX and preflight ARE committed)
|
|
8
|
+
.zudo-doc/
|
|
9
|
+
.circuit-cache/
|
|
10
|
+
|
|
11
|
+
# zudo-doc's own generated Claude Code resource docs (regenerated on every
|
|
12
|
+
# build/check/dev from .claude/ — same convention zudo-doc itself uses)
|
|
13
|
+
doc/src/content/docs/claude/
|
|
14
|
+
doc/src/content/docs/claude-md/
|
|
15
|
+
doc/src/content/docs/claude-commands/
|
|
16
|
+
doc/src/content/docs/claude-skills/
|
|
17
|
+
doc/src/content/docs/claude-agents/
|
|
18
|
+
|
|
19
|
+
# macOS
|
|
20
|
+
.DS_Store
|
|
21
|
+
|
|
22
|
+
# Logs
|
|
23
|
+
*.log
|
|
24
|
+
npm-debug.log*
|
|
25
|
+
pnpm-debug.log*
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
# Circuit workflow
|
|
2
|
+
|
|
3
|
+
This is the canonical working agreement between this project and its AI agents. `CLAUDE.md` and `AGENTS.md` only point here. Every agent, whatever tool it runs in, follows this file.
|
|
4
|
+
|
|
5
|
+
The goal is that a short request such as "download this datasheet", "get the 3D model" or "check this spec" becomes durable, honest project knowledge: exact identity, retained evidence, regenerated documentation and a truthful statement of what is still unknown.
|
|
6
|
+
|
|
7
|
+
Routine work that the request already covers (downloads, evidence updates, regeneration, checks) needs no extra permission prompt. Ask one focused question only when a missing exact identity, design choice or external access prevents a meaningful result.
|
|
8
|
+
|
|
9
|
+
## Shared entry
|
|
10
|
+
|
|
11
|
+
Do this at the start of every task.
|
|
12
|
+
|
|
13
|
+
1. Read the project brief [`project/index.mdx`](../doc/src/content/docs/project/index.mdx) and [`project/next-actions.mdx`](../doc/src/content/docs/project/next-actions.mdx).
|
|
14
|
+
2. Read the inventory (`.claude/skills/component-spec-audit/references/inventory.json`) and the owner bundles and integration rules relevant to the request.
|
|
15
|
+
3. Run `pnpm circuit:check` **before** editing anything. Note what already fails, so pre-existing gaps are not confused with the ones your edit introduces.
|
|
16
|
+
4. Route by **exact manufacturer + complete MPN (including package/suffix) + supplier order code + project role**. A bare base name, family name or package name is not enough to resolve an identity, even when only one match seems plausible. When more than one record could match, report the ambiguity.
|
|
17
|
+
5. For a multi-step task, keep a short work note: the requested result, affected records and files, existing uncertainty, actions taken, new evidence and remaining work. A trivial download whose source record already carries the receipt does not need a separate note.
|
|
18
|
+
|
|
19
|
+
## Layout and ownership
|
|
20
|
+
|
|
21
|
+
| Path | What it is | Owner | Edit by hand? |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| `doc/src/content/docs/{project,architecture,research,decisions,verification}/` | Authored narrative: intent, rationale, decisions, plans, handoff | Project | Yes |
|
|
24
|
+
| `circuit/WORKFLOW.md`, `circuit/agent-task-examples.md`, `circuit/templates/` | This agreement, request examples, unpublished authoring templates | Project | Yes |
|
|
25
|
+
| `.claude/skills/component-*/` | Owner evidence bundles (v1 contract), one per exact component or group | Project | Yes, following the contract |
|
|
26
|
+
| `.claude/skills/component-spec-audit/references/inventory.json` | Orderable identities and declared placements | Project | Yes |
|
|
27
|
+
| `.claude/skills/component-spec-audit/references/direct-routing.json`, `external-vendor-qualifiers.json` | Routing cases and vendor qualifiers | Project | Yes |
|
|
28
|
+
| `.claude/skills/circuit-spec-integration/references/rules.json` | Cross-component integration rules | Project | Yes |
|
|
29
|
+
| `circuit/publication/selection.json` | What is published: record, source and linkable-source IDs, document selections, `expect` count locks | Project | Yes, as a reviewed diff |
|
|
30
|
+
| `circuit/publication/assets.json` | Allowlist of files deliberately published under `doc/public/` | Project | Yes, as a reviewed diff |
|
|
31
|
+
| `circuit/cad-receipts/` | CAD asset receipts (see Workflow D), created when the first asset is acquired | Project | Yes |
|
|
32
|
+
| `.circuit-cache/sources/` | Local working copies of downloaded sources (git-ignored) | Project, local only | Yes |
|
|
33
|
+
| `circuit.config.ts` | Project configuration read by the CLI | Project | Yes |
|
|
34
|
+
| `doc/zfb.config.ts` | Site config: header nav, sidebar categories, features | Project | Yes |
|
|
35
|
+
| `doc/src/**` outside `content/docs/` | Chrome bindings, styles and other site-shell code | Project | Yes |
|
|
36
|
+
| `doc/public/**` except `doc/public/assets/component-previews/` | Files you publish by hand (favicons, downloadable drawings, …) | Project | Yes, listed in `circuit/publication/assets.json` when restricted |
|
|
37
|
+
| Root `package.json` `scripts` | The project's command surface (`pnpm check`, `pnpm build`, …) | Project | Yes |
|
|
38
|
+
| `doc/src/content/docs/components/**` | Generated catalog, record and integration pages | Generator | **Never** |
|
|
39
|
+
| `circuit/generated/preflight.json` | Generated preflight report | Generator | **Never** |
|
|
40
|
+
| `doc/public/assets/component-previews/**` | Generated footprint SVGs and published WRL models | Generator | **Never** |
|
|
41
|
+
| `node_modules/@takazudo/zudo-circuit-doc/` | Renderer, validator, contract and component template | Package | **Never** |
|
|
42
|
+
|
|
43
|
+
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 marker removed is reported as an ownership conflict.
|
|
44
|
+
|
|
45
|
+
The five authored sections above (`project`, `architecture`, `research`, `decisions`, `verification`) are a default, not a ceiling — see [Adding an authored section](#adding-an-authored-section) to add your own.
|
|
46
|
+
|
|
47
|
+
## Adding an authored section
|
|
48
|
+
|
|
49
|
+
A project may add its own top-level authored section (for example `testing/` or `manufacturing/`) alongside the five defaults.
|
|
50
|
+
|
|
51
|
+
1. Add the content under `doc/src/content/docs/<section>/`, with an `index.mdx` as the section's landing page.
|
|
52
|
+
2. Give it a matching `categoryMatch` (equal to the section's directory name) wherever it appears in `headerNav` in `doc/zfb.config.ts`. Without a matching `categoryMatch`, the section's sidebar stays empty even though the pages exist.
|
|
53
|
+
3. The header nav is capped at **6 top-level items** (zudo-doc 5.27.0; the zudo-circuit-doc project documentation's "Getting started → What you get" page states the same cap). Project, Architecture, Research, Decisions, Verification and Components already fill it, so add the new section as a `children` entry under one of the existing dropdown items instead of a seventh top-level entry.
|
|
54
|
+
4. `project/index.mdx` and `project/next-actions.mdx` stay required regardless of what you add — the Shared entry above reads them first, on every task.
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
Run these from the project root.
|
|
59
|
+
|
|
60
|
+
| Command | Does | Network |
|
|
61
|
+
| --- | --- | --- |
|
|
62
|
+
| `pnpm circuit:check` | Canonical offline validation of the evidence contract (`zudo-circuit-doc validate`) | No |
|
|
63
|
+
| `pnpm circuit:generate` | Regenerate component pages and the preflight report (`zudo-circuit-doc generate`) | No |
|
|
64
|
+
| `pnpm circuit:doctor` | Report required and optional tools (`zudo-circuit-doc doctor`) | No |
|
|
65
|
+
| `pnpm check` | Validate, compare a dry-run generation against committed output, check previews, type-check the doc site | No |
|
|
66
|
+
| `pnpm build` | Publish selected models, generate, build the site | No |
|
|
67
|
+
| `pnpm check:site` | Post-build checks: built references, publication scan, strict link check | No |
|
|
68
|
+
| `pnpm dev` | Dev server with generation in watch mode | No |
|
|
69
|
+
| `pnpm previews:generate` | Render footprint SVG previews with the pinned KiCad Docker image (`zudo-circuit-doc footprints generate`) | Image pull only |
|
|
70
|
+
| `pnpm exec zudo-circuit-doc new-component <suffix>` | Create an owner bundle `.claude/skills/component-<suffix>/` from the package template | No |
|
|
71
|
+
| `pnpm exec zudo-circuit-doc validate --online` | Re-download every non-volatile source and compare hashes; never alters retained evidence | **Yes** |
|
|
72
|
+
| `pnpm exec zudo-circuit-doc validate --refresh-source <SOURCE_ID>` | Re-download named sources only | **Yes** |
|
|
73
|
+
| `pnpm exec zudo-circuit-doc validate --json` | Same validation, machine-readable | No |
|
|
74
|
+
| `pnpm exec zudo-circuit-doc models` / `models --check` | Publish or check the selected WRL models | No |
|
|
75
|
+
| `pnpm exec zudo-circuit-doc footprints check` | Check committed footprint previews against their inputs | No |
|
|
76
|
+
| `pnpm exec zudo-circuit-doc check-browser` | Browser smoke of the built site with system Chrome, using `browserSmoke.representatives` or, absent that, up to 3 derived representatives | No |
|
|
77
|
+
|
|
78
|
+
Exit codes: `0` pass, `1` check failed, `2` usage or config error, `4` not run because an optional tool (Docker, Chrome) is missing. Exit `4` is "not run", never "passed". What each check does and does not prove is in [checks/README.md](./checks/README.md).
|
|
79
|
+
|
|
80
|
+
The documentation build never goes online. `--online` and `--refresh-source` are explicit agent operations for acquisition and refresh only.
|
|
81
|
+
|
|
82
|
+
## Evidence contract essentials
|
|
83
|
+
|
|
84
|
+
The frozen contract prose is [`.claude/skills/component-spec-audit/references/contract.md`](../.claude/skills/component-spec-audit/references/contract.md); the package's own copy, [contract.md](../node_modules/@takazudo/zudo-circuit-doc/contract/contract.md) (available after `pnpm install`), is the fallback if the skill copy is ever missing. The summary below does not replace either.
|
|
85
|
+
|
|
86
|
+
### Files of a v1 owner bundle
|
|
87
|
+
|
|
88
|
+
| File | Role |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `manifest.json` | Exact record identity, parentage, and the assigned source, fact and interaction IDs |
|
|
91
|
+
| `sources.json` | Source authority, availability, document revision, URL, hash, locator and retained extract |
|
|
92
|
+
| `facts.json` | Typed claims: value, unit, conditions, provenance, verdict and calculation dependencies |
|
|
93
|
+
| `coverage.json` | Declared domain coverage with explicit reasons and `blocking_fact_ids` |
|
|
94
|
+
| `routing.json` | Positive and negative routing cases to the exact owner |
|
|
95
|
+
| `interactions.json` | Component-level interaction knowledge |
|
|
96
|
+
| `pin-map.json` | Source-backed pin identity and project mapping (symbol pin, footprint pad, net) |
|
|
97
|
+
| `SKILL.md` | Owner-bundle entry instructions |
|
|
98
|
+
|
|
99
|
+
The inventory holds orderable identities and placements; the owner bundle holds evidence. Standalone and subordinate records follow the same rules: parentage changes organization, never rigor. A subordinate gets its own record, source, fact, interaction, routing, coverage and pin-map IDs.
|
|
100
|
+
|
|
101
|
+
### Verdicts
|
|
102
|
+
|
|
103
|
+
Only these six verdicts are valid, spelled exactly:
|
|
104
|
+
|
|
105
|
+
| Verdict | Meaning |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| `PASS - primary-source confirmed` | A qualifying primary claim, or a calculation whose whole dependency closure is primary PASS |
|
|
108
|
+
| `CONFIRMED - distributor identity only` | Narrow order-identity confirmation; never performance evidence |
|
|
109
|
+
| `BLOCKER - deterministic spec violation` | A supported, deterministic violation |
|
|
110
|
+
| `NEEDS BENCH` | Requires measurement or physical verification |
|
|
111
|
+
| `UNSOURCED` | Required support is not retained |
|
|
112
|
+
| `NOT APPLICABLE` | The claim or domain does not apply, with a reason; it never blocks a domain |
|
|
113
|
+
|
|
114
|
+
Do not collapse these into a single pass/fail field anywhere, including in reports.
|
|
115
|
+
|
|
116
|
+
### Provenance, authority and availability
|
|
117
|
+
|
|
118
|
+
- Provenance values: `PRIMARY-SPEC`, `DISTRIBUTOR-IDENTITY`, `REFERENCE-DESIGN`, `CALCULATED`, `PROJECT-CHOICE`, `BENCH-OBSERVED`, `UNVERIFIED`. Provenance and verdict are separate fields.
|
|
119
|
+
- `PRIMARY-SPEC` may be PASS only from an `AVAILABLE` `MANUFACTURER_PRIMARY` source. `CONFIRMED - distributor identity only` needs an `AVAILABLE` `DISTRIBUTOR_IDENTITY` source and a `PROJECT_STATE` identity fact.
|
|
120
|
+
- **Availability is not authority.** A downloaded distributor page is available but not primary. A correct manufacturer URL is authoritative in origin but may be unavailable.
|
|
121
|
+
- An unavailable source has availability `SOURCE UNAVAILABLE` and the **zero-hash sentinel**: a SHA-256 of 64 zeros. It records the absence of verified bytes, not a digest. Never write a guessed or copied hash.
|
|
122
|
+
- A hash belongs to the bytes actually inspected. A URL can later serve different bytes; an old hash is not proof of current remote content.
|
|
123
|
+
|
|
124
|
+
### Locators
|
|
125
|
+
|
|
126
|
+
A source lock records both `physical_pdf_page_index` and `printed_page_label`. The physical index is **0-based**: the first page of the PDF file is `0`, whatever is printed on it. The printed label is the page number as printed on the page (which may be roman, prefixed, or absent). They often differ; record both. Add an exact section, table, figure or row locator and a minimal normalized extract, enough to audit the claim without redistributing the document.
|
|
127
|
+
|
|
128
|
+
### Conditions and scope
|
|
129
|
+
|
|
130
|
+
Keep absolute maximum distinct from recommended operation, typical curves distinct from guaranteed limits, clamp distinct from standoff and breakdown, and project state distinct from manufacturer behavior. Every quantitative fact carries an explicit unit and its conditions; textual facts use unit `NONE`.
|
|
131
|
+
|
|
132
|
+
### Calculations
|
|
133
|
+
|
|
134
|
+
A `CALCULATED` fact lists its raw fact IDs in `depends_on` and an evaluable arithmetic `expression` that names exactly those IDs. Missing, unused, self and cyclic dependencies fail. A calculated PASS is trusted only when every raw leaf of its **dependency closure** is a primary-source PASS; a figure computed from a typical value stays dependent on typical evidence.
|
|
135
|
+
|
|
136
|
+
The validator recomputes the arithmetic. **Arithmetic is not dimensional proof:** it does not check units algebraically or prove the source table was read correctly. Unit consistency and table interpretation remain an explicit review step for the agent.
|
|
137
|
+
|
|
138
|
+
### Coverage
|
|
139
|
+
|
|
140
|
+
`COVERED` means the declared domain has available, non-`UNSOURCED` evidence for its listed facts. **`COVERED` is not hardware sign-off**: a `NEEDS BENCH` fact can still count as available evidence. Report explicit verdicts, never a summary "safe" badge. Every `OPEN` domain names its blocking facts in `blocking_fact_ids`.
|
|
141
|
+
|
|
142
|
+
## Workflow A — start a circuit
|
|
143
|
+
|
|
144
|
+
**Input:** an idea, constraints, sketches or an existing design.
|
|
145
|
+
|
|
146
|
+
1. Fill the brief in `doc/src/content/docs/project/index.mdx`: intended behavior, interfaces, power source, dimensions, environment, quantity, constraints and unknowns. Keep "Not entered" where the owner has not said.
|
|
147
|
+
2. Draft functional blocks and operating states in `doc/src/content/docs/architecture/overview.mdx`. Name the decisions that constrain component selection. Start from responsibilities, not IC names.
|
|
148
|
+
3. Record candidate components as authored research (copy `circuit/templates/project-docs/research/component-candidate.mdx` into `doc/src/content/docs/research/`). Candidates stay out of the inventory until selected.
|
|
149
|
+
4. Put the most consequential uncertainties and the next bounded task in `doc/src/content/docs/project/next-actions.mdx`.
|
|
150
|
+
5. Add integration rules only when a real interaction exists (see [Integration rules](#integration-rules)).
|
|
151
|
+
6. Run `pnpm circuit:check` and `pnpm check`.
|
|
152
|
+
|
|
153
|
+
**Done:** another agent can explain the goal and the next decision from the brief, the overview and next actions alone, without the original conversation. Unknown electrical values remain unknown; none was invented to fill a table.
|
|
154
|
+
|
|
155
|
+
## Workflow B — add or replace an exact component
|
|
156
|
+
|
|
157
|
+
**Input:** an exact part or link, its function, a proposed placement, or a requested substitution. The step-by-step checklist is [new-component-workflow.md](../.claude/skills/component-spec-audit/references/new-component-workflow.md).
|
|
158
|
+
|
|
159
|
+
1. **Resolve identity:** manufacturer, complete MPN with suffix and package variant, supplier order codes, and population intent (fitted, not fitted, hand-fitted, external).
|
|
160
|
+
2. **Find or create the owner.** Reuse an existing owner bundle, or create one:
|
|
161
|
+
|
|
162
|
+
```sh
|
|
163
|
+
pnpm exec zudo-circuit-doc new-component <suffix>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
This copies the package template to `.claude/skills/component-<suffix>/`. It contains deliberate placeholder values; replace **every** one. The validator fails on any placeholder left behind.
|
|
167
|
+
3. **Obtain evidence** through Workflow C. Record identity, ratings, pinout, defaults, conditions and relevant behavior at the granularity the design needs.
|
|
168
|
+
4. **Map pins:** symbol pins, footprint pads and current nets in `pin-map.json`. Board placement is project state with its own revision.
|
|
169
|
+
5. **Update the inventory** (`.claude/skills/component-spec-audit/references/inventory.json`, manual profile):
|
|
170
|
+
- One line per orderable identity. Identity is a unique `line_id` plus a unique (manufacturer, complete MPN) pair. The line's `mpn`, `manufacturer`, `lcsc` and `package` must equal the owner record's.
|
|
171
|
+
- `lcsc` is required but may be `""`. A non-empty value must be a real LCSC C-number read from the supplier listing for this exact part. **Never fabricate or guess a C-number**; leave it empty when the part is not on LCSC or not yet checked.
|
|
172
|
+
- `suppliers: [{ "supplier": …, "order_code": … }]` is optional and display-only; it does not create routing aliases.
|
|
173
|
+
- `placements` lists board and reference designator. It may be `[]`. Placements are **declared, not verified**: the manual profile does not bind them to a schematic.
|
|
174
|
+
- Update the reviewed `assertions` counts. Add the line's direct-routing cases to `direct-routing.json` (one set per line is mandatory once the file is configured).
|
|
175
|
+
6. **Read the `SCOPE:` line** printed by `pnpm circuit:check`. It states that the manual inventory provider performed no schematic or placement binding, how many lines and declared placements it saw, and whether the pin-asset check ran or was skipped because CAD is disabled. That line is the honest limit of what the check proved; repeat it in the report.
|
|
176
|
+
7. **Obtain CAD** through Workflow D if the part goes on a board.
|
|
177
|
+
8. **Update the publication selection in the same task** (see [Publication policy](#publication-policy)), then `pnpm circuit:generate`, `pnpm check`, and `pnpm build` followed by `pnpm check:site`.
|
|
178
|
+
9. **For a substitution,** compare electrical, firmware, startup, thermal and mechanical dependencies of both exact parts, and record changed design decisions explicitly (use a change-impact note).
|
|
179
|
+
|
|
180
|
+
**Done:** one exact identity is traceable from the inventory through its owner bundle, pin map and published page; every outstanding gap is visible as an `OPEN` domain or a non-PASS verdict; the selection diff is part of the change. "Added to the catalog" does not mean "suitable for production".
|
|
181
|
+
|
|
182
|
+
## Workflow C — find or download a datasheet or source
|
|
183
|
+
|
|
184
|
+
**Input:** an exact component and the fact(s) that need evidence.
|
|
185
|
+
|
|
186
|
+
1. Reuse a retained source if its identity, revision and scope meet the task.
|
|
187
|
+
2. Prefer manufacturer-primary documents for performance claims. A distributor page may establish order identity only, in the narrow identity lane.
|
|
188
|
+
3. Fetch the actual bytes into the local cache, following redirects and keeping the response headers:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
mkdir -p .circuit-cache/sources/<SOURCE_ID>
|
|
192
|
+
curl -fsSL --max-redirs 10 -D .circuit-cache/sources/<SOURCE_ID>/headers.txt \
|
|
193
|
+
-o .circuit-cache/sources/<SOURCE_ID>/document.pdf "<URL>"
|
|
194
|
+
head -c 5 .circuit-cache/sources/<SOURCE_ID>/document.pdf # must print %PDF-
|
|
195
|
+
sha256sum .circuit-cache/sources/<SOURCE_ID>/document.pdf
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
4. **Reject HTML posing as a PDF.** A file whose first bytes are not `%PDF-`, whose `Content-Type` header is `text/html`, or which contains `<html` or a login, captcha or error page is **not** a datasheet, whatever its URL or filename says. Then open the PDF and confirm the title, document number and part list cover the exact MPN and package before relying on it.
|
|
199
|
+
5. Record in `sources.json`: title, document number, revision and date, authoritative URL, retrieval date, authority class, availability, SHA-256 of the inspected bytes, `physical_pdf_page_index` (0-based), `printed_page_label`, the exact locator and a minimal extract.
|
|
200
|
+
6. Inspect pin diagrams, tables and graphs visually when text extraction loses their meaning.
|
|
201
|
+
7. Refresh the affected facts and their dependency closure. A download that succeeds does not make every fact PASS; each claim is checked against its own locator.
|
|
202
|
+
8. Regenerate (`pnpm circuit:generate`) and run `pnpm circuit:check`.
|
|
203
|
+
|
|
204
|
+
### Retention policy
|
|
205
|
+
|
|
206
|
+
| Storage | Location | Committed | Meaning |
|
|
207
|
+
| --- | --- | --- | --- |
|
|
208
|
+
| Working cache | `.circuit-cache/sources/<SOURCE_ID>/` | No (git-ignored) | Convenient local bytes; reproducible only while the URL still serves the same bytes (compare the recorded hash) |
|
|
209
|
+
| Project-retained archive | A committed directory the project chooses, for example `circuit/source-archive/` | Yes | Durable bytes, only when the project decides to keep them and the source's terms allow it |
|
|
210
|
+
| Public selected asset | `doc/public/...`, listed in `circuit/publication/assets.json` | Yes | A deliberate documentation download; requires permission to redistribute |
|
|
211
|
+
|
|
212
|
+
The evidence record, not the cached file, is authoritative. Nothing under `.circuit-cache/` is published or relied on by the build.
|
|
213
|
+
|
|
214
|
+
### SOURCE UNAVAILABLE procedure
|
|
215
|
+
|
|
216
|
+
If acquisition is blocked (paywall, login, bot wall, dead link, transport error):
|
|
217
|
+
|
|
218
|
+
1. Keep the source entry with availability `SOURCE UNAVAILABLE` and the zero-hash sentinel. Record the attempted URL, the date and the genuine reason in the locator or extract.
|
|
219
|
+
2. Give facts that depend on it the verdict `UNSOURCED` (or keep them unresolved); list them in the relevant `OPEN` coverage entry's `blocking_fact_ids`.
|
|
220
|
+
3. Do not borrow values from a same-name part, a family datasheet or memory, and do not create an empty file and call it a download.
|
|
221
|
+
4. Add the retry to next actions. When the source becomes available later, inspect it and update claims one by one; never bulk-promote facts.
|
|
222
|
+
|
|
223
|
+
**Done:** the next agent can find exactly which bytes were consulted (or why none were), and which facts each source supports.
|
|
224
|
+
|
|
225
|
+
## Workflow D — obtain symbol, footprint and 3D model
|
|
226
|
+
|
|
227
|
+
**Input:** the exact orderable variant and its intended board or mechanical use. CAD checks run only when `cad.enabled` is `true` in `circuit.config.ts`, with its symbol libraries, footprint roots and model root configured; otherwise the pin-asset check is reported as SKIPPED.
|
|
228
|
+
|
|
229
|
+
A complete enabled block, with real values taken from this repository's own `examples/minimal/circuit.config.ts`:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import type { CircuitConfig } from "@takazudo/zudo-circuit-doc/config";
|
|
233
|
+
import { DEFAULT_PREVIEW_RENDERER } from "@takazudo/zudo-circuit-doc/config";
|
|
234
|
+
|
|
235
|
+
export default {
|
|
236
|
+
// ...
|
|
237
|
+
cad: {
|
|
238
|
+
enabled: true,
|
|
239
|
+
libraryName: "example-minimal-circuit-lib",
|
|
240
|
+
symbolLibraries: ["symbols/example-minimal-circuit-lib.kicad_sym"],
|
|
241
|
+
footprintMasterRoot: "footprints/kicad",
|
|
242
|
+
footprintLibraryRoot: "footprints/kicad/example-minimal-circuit-lib.pretty",
|
|
243
|
+
modelRoot: "footprints/kicad/example-minimal-circuit-lib.3dshapes",
|
|
244
|
+
modelLocatorPrefix: "${KIPRJMOD}/../../footprints/kicad/example-minimal-circuit-lib.3dshapes/",
|
|
245
|
+
previewRenderer: DEFAULT_PREVIEW_RENDERER,
|
|
246
|
+
},
|
|
247
|
+
// ...
|
|
248
|
+
} satisfies CircuitConfig;
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
- `libraryName` — the KiCad library name the project's symbols and footprints live under.
|
|
252
|
+
- `symbolLibraries` — one or more `.kicad_sym` paths merged for pin lookups.
|
|
253
|
+
- `footprintMasterRoot` / `footprintLibraryRoot` — the canonical footprint directory and the `.pretty` library directory the check keeps byte-identical (`cmp -s`) when both are configured.
|
|
254
|
+
- `modelRoot` — the `.3dshapes` directory holding the published WRL models (and any optional STEP siblings).
|
|
255
|
+
- `modelLocatorPrefix` — the `${KIPRJMOD}`-relative prefix written into a footprint's 3D-model reference.
|
|
256
|
+
- `previewRenderer` — reuse the package's `DEFAULT_PREVIEW_RENDERER` (`import { DEFAULT_PREVIEW_RENDERER } from "@takazudo/zudo-circuit-doc/config"`; the pinned KiCad Docker image, version, platform, render layers and theme) unless the project needs a different renderer. A missing rendered preview means running `pnpm previews:generate`, not hand-authoring one.
|
|
257
|
+
|
|
258
|
+
1. Resolve the exact part and package, and check whether the project already has the symbol, footprint or model.
|
|
259
|
+
2. Acquire assets, recording provider, exact product page, original filename, date and SHA-256 in a receipt. Keep the unmodified import next to any documented derived version.
|
|
260
|
+
- **KiCad official libraries:** pin the library release tag you took files from and record it. The KiCad 9 official 3D library ships STEP only; a matching WRL may exist only in a tagged 8.x release. Use a pair from one tagged release or record the WRL as unavailable. The web viewer renders WRL only, and no STEP-to-WRL conversion is part of this workflow.
|
|
261
|
+
- **LCSC-listed parts (optional):** `easyeda2kicad --lcsc_id <C-number> --footprint --symbol --3d --output .circuit-cache/cad/<part>` imports EasyEDA assets. Treat the result as an import to inspect, not as verified geometry.
|
|
262
|
+
3. Merge only the part's symbol into the configured symbol library; never overwrite a shared multi-symbol library file. If the config names both a footprint master root and a library root, keep the `.kicad_mod` byte-identical in both (`cmp -s`).
|
|
263
|
+
4. Check symbol pins and footprint pads against the exact datasheet: numbering, exposed pad, pin 1, polarity, pitch, drill, body envelope, mounting. `pnpm circuit:check` enforces that symbol pins, footprint pads and the pin map agree; it cannot tell whether they match the datasheet.
|
|
264
|
+
5. Check the 3D model's variant, units, axis and origin, scale, rotation, offset, seating plane and dimensions against the mechanical drawing.
|
|
265
|
+
6. Classify **fidelity** with the evidence for the label:
|
|
266
|
+
|
|
267
|
+
| Fidelity | Meaning |
|
|
268
|
+
| --- | --- |
|
|
269
|
+
| `exact-vendor` | Published by the manufacturer for this exact orderable variant |
|
|
270
|
+
| `family` | Represents the package or series, not proven for this variant (for example a generic library package) |
|
|
271
|
+
| `derived` | Produced from an original by a recorded transformation; keep input hashes, script, parameters and output hashes |
|
|
272
|
+
| `unavailable` | No usable asset; the state is documented, nothing is fabricated |
|
|
273
|
+
|
|
274
|
+
A familiar shape is not proof of the exact variant.
|
|
275
|
+
7. Write the receipt from [templates/cad-asset-receipt.json](./templates/cad-asset-receipt.json) (and optionally the Markdown form) to `circuit/cad-receipts/<ASSET_ID>.receipt.json`.
|
|
276
|
+
8. Select the package for preview in `circuit/publication/selection.json` and update `expect.packages`, then regenerate: `pnpm previews:generate` (Docker), `pnpm exec zudo-circuit-doc footprints check`, `pnpm exec zudo-circuit-doc models`, `pnpm exec zudo-circuit-doc models --check`. Restart the dev server after adding an asset; it does not pick up new public files while running.
|
|
277
|
+
9. Report which checks were performed and which remain visual or physical.
|
|
278
|
+
|
|
279
|
+
A preview is a rendering result. **A preview is not dimensional proof**, and a footprint that imports cleanly does not prove pin correspondence or physical seating.
|
|
280
|
+
|
|
281
|
+
**Done:** a future agent can tell which file to use, why it matches, which fidelity class it has and on what evidence, and what the model cannot establish.
|
|
282
|
+
|
|
283
|
+
## Workflow E — verify a specification
|
|
284
|
+
|
|
285
|
+
**Input:** a claim, a component record, a design decision or a changed source.
|
|
286
|
+
|
|
287
|
+
1. Identify the exact claim, raw facts, units, conditions, provenance and source revision.
|
|
288
|
+
2. Classify the fact: absolute maximum, recommended operation, guaranteed characteristic, typical curve, transient or protection condition, thermal/SOA, or project state.
|
|
289
|
+
3. Inspect the primary evidence at its locator and compare the source condition with the intended use condition.
|
|
290
|
+
4. Recompute calculations with explicit `depends_on` and units. A calculation cannot gain stronger evidence than its raw inputs, and the arithmetic check does not prove dimensional correctness.
|
|
291
|
+
5. Where the conclusion depends on rails, startup and defaults, pins, harnesses, thermal assumptions or firmware, check the cross-component state too (integration rules).
|
|
292
|
+
6. Record one of the six verdicts with its reason. Keep `NEEDS BENCH` and `UNSOURCED` where they apply.
|
|
293
|
+
7. Regenerate, update the affected decision or open question, and run `pnpm circuit:check` and `pnpm check`.
|
|
294
|
+
|
|
295
|
+
**Done:** the claim's meaning, conditions and support are clear, with its locator, and the report says whether it is source-confirmed, violated, unsupported or awaiting measurement. A schema pass is not an electrical correctness result.
|
|
296
|
+
|
|
297
|
+
## Workflow F — record a bench result
|
|
298
|
+
|
|
299
|
+
**Input:** actual measurements or a user-supplied test log.
|
|
300
|
+
|
|
301
|
+
1. Use a verification report (copy `circuit/templates/project-docs/verification/bring-up.mdx` into `doc/src/content/docs/verification/`). Record board revision, population changes, firmware and configuration, instruments and setup, supply and load, ambient conditions, method, raw observations, the expected criterion with its basis, and the outcome.
|
|
302
|
+
2. Keep raw data and photographs linked. Preserve separate runs and rework states; a later success never overwrites an earlier failure.
|
|
303
|
+
3. Where a measurement becomes evidence, record it with provenance `BENCH-OBSERVED` from a `BENCH_RECORD` source. Never force a measurement into a manufacturer-primary PASS.
|
|
304
|
+
4. Scope the conclusion to the tested unit, configuration and conditions. On a failure, link the affected decision and add the next action.
|
|
305
|
+
|
|
306
|
+
**Done:** the observation, its conditions and its scope are recorded against one revision, only observed values are entered, and the affected coverage and next actions are updated.
|
|
307
|
+
|
|
308
|
+
## Workflow G — handle a source or design change
|
|
309
|
+
|
|
310
|
+
**Input:** an updated datasheet, a substitution, a footprint edit, a firmware change or a schematic/net change.
|
|
311
|
+
|
|
312
|
+
1. Find every reference to the affected source, fact and record IDs (search the owner bundles, `rules.json`, the selection and authored pages).
|
|
313
|
+
2. Evaluate stale project-state hashes, calculated dependencies, integration rules, pin maps, footprint and model hashes and authored decisions.
|
|
314
|
+
3. Update each affected item, or mark it pending with a reason. Do not clear unrelated unresolved items to get a clean output.
|
|
315
|
+
4. Never re-pin a source hash without inspecting the changed bytes.
|
|
316
|
+
5. Use a change-impact note (`circuit/templates/project-docs/project/change-impact.mdx`) when the change has downstream effects.
|
|
317
|
+
6. Regenerate and run `pnpm circuit:check`, `pnpm check` and, when publishable output changed, `pnpm build` and `pnpm check:site`.
|
|
318
|
+
|
|
319
|
+
**Done:** one small reviewable diff contains the evidence change, the design state, the regenerated pages and any revised decision; everything still pending is named with its reason.
|
|
320
|
+
|
|
321
|
+
## Integration rules
|
|
322
|
+
|
|
323
|
+
`.claude/skills/circuit-spec-integration/references/rules.json` starts as `{ "schema_version": 1, "rules": [] }`. An empty rule list is valid.
|
|
324
|
+
|
|
325
|
+
- Add a rule **only when a real interaction exists** between exact components (a shared rail, a logic-level boundary, a startup dependency, a thermal coupling). Name its records, fact IDs, conditions, verdict and refusal text, and any conditioned calculation.
|
|
326
|
+
- An evidence chain lists stages from official source through conditioned requirement, netlist, symbol/footprint, PCB orientation, BOM and placement, as-built, programmed and bench. **Stages stay `OPEN` with empty `fact_ids` until real evidence exists.** A completed early stage never implies a later one; a generated netlist is never `CONFIRMED`.
|
|
327
|
+
- Follow [circuit-spec-integration](../.claude/skills/circuit-spec-integration/SKILL.md) when a question spans more than one component.
|
|
328
|
+
|
|
329
|
+
## Publication policy
|
|
330
|
+
|
|
331
|
+
Adding evidence does not publish it. `circuit/publication/selection.json` lists exactly which record IDs, source IDs and linkable source IDs are published, one document selection per record (`documentKind` is `datasheet`, `specification` or `drawing`, chosen after inspecting the content), and the `expect` counts (`records`, `sources`, `integrationRules`, `packages`) that lock the published set. Zero is allowed.
|
|
332
|
+
|
|
333
|
+
- Selection and assets-allowlist edits happen **in the same task** as the evidence change and show up as a reviewable diff. No per-part conversational permission prompt is needed; the diff is the review.
|
|
334
|
+
- Selecting a source publishes its metadata; an outbound link is published only for IDs in `linkableSourceIds`.
|
|
335
|
+
- Raw sources and CAD files stay outside `doc/public/`. A file placed there deliberately must be listed in `circuit/publication/assets.json` with a reason; the publication scan fails otherwise. Generated previews under `doc/public/assets/component-previews/` are the only exception.
|
|
336
|
+
|
|
337
|
+
## Tool matrix
|
|
338
|
+
|
|
339
|
+
| Tool | Status | Needed for |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
| Node.js ≥22.18 | Required | Everything |
|
|
342
|
+
| pnpm 11 (via corepack) | Required | Install and scripts |
|
|
343
|
+
| Python ≥3.10 (stdlib only) | Required | `pnpm circuit:check` (override the interpreter with `CIRCUIT_DOC_PYTHON`) |
|
|
344
|
+
| git | Required | History, review diffs, doc history |
|
|
345
|
+
| Docker + the pinned KiCad image | Optional | `pnpm previews:generate` |
|
|
346
|
+
| Chrome (or `CHROME_BIN`) | Optional | `zudo-circuit-doc check-browser` |
|
|
347
|
+
| Network | Optional | Acquisition and `--online` refresh only; never the build |
|
|
348
|
+
| easyeda2kicad | Optional | Importing assets for LCSC-listed parts |
|
|
349
|
+
|
|
350
|
+
`pnpm circuit:doctor` reports which of these are present. A missing optional tool gives exit `4` ("not run") for the command that needs it. The dev server must be restarted after adding an asset to `doc/public/` (zudo-doc behavior).
|
|
351
|
+
|
|
352
|
+
## Completion report
|
|
353
|
+
|
|
354
|
+
End every task with four parts:
|
|
355
|
+
|
|
356
|
+
1. **Obtained or checked:** what was downloaded, verified, generated or measured.
|
|
357
|
+
2. **Exact identity:** the manufacturer, complete MPN, package variant, source (document number, revision, locator) or asset (with its receipt and fidelity) involved.
|
|
358
|
+
3. **Changed:** the evidence records, authored pages, selection and generated outputs that changed, and the checks run with their actual results (including any `SCOPE:` and `SKIP:` lines).
|
|
359
|
+
4. **Remaining:** what is still open, each item with its reason (unavailable source, needs bench, needs a design decision).
|
|
360
|
+
|
|
361
|
+
Keep routine tool chatter out of the report. Update next actions when the project state has materially changed.
|