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.
Files changed (91) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +58 -0
  4. package/bin/create-zudo-circuit-doc.js +6 -0
  5. package/dist/args.d.ts +21 -0
  6. package/dist/args.js +71 -0
  7. package/dist/cli.d.ts +27 -0
  8. package/dist/cli.js +101 -0
  9. package/dist/errors.d.ts +4 -0
  10. package/dist/errors.js +7 -0
  11. package/dist/git.d.ts +11 -0
  12. package/dist/git.js +69 -0
  13. package/dist/help.d.ts +2 -0
  14. package/dist/help.js +21 -0
  15. package/dist/install.d.ts +3 -0
  16. package/dist/install.js +17 -0
  17. package/dist/next-steps.d.ts +10 -0
  18. package/dist/next-steps.js +24 -0
  19. package/dist/plan.d.ts +17 -0
  20. package/dist/plan.js +59 -0
  21. package/dist/prompt.d.ts +3 -0
  22. package/dist/prompt.js +12 -0
  23. package/dist/scaffold.d.ts +22 -0
  24. package/dist/scaffold.js +187 -0
  25. package/dist/shell-quote.d.ts +2 -0
  26. package/dist/shell-quote.js +7 -0
  27. package/dist/validate.d.ts +18 -0
  28. package/dist/validate.js +85 -0
  29. package/dist/version.d.ts +6 -0
  30. package/dist/version.js +13 -0
  31. package/package.json +49 -0
  32. package/templates/default/.claude/skills/circuit-spec-integration/SKILL.md +22 -0
  33. package/templates/default/.claude/skills/circuit-spec-integration/references/rules.json +4 -0
  34. package/templates/default/.claude/skills/component-spec-audit/SKILL.md +36 -0
  35. package/templates/default/.claude/skills/component-spec-audit/references/contract.md +21 -0
  36. package/templates/default/.claude/skills/component-spec-audit/references/direct-routing.json +5 -0
  37. package/templates/default/.claude/skills/component-spec-audit/references/external-vendor-qualifiers.json +4 -0
  38. package/templates/default/.claude/skills/component-spec-audit/references/inventory.json +11 -0
  39. package/templates/default/.claude/skills/component-spec-audit/references/new-component-workflow.md +113 -0
  40. package/templates/default/AGENTS.md +7 -0
  41. package/templates/default/CLAUDE.md +7 -0
  42. package/templates/default/README.md +49 -0
  43. package/templates/default/ZUDO_DEPS_PINS.md +48 -0
  44. package/templates/default/_gitignore +25 -0
  45. package/templates/default/circuit/WORKFLOW.md +361 -0
  46. package/templates/default/circuit/agent-task-examples.md +178 -0
  47. package/templates/default/circuit/checks/README.md +37 -0
  48. package/templates/default/circuit/generated/preflight.json +625 -0
  49. package/templates/default/circuit/publication/assets.json +9 -0
  50. package/templates/default/circuit/publication/selection.json +13 -0
  51. package/templates/default/circuit/templates/README.md +33 -0
  52. package/templates/default/circuit/templates/cad-asset-receipt.json +58 -0
  53. package/templates/default/circuit/templates/cad-asset-receipt.md +33 -0
  54. package/templates/default/circuit/templates/project-docs/architecture/interfaces.mdx +52 -0
  55. package/templates/default/circuit/templates/project-docs/architecture/overview.mdx +55 -0
  56. package/templates/default/circuit/templates/project-docs/decisions/decision.mdx +66 -0
  57. package/templates/default/circuit/templates/project-docs/decisions/sourcing.mdx +57 -0
  58. package/templates/default/circuit/templates/project-docs/project/change-impact.mdx +61 -0
  59. package/templates/default/circuit/templates/project-docs/project/index.mdx +62 -0
  60. package/templates/default/circuit/templates/project-docs/project/next-actions.mdx +58 -0
  61. package/templates/default/circuit/templates/project-docs/project/task-request.mdx +56 -0
  62. package/templates/default/circuit/templates/project-docs/research/component-candidate.mdx +60 -0
  63. package/templates/default/circuit/templates/project-docs/verification/bring-up.mdx +55 -0
  64. package/templates/default/circuit.config.ts +36 -0
  65. package/templates/default/doc/package.json +37 -0
  66. package/templates/default/doc/pages/docs/[[...slug]].tsx +68 -0
  67. package/templates/default/doc/pages/index.tsx +6 -0
  68. package/templates/default/doc/pages/lib/_circuit-doc-islands.ts +4 -0
  69. package/templates/default/doc/public/favicon-16x16.png +0 -0
  70. package/templates/default/doc/public/favicon-32x32.png +0 -0
  71. package/templates/default/doc/public/favicon.ico +0 -0
  72. package/templates/default/doc/public/favicon.svg +4 -0
  73. package/templates/default/doc/scripts/check-links.js +969 -0
  74. package/templates/default/doc/src/chrome-bindings.tsx +11 -0
  75. package/templates/default/doc/src/content/docs/architecture/index.mdx +11 -0
  76. package/templates/default/doc/src/content/docs/architecture/overview.mdx +55 -0
  77. package/templates/default/doc/src/content/docs/components/catalog/index.mdx +12 -0
  78. package/templates/default/doc/src/content/docs/components/index.mdx +49 -0
  79. package/templates/default/doc/src/content/docs/components/integration/index.mdx +34 -0
  80. package/templates/default/doc/src/content/docs/components/records/index.mdx +14 -0
  81. package/templates/default/doc/src/content/docs/decisions/index.mdx +9 -0
  82. package/templates/default/doc/src/content/docs/project/how-we-work.mdx +67 -0
  83. package/templates/default/doc/src/content/docs/project/index.mdx +60 -0
  84. package/templates/default/doc/src/content/docs/project/next-actions.mdx +58 -0
  85. package/templates/default/doc/src/content/docs/research/index.mdx +9 -0
  86. package/templates/default/doc/src/content/docs/verification/index.mdx +9 -0
  87. package/templates/default/doc/src/styles/global.css +31 -0
  88. package/templates/default/doc/tsconfig.json +13 -0
  89. package/templates/default/doc/zfb.config.ts +78 -0
  90. package/templates/default/package.json +23 -0
  91. package/templates/default/pnpm-workspace.yaml +9 -0
@@ -0,0 +1,178 @@
1
+ # Everyday agent requests for a circuit project
2
+
3
+ These are nine short requests an owner can give an agent in this project, each in English and Japanese. They are **task examples**, not an installed skill. The agent handles each one by following [WORKFLOW.md](./WORKFLOW.md); the "Workflow and commands" line under each example names the section and the project commands involved.
4
+
5
+ The everyday request should remain short. This project supplies the shared conventions for exact identity, evidence retention, asset checks, generated documentation, and truthful status reporting. The “completion expectations” below explain what those short requests should produce. Every task starts with the shared entry (`pnpm circuit:check` before editing) and ends with the four-part completion report.
6
+
7
+ Replace uppercase tokens such as `COMPONENT_ID`, `CLAIM_ID`, and `REVISION` with the actual project references. None of the examples selects a part or assumes a circuit rating. If a user names a component in ordinary language, the local agent should resolve it through the project's component evidence bundle and report ambiguity when there is more than one plausible match.
8
+
9
+ ## 1. Download the exact datasheet
10
+
11
+ **English request**
12
+
13
+ > Download the datasheet for COMPONENT_ID and keep it with the component evidence. Check that it covers the exact manufacturer, MPN, and package suffix we are using. Update the source record and tell me which design-relevant information is still missing.
14
+
15
+ **日本語の依頼例**
16
+
17
+ > COMPONENT_ID のデータシートをダウンロードして、部品のエビデンスと一緒に保存して。採用候補のメーカー・正式型番・パッケージ末尾まで一致する資料か確認し、出典の記録を更新してほしい。設計上必要な情報で、まだ確認できていないものも教えて。
18
+
19
+ **Completion expectations**
20
+
21
+ - Resolve the exact component first. Prefer the manufacturer's document; record a distributor-hosted copy as such.
22
+ - Retain the actual downloaded file when available, its originating URL, access date, document identity or revision, checksum, and applicability to the exact part.
23
+ - Distinguish “source linked,” “file acquired,” and “relevant specification checked.” Downloading the PDF does not mean every claim has been audited.
24
+ - If the file cannot be obtained, preserve the actual attempted source and limitation. Do not create an empty file and call it a downloaded datasheet.
25
+
26
+ **Workflow and commands:** Workflow C. Cache the bytes under `.circuit-cache/sources/`, check for `%PDF-`, update `sources.json`, then `pnpm circuit:generate` and `pnpm circuit:check`.
27
+
28
+ ## 2. Find and check a 3D model
29
+
30
+ **English request**
31
+
32
+ > Find 3D data for COMPONENT_ID and add it to the project. Check the body dimensions, mounting datum, and relevant pin or actuator positions against the exact part's drawing. If only a family model is available, make that limitation visible and tell me what must be corrected.
33
+
34
+ **日本語の依頼例**
35
+
36
+ > COMPONENT_ID の 3D データを探してプロジェクトに追加して。外形寸法、取り付け基準面、関係する端子や操作部の位置を、その型番の図面と照合してほしい。シリーズ共通モデルしかない場合は、そのことを明記して、修正が必要な箇所を教えて。
37
+
38
+ **Completion expectations**
39
+
40
+ - Preserve the acquired original and its provenance. Record the fidelity class (`exact-vendor`, `family`, `derived` or `unavailable`) in the CAD asset receipt.
41
+ - If conversion or correction is requested and possible, preserve the transformation and link the derived result to its source.
42
+ - Inspect orientation, scale, relevant dimensions, and mounting datum. A successful preview is a rendering result, not proof of dimensional correctness.
43
+ - Report unavailable drawings or unknown dimensions as gaps. Do not infer numeric pin mapping from visual resemblance.
44
+
45
+ **Workflow and commands:** Workflow D. Write a receipt in `circuit/cad-receipts/`, classify fidelity, then `pnpm previews:generate`, `pnpm exec zudo-circuit-doc footprints check` and `pnpm exec zudo-circuit-doc models --check` when CAD is enabled.
46
+
47
+ ## 3. Verify a claimed specification
48
+
49
+ **English request**
50
+
51
+ > Check whether CLAIM_ID is actually supported for COMPONENT_ID in our intended use. Use the retained primary source, preserve the value's conditions and whether it is typical, guaranteed, recommended, or an absolute maximum, and update the canonical evidence. Explain whether the project conclusion still follows.
52
+
53
+ **日本語の依頼例**
54
+
55
+ > COMPONENT_ID について、CLAIM_ID の仕様が本当に根拠付きで言えるか確認して。このプロジェクトの使用条件に対して成り立つか見てほしい。一次資料の該当箇所を確認して、typical・保証値・推奨条件・絶対最大定格の違いと条件を残したうえで部品のエビデンスを更新し、設計上の結論がそのまま成り立つか教えて。
56
+
57
+ **Completion expectations**
58
+
59
+ - State the exact claim, source locator, value, unit, qualifier, and conditions.
60
+ - Separate a direct source fact from derived reasoning. Preserve calculation inputs and assumptions when the conclusion combines facts.
61
+ - If the current narrative overstates the evidence, correct or qualify it and identify the affected decision or integration analysis.
62
+ - A typical characteristic must not be relabeled a worst-case guarantee. Missing evidence stays unresolved even if a similar part behaves as expected.
63
+
64
+ **Workflow and commands:** Workflow E. Update `facts.json` and `coverage.json`, then `pnpm circuit:generate`, `pnpm circuit:check` and `pnpm check`.
65
+
66
+ ## 4. Check interactions between components
67
+
68
+ **English request**
69
+
70
+ > Review INTERFACE_ID at REVISION. Trace the relevant component facts and configuration through the complete connection, including startup, reset, and one-side-powered conditions where they apply. Record the conditioned calculations and identify what still requires measurement.
71
+
72
+ **日本語の依頼例**
73
+
74
+ > REVISION の INTERFACE_ID を確認して。関係する部品の仕様と設定を、接続全体として追ってほしい。関係する場合は起動時、リセット時、片側だけ給電されている状態も含めて確認し、計算に使った条件と根拠を残して。実測しないと分からない点も分けて教えて。
75
+
76
+ **Completion expectations**
77
+
78
+ - Link the exact design revision, endpoints, component records, input facts, and relevant configuration.
79
+ - Evaluate the requested conditions rather than assuming each component's individually valid rating proves the whole interface.
80
+ - Preserve unknowns such as source behavior, parasitics, actual wiring, or unmeasured transient response when they affect the conclusion.
81
+ - Create or update the integration evidence and concise authored interpretation. Do not claim bench verification from a paper analysis.
82
+
83
+ **Workflow and commands:** Workflow E with the integration rules in `.claude/skills/circuit-spec-integration/references/rules.json`; `pnpm circuit:check` and `pnpm check`.
84
+
85
+ ## 5. Compare a possible replacement
86
+
87
+ **English request**
88
+
89
+ > PART_A is becoming hard to source. Assess PART_B as a replacement at the current placements. Compare the exact identities, relevant behavior, pins, package, mechanical fit, firmware effects, and assembly implications. Give me a change-impact note and a recommendation with any remaining conditions.
90
+
91
+ **日本語の依頼例**
92
+
93
+ > PART_A の入手が難しくなってきたので、今の実装箇所で PART_B に置き換えられるか調べて。正式型番、必要な動作、ピン、パッケージ、機械的な収まり、ファームウェアと実装方法への影響を比較してほしい。変更影響のメモを作って、残っている確認条件と一緒に採用の見立てを教えて。
94
+
95
+ **Completion expectations**
96
+
97
+ - Establish exact identity and evidence for both parts. Do not treat a matching short name or generic package as sufficient compatibility.
98
+ - Explain which required properties are equivalent, different, or still unknown for the intended conditions.
99
+ - Identify affected facts, integration records, schematic placements, assets, firmware, generated outputs, and prior verification.
100
+ - This wording requests an assessment. Applying the replacement becomes a separate concrete implementation task when the owner requests it.
101
+
102
+ **Workflow and commands:** Workflows B, C and E for the candidate, recorded as a change-impact note from `circuit/templates/project-docs/project/change-impact.mdx`; no inventory or selection change until the replacement is applied.
103
+
104
+ ## 6. Implement an already selected change
105
+
106
+ **English request**
107
+
108
+ > Apply DECISION_ID to REVISION. Update the authoritative design inputs, dependent component and integration evidence, relevant CAD assets, generated documentation, and the change-impact note. Run the checks supported by this project and report the exact changes, results, and any hardware checks still pending.
109
+
110
+ **日本語の依頼例**
111
+
112
+ > DECISION_ID の変更を REVISION に反映して。設計の正本、関係する部品・組み合わせのエビデンス、必要な CAD データ、生成ドキュメント、変更影響メモまで揃えて更新してほしい。このプロジェクトで実行できる確認を行い、変更内容と結果、まだ必要な実機確認をまとめて。
113
+
114
+ **Completion expectations**
115
+
116
+ - Read the accepted decision and remain within its scope. Continue the routine edits and generation already requested without another approval loop.
117
+ - Change authoritative inputs before derived outputs. Use only the commands listed in WORKFLOW.md.
118
+ - Refresh project-state evidence and dependencies where the implementation changed. Keep previous hardware observations attached to their original revision.
119
+ - Report a materially different choice if the implementation reveals one; do not silently reinterpret the selected design to make a check pass.
120
+
121
+ **Workflow and commands:** Workflows B and G. Update evidence, inventory and `circuit/publication/selection.json` in one diff, then `pnpm circuit:generate`, `pnpm check`, `pnpm build` and `pnpm check:site`.
122
+
123
+ ## 7. Prepare a bring-up procedure
124
+
125
+ **English request**
126
+
127
+ > Prepare a bring-up plan for BUILD_ID from the current evidence and open questions. Define the setup, prerequisites, staged checks where needed, expected criteria, and evidence to capture. Keep it clearly marked as an unperformed plan; I will run the physical measurements locally.
128
+
129
+ **日本語の依頼例**
130
+
131
+ > BUILD_ID の立ち上げ手順を、今ある根拠と未解決事項から作って。接続や測定器の準備、前提条件、必要なら段階的な確認、判定基準、残すべき測定データをまとめてほしい。実測は手元で行うので、まだ実行していない計画であることを明記して。
132
+
133
+ **Completion expectations**
134
+
135
+ - Derive the procedure from this project's design, hardware revision, intended configuration, and documented operating conditions.
136
+ - Separate evidence review, predicted behavior, and physical checks.
137
+ - Explain dependencies between stages where a result determines whether the next stage is meaningful or appropriate.
138
+ - Leave observed values and outcomes unfilled. Do not carry over another project's voltage, current, timing, or temperature limits.
139
+
140
+ **Workflow and commands:** Workflow F (planning half), using `circuit/templates/project-docs/verification/bring-up.mdx` copied into `doc/src/content/docs/verification/`; `pnpm check` after editing.
141
+
142
+ ## 8. Turn bench observations into evidence
143
+
144
+ **English request**
145
+
146
+ > Organize the attached measurements for BUILD_ID into a verification report. Preserve the raw observations, setup, revision, and configuration. Compare only against criteria we have evidence for, update the relevant coverage, and list any questions the results reopen.
147
+
148
+ **日本語の依頼例**
149
+
150
+ > 添付した BUILD_ID の測定結果を検証レポートに整理して。生の観測値、測定条件、基板のリビジョン、設定内容を残してほしい。根拠がある判定基準だけと比較して、関係する確認状況を更新し、結果から再確認が必要になった点も挙げて。
151
+
152
+ **Completion expectations**
153
+
154
+ - Use only supplied or actually observed measurements. Ask for missing setup information when it prevents interpretation, while organizing the material already available.
155
+ - Distinguish results from proposed explanations. Mark an ambiguous result inconclusive rather than forcing pass or fail.
156
+ - Scope any evidence update to the tested configuration and physical unit.
157
+ - Preserve separate runs and rework states so a later successful measurement does not erase an earlier failure.
158
+
159
+ **Workflow and commands:** Workflow F. Record `BENCH-OBSERVED` facts from a `BENCH_RECORD` source where a measurement becomes evidence, then `pnpm circuit:generate` and `pnpm circuit:check`.
160
+
161
+ ## 9. Continue the project without rediscovering it
162
+
163
+ **English request**
164
+
165
+ > Read the current project snapshot and next actions, then complete the next unblocked research task. Keep the component evidence and authored rationale consistent, update the handoff, and tell me the result and the next unresolved decision.
166
+
167
+ **日本語の依頼例**
168
+
169
+ > 現在のプロジェクト状況と次の作業を読んで、着手可能な調査タスクを一つ完了して。部品のエビデンスと説明文の整合を取り、引き継ぎメモを更新してほしい。今回分かったことと、次に決める必要がある未解決事項を教えて。
170
+
171
+ **Completion expectations**
172
+
173
+ - Use the current snapshot and linked authoritative records as the starting point.
174
+ - Select the next bounded task according to the project's recorded priorities and dependencies.
175
+ - Resolve or reopen questions only with supporting evidence or a recorded decision.
176
+ - End with a concrete next result, not a broad request to “continue investigating.”
177
+
178
+ **Workflow and commands:** Shared entry, then whichever workflow the next action needs; update `doc/src/content/docs/project/next-actions.mdx` and run `pnpm check`.
@@ -0,0 +1,37 @@
1
+ # Checks
2
+
3
+ What each project check establishes, and what it does not. Report a check's actual output, including its `SCOPE:`, `SKIP:` and `WARN:` lines; never summarize a skipped check as passed.
4
+
5
+ | Command | Establishes | Does not establish |
6
+ | --- | --- | --- |
7
+ | `pnpm circuit:check` | The evidence bundles, inventory, routing, integration rules and (when CAD is enabled) pin assets satisfy the v1 contract; the package's seeded self-test still detects known mutations | That any electrical claim is correct for the design, that a source was read correctly, or that declared placements match a schematic (see the `SCOPE:` line) |
8
+ | `pnpm circuit:generate` | Generated component pages and `circuit/generated/preflight.json` reflect the current evidence and selection | That the evidence is current with its remote sources |
9
+ | `pnpm check` | Validation passes, committed generated output matches a dry-run generation (drift and ownership conflicts), selected models and footprint previews match their inputs, the doc site type-checks | Anything about the built HTML |
10
+ | `pnpm build` then `pnpm check:site` | The built site references only files that exist, publishes nothing outside the selection and the assets allowlist, and has no broken links or anchors | Visual rendering or island behavior in a browser |
11
+ | `pnpm exec zudo-circuit-doc check-browser` | Islands hydrate and the built pages behave in system Chrome, for whichever representative pages it resolved | Anything about a representative it never resolved (reported `SKIP`), and anything at all when it exits `4` |
12
+ | `pnpm exec zudo-circuit-doc validate --online` | Retained non-volatile source hashes still match the bytes the URLs serve today | That the documents support the recorded claims; it never alters retained evidence |
13
+ | `pnpm previews:generate`, `pnpm exec zudo-circuit-doc footprints check` | Footprint SVG previews are rendered from, and match, the selected footprints | Dimensional correctness or pin correspondence; a preview is a rendering |
14
+ | `pnpm circuit:doctor` | Which required and optional tools are present | That any check passes |
15
+
16
+ ### `check-browser` representative pages
17
+
18
+ `check-browser` resolves which pages to exercise in this order:
19
+
20
+ 1. `--representatives <json>` on the command line.
21
+ 2. `browserSmoke.representatives` in `circuit.config.ts`, used exactly as configured — even an explicit empty list.
22
+ 3. Otherwise, up to 3 representatives **derived** from the preflight report: published record slugs, sorted, filtered to the ones whose generated page has a decodable component-references section (a reviewed PDF, a footprint and a WRL model), and, once the site is built, whose built output carries the matching marker and assets. A derived run prints `INFO: using derived representatives: ...`.
23
+
24
+ A declared-zero project (nothing published) is a `SKIP`, not a failure. If records are published but derivation finds none that qualifies, the command exits `4` rather than silently checking nothing — set `browserSmoke.representatives` in `circuit.config.ts` to name pages explicitly.
25
+
26
+ ## Exit codes
27
+
28
+ | Code | Meaning |
29
+ | --- | --- |
30
+ | `0` | Pass |
31
+ | `1` | Check failed |
32
+ | `2` | Usage or configuration error |
33
+ | `4` | Not run: an optional tool (Docker, Chrome) is missing, or (`check-browser` only) records are published but none qualifies for a default representative and none was configured |
34
+
35
+ ## What no check establishes
36
+
37
+ `COVERED` coverage, a clean validation and a green build are not hardware sign-off. Physical fit, assembled state, programmed state and bench behavior are established only by recorded observations (Workflow F in [WORKFLOW.md](../WORKFLOW.md)).