forgecad 0.9.15 → 0.10.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 (166) hide show
  1. package/dist/assets/{AdminPage-CDyGUinA.js → AdminPage-DwYHz72L.js} +1 -1
  2. package/dist/assets/{BenchmarkPage-DfPMY_-d.js → BenchmarkPage-a9_f-1US.js} +1 -1
  3. package/dist/assets/{BlogPage-kF0fkdJT.js → BlogPage-DodHpvmf.js} +1 -1
  4. package/dist/assets/{DocsPage-B954L3YN.js → DocsPage-B5LePEuj.js} +8 -858
  5. package/dist/assets/{EditorApp-CuDLxKqL.css → EditorApp-BpjZgzk0.css} +148 -0
  6. package/dist/assets/EditorApp-QXsAISLR.js +16307 -0
  7. package/dist/assets/{EmbedViewer-C77B-TrF.js → EmbedViewer-DdEHGUMU.js} +2 -2
  8. package/dist/assets/{LandingPageProofDriven-Cr6fXMDj.js → LandingPageProofDriven-yhhOodbf.js} +2 -2
  9. package/dist/assets/{LegalPage-Dzklqmmg.js → LegalPage-5RbKRGYK.js} +1 -1
  10. package/dist/assets/{PricingPage-zWXkvlwl.js → PricingPage-E3Rma7aV.js} +1 -1
  11. package/dist/assets/{SettingsPage-Bz0of4KQ.js → SettingsPage-BJZcM97j.js} +1 -1
  12. package/dist/assets/{app-D3kDkggg.js → app-DSYrDg0V.js} +1846 -352
  13. package/dist/assets/cli/{render-DSY3mMQa.js → render-ZMHR9HkV.js} +161 -70
  14. package/dist/assets/{constructionHistoryWorker-gpDo-uH2.js → constructionHistoryWorker-AwMMWSxg.js} +1104 -349
  15. package/dist/assets/{evalWorker-CU0Ke6DP.js → evalWorker-DbNs7Dkp.js} +5155 -3772
  16. package/dist/assets/{inspectWorker-COyp8XXA.js → inspectWorker-CZsCFtQT.js} +1415 -439
  17. package/dist/assets/{targets-B9sGB5nB.js → jointPose-DO6mnXn_.js} +71 -3
  18. package/dist/assets/{manifold-DNkrUWpA.js → manifold-BGlQBBH9.js} +1 -1
  19. package/dist/assets/{manifold-BRI5prcH.js → manifold-BU-tJwQh.js} +1 -1
  20. package/dist/assets/{manifold-C-3h2M7p.js → manifold-fy2MV7K1.js} +2 -2
  21. package/dist/assets/{reportWorker-CdBz5bNg.js → reportWorker-DO6hcQbh.js} +8474 -4549
  22. package/dist/assets/{scalar-sampling-budget-wJF98aY9.js → scalar-sampling-budget-o90NSNmF.js} +5347 -3906
  23. package/dist/assets/{scanProxyWorker-B-9VbLIs.js → scanProxyWorker-2GtDLk-R.js} +19 -6
  24. package/dist/assets/{javascript-1kQXfVaz.js → typescript-DBQ6RN5l.js} +874 -22
  25. package/dist/cli/render.html +1 -1
  26. package/dist/docs/index.html +3 -3
  27. package/dist/docs-raw/AI/usage.md +3 -1
  28. package/dist/docs-raw/CLI.md +65 -239
  29. package/dist/docs-raw/README.md +6 -0
  30. package/dist/docs-raw/component-model.md +17 -150
  31. package/dist/docs-raw/generated/assembly.md +159 -520
  32. package/dist/docs-raw/generated/concepts.md +245 -3491
  33. package/dist/docs-raw/generated/core.md +277 -1251
  34. package/dist/docs-raw/generated/curves.md +387 -1608
  35. package/dist/docs-raw/generated/legacy.md +162 -0
  36. package/dist/docs-raw/generated/lib.md +238 -112
  37. package/dist/docs-raw/generated/output.md +51 -76
  38. package/dist/docs-raw/generated/runtime-names.md +30 -22
  39. package/dist/docs-raw/generated/sdf.md +68 -284
  40. package/dist/docs-raw/generated/sheet-metal.md +68 -335
  41. package/dist/docs-raw/generated/sketch.md +240 -1161
  42. package/dist/docs-raw/generated/viewport.md +75 -316
  43. package/dist/docs-raw/generated/wood.md +21 -49
  44. package/dist/docs-raw/guides/coordinate-system.md +4 -42
  45. package/dist/docs-raw/guides/inspection-bundles.md +44 -442
  46. package/dist/docs-raw/guides/joint-design.md +18 -79
  47. package/dist/docs-raw/guides/positioning.md +21 -143
  48. package/dist/docs-raw/guides/scene-presentation.md +89 -0
  49. package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +25 -111
  50. package/dist/docs-raw/skills/forgecad-blockout-model.md +20 -117
  51. package/dist/docs-raw/skills/forgecad-component-model.md +23 -107
  52. package/dist/docs-raw/skills/forgecad-high-level-spec.md +47 -155
  53. package/dist/docs-raw/skills/forgecad-image-replicator.md +26 -143
  54. package/dist/docs-raw/skills/forgecad-lld.md +19 -113
  55. package/dist/docs-raw/skills/forgecad-make-a-model.md +113 -532
  56. package/dist/docs-raw/skills/forgecad-model-grader.md +38 -108
  57. package/dist/docs-raw/skills/forgecad-prepare-prompt.md +24 -211
  58. package/dist/docs-raw/skills/forgecad-project.md +13 -129
  59. package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +42 -134
  60. package/dist/docs-raw/skills/forgecad-render-inspect.md +27 -174
  61. package/dist/docs-raw/skills/forgecad-visual-spec.md +32 -112
  62. package/dist/docs-raw/skills/forgecad.md +19 -18
  63. package/dist/docs-raw/skills/index.md +2 -0
  64. package/dist/docs-raw/welcome.md +4 -2
  65. package/dist/index.html +1 -1
  66. package/dist/llms.txt +1 -2
  67. package/dist/sitemap.xml +13 -13
  68. package/dist-cli/{check-compiler-SDX5QIXI.js → check-compiler-JTVBITCR.js} +1 -1
  69. package/dist-cli/{check-query-propagation-EAYEFT77.js → check-query-propagation-3FFLSMVN.js} +1 -1
  70. package/dist-cli/{chunk-N4O47JLF.js → chunk-OAN5T4XD.js} +5722 -4287
  71. package/dist-cli/forgecad.js +2195 -656
  72. package/dist-skill/CONTEXT.md +1778 -7912
  73. package/dist-skill/SKILL.md +15 -15
  74. package/dist-skill/docs/API/core/concepts.md +27 -157
  75. package/dist-skill/docs/CLI.md +65 -239
  76. package/dist-skill/docs/generated/assembly.md +160 -493
  77. package/dist-skill/docs/generated/core.md +277 -1251
  78. package/dist-skill/docs/generated/curves.md +387 -1609
  79. package/dist-skill/docs/generated/lib.md +238 -112
  80. package/dist-skill/docs/generated/output.md +51 -76
  81. package/dist-skill/docs/generated/runtime-names.md +16 -22
  82. package/dist-skill/docs/generated/sdf.md +68 -284
  83. package/dist-skill/docs/generated/sheet-metal.md +68 -335
  84. package/dist-skill/docs/generated/sketch.md +240 -1160
  85. package/dist-skill/docs/generated/viewport.md +75 -223
  86. package/dist-skill/docs/generated/wood.md +21 -49
  87. package/dist-skill/docs/guides/coordinate-system.md +4 -42
  88. package/dist-skill/docs/guides/inspection-bundles.md +44 -442
  89. package/dist-skill/docs/guides/joint-design.md +18 -79
  90. package/dist-skill/docs/guides/positioning.md +21 -143
  91. package/dist-skill/docs/guides/scene-presentation.md +89 -0
  92. package/dist-skill/docs/guides/surface-members.md +26 -0
  93. package/dist-skill/library/forgecad-3d-reconstruction/SKILL.md +23 -111
  94. package/dist-skill/library/forgecad-blockout-model/SKILL.md +18 -117
  95. package/dist-skill/library/forgecad-component-model/SKILL.md +21 -107
  96. package/dist-skill/library/forgecad-high-level-spec/SKILL.md +45 -155
  97. package/dist-skill/library/forgecad-image-replicator/SKILL.md +24 -143
  98. package/dist-skill/library/forgecad-lld/SKILL.md +17 -113
  99. package/dist-skill/library/forgecad-make-a-model/SKILL.md +111 -532
  100. package/dist-skill/library/forgecad-model-grader/SKILL.md +36 -108
  101. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +35 -224
  102. package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +43 -271
  103. package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +30 -99
  104. package/dist-skill/library/forgecad-project/SKILL.md +13 -131
  105. package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +29 -123
  106. package/dist-skill/library/forgecad-render-inspect/SKILL.md +25 -174
  107. package/dist-skill/library/forgecad-visual-spec/SKILL.md +30 -111
  108. package/dist-skill/website/skills/forgecad-3d-reconstruction.md +58 -0
  109. package/dist-skill/website/skills/forgecad-blockout-model.md +49 -0
  110. package/dist-skill/website/skills/forgecad-component-model.md +53 -0
  111. package/dist-skill/website/skills/forgecad-high-level-spec.md +101 -0
  112. package/dist-skill/website/skills/forgecad-image-replicator.md +63 -0
  113. package/dist-skill/website/skills/forgecad-lld.md +41 -0
  114. package/dist-skill/website/skills/forgecad-make-a-model.md +186 -0
  115. package/dist-skill/website/skills/forgecad-model-grader.md +82 -0
  116. package/dist-skill/website/skills/forgecad-prepare-prompt.md +63 -0
  117. package/dist-skill/website/skills/forgecad-project.md +26 -0
  118. package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +60 -0
  119. package/dist-skill/website/skills/forgecad-render-inspect.md +80 -0
  120. package/dist-skill/website/skills/forgecad-visual-spec.md +71 -0
  121. package/dist-skill/website/skills/forgecad.md +122 -0
  122. package/dist-skill/website/skills/index.md +26 -0
  123. package/examples/api/comparison-imported-sphere-candidate.forge.js +1 -1
  124. package/examples/api/conformal-product-ribbon.forge.js +1 -1
  125. package/examples/api/exact-sheet-shell-assembly.forge.js +1 -1
  126. package/examples/api/extrude-options.forge.js +4 -2
  127. package/examples/api/field-loft-drive-tip.forge.js +40 -0
  128. package/examples/api/guided-loft-olive-oil-bottle.forge.js +1 -1
  129. package/examples/api/helix-basics.forge.js +2 -2
  130. package/examples/api/highlight-debug.forge.js +10 -10
  131. package/examples/api/mesh-import-slats.forge.js +1 -1
  132. package/examples/api/real-product-curves.forge.js +1 -1
  133. package/examples/api/route3d-elbow.forge.js +3 -0
  134. package/examples/api/sculpt-box-circle-booleans.forge.js +1 -1
  135. package/examples/api/sdf-shapes.forge.js +2 -5
  136. package/examples/api/sketch-rounding-strategies.forge.js +6 -6
  137. package/examples/api/surface-member-bottle-cage.forge.js +3 -3
  138. package/examples/api/surface-member-conformal-product-ribbon.forge.js +3 -3
  139. package/examples/api/surface-member-razor-inlay.forge.js +1 -1
  140. package/examples/api/variable-sweep-test.forge.js +4 -2
  141. package/examples/mechanical/airplane-propeller.forge.js +74 -39
  142. package/examples/nurbs-surface.forge.js +1 -1
  143. package/examples/products/iphone.forge.js +1 -1
  144. package/package.json +4 -1
  145. package/dist/assets/EditorApp-Beb-IZ0y.js +0 -14014
  146. package/dist/docs-raw/guides/geometry-conventions.md +0 -52
  147. package/dist/docs-raw/guides/modeling-recipes.md +0 -78
  148. package/dist-skill/docs/guides/geometry-conventions.md +0 -52
  149. package/dist-skill/docs/guides/modeling-recipes.md +0 -78
  150. package/dist-skill/library/forgecad-visual-spec/references/prompt-template.md +0 -79
  151. package/examples/api/bolted-service-cover.forge.js +0 -17
  152. package/examples/api/cable-gland-anchor.forge.js +0 -14
  153. package/examples/api/captured-cartridge-guide.forge.js +0 -14
  154. package/examples/api/captured-linear-slide.forge.js +0 -13
  155. package/examples/api/clevis-pin-joint.forge.js +0 -13
  156. package/examples/api/datum-enclosure.forge.js +0 -16
  157. package/examples/api/hose-barb-port.forge.js +0 -14
  158. package/examples/api/knuckled-hinge-assembly.forge.js +0 -15
  159. package/examples/api/living-hinge-cover.forge.js +0 -14
  160. package/examples/api/pcb-terminal-block.forge.js +0 -22
  161. package/examples/api/pinned-lever-pivot-stack.forge.js +0 -14
  162. package/examples/api/retained-shaft-knob-stack.forge.js +0 -15
  163. package/examples/api/routed-tube-clip.forge.js +0 -15
  164. package/examples/api/seated-bearing-stack.forge.js +0 -30
  165. package/examples/api/snap-latch-cover.forge.js +0 -14
  166. package/examples/api/thumb-screw-clamp.forge.js +0 -15
