forgecad 0.9.16 → 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 (147) hide show
  1. package/dist/assets/{AdminPage-CXvls4-J.js → AdminPage-DwYHz72L.js} +1 -1
  2. package/dist/assets/{BenchmarkPage-B27zk8xL.js → BenchmarkPage-a9_f-1US.js} +1 -1
  3. package/dist/assets/{BlogPage-CMAVvgQL.js → BlogPage-DodHpvmf.js} +1 -1
  4. package/dist/assets/{DocsPage-knf4I4h7.js → DocsPage-B5LePEuj.js} +8 -858
  5. package/dist/assets/EditorApp-QXsAISLR.js +16307 -0
  6. package/dist/assets/{EmbedViewer-D7ZGlFjx.js → EmbedViewer-DdEHGUMU.js} +2 -2
  7. package/dist/assets/{LandingPageProofDriven-CnevhTE8.js → LandingPageProofDriven-yhhOodbf.js} +1 -1
  8. package/dist/assets/{LegalPage-BPTUmqeg.js → LegalPage-5RbKRGYK.js} +1 -1
  9. package/dist/assets/{PricingPage-B0D4goG_.js → PricingPage-E3Rma7aV.js} +1 -1
  10. package/dist/assets/{SettingsPage-CFF-UgjI.js → SettingsPage-BJZcM97j.js} +1 -1
  11. package/dist/assets/{app-T0pDcSX4.js → app-DSYrDg0V.js} +733 -205
  12. package/dist/assets/cli/{render-C5pcIISc.js → render-ZMHR9HkV.js} +19 -46
  13. package/dist/assets/{constructionHistoryWorker-Ba2Hm58b.js → constructionHistoryWorker-AwMMWSxg.js} +1103 -349
  14. package/dist/assets/{evalWorker-vkx310U2.js → evalWorker-DbNs7Dkp.js} +3798 -1622
  15. package/dist/assets/{inspectWorker-BuTJDVX6.js → inspectWorker-CZsCFtQT.js} +1163 -409
  16. package/dist/assets/{jointPose-B_Cgedn9.js → jointPose-DO6mnXn_.js} +1 -1
  17. package/dist/assets/{manifold-BWgsjmAM.js → manifold-BGlQBBH9.js} +1 -1
  18. package/dist/assets/{manifold-rZexZI0G.js → manifold-BU-tJwQh.js} +1 -1
  19. package/dist/assets/{manifold-D6IFSkhH.js → manifold-fy2MV7K1.js} +2 -2
  20. package/dist/assets/{reportWorker-0AGij1Ru.js → reportWorker-DO6hcQbh.js} +7155 -2437
  21. package/dist/assets/{scalar-sampling-budget-J5cuzxT1.js → scalar-sampling-budget-o90NSNmF.js} +3940 -1742
  22. package/dist/assets/{scanProxyWorker-Vl4Wxa1y.js → scanProxyWorker-2GtDLk-R.js} +1 -1
  23. package/dist/assets/{javascript-1kQXfVaz.js → typescript-DBQ6RN5l.js} +874 -22
  24. package/dist/cli/render.html +1 -1
  25. package/dist/docs/index.html +3 -3
  26. package/dist/docs-raw/AI/usage.md +1 -1
  27. package/dist/docs-raw/CLI.md +63 -241
  28. package/dist/docs-raw/README.md +6 -0
  29. package/dist/docs-raw/component-model.md +17 -150
  30. package/dist/docs-raw/generated/assembly.md +139 -598
  31. package/dist/docs-raw/generated/concepts.md +245 -3501
  32. package/dist/docs-raw/generated/core.md +277 -1251
  33. package/dist/docs-raw/generated/curves.md +387 -1608
  34. package/dist/docs-raw/generated/legacy.md +162 -0
  35. package/dist/docs-raw/generated/lib.md +227 -85
  36. package/dist/docs-raw/generated/output.md +38 -73
  37. package/dist/docs-raw/generated/runtime-names.md +23 -23
  38. package/dist/docs-raw/generated/sdf.md +68 -284
  39. package/dist/docs-raw/generated/sheet-metal.md +68 -335
  40. package/dist/docs-raw/generated/sketch.md +240 -1161
  41. package/dist/docs-raw/generated/viewport.md +75 -316
  42. package/dist/docs-raw/generated/wood.md +21 -49
  43. package/dist/docs-raw/guides/coordinate-system.md +4 -42
  44. package/dist/docs-raw/guides/inspection-bundles.md +44 -442
  45. package/dist/docs-raw/guides/joint-design.md +18 -79
  46. package/dist/docs-raw/guides/positioning.md +21 -143
  47. package/dist/docs-raw/guides/scene-presentation.md +89 -0
  48. package/dist/docs-raw/skills/forgecad-3d-reconstruction.md +25 -111
  49. package/dist/docs-raw/skills/forgecad-blockout-model.md +20 -117
  50. package/dist/docs-raw/skills/forgecad-component-model.md +23 -107
  51. package/dist/docs-raw/skills/forgecad-high-level-spec.md +47 -155
  52. package/dist/docs-raw/skills/forgecad-image-replicator.md +26 -143
  53. package/dist/docs-raw/skills/forgecad-lld.md +19 -113
  54. package/dist/docs-raw/skills/forgecad-make-a-model.md +112 -532
  55. package/dist/docs-raw/skills/forgecad-model-grader.md +38 -108
  56. package/dist/docs-raw/skills/forgecad-prepare-prompt.md +24 -211
  57. package/dist/docs-raw/skills/forgecad-project.md +13 -131
  58. package/dist/docs-raw/skills/forgecad-reconstruction-benchmark.md +42 -134
  59. package/dist/docs-raw/skills/forgecad-render-inspect.md +27 -174
  60. package/dist/docs-raw/skills/forgecad-visual-spec.md +32 -112
  61. package/dist/docs-raw/skills/forgecad.md +19 -18
  62. package/dist/docs-raw/skills/index.md +2 -0
  63. package/dist/docs-raw/welcome.md +2 -2
  64. package/dist/index.html +1 -1
  65. package/dist/llms.txt +1 -2
  66. package/dist/sitemap.xml +13 -13
  67. package/dist-cli/{check-compiler-SYQ2PWOB.js → check-compiler-JTVBITCR.js} +1 -1
  68. package/dist-cli/{check-query-propagation-HIAGV62W.js → check-query-propagation-3FFLSMVN.js} +1 -1
  69. package/dist-cli/{chunk-SPZE3DUY.js → chunk-OAN5T4XD.js} +4412 -2212
  70. package/dist-cli/forgecad.js +507 -179
  71. package/dist-skill/CONTEXT.md +2172 -8377
  72. package/dist-skill/SKILL.md +15 -15
  73. package/dist-skill/docs/API/core/concepts.md +27 -157
  74. package/dist-skill/docs/CLI.md +63 -241
  75. package/dist-skill/docs/generated/assembly.md +138 -549
  76. package/dist-skill/docs/generated/core.md +277 -1251
  77. package/dist-skill/docs/generated/curves.md +387 -1609
  78. package/dist-skill/docs/generated/lib.md +227 -85
  79. package/dist-skill/docs/generated/output.md +38 -73
  80. package/dist-skill/docs/generated/runtime-names.md +16 -21
  81. package/dist-skill/docs/generated/sdf.md +68 -284
  82. package/dist-skill/docs/generated/sheet-metal.md +68 -335
  83. package/dist-skill/docs/generated/sketch.md +240 -1160
  84. package/dist-skill/docs/generated/viewport.md +75 -223
  85. package/dist-skill/docs/generated/wood.md +21 -49
  86. package/dist-skill/docs/guides/coordinate-system.md +4 -42
  87. package/dist-skill/docs/guides/inspection-bundles.md +44 -442
  88. package/dist-skill/docs/guides/joint-design.md +18 -79
  89. package/dist-skill/docs/guides/positioning.md +21 -143
  90. package/dist-skill/docs/guides/scene-presentation.md +89 -0
  91. package/dist-skill/docs/guides/surface-members.md +26 -0
  92. package/dist-skill/library/forgecad-3d-reconstruction/SKILL.md +23 -111
  93. package/dist-skill/library/forgecad-blockout-model/SKILL.md +18 -117
  94. package/dist-skill/library/forgecad-component-model/SKILL.md +21 -107
  95. package/dist-skill/library/forgecad-high-level-spec/SKILL.md +45 -155
  96. package/dist-skill/library/forgecad-image-replicator/SKILL.md +24 -143
  97. package/dist-skill/library/forgecad-lld/SKILL.md +17 -113
  98. package/dist-skill/library/forgecad-make-a-model/SKILL.md +110 -532
  99. package/dist-skill/library/forgecad-model-grader/SKILL.md +36 -108
  100. package/dist-skill/library/forgecad-prepare-prompt/SKILL.md +35 -224
  101. package/dist-skill/library/forgecad-prepare-prompt/references/default-profiles.md +43 -271
  102. package/dist-skill/library/forgecad-prepare-prompt/references/master-prompt.md +30 -99
  103. package/dist-skill/library/forgecad-project/SKILL.md +13 -133
  104. package/dist-skill/library/forgecad-reconstruction-benchmark/SKILL.md +29 -123
  105. package/dist-skill/library/forgecad-render-inspect/SKILL.md +25 -174
  106. package/dist-skill/library/forgecad-visual-spec/SKILL.md +30 -111
  107. package/dist-skill/website/skills/forgecad-3d-reconstruction.md +58 -0
  108. package/dist-skill/website/skills/forgecad-blockout-model.md +49 -0
  109. package/dist-skill/website/skills/forgecad-component-model.md +53 -0
  110. package/dist-skill/website/skills/forgecad-high-level-spec.md +101 -0
  111. package/dist-skill/website/skills/forgecad-image-replicator.md +63 -0
  112. package/dist-skill/website/skills/forgecad-lld.md +41 -0
  113. package/dist-skill/website/skills/forgecad-make-a-model.md +186 -0
  114. package/dist-skill/website/skills/forgecad-model-grader.md +82 -0
  115. package/dist-skill/website/skills/forgecad-prepare-prompt.md +63 -0
  116. package/dist-skill/website/skills/forgecad-project.md +26 -0
  117. package/dist-skill/website/skills/forgecad-reconstruction-benchmark.md +60 -0
  118. package/dist-skill/website/skills/forgecad-render-inspect.md +80 -0
  119. package/dist-skill/website/skills/forgecad-visual-spec.md +71 -0
  120. package/dist-skill/website/skills/forgecad.md +122 -0
  121. package/dist-skill/website/skills/index.md +26 -0
  122. package/examples/api/comparison-imported-sphere-candidate.forge.js +1 -1
  123. package/examples/api/conformal-product-ribbon.forge.js +1 -1
  124. package/examples/api/exact-sheet-shell-assembly.forge.js +1 -1
  125. package/examples/api/extrude-options.forge.js +4 -2
  126. package/examples/api/field-loft-drive-tip.forge.js +40 -0
  127. package/examples/api/guided-loft-olive-oil-bottle.forge.js +1 -1
  128. package/examples/api/highlight-debug.forge.js +10 -10
  129. package/examples/api/mesh-import-slats.forge.js +1 -1
  130. package/examples/api/real-product-curves.forge.js +1 -1
  131. package/examples/api/sculpt-box-circle-booleans.forge.js +1 -1
  132. package/examples/api/sdf-shapes.forge.js +2 -5
  133. package/examples/api/sketch-rounding-strategies.forge.js +6 -6
  134. package/examples/api/surface-member-bottle-cage.forge.js +3 -3
  135. package/examples/api/surface-member-conformal-product-ribbon.forge.js +3 -3
  136. package/examples/api/surface-member-razor-inlay.forge.js +1 -1
  137. package/examples/api/variable-sweep-test.forge.js +3 -3
  138. package/examples/mechanical/airplane-propeller.forge.js +74 -39
  139. package/examples/nurbs-surface.forge.js +1 -1
  140. package/examples/products/iphone.forge.js +1 -1
  141. package/package.json +1 -1
  142. package/dist/assets/EditorApp-BHMQlJ-D.js +0 -14686
  143. package/dist/docs-raw/guides/geometry-conventions.md +0 -52
  144. package/dist/docs-raw/guides/modeling-recipes.md +0 -78
  145. package/dist-skill/docs/guides/geometry-conventions.md +0 -52
  146. package/dist-skill/docs/guides/modeling-recipes.md +0 -78
  147. package/dist-skill/library/forgecad-visual-spec/references/prompt-template.md +0 -79
@@ -1,3 +1,5 @@
1
+ <!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-blockout-model/SKILL.md instead. -->
2
+
1
3
  # forgecad-blockout-model
2
4
 
3
5
  Create rough high-level ForgeCAD concept models from simple primitives to explore layout, proportions, motion, and part relationships without production detail. Use when asked for a quick model sketch, blockout, spatial mockup, or intuitive low-detail 3D concept.
@@ -11,25 +13,7 @@ Create rough high-level ForgeCAD concept models from simple primitives to explor
11
13
 
12
14
  ## Block Out a Model
13
15
 
14
- 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.
15
-
16
- ### Trigger Boundary
17
-
18
- Use this skill when the user wants to answer questions like:
19
-
20
- - Roughly where do the parts go?
21
- - Does this mechanism idea make intuitive spatial sense?
22
- - What is the silhouette, footprint, or motion envelope?
23
- - Can we show the concept before spending time on detail?
24
-
25
- Do **not** use this skill for:
26
-
27
- - print-ready or fabrication-ready geometry
28
- - exact fit, tight tolerances, or detailed dimensioning
29
- - dense parametric modeling
30
- - hardware details, fillets, chamfers, or finish work unless they are essential to the concept
31
-
32
- Routing:
16
+ 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.
33
17
 
34
18
  | Need | Skill |
35
19
  |------|-------|
@@ -37,110 +21,29 @@ Routing:
37
21
  | Written concept or architecture before CAD | `forgecad-high-level-spec` |
38
22
  | Accurate, detailed, parametric ForgeCAD model | `forgecad-make-a-model` |
39
23
 
40
- ### File Placement
41
-
42
- All new `.forge.js` files go under the date-based directory structure:
43
-
44
- ```text
45
- YYYY/MM/DD/file.forge.js - single-file blockout
46
- YYYY/MM/DD/folder/file.forge.js - multi-file concept project
47
- ```
48
-
49
- 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.
50
-
51
- #### Naming
52
-
53
- - Use kebab-case
54
- - Prefer names like `desk-lamp-blockout.forge.js` or `hinged-display-concept.forge.js`
55
- - Add `-blockout` or `-concept` unless the user already supplied a clearer name
56
-
57
- ### Workflow
58
-
59
- 1. **Load the `forgecad` skill first** and read the Core API and CLI docs. Only load more documentation if the concept truly needs it.
60
- 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.
61
- 3. **Choose approximate dimensions** using round numbers and obvious proportions. Favor "believably shaped" over "numerically correct".
62
- 4. **Write the simplest geometry that communicates the idea**. Default to `box()`, `cylinder()`, `sphere()`, and very simple extrusions.
63
- 5. **Place parts with readable transforms**. Keep coordinates easy to inspect and edit. Prefer centered primitives when that reduces mental load.
64
- 6. **Color by meaning** so a viewer can decode the concept immediately.
65
- 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.
66
- 8. **Stop early** once the mechanism, layout, or concept is understandable.
24
+ ### Method
67
25
 
68
- ### Modeling Rules
26
+ - Load the `forgecad` skill first; read its Core API and CLI docs. Load nothing else unless the concept demands it.
27
+ - Translate the idea into 3-7 conceptual parts BEFORE writing geometry: masses and zones (base, arm, payload, sweep volume, keep-out, hand access).
28
+ - 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.
29
+ - Use round-number dimensions; "believably shaped" beats numerically correct. Name uncertainty honestly: `armLengthGuess`, `baseWidthApprox`, `clearanceEnvelope`.
30
+ - At most a handful of `param()` values, for comparing proportions. Do not parameterize every dimension.
31
+ - 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.
32
+ - 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.
33
+ - 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).
34
+ - Leave out: fasteners and screw holes, wall thicknesses, fillets and blend radii, polished materials, hidden internal structure that does not affect the concept.
69
35
 
70
- - Use one primitive to stand in for many eventual details whenever possible.
71
- - A bounding box is usually better than a fake detailed part.
72
- - Use at most a handful of top-level `param()` values when comparing rough proportions. Do not parameterize every dimension.
73
- - Name uncertainty honestly: `armLengthGuess`, `baseWidthApprox`, `screenVolume`, `clearanceEnvelope`.
74
- - 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.
75
- - 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.
76
- - Use transparent ghost geometry for:
77
- - sweep arcs
78
- - keep-out volumes
79
- - approximate payloads
80
- - user reach or access space
81
- - Ghost geometry must represent a real physical envelope, clearance, motion path, or human-access zone, not decorative teaching overlays.
82
- - Exaggerate tiny clearances if needed to keep the concept readable.
83
- - Keep each conceptual part visually distinct through color or opacity.
84
- - Prefer arrays of named shapes in the return value so the viewer can inspect the concept part-by-part.
36
+ ### Verify
85
37
 
86
- ### What to Leave Out
87
-
88
- Do not spend time on:
89
-
90
- - screw holes
91
- - exact wall thicknesses
92
- - blend radii
93
- - polished materials
94
- - hidden internal structure that does not affect the concept
95
- - mathematical precision that the concept does not justify
96
-
97
- If you notice yourself reaching for detailed constraints, pause and ask whether the blockout should instead hand off to `forgecad-make-a-model`.
98
-
99
- ### Render-Verify Loop
100
-
101
- Even rough models must be rendered. The whole point is spatial intuition.
102
-
103
- #### Minimum check
104
-
105
- ```bash
106
- forgecad run model.forge.js
107
- node dist-cli/forgecad.js render model.forge.js /tmp/blockout.png --camera 45:25 --camera 0:0 --camera 90:0 --size 600
108
- ```
109
-
110
- Inspect the render and ask:
38
+ 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:
111
39
 
112
40
  - Can someone unfamiliar with the idea tell what each mass represents?
113
- - Are the overall proportions believable enough to discuss?
41
+ - Are proportions believable enough to discuss?
114
42
  - Is motion or interference visible where it matters?
115
- - Are unknowns shown honestly, rather than hidden behind fake detail?
116
-
117
- If the answer is no, simplify the model or add clearer ghost volumes.
118
-
119
- ### Useful Pattern
120
-
121
- ```js
122
- // Concept only:
123
- // - dimensions are approximate
124
- // - red transparent geometry shows motion / keep-out
125
-
126
- const base = box(160, 90, 30).placeReference('center', [0, 0, 0]).color('#4c6ef5');
127
- const arm = box(22, 22, 180).placeReference('center', [0, 0, 105]).color('#f08c00');
128
- const payload = box(120, 18, 70).placeReference('center', [0, 0, 210]).color('#2b8a3e');
129
-
130
- const sweep = cylinder(12, 110, 110, 48).placeReference('center', [0, 0, 0])
131
- .rotateY(90)
132
- .translate(0, 0, 120)
133
- .color('#e03131')
134
- .material({ opacity: 0.18 });
43
+ - Are unknowns shown honestly, not hidden behind fake detail?
135
44
 
136
- return [
137
- { name: 'Base', shape: base },
138
- { name: 'Arm', shape: arm },
139
- { name: 'Payload Volume', shape: payload },
140
- { name: 'Sweep Envelope', shape: sweep },
141
- ];
142
- ```
45
+ If any answer is no, simplify or add clearer ghost volumes.
143
46
 
144
- ### Handoff Rule
47
+ ### Handoff
145
48
 
146
- 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.
49
+ 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.
@@ -1,3 +1,5 @@
1
+ <!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-component-model/SKILL.md instead. -->
2
+
1
3
  # forgecad-component-model
2
4
 
3
5
  Enforce the ForgeCAD Component Model when building multi-part assemblies. Parts build at origin, connectors position them, data flows down from parent. Use when building or reviewing any multi-file ForgeCAD project.
@@ -9,129 +11,43 @@ Enforce the ForgeCAD Component Model when building multi-part assemblies. Parts
9
11
 
10
12
  ---
11
13
 
12
- ## Component Model — The React of CAD
13
-
14
- You are building a ForgeCAD multi-part assembly. Follow the Component Model strictly.
15
-
16
- ### The Core Principle
17
-
18
- **Parts never position themselves. The assembly positions them via connectors.**
19
-
20
- 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.
21
-
22
- ### Rules (Non-Negotiable)
23
-
24
- #### 1. Parts Build at Origin
25
- - Geometry starts at `[0, 0, 0]` in local coordinates
26
- - No assembly-space offsets (no `translate(pinionPitchR, 0, layout.pinionZ)`)
27
- - Internal structure computed from the part's own props only
28
-
29
- #### 2. Connectors Are the Interface
30
- - Every part that joins an assembly declares connectors via `.withConnectors({})`
31
- - A connector = origin + axis (outward from the part)
32
- - Connectors meet **face-to-face**: both axes point outward, system brings them together
33
- - For prismatic joints: axes point along the shared slide direction
34
- - Mirrored revolute axes need negated physical joint values for the same mirrored pose
35
-
36
- #### 3. Assembly Is Pure Composition
37
- - Use `addPart()` + `connect()` for frame-aware serial assemblies
38
- - Use `link()` + `edgeBetweenLinks()` + `addAngleBetweenLinks()` for solved point skeletons
39
- - Zero `translate()` calls for structural parts
40
- - Zero coordinate math
41
- - The assembly passes props down and reads metadata up
42
-
43
- #### 4. Data Flows Down, Never Sideways
44
- - **Props down:** Assembly passes dimensions to parts via `require('./part.forge.js', { Height: 20 })`
45
- - **Metadata up:** Parts return `{ shape, boltPattern, pinionZ, ... }` — computed values the parent might pass to siblings
46
- - **Siblings never import each other.** The assembly mediates ALL sibling communication
47
-
48
- #### 5. Verify, Don't console.log
49
- - Use `verify.that("name", () => condition)` for spatial checks
50
- - Use `verify.equal()`, `verify.inRange()`, `verify.notColliding()` for specific assertions
51
- - Never `console.log` + `if` for validation
52
-
53
- ### Connector Convention
54
-
55
- ```js
56
- // Face-to-face: both point outward, system opposes them
57
- base.withConnectors({
58
- mount_face: connector("bolt-face", { origin: [0, 0, 0], axis: [0, 0, -1] }),
59
- // ↑ bottom face ↑ faces downward
60
- });
61
- mount.withConnectors({
62
- flange: connector("bolt-face", { origin: [0, 0, 0], axis: [0, 0, 1] }),
63
- // ↑ top face ↑ faces upward
64
- });
65
-
66
- // Assembly — no flip, no coordinate math
67
- assembly.connect("Base.mount_face", "Mount.flange", { as: "mount-fix" });
68
- ```
14
+ ## Component Model
69
15
 
70
- Revolute values are signed by the physical hinge axis. In a bilateral mechanism,
71
- `axis: [1, 0, 0]` on the right side and `axis: [-1, 0, 0]` on the left side are
72
- exact mirrors at rest, but the same `+theta` value rotates them in opposite
73
- fore/aft senses. Use `Right: +theta`, `Left: -theta`, and mirror physical limits
74
- as `[min, max] -> [-max, -min]`, or drive both sides from a side-neutral link
75
- graph/control layer.
16
+ 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.
76
17
 
77
- ### Part Return Shape
18
+ ### Rules
78
19
 
79
- Every part file returns a structured object:
20
+ 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.
21
+ 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`.
22
+ 3. **Assembly is pure composition.** Zero `translate()` to position structural parts, zero coordinate math — connect connectors, pass props down, read metadata up.
23
+ 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.
24
+ 5. **Validate with `verify.*`, never `console.log` + `if`.**
80
25
 
81
- ```js
82
- return {
83
- shape: body.color('#708090').withConnectors({ ... }),
84
- // Public metadata — parent may pass to siblings:
85
- boltPattern, // bolt positions for sibling parts
86
- pinionZ, // Z center for gear alignment
87
- armWidth, // arm cross-section for cover plate slots
88
- };
89
- ```
90
-
91
- ### File Structure
92
-
93
- **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.
26
+ ### Part return shape
94
27
 
95
28
  ```js
96
- // ─── Motor Mount ────────────────────────────
97
- const mount = buildMount({ servo, wall, clearance });
98
-
99
- // ─── Base Body ──────────────────────────────
100
- const base = buildBase({ gears, depth, height, boltPattern: mount.boltPattern });
101
-
102
- // ─── Assembly ───────────────────────────────
103
- assembly("Gripper")
104
- .addPart("Base", base.shape)
105
- .addPart("Mount", mount.shape)
106
- .connect("Base.mount_face", "Mount.flange", { as: "fix" })
29
+ return { shape, boltPattern, pinionZ }; // shape + metadata the parent may route to siblings
107
30
  ```
108
31
 
109
- ### Anti-Patterns (Reject These)
110
-
111
- ❌ **shared-dims.js** — A file whose only job is computing derived dimensions. The assembly should derive and pass them.
112
-
113
- ❌ **Sibling imports** — `require('./motor-mount.forge.js')` inside `cover-plate.forge.js`. Data flows through the parent.
32
+ ### File structure
114
33
 
115
- **Assembly-space coordinates in parts** A part knowing `pinionZ = 14` from a sibling's geometry. It should receive `rackZ: 14` as a prop.
34
+ 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".
116
35
 
117
- **`translate()` in assembly** — If you're translating to position a part, add a connector instead.
36
+ ### Anti-patterns (reject on review)
118
37
 
119
- **console.log validation** Use `verify.*`. Always.
38
+ - `shared-dims.js`a file that only computes derived dimensions; the assembly derives and passes them.
39
+ - Sibling `require()` — e.g. `require('./motor-mount.forge.js')` inside `cover-plate.forge.js`; route through the parent.
40
+ - Assembly-space coordinates inside a part — a part knowing `pinionZ = 14` from a sibling's geometry; receive it as a prop.
41
+ - `translate()` to position a structural part in an assembly — add a connector instead.
42
+ - `console.log` + `if` validation — use `verify.*`.
43
+ - Bare `connector.neutral()` outside a reusable component library with compatibility checking.
120
44
 
121
- **Bare `connector.neutral()`** — Use `connector()` without gender unless building a reusable component library with compatibility checking.
45
+ ### Design gate
122
46
 
123
- ### Design Gate
124
-
125
- Before committing any multi-part assembly, verify:
47
+ Before committing any multi-part assembly:
126
48
 
127
49
  1. Can you understand each part without reading other files?
128
50
  2. Does the assembly contain zero coordinate math?
129
51
  3. Do all inter-part relationships flow through connectors and props?
130
52
 
131
53
  If any answer is no, refactor.
132
-
133
- ### Reference
134
-
135
- Full philosophy: `docs/permanent/component-model.md`
136
- Connector details: `docs/permanent/generated/assembly.md`
137
- Blueprint-first: `docs/permanent/blueprint-first.md`
@@ -1,3 +1,5 @@
1
+ <!-- Generated by scripts/build-forgecad-skill.mjs — do not edit. Edit agent-skill-library/forgecad-high-level-spec/SKILL.md instead. -->
2
+
1
3
  # forgecad-high-level-spec
2
4
 
3
5
  Write a high-level design document (HLD) for a model, mechanism, or assembly before detailed specification or coding. Use when starting a new design, rethinking an existing one, or when the user asks to spec out, plan, or think through a model at a high level. Works backwards from requirements — defines the problem, explores alternatives, records decisions. Produces a right-sized design document for review and iteration.
@@ -11,199 +13,89 @@ Write a high-level design document (HLD) for a model, mechanism, or assembly bef
11
13
 
12
14
  ## High-Level Design (HLD)
13
15
 
14
- 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.
15
-
16
- ### Philosophy
17
-
18
- An HLD is a thinking tool, not a construction document. It should be:
19
-
20
- - **Quality-first and right-sized.** Use whatever detail, evidence, diagrams, dimensions, and examples are needed for a good decision.
21
- - **Honest about what's unknown.** Open questions are features, not bugs.
22
- - **Opinionated about alternatives.** Don't just list options — recommend one and say why.
23
- - **Stable under iteration.** Easy to update after a round of feedback without rewriting everything.
24
-
25
- 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.
26
-
27
- 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.
28
-
29
- Manufacturing process is part of the design problem, not a default.
30
- 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.
31
- Do not default to 3D printing, FDM, or "printable" unless the user asked for it or the chosen concept genuinely calls for printed parts.
16
+ 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.
32
17
 
33
- ### When to Write an HLD
18
+ 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`).
34
19
 
35
- - Before starting a new model, mechanism, or assembly
36
- - When an existing design has fundamental problems (wrong approach, not just wrong numbers)
37
- - When the user says "spec this out", "think this through", "what should we build"
38
- - Before writing an LLD
39
-
40
- ### Output Location
41
-
42
- HLDs go next to the model files. Name: `<name>-hld.md` or for a project: `hld.md` in the project folder.
20
+ 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.
43
21
 
44
22
  ### Document Structure
45
23
 
24
+ The section order is the workflow — write it top to bottom, following the embedded instructions.
25
+
46
26
  ```markdown
47
27
  # [Name] — High-Level Design
48
28
 
49
29
  ## Problem
50
-
51
- What does this need to do? What role does it play? What are the hard
52
- requirements (must grip objects, must fit in a 60mm housing, must use
53
- sheet metal, must be CNC-machinable, must be printable, must use purchased
54
- bearings)?
55
-
56
- State the problem without implying a solution.
30
+ What must this do? Hard requirements (must grip objects, fit a 60mm
31
+ housing, use purchased bearings). State the problem without implying
32
+ a solution. Unspecified process choice is an open design dimension.
57
33
 
58
34
  ## Approach
59
-
60
- How does it work at a conceptual level? Describe the mechanism, structure,
61
- or behavior. Use ASCII diagrams where they make spatial relationships clearer.
62
-
63
- Keep this at the architecture level, but include enough spatial and behavioral
64
- detail that someone unfamiliar with the project understands the concept.
35
+ How it works at a conceptual level. ASCII diagram of the key elements
36
+ and their spatial relationships diagram labels stay in this markdown;
37
+ never carry them into CAD geometry unless the real artifact needs
38
+ markings.
65
39
 
66
40
  ## Key Interfaces
67
-
68
- How does this connect to the rest of the system? What are the mating
69
- surfaces, shared dimensions, or coordination points? List them explicitly.
41
+ Every point where this touches another part or the outside world:
42
+ mating surfaces, shared dimensions, coordination points. These are the
43
+ contracts that constrain the design.
70
44
 
71
45
  ## Dictionary
72
-
73
- Define every domain-specific term used in this document. Don't assume
74
- engineering terminology is widely known — write for a developer who
75
- doesn't have a mechanical engineering background.
76
-
77
46
  | Term | What it is |
78
47
  |------|-----------|
79
- | ... | Plain-language description with dimensions if relevant |
48
+ Define every domain term in plain words, with dimensions where relevant.
49
+ Write for a developer without a mechanical-engineering background.
80
50
 
81
51
  ## Alternatives
82
-
83
52
  | Option | Description | Tradeoff |
84
53
  |--------|-------------|----------|
85
- | A (recommended) | ... | ... |
86
- | B | ... | ... |
87
- | C | ... | ... |
88
-
89
- For each alternative, include enough detail to understand why it fits or loses.
90
- One sentence is fine only when one sentence is enough. Mark the recommended option.
54
+ 2-3 genuinely different strategies, not minor variations. Enough detail
55
+ per row to see why it fits or loses. Mark one recommended and say why.
56
+ If there is honestly only one approach, say so and skip the table.
91
57
 
92
58
  ## Usage Guide
93
-
94
- Work backwards from the user experience. Write the step-by-step needed to show
95
- how someone would use/assemble/operate this thing. This exposes gaps in the
96
- design before any code is written.
97
-
98
- For a physical product: assembly steps, tools needed, what connects to what.
99
- For a mechanism: how it moves, what the user does, what happens.
100
- For a software component: how it's called, what it returns, error cases.
101
-
102
- Flag issues inline with ⚠️.
59
+ The strongest validation: work backwards from how someone uses,
60
+ assembles, or operates the thing, step by step (physical product:
61
+ assembly steps, tools, what connects to what; mechanism: how it moves
62
+ and what the user does). If a step doesn't make sense ("how does the
63
+ servo get inside?"), the design has a gap — flag it inline with ⚠️ and
64
+ promote it to Concerns.
103
65
 
104
66
  ## Concerns
105
-
106
- Numbered list. Each concern is a risk, open question, or thing that
107
- could go wrong. Be specific "tolerances might be tight" is useless;
108
- "the 12mm arm cantilevers under gripping load, may flex >0.5mm" is useful.
109
-
110
- Include issues discovered while writing the Usage Guide.
111
-
112
- 1. ...
113
- 2. ...
67
+ 1. Numbered, falsifiably specific — a reviewer must be able to say
68
+ "real problem" or "fine, because…". "Tolerances might be tight" is
69
+ useless; "the 12mm arm cantilevers under gripping load, may flex
70
+ >0.5mm" is useful.
114
71
 
115
72
  ## Decisions
116
-
117
- Filled in after review. Each decision references which concern or
118
- alternative it resolves.
119
-
120
73
  | # | Decision | Rationale |
121
74
  |---|----------|-----------|
122
- | 1 | ... | ... |
75
+ Filled ONLY after user review never pre-decide. Each row resolves a
76
+ concern or alternative.
123
77
  ```
124
78
 
125
- ### Workflow
126
-
127
- #### 1. Define the problem
128
-
129
- 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.
130
- If no process is specified, treat manufacturing/process choice as an HLD alternative rather than as a hidden assumption.
131
-
132
- #### 2. Sketch the approach
133
-
134
- 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.
135
-
136
- #### 3. Identify interfaces
137
-
138
- List every point where this design touches another part or the outside world. These are the contracts that constrain the design.
139
-
140
- #### 4. Explore alternatives
141
-
142
- Show 2-3 meaningfully different approaches. Not minor variations — genuinely different strategies. For each, state the key tradeoff in one line. Recommend one.
143
-
144
- #### 5. Write the usage guide
145
-
146
- 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.
147
-
148
- Flag issues inline with ⚠️. These feed directly into the Concerns list.
149
-
150
- #### 6. Surface concerns
79
+ ### Review via git
151
80
 
152
- 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.
81
+ HLDs and LLDs iterate through git, not conversation:
153
82
 
154
- #### 7. Commit and present for review
83
+ - **Commit every version.** No drafts floating in chat. After writing, commit and tell the user it's ready for review.
84
+ - **Feedback arrives as file edits** (inline comments, strikethroughs) **or chat — check both.** Read `git diff`: the diff is the review artifact.
85
+ - **Update, commit, repeat** until the Decisions table is filled and the user says "go."
155
86
 
156
- Commit the HLD to git. Tell the user it's ready for review. Do NOT fill in the Decisions table yet.
87
+ ### Rules
157
88
 
158
- #### 8. Iterate via git
89
+ - If you're speccing every part, formula, tolerance, and fabrication step, you're writing an LLD — back up.
90
+ - If you can't draw it, you don't understand it yet.
91
+ - Tables are welcome where they clarify (interfaces, requirements, visible evidence); full parameter catalogs go to the LLD.
159
92
 
160
- The user reviews the file (may edit it directly with comments/strikethroughs, or give verbal feedback). After review:
161
-
162
- 1. Read the git diff or the updated file to see the user's feedback
163
- 2. Update the HLD to address feedback
164
- 3. Commit the update
165
- 4. Present for another round if needed
166
-
167
- Repeat until the Decisions table is filled and the user says "go."
168
-
169
- ### Git Workflow
170
-
171
- 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.
172
-
173
- ```
174
- Agent writes HLD → git commit → User reviews (edits file or gives feedback)
175
- → Agent reads diff → updates HLD → git commit → repeat until approved
176
- ```
177
-
178
- - **Every version gets committed.** No unsaved drafts floating in conversation.
179
- - **User feedback goes in the file** (inline comments, strikethroughs) or in chat — agent checks both.
180
- - **The diff is the review artifact.** Agent reads `git diff` to see what changed.
181
-
182
- ### Writing Rules
183
-
184
- - **Quality first.** There is no fixed page, time, or section-length limit. Write the HLD to the depth the design deserves.
185
- - **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.
186
- - **ASCII diagrams where useful.** A cross-section sketch can communicate layout better than paragraphs, but use whichever representation makes the design clearest.
187
- - **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.
188
- - **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.
189
- - **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."
190
- - **Alternatives are not padding.** If there's genuinely only one way to do it, say so and skip the table.
191
-
192
- ### Relationship to Other Skills
93
+ ### Pipeline
193
94
 
194
95
  | Stage | Skill | Output |
195
96
  |-------|-------|--------|
196
- | 1. Explore the problem space | `/forgecad-high-level-spec` (this skill) | `*-hld.md` |
97
+ | 1. Explore the problem space | this skill | `*-hld.md` |
197
98
  | 2. Detailed design | `/forgecad-lld` | `*-lld.md` |
198
- | 3. Implementation | `/forgecad-make-a-model` + `/forgecad` | `.forge.js` files |
199
-
200
- 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).
201
-
202
- ### Anti-Patterns
99
+ | 3. Implementation | `/forgecad-make-a-model` + `/forgecad` | `.forge.js` |
203
100
 
204
- - **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.
205
- - **HLD with no alternatives.** You haven't explored the solution space. Even if the answer is obvious, name what you rejected and why.
206
- - **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.
207
- - **Decisions made before review.** The whole point is to align with the user before committing. Present the HLD, discuss, then decide.
208
- - **Skipping the diagram.** If you can't draw it, you don't understand it yet.
209
- - **Iterating in conversation instead of in the file.** The document is the artifact. Update it, commit it, review the diff.
101
+ The Decisions table must be filled before writing the LLD. Simple models may skip straight from HLD to code.