@@ -6,25 +6,7 @@ forgecad-public: true
6
6
 
7
7
  # Block Out a Model
8
8
 
9
- Create lightweight ForgeCAD concept models. These are spatial planning artifacts: fast, legible, and intentionally approximate, but still grounded in the physical object rather than an annotated lesson diagram.
10
-
11
- ## Trigger Boundary
12
-
13
- Use this skill when the user wants to answer questions like:
14
-
15
- - Roughly where do the parts go?
16
- - Does this mechanism idea make intuitive spatial sense?
17
- - What is the silhouette, footprint, or motion envelope?
18
- - Can we show the concept before spending time on detail?
19
-
20
- Do **not** use this skill for:
21
-
22
- - print-ready or fabrication-ready geometry
23
- - exact fit, tight tolerances, or detailed dimensioning
24
- - dense parametric modeling
25
- - hardware details, fillets, chamfers, or finish work unless they are essential to the concept
26
-
27
- Routing:
9
+ A blockout is a spatial planning artifact: 3-7 simple masses that answer where parts go, whether a mechanism makes spatial sense, and what the silhouette, footprint, or motion envelope looks like. Not for print-ready geometry, exact fit, tolerances, or detail work.
28
10
 
29
11
  | Need | Skill |
30
12
  |------|-------|
@@ -32,110 +14,29 @@ Routing:
32
14
  | Written concept or architecture before CAD | `forgecad-high-level-spec` |
33
15
  | Accurate, detailed, parametric ForgeCAD model | `forgecad-make-a-model` |
34
16
 
35
- ## File Placement
36
-
37
- All new `.forge.js` files go under the date-based directory structure:
38
-
39
- ```text
40
- YYYY/MM/DD/file.forge.js - single-file blockout
41
- YYYY/MM/DD/folder/file.forge.js - multi-file concept project
42
- ```
43
-
44
- Use today's date for the directory. Use the user's current ForgeCAD project when one is available; otherwise use a clearly named local model folder.
45
-
46
- ### Naming
47
-
48
- - Use kebab-case
49
- - Prefer names like `desk-lamp-blockout.forge.js` or `hinged-display-concept.forge.js`
50
- - Add `-blockout` or `-concept` unless the user already supplied a clearer name
51
-
52
- ## Workflow
53
-
54
- 1. **Load the `forgecad` skill first** and read the Core API and CLI docs. Only load more documentation if the concept truly needs it.
55
- 2. **Translate the idea into 3-7 conceptual parts** before writing geometry. Think in terms of masses and zones: base, arm, payload, sweep volume, keep-out space, hand access, wheel envelope.
56
- 3. **Choose approximate dimensions** using round numbers and obvious proportions. Favor "believably shaped" over "numerically correct".
57
- 4. **Write the simplest geometry that communicates the idea**. Default to `box()`, `cylinder()`, `sphere()`, and very simple extrusions.
58
- 5. **Place parts with readable transforms**. Keep coordinates easy to inspect and edit. Prefer centered primitives when that reduces mental load.
59
- 6. **Color by meaning** so a viewer can decode the concept immediately.
60
- 7. **Render and inspect** from a few angles. If the idea is still unclear, simplify or reposition; do not add detail as a substitute for clarity.
61
- 8. **Stop early** once the mechanism, layout, or concept is understandable.
17
+ ## Method
62
18
 
63
- ## Modeling Rules
19
+ - Load the `forgecad` skill first; read its Core API and CLI docs. Load nothing else unless the concept demands it.
20
+ - Translate the idea into 3-7 conceptual parts BEFORE writing geometry: masses and zones (base, arm, payload, sweep volume, keep-out, hand access).
21
+ - One primitive stands in for many eventual details. A bounding box beats a fake detailed part. Never add detail as a substitute for clarity — simplify or reposition instead.
22
+ - Use round-number dimensions; "believably shaped" beats numerically correct. Name uncertainty honestly: `armLengthGuess`, `baseWidthApprox`, `clearanceEnvelope`.
23
+ - At most a handful of `param()` values, for comparing proportions. Do not parameterize every dimension.
24
+ - Color by meaning; keep each conceptual part visually distinct via color or opacity. Return named shape objects so the viewer can inspect the concept part-by-part.
25
+ - Ghost geometry: transparent volumes only for REAL physical envelopes — sweep arcs, keep-out volumes, approximate payloads, reach/access zones. Never decorative teaching overlays. Exaggerate tiny clearances when needed for readability.
26
+ - Even a blockout represents the object in its normal assembled state: no labels, legends, cutaways, or permanently exploded layouts (full rule in the `forgecad` skill).
27
+ - Leave out: fasteners and screw holes, wall thicknesses, fillets and blend radii, polished materials, hidden internal structure that does not affect the concept.
64
28
 
65
- - Use one primitive to stand in for many eventual details whenever possible.
66
- - A bounding box is usually better than a fake detailed part.
67
- - Use at most a handful of top-level `param()` values when comparing rough proportions. Do not parameterize every dimension.
68
- - Name uncertainty honestly: `armLengthGuess`, `baseWidthApprox`, `screenVolume`, `clearanceEnvelope`.
69
- - Do not add text labels, callout arrows, legends, coordinate labels, or explanatory plaques to the model. Use named return objects and a short written note outside the geometry.
70
- - Do not cut away a shell, remove covers, or permanently explode parts just to show hidden intent. Even a blockout should represent the object in its normal assembled state unless the user explicitly asks for a presentation view.
71
- - Use transparent ghost geometry for:
72
- - sweep arcs
73
- - keep-out volumes
74
- - approximate payloads
75
- - user reach or access space
76
- - Ghost geometry must represent a real physical envelope, clearance, motion path, or human-access zone, not decorative teaching overlays.
77
- - Exaggerate tiny clearances if needed to keep the concept readable.
78
- - Keep each conceptual part visually distinct through color or opacity.
79
- - Prefer arrays of named shapes in the return value so the viewer can inspect the concept part-by-part.
29
+ ## Verify
80
30
 
81
- ## What to Leave Out
82
-
83
- Do not spend time on:
84
-
85
- - screw holes
86
- - exact wall thicknesses
87
- - blend radii
88
- - polished materials
89
- - hidden internal structure that does not affect the concept
90
- - mathematical precision that the concept does not justify
91
-
92
- If you notice yourself reaching for detailed constraints, pause and ask whether the blockout should instead hand off to `forgecad-make-a-model`.
93
-
94
- ## Render-Verify Loop
95
-
96
- Even rough models must be rendered. The whole point is spatial intuition.
97
-
98
- ### Minimum check
99
-
100
- ```bash
101
- forgecad run model.forge.js
102
- node dist-cli/forgecad.js render model.forge.js /tmp/blockout.png --camera 45:25 --camera 0:0 --camera 90:0 --size 600
103
- ```
104
-
105
- Inspect the render and ask:
31
+ Rendering is mandatory even for rough models. Run the script, then render from 2-3 angles with the installed `forgecad` CLI (syntax: the `forgecad` skill's CLI docs). Judge by the reader test:
106
32
 
107
33
  - Can someone unfamiliar with the idea tell what each mass represents?
108
- - Are the overall proportions believable enough to discuss?
34
+ - Are proportions believable enough to discuss?
109
35
  - Is motion or interference visible where it matters?
110
- - Are unknowns shown honestly, rather than hidden behind fake detail?
111
-
112
- If the answer is no, simplify the model or add clearer ghost volumes.
113
-
114
- ## Useful Pattern
115
-
116
- ```js
117
- // Concept only:
118
- // - dimensions are approximate
119
- // - red transparent geometry shows motion / keep-out
120
-
121
- const base = box(160, 90, 30).placeReference('center', [0, 0, 0]).color('#4c6ef5');
122
- const arm = box(22, 22, 180).placeReference('center', [0, 0, 105]).color('#f08c00');
123
- const payload = box(120, 18, 70).placeReference('center', [0, 0, 210]).color('#2b8a3e');
124
-
125
- const sweep = cylinder(12, 110, 110, 48).placeReference('center', [0, 0, 0])
126
- .rotateY(90)
127
- .translate(0, 0, 120)
128
- .color('#e03131')
129
- .material({ opacity: 0.18 });
36
+ - Are unknowns shown honestly, not hidden behind fake detail?
130
37
 
131
- return [
132
- { name: 'Base', shape: base },
133
- { name: 'Arm', shape: arm },
134
- { name: 'Payload Volume', shape: payload },
135
- { name: 'Sweep Envelope', shape: sweep },
136
- ];
137
- ```
38
+ If any answer is no, simplify or add clearer ghost volumes.
138
39
 
139
- ## Handoff Rule
40
+ ## Handoff
140
41
 
141
- When the blockout has answered the high-level questions, stop. If the next question is about real fit, tunable dimensions, part details, or manufacturing logic, switch to `forgecad-make-a-model` rather than refining the blockout indefinitely.
42
+ File placement and naming follow `forgecad-make-a-model` conventions; suffix the filename `-blockout` or `-concept` unless the user supplied a clearer name. Once the high-level questions are answered, stop. If the next question is real fit, tunable dimensions, part details, or manufacturing logic, switch to `forgecad-make-a-model` instead of refining the blockout indefinitely.
@@ -4,129 +4,43 @@ description: "Enforce the ForgeCAD Component Model when building multi-part asse
4
4
  forgecad-public: true
5
5
  ---
6
6
 
7
- # Component Model — The React of CAD
7
+ # Component Model
8
8
 
9
- You are building a ForgeCAD multi-part assembly. Follow the Component Model strictly.
9
+ The React of CAD: a part is a function from props to `{ shape, connectors, metadata }`, built at origin in local space. Parts never position themselves — the assembly positions them via connectors.
10
10
 
11
- ## The Core Principle
11
+ ## Rules
12
12
 
13
- **Parts never position themselves. The assembly positions them via connectors.**
13
+ 1. **Parts build at origin.** Geometry starts at `[0,0,0]` in local coordinates; no assembly-space offsets; internal structure derives from the part's own props only.
14
+ 2. **Connectors are the only interface.** Declare via `.withConnectors({})`; axes point outward, mating is face-to-face (exception: prismatic joints share a co-directional slide axis). Mechanics: the forgecad skill's `docs/guides/positioning.md` and `docs/generated/assembly.md`.
15
+ 3. **Assembly is pure composition.** Zero `translate()` to position structural parts, zero coordinate math — connect connectors, pass props down, read metadata up.
16
+ 4. **Data flows down, never sideways.** Props down via `require('./part.forge.js', { Height: 20 })` overrides; metadata up via the part's return object; siblings NEVER import each other — the assembly mediates all sibling communication.
17
+ 5. **Validate with `verify.*`, never `console.log` + `if`.**
14
18
 
15
- A part is a function from props to `{ shape, connectors, metadata }`. It builds at origin in local space. It doesn't know where it sits in the world.
16
-
17
- ## Rules (Non-Negotiable)
18
-
19
- ### 1. Parts Build at Origin
20
- - Geometry starts at `[0, 0, 0]` in local coordinates
21
- - No assembly-space offsets (no `translate(pinionPitchR, 0, layout.pinionZ)`)
22
- - Internal structure computed from the part's own props only
23
-
24
- ### 2. Connectors Are the Interface
25
- - Every part that joins an assembly declares connectors via `.withConnectors({})`
26
- - A connector = origin + axis (outward from the part)
27
- - Connectors meet **face-to-face**: both axes point outward, system brings them together
28
- - For prismatic joints: axes point along the shared slide direction
29
- - Mirrored revolute axes need negated physical joint values for the same mirrored pose
30
-
31
- ### 3. Assembly Is Pure Composition
32
- - Use `addPart()` + `connect()` for frame-aware serial assemblies
33
- - Use `link()` + `edgeBetweenLinks()` + `addAngleBetweenLinks()` for solved point skeletons
34
- - Zero `translate()` calls for structural parts
35
- - Zero coordinate math
36
- - The assembly passes props down and reads metadata up
37
-
38
- ### 4. Data Flows Down, Never Sideways
39
- - **Props down:** Assembly passes dimensions to parts via `require('./part.forge.js', { Height: 20 })`
40
- - **Metadata up:** Parts return `{ shape, boltPattern, pinionZ, ... }` — computed values the parent might pass to siblings
41
- - **Siblings never import each other.** The assembly mediates ALL sibling communication
42
-
43
- ### 5. Verify, Don't console.log
44
- - Use `verify.that("name", () => condition)` for spatial checks
45
- - Use `verify.equal()`, `verify.inRange()`, `verify.notColliding()` for specific assertions
46
- - Never `console.log` + `if` for validation
47
-
48
- ## Connector Convention
49
-
50
- ```js
51
- // Face-to-face: both point outward, system opposes them
52
- base.withConnectors({
53
- mount_face: connector("bolt-face", { origin: [0, 0, 0], axis: [0, 0, -1] }),
54
- // ↑ bottom face ↑ faces downward
55
- });
56
- mount.withConnectors({
57
- flange: connector("bolt-face", { origin: [0, 0, 0], axis: [0, 0, 1] }),
58
- // ↑ top face ↑ faces upward
59
- });
60
-
61
- // Assembly — no flip, no coordinate math
62
- assembly.connect("Base.mount_face", "Mount.flange", { as: "mount-fix" });
63
- ```
64
-
65
- Revolute values are signed by the physical hinge axis. In a bilateral mechanism,
66
- `axis: [1, 0, 0]` on the right side and `axis: [-1, 0, 0]` on the left side are
67
- exact mirrors at rest, but the same `+theta` value rotates them in opposite
68
- fore/aft senses. Use `Right: +theta`, `Left: -theta`, and mirror physical limits
69
- as `[min, max] -> [-max, -min]`, or drive both sides from a side-neutral link
70
- graph/control layer.
71
-
72
- ## Part Return Shape
73
-
74
- Every part file returns a structured object:
19
+ ## Part return shape
75
20
 
76
21
  ```js
77
- return {
78
- shape: body.color('#708090').withConnectors({ ... }),
79
- // Public metadata — parent may pass to siblings:
80
- boltPattern, // bolt positions for sibling parts
81
- pinionZ, // Z center for gear alignment
82
- armWidth, // arm cross-section for cover plate slots
83
- };
22
+ return { shape, boltPattern, pinionZ }; // shape + metadata the parent may route to siblings
84
23
  ```
85
24
 
86
- ## File Structure
87
-
88
- **Default: one file for project-specific assemblies.** Parts are sections within the file. Shared data is variables. Split into separate files only when parts are reusable or the file exceeds ~300 lines.
89
-
90
- ```js
91
- // ─── Motor Mount ────────────────────────────
92
- const mount = buildMount({ servo, wall, clearance });
93
-
94
- // ─── Base Body ──────────────────────────────
95
- const base = buildBase({ gears, depth, height, boltPattern: mount.boltPattern });
96
-
97
- // ─── Assembly ───────────────────────────────
98
- assembly("Gripper")
99
- .addPart("Base", base.shape)
100
- .addPart("Mount", mount.shape)
101
- .connect("Base.mount_face", "Mount.flange", { as: "fix" })
102
- ```
25
+ ## File structure
103
26
 
104
- ## Anti-Patterns (Reject These)
27
+ Default: ONE file per project-specific assembly — parts as sections, shared data as variables. Split only for cross-project reuse or past ~300 lines. Never split for "organization".
105
28
 
106
- **shared-dims.js** A file whose only job is computing derived dimensions. The assembly should derive and pass them.
29
+ ## Anti-patterns (reject on review)
107
30
 
108
- **Sibling imports** — `require('./motor-mount.forge.js')` inside `cover-plate.forge.js`. Data flows through the parent.
31
+ - `shared-dims.js` a file that only computes derived dimensions; the assembly derives and passes them.
32
+ - Sibling `require()` — e.g. `require('./motor-mount.forge.js')` inside `cover-plate.forge.js`; route through the parent.
33
+ - Assembly-space coordinates inside a part — a part knowing `pinionZ = 14` from a sibling's geometry; receive it as a prop.
34
+ - `translate()` to position a structural part in an assembly — add a connector instead.
35
+ - `console.log` + `if` validation — use `verify.*`.
36
+ - Bare `connector.neutral()` outside a reusable component library with compatibility checking.
109
37
 
110
- **Assembly-space coordinates in parts** — A part knowing `pinionZ = 14` from a sibling's geometry. It should receive `rackZ: 14` as a prop.
38
+ ## Design gate
111
39
 
112
- **`translate()` in assembly** — If you're translating to position a part, add a connector instead.
113
-
114
- ❌ **console.log validation** — Use `verify.*`. Always.
115
-
116
- ❌ **Bare `connector.neutral()`** — Use `connector()` without gender unless building a reusable component library with compatibility checking.
117
-
118
- ## Design Gate
119
-
120
- Before committing any multi-part assembly, verify:
40
+ Before committing any multi-part assembly:
121
41
 
122
42
  1. Can you understand each part without reading other files?
123
43
  2. Does the assembly contain zero coordinate math?
124
44
  3. Do all inter-part relationships flow through connectors and props?
125
45
 
126
46
  If any answer is no, refactor.
127
-
128
- ## Reference
129
-
130
- Full philosophy: `docs/permanent/component-model.md`
131
- Connector details: `docs/permanent/generated/assembly.md`
132
- Blueprint-first: `docs/permanent/blueprint-first.md`
@@ -6,199 +6,89 @@ forgecad-public: true
6
6
 
7
7
  # High-Level Design (HLD)
8
8
 
9
- Write a right-sized design document that works backwards from requirements. Define the problem, explore the solution space, record decisions. Include as much detail as needed for quality and shared understanding; stop before exhaustive construction details.
9
+ The HLD aligns the user and the agent on *what* to build before anyone thinks about *how*. Every design concern, risk, and tradeoff lives in the document — not in conversation, not in the agent's head. Brevity is a readability tool, not a success metric: there is no page limit; include whatever evidence, diagrams, and dimensions a good decision needs. Decision-driving dimensions belong here; exhaustive construction dimensions belong in the LLD.
10
10
 
11
- ## Philosophy
11
+ Manufacturing process is a design decision, not a default — never assume 3D printing/FDM. If the user didn't specify a process, treat process choice as an HLD alternative (full posture taxonomy: `/forgecad-prepare-prompt`).
12
12
 
13
- An HLD is a thinking tool, not a construction document. It should be:
14
-
15
- - **Quality-first and right-sized.** Use whatever detail, evidence, diagrams, dimensions, and examples are needed for a good decision.
16
- - **Honest about what's unknown.** Open questions are features, not bugs.
17
- - **Opinionated about alternatives.** Don't just list options — recommend one and say why.
18
- - **Stable under iteration.** Easy to update after a round of feedback without rewriting everything.
19
-
20
- Brevity is a readability tool, not a success metric. Do not omit visible evidence, image-derived features, assumptions, interfaces, risks, or decision-driving dimensions just to keep the document short.
21
-
22
- The HLD exists so that the user and the agent can align on *what* to build before anyone thinks about *how* to build it. All design concerns, risks, and tradeoffs live here — not in conversation, not in the agent's head.
23
-
24
- Manufacturing process is part of the design problem, not a default.
25
- If the user has not specified a process, compare plausible approaches and recommend the one that fits the artifact, load path, scale, material needs, safety expectations, and intended use.
26
- Do not default to 3D printing, FDM, or "printable" unless the user asked for it or the chosen concept genuinely calls for printed parts.
27
-
28
- ## When to Write an HLD
29
-
30
- - Before starting a new model, mechanism, or assembly
31
- - When an existing design has fundamental problems (wrong approach, not just wrong numbers)
32
- - When the user says "spec this out", "think this through", "what should we build"
33
- - Before writing an LLD
34
-
35
- ## Output Location
36
-
37
- HLDs go next to the model files. Name: `<name>-hld.md` or for a project: `hld.md` in the project folder.
13
+ Write an HLD before any LLD, and whenever an existing design is wrong in approach, not just in numbers. Output: `<name>-hld.md` beside the model files, or `hld.md` for a whole project.
38
14
 
39
15
  ## Document Structure
40
16
 
17
+ The section order is the workflow — write it top to bottom, following the embedded instructions.
18
+
41
19
  ```markdown
42
20
  # [Name] — High-Level Design
43
21
 
44
22
  ## Problem
45
-
46
- What does this need to do? What role does it play? What are the hard
47
- requirements (must grip objects, must fit in a 60mm housing, must use
48
- sheet metal, must be CNC-machinable, must be printable, must use purchased
49
- bearings)?
50
-
51
- State the problem without implying a solution.
23
+ What must this do? Hard requirements (must grip objects, fit a 60mm
24
+ housing, use purchased bearings). State the problem without implying
25
+ a solution. Unspecified process choice is an open design dimension.
52
26
 
53
27
  ## Approach
54
-
55
- How does it work at a conceptual level? Describe the mechanism, structure,
56
- or behavior. Use ASCII diagrams where they make spatial relationships clearer.
57
-
58
- Keep this at the architecture level, but include enough spatial and behavioral
59
- detail that someone unfamiliar with the project understands the concept.
28
+ How it works at a conceptual level. ASCII diagram of the key elements
29
+ and their spatial relationships diagram labels stay in this markdown;
30
+ never carry them into CAD geometry unless the real artifact needs
31
+ markings.
60
32
 
61
33
  ## Key Interfaces
62
-
63
- How does this connect to the rest of the system? What are the mating
64
- surfaces, shared dimensions, or coordination points? List them explicitly.
34
+ Every point where this touches another part or the outside world:
35
+ mating surfaces, shared dimensions, coordination points. These are the
36
+ contracts that constrain the design.
65
37
 
66
38
  ## Dictionary
67
-
68
- Define every domain-specific term used in this document. Don't assume
69
- engineering terminology is widely known — write for a developer who
70
- doesn't have a mechanical engineering background.
71
-
72
39
  | Term | What it is |
73
40
  |------|-----------|
74
- | ... | Plain-language description with dimensions if relevant |
41
+ Define every domain term in plain words, with dimensions where relevant.
42
+ Write for a developer without a mechanical-engineering background.
75
43
 
76
44
  ## Alternatives
77
-
78
45
  | Option | Description | Tradeoff |
79
46
  |--------|-------------|----------|
80
- | A (recommended) | ... | ... |
81
- | B | ... | ... |
82
- | C | ... | ... |
83
-
84
- For each alternative, include enough detail to understand why it fits or loses.
85
- One sentence is fine only when one sentence is enough. Mark the recommended option.
47
+ 2-3 genuinely different strategies, not minor variations. Enough detail
48
+ per row to see why it fits or loses. Mark one recommended and say why.
49
+ If there is honestly only one approach, say so and skip the table.
86
50
 
87
51
  ## Usage Guide
88
-
89
- Work backwards from the user experience. Write the step-by-step needed to show
90
- how someone would use/assemble/operate this thing. This exposes gaps in the
91
- design before any code is written.
92
-
93
- For a physical product: assembly steps, tools needed, what connects to what.
94
- For a mechanism: how it moves, what the user does, what happens.
95
- For a software component: how it's called, what it returns, error cases.
96
-
97
- Flag issues inline with ⚠️.
52
+ The strongest validation: work backwards from how someone uses,
53
+ assembles, or operates the thing, step by step (physical product:
54
+ assembly steps, tools, what connects to what; mechanism: how it moves
55
+ and what the user does). If a step doesn't make sense ("how does the
56
+ servo get inside?"), the design has a gap — flag it inline with ⚠️ and
57
+ promote it to Concerns.
98
58
 
99
59
  ## Concerns
100
-
101
- Numbered list. Each concern is a risk, open question, or thing that
102
- could go wrong. Be specific "tolerances might be tight" is useless;
103
- "the 12mm arm cantilevers under gripping load, may flex >0.5mm" is useful.
104
-
105
- Include issues discovered while writing the Usage Guide.
106
-
107
- 1. ...
108
- 2. ...
60
+ 1. Numbered, falsifiably specific — a reviewer must be able to say
61
+ "real problem" or "fine, because…". "Tolerances might be tight" is
62
+ useless; "the 12mm arm cantilevers under gripping load, may flex
63
+ >0.5mm" is useful.
109
64
 
110
65
  ## Decisions
111
-
112
- Filled in after review. Each decision references which concern or
113
- alternative it resolves.
114
-
115
66
  | # | Decision | Rationale |
116
67
  |---|----------|-----------|
117
- | 1 | ... | ... |
68
+ Filled ONLY after user review never pre-decide. Each row resolves a
69
+ concern or alternative.
118
70
  ```
119
71
 
120
- ## Workflow
72
+ ## Review via git
121
73
 
122
- ### 1. Define the problem
74
+ HLDs and LLDs iterate through git, not conversation:
123
75
 
124
- State what the part/assembly needs to accomplish. Include hard constraints (size envelope, specified manufacturing/process constraints, interfaces with other parts). Do not describe a solution yet.
125
- If no process is specified, treat manufacturing/process choice as an HLD alternative rather than as a hidden assumption.
76
+ - **Commit every version.** No drafts floating in chat. After writing, commit and tell the user it's ready for review.
77
+ - **Feedback arrives as file edits** (inline comments, strikethroughs) **or chat check both.** Read `git diff`: the diff is the review artifact.
78
+ - **Update, commit, repeat** until the Decisions table is filled and the user says "go."
126
79
 
127
- ### 2. Sketch the approach
80
+ ## Rules
128
81
 
129
- Describe the recommended approach at a conceptual level. Draw an ASCII diagram showing the key elements and their spatial relationships. Label the markdown diagram, but do not carry those labels into CAD geometry unless the real artifact needs markings.
82
+ - If you're speccing every part, formula, tolerance, and fabrication step, you're writing an LLD back up.
83
+ - If you can't draw it, you don't understand it yet.
84
+ - Tables are welcome where they clarify (interfaces, requirements, visible evidence); full parameter catalogs go to the LLD.
130
85
 
131
- ### 3. Identify interfaces
132
-
133
- List every point where this design touches another part or the outside world. These are the contracts that constrain the design.
134
-
135
- ### 4. Explore alternatives
136
-
137
- Show 2-3 meaningfully different approaches. Not minor variations — genuinely different strategies. For each, state the key tradeoff in one line. Recommend one.
138
-
139
- ### 5. Write the usage guide
140
-
141
- Work backwards: describe how someone uses/assembles/operates this thing step by step. This is the most powerful validation — it forces you to think through the physical reality before writing code. If a step doesn't make sense ("how does the servo get inside?"), the design has a gap.
142
-
143
- Flag issues inline with ⚠️. These feed directly into the Concerns list.
144
-
145
- ### 6. Surface concerns
146
-
147
- Collect everything from the usage guide ⚠️ flags plus any risks, open questions, or things that could go wrong. Be concrete and specific. These are the agenda for the review conversation.
148
-
149
- ### 7. Commit and present for review
150
-
151
- Commit the HLD to git. Tell the user it's ready for review. Do NOT fill in the Decisions table yet.
152
-
153
- ### 8. Iterate via git
154
-
155
- The user reviews the file (may edit it directly with comments/strikethroughs, or give verbal feedback). After review:
156
-
157
- 1. Read the git diff or the updated file to see the user's feedback
158
- 2. Update the HLD to address feedback
159
- 3. Commit the update
160
- 4. Present for another round if needed
161
-
162
- Repeat until the Decisions table is filled and the user says "go."
163
-
164
- ## Git Workflow
165
-
166
- HLDs and LLDs iterate through git, not conversation. This keeps the document as the single source of truth and gives both sides a clear diff to review.
167
-
168
- ```
169
- Agent writes HLD → git commit → User reviews (edits file or gives feedback)
170
- → Agent reads diff → updates HLD → git commit → repeat until approved
171
- ```
172
-
173
- - **Every version gets committed.** No unsaved drafts floating in conversation.
174
- - **User feedback goes in the file** (inline comments, strikethroughs) or in chat — agent checks both.
175
- - **The diff is the review artifact.** Agent reads `git diff` to see what changed.
176
-
177
- ## Writing Rules
178
-
179
- - **Quality first.** There is no fixed page, time, or section-length limit. Write the HLD to the depth the design deserves.
180
- - **Clear, not artificially terse.** If a reviewer has to re-read a paragraph to understand it, rewrite it; do not delete needed content just to make it shorter.
181
- - **ASCII diagrams where useful.** A cross-section sketch can communicate layout better than paragraphs, but use whichever representation makes the design clearest.
182
- - **Decision-driving dimensions are welcome.** Include dimensions, size envelopes, counts, interface dimensions, and proportional constraints when they clarify architecture, risks, image matching, or feasibility. Put exhaustive construction dimensions and formulas in the LLD.
183
- - **Tables are allowed when they improve clarity.** Use compact tables for alternatives, interfaces, requirements, feature inventories, or visible evidence. Keep full parameter catalogs in the LLD.
184
- - **Concerns are not rhetorical.** Every concern must be specific enough that someone can say "yes that's a real problem" or "no, here's why it's fine."
185
- - **Alternatives are not padding.** If there's genuinely only one way to do it, say so and skip the table.
186
-
187
- ## Relationship to Other Skills
86
+ ## Pipeline
188
87
 
189
88
  | Stage | Skill | Output |
190
89
  |-------|-------|--------|
191
- | 1. Explore the problem space | `/forgecad-high-level-spec` (this skill) | `*-hld.md` |
90
+ | 1. Explore the problem space | this skill | `*-hld.md` |
192
91
  | 2. Detailed design | `/forgecad-lld` | `*-lld.md` |
193
- | 3. Implementation | `/forgecad-make-a-model` + `/forgecad` | `.forge.js` files |
194
-
195
- The HLD must have its Decisions table filled before writing an LLD. The LLD must exist before implementation (unless the model is simple enough to skip straight from HLD to code).
196
-
197
- ## Anti-Patterns
92
+ | 3. Implementation | `/forgecad-make-a-model` + `/forgecad` | `.forge.js` |
198
93
 
199
- - **HLD that's actually an LLD.** If you're exhaustively specifying every part, formula, tolerance, and fabrication step before the architecture is chosen, you've gone too far. Back up.
200
- - **HLD with no alternatives.** You haven't explored the solution space. Even if the answer is obvious, name what you rejected and why.
201
- - **Concerns that are vague worries.** "This might be hard to manufacture" — hard how? Tool access? Bending radius? Wall thickness? Tolerance stack? Support material? Be specific or don't list it.
202
- - **Decisions made before review.** The whole point is to align with the user before committing. Present the HLD, discuss, then decide.
203
- - **Skipping the diagram.** If you can't draw it, you don't understand it yet.
204
- - **Iterating in conversation instead of in the file.** The document is the artifact. Update it, commit it, review the diff.
94
+ The Decisions table must be filled before writing the LLD. Simple models may skip straight from HLD to code.