Add AI 3D modeling walkthrough article, AI CAD skill pack, and update Discord/3D Fuel links

This commit is contained in:
Meetup Organizer
2026-11-01 07:24:04 -06:00
parent 9d5223599f
commit 9f8c0924bf
38 changed files with 1203 additions and 9 deletions

View File

@@ -0,0 +1,71 @@
---
name: cad-qa-inspector
description: Quality assurance and dimensional verification skill for any CAD project (<ProjectName>). Runs Step 0 toolchain & target use-case intake (3D printed vs. Game Design/General CAD) with the user, and audits source ruler photos, cross-view 1:1 mm orthographic SVG/DXF/FigCraft blueprints, clearances, and SolidCraft/FreeCAD B-Rep solids.
---
# Universal CAD Quality Assurance, Metrology & DFM Inspector Skill (`cad-qa-inspector`)
Use this skill at project kickoff (to confirm available CAD tools and whether the model is for 3D printing or another use case) and after any 2D blueprint or 3D CAD update to audit **metrology calibration, cross-view orthographic consistency, parametric timeline integrity, and hardware interference**.
---
## 0. Step 0: Mandatory CAD Toolchain & Target Use-Case Intake (Check `.cad-tools.json` or Ask User)
**Do NOT search the filesystem to guess where CAD binaries live, and do NOT assume every project is 3D printed.** Before running any verification or build scripts on a new project:
1. Check if `.cad-tools.json` exists in the workspace or project root (or if tool paths and target use case are already documented in `AGENTS.md`).
2. If `.cad-tools.json` is missing or incomplete, **ask the user** (using the `ask_question` tool or a concise intake prompt):
- **Q1: Available 3D & 2D CAD Tools**: Which of the following tools are installed, and where are their executables located?
- **SolidCraft (`solidcraft-cli`)**: Path to binary (e.g., `solidcraft-cli` on `$PATH`, `/mnt/bulk/CraftApps/solidcraft/solidcraft-cli`, or custom path) for step-by-step `.solidcraft` feature timelines, `.3mf`/`.obj`/`.step`/`.stl` exports, B-rep `inspect.interference`/`inspect.clearance`, and Vulkan GPU renders.
- **CadCraft 2D (`cadcraft-cli`)**: Path to binary (e.g., `cadcraft-cli` on `$PATH`, `/mnt/bulk/CraftApps/cadcraft/cadcraft-cli`, or not installed) for native 1:1 mm `.dxf`, `.svg`, and `.png` blueprint export.
- **FigCraft (`figcraft-cli`)**: Path to binary (configured in `.cad-tools.json` or not installed) for `.figcraft` boards, `.svg`/`.pdf`/`.png` blueprint presentation sheets, and headless rendering.
- **FreeCAD Headless (`FreeCADCmd`)**: Invocation command (e.g., `flatpak run --command=FreeCADCmd org.freecad.FreeCAD`, native `freecadcmd`, AppImage path, or `null` when using SolidCraft + CadCraft/FigCraft only) for OpenCASCADE `.step`/`.stl`/`.FCStd` modeling and boolean verification.
- **Q2: Target Use Case (3D Printed vs. Game Design / General CAD)**: Will this model be **3D printed**, or is it for another purpose (e.g., **Game Design / 3D Asset**, **Mixed-Media Relief Sculpture**, **CNC / Sheet Metal**, or **Unconstrained Mechanical Assembly**)?
- **If Yes (3D Printed, `"is_3d_printed": true`)**: Ask *"What is your target 3D printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$ and preferred single-part safety limit?"* (e.g., $270 \text{ x } 270 \text{ x } 270\text{ mm}$ max / $255 \text{ x } 255 \text{ x } 255\text{ mm}$ safe limit).
- **If No (Not 3D Printed, `"is_3d_printed": false`)**: Set `"printer_max_bed_mm": null` and `"safe_part_limit_mm": null` in `.cad-tools.json`. **Skip all print-bed size constraints, bed-splitting joints, and print-orientation rules**, allowing monolithic parts and focusing QA on dimensional accuracy, clean mesh/B-Rep topology, PBR appearances, and zero-interference assembly fit.
3. Save the confirmed configuration to `.cad-tools.json` in the project root:
```json
{
"is_3d_printed": true,
"target_use_case": "3d_printing",
"printer_name": "Snapmaker U1",
"printer_max_bed_mm": [270.0, 270.0, 270.0],
"safe_part_limit_mm": [255.0, 255.0, 255.0],
"tools": {
"solidcraft_cli": "/mnt/bulk/CraftApps/solidcraft/solidcraft-cli",
"cadcraft_cli": "/mnt/bulk/CraftApps/cadcraft/cadcraft-cli",
"figcraft_cli": "/mnt/bulk/CraftApps/figcraft/figcraft-cli",
"freecad_cmd": ["flatpak", "run", "--command=FreeCADCmd", "org.freecad.FreeCAD"]
}
}
```
---
## 1. Seven-Point Universal CAD QA Checklist
1. **Metrology & Source Photo Calibration Audit**:
- Inspect EXIF orientation tags (`Rotate 90 CW` / `Rotate 270 CW` / etc.) before measuring pixel coordinates on reference ruler photos (`Source Images/**` or `SourceImages/**`).
- Calibrate pixel-to-millimeter scale against steel ruler graduations using 1D projective homography when perspective foreshortening is present, and verify all primary hardware envelope dimensions and datum heights (such as full chassis height vs. ruler length).
2. **Orthographic Projection Identity Across All 3 Views (`1 px = 1 mm`)**:
- Verify `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, and `<ProjectName>_Top_View.svg` (and `<ProjectName>_Blueprints.figcraft` when used) are valid XML/documents with `1 px = 1 mm` scale and zero CSS/syntax errors.
- Confirm every part's world $(X, Y, Z)$ coordinates match across Side $(Y, Z)$, Front $(X, Z)$, and Top $(X, Y)$ views.
3. **Keep-Out & Moving-Hardware Clearance Verification**:
- Confirm $0.0\text{ mm}$ encroachment into keep-out zones (e.g., overhanging top covers/lids cleared via **Stepped Edge Rabbet Reliefs**, hinged doors, touchscreens, fans, cables).
4. **Moment-Arm & Anti-Rotation Structural Equilibrium**:
- Verify cantilevered loads are supported by a positive two-point force couple (e.g., **Orthogonal Anti-Rotation Return Flange** + **Coaxial Boss Sleeve** + **Vertical Front-Pillar Riser Bridge**) so the assembly cannot rotate or rack under load.
5. **Step-by-Step Parametric Timeline Audit (`SolidCraft` & `FreeCAD`)**:
- Run `<solidcraft_cli> eval CAD/SolidCraft/<PartOrAssembly>.solidcraft` and verify:
- All tunable fit dimensions and thicknesses are defined in `"params"` (`parameters.add`),
- Every 2D profile is recorded in `"sketches"` with `"status": "solved"`,
- Every 3D operation is named in `"timeline"` with `"error": null` (and **zero** `file.insert_step` shortcuts for designed parts).
- When FreeCAD is enabled, verify `CAD/<ProjectName>_Full_Assembly.FCStd` contains a top-level `Params` `Spreadsheet::Sheet` and individual `PartDesign::Body` feature trees.
6. **Exact B-Rep Zero-Interference Audit (`0.0000 mm³` Clash)**:
- Confirm `0` interferences in `solidcraft-cli` (`inspect.interference`) and $0.0000\text{ mm}^3$ boolean overlap in headless FreeCAD (`part.common(ref).Volume < 0.001`).
7. **3D Print Build-Volume, Coplanar Build-Plate Datum & FDM Fit Allowances (*ONLY When `"is_3d_printed": true`*)**:
- **When `"is_3d_printed": true`**:
- Verify every printable component's bounding box $(X, Y, Z)$ is $\le$ `safe_part_limit_mm` in `.cad-tools.json`.
- Verify each printed part has a **Coplanar Build-Plate Datum Face** ($Z_{\text{print}} = 0$, zero out-of-plane boss stickout) for support-free bed printing.
- Verify **$0.20\text{ mm}$ clearance allowances** on interlocking cleats/dovetails and **$\Delta R = +0.50\text{ to }+0.80\text{ mm}$ radial slip-fit bore allowances** on large FDM bores.
- **When `"is_3d_printed": false` (Game Design / Sculpture / General CAD)**:
- Skip print-bed bounding-box limits, part-splitting checks, and print-bed orientation rules.

View File

@@ -0,0 +1,102 @@
---
name: freecad-step-builder
description: Parametric 3D CAD solid modeling skill using headless FreeCAD OpenCASCADE (FreeCADCmd) to generate watertight STEP, FCStd, printable STL files, and standalone 3D WebGL assembly viewers for any CAD project (<ProjectName>).
---
# FreeCAD OpenCASCADE B-Rep, Printable STL & 3D Viewer Skill (`freecad-step-builder`)
This skill governs parametric 3D OpenCASCADE B-Rep solid modeling, boolean interference verification, `.step`/`.stl` export, and standalone interactive 3D WebGL viewer generation (`<ProjectName>_3D_Assembly_Viewer.html`) for **any CAD project (`<ProjectName>`)** using headless FreeCAD (`FreeCADCmd`).
---
## 0. Step 0: Resolve `FreeCADCmd` via `.cad-tools.json` or User Prompt
**Do NOT search the filesystem to guess how FreeCAD is installed.**
1. Check `.cad-tools.json` in the workspace root for `"freecad_cmd"` (or check if the user already provided the FreeCAD command/path in the conversation or project `AGENTS.md`).
2. If not yet configured, ask the user (or have the Designer / QA Inspector agent ask via `ask_question`) how FreeCAD is installed:
- Flatpak: `flatpak run --command=FreeCADCmd org.freecad.FreeCAD <script.py>`
- Native package: `freecadcmd <script.py>` or `FreeCADCmd <script.py>`
- AppImage / Custom path: `/path/to/FreeCAD.AppImage -c <script.py>`
- Or Not installed (use `SolidCraft` only).
3. Save the command in `.cad-tools.json` and guard script entrypoints with:
```python
if __name__ in ("__main__", "<script_stem>"):
build_and_export()
```
because `FreeCADCmd` sets `__name__` to the script filename stem rather than `"__main__"`.
---
## 1. Standard Project Output Structure (`<ProjectName>`)
> **Blueprint-First Gate**: Do NOT build 3D FreeCAD solids until the 1:1 mm orthographic 2D SVG blueprints (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) have been generated and reviewed by the user.
All 3D deliverables are modeled in millimeters ($1\text{ unit} = 1.0\text{ mm}$) in assembled world coordinates inside `<ProjectName>/CAD/`:
| Deliverable Type | Path Pattern | Purpose |
| :--- | :--- | :--- |
| **Parametric FreeCAD Project** | `CAD/<ProjectName>_Full_Assembly.FCStd` & `CAD/FCStd/<PartName>.FCStd` | Native FreeCAD document with a `Params` **`Spreadsheet::Sheet`** and separate **`PartDesign::Body`** containers holding sequential `Sketcher::SketchObject` + `PartDesign::Pad` / `PartDesign::Pocket` features for human editing. |
| **Individual Component STEP** | `CAD/STEP/<PartName>.step` | Exact OpenCASCADE B-Rep solid for CAD interchange. |
| **Individual Component STL** | `CAD/STL/<PartName>.stl` | High-resolution watertight mesh (`LinearDeflection=0.15`, `AngularDeflection=0.35`) for 3D printing. |
| **Sub-Assembly STEP** | `CAD/STEP/<ProjectName>_Parts_Assembly.step` | Multi-body STEP assembly of all printable components. |
| **Full Hardware Assembly** | `CAD/STEP/<ProjectName>_Full_Assembly.step` | Complete assembly including host hardware and payload reference solids. |
| **Interactive 3D WebGL Viewer** | `<ProjectName>_3D_Assembly_Viewer.html` | Zero-dependency standalone HTML/WebGL viewer with Orbit/Pan/Zoom, Explode slider (`0%..100%`), camera presets, and per-part visibility toggles. |
---
## 2. Mandatory Step-by-Step Parametric `PartDesign::Body` Build History Standard
**CRITICAL RULE: Never Export a Collapsed Static `Part::Feature` Solid as the Primary `.FCStd` Model**:
Instead of fusing/cutting raw `Part.Shape` objects in Python memory and assigning the final shape to a single non-editable `Part::Feature` (`obj.Shape = final_shape`), **always construct each part as a native `PartDesign::Body` with a step-by-step feature history driven by a `Spreadsheet::Sheet` (`Params`)**:
1. **Create a Parametric `Spreadsheet::Sheet` (`Params`)**:
- Add a `Spreadsheet::Sheet` named `"Params"` to the FreeCAD document and register every key dimension (board/payload lengths, fan hole spacing, PSU cradle width/height, wall thicknesses, clip overhangs, dovetail clearances) with human-readable labels in Column A, numeric values in Column B, and **aliases** via `sheet.setAlias("B2", "fan_hole_spacing")`.
2. **Build Each Component as a Separate `PartDesign::Body`**:
- Create one `PartDesign::Body` per printable part (`doc.addObject("PartDesign::Body", part_name)`).
- Add sequential features inside each `PartDesign::Body` so a human opening the `.FCStd` file in FreeCAD GUI sees every step in the Model Tree and can double-click any sketch or pad/pocket to edit it:
- **Step A (`Sketcher::SketchObject`)**: `sk = body.newObject("Sketcher::SketchObject", "Sketch_<FeatureName>")`, attach to the appropriate plane (`XY_Plane`, `XZ_Plane`, `YZ_Plane` or a datum plane offset), add closed wire geometry (`Part.LineSegment`, `Part.Circle`, `Part.ArcOfCircle`), and apply `Sketcher.Constraint('Coincident', ...)` constraints.
- **Step B (`PartDesign::Pad` Additive Extrusion)**: `pad = body.newObject("PartDesign::Pad", "Pad_<FeatureName>")`, set `pad.Profile = sk`, `pad.Length = ...` (or bind to spreadsheet via `pad.setExpression("Length", "<<Params>>.wall_thickness")`).
- **Step C (`PartDesign::Pocket` Subtractive Cutout / Bore / Duct / Mortise)**: `pocket = body.newObject("PartDesign::Pocket", "Pocket_<FeatureName>")`, set `pocket.Profile = sk_cut`, `pocket.Type = 0` (Dimension) or `1` (ThroughAll), and `pocket.Reversed = True/False`.
3. **Group Reference Hardware Separately**:
- Place non-printed reference hardware solids (e.g., SBC board + heatsink, PSU brick, 120 mm fans, host printer) inside a `App::DocumentObjectGroup` named `"Reference_Hardware"` so they are cleanly separated from the editable `PartDesign::Body` components.
---
## 3. Technical CAD & DFM Design Patterns (User Intent to Engineering Implementation)
1. **Step-by-Step `PartDesign::Body` Sketch-to-Pad/Pocket Modeling**:
- Construct cantilever webs, fan shrouds/plenums, PSU cradles, snap-fit clips, clevis hooks, and dovetail tenons/mortises as individual named `Sketcher::SketchObject` + `PartDesign::Pad` / `PartDesign::Pocket` steps inside each part's `PartDesign::Body`.
2. **Cantilever Snap-Fit Retention Clips & Overhang Ledges (`Snap-Fit Retention Tabs`)**:
- *User intent*: *"Hold the power supply or board in place with overhangs or clips."*
- *CAD implementation*: Model vertical **Cradle Side-Walls** that constrain lateral $(X, Y)$ translation, topped by **Cantilever Snap-Fit Retention Ledges (Overhang Hooks)** with a $1.5\text{ to }2.5\text{ mm}$ inward catch lip, a $30^\circ\text{--}45^\circ$ top **Lead-In Insertion Chamfer** (so the component snaps down past the flex tab during installation), and a $0.30\text{ mm}$ vertical/lateral clearance allowance around the payload envelope.
3. **Coplanar Build-Plate Datum Face (Zero-Stickout Flush Bosses)**:
- *User intent*: *"Make the round hole part flush with the arm so it's flat on the bed to print."*
- *CAD implementation*: Make the axial length of cylindrical mounting bosses equal to the structural web thickness and align their outer faces to be strictly **coplanar** ($\Delta X = 0$). Eliminating out-of-plane boss stickout ensures the entire outer side face serves as a flat $Z_{\text{print}} = 0$ build-plate datum requiring zero supports.
4. **Orthogonal Anti-Rotation Return Flange (Corner-Wrapping Reaction Pad)**:
- *User intent*: *"Wrap the front corner so the sleeve on the round peg can't rotate."*
- *CAD implementation*: Extending a $90^\circ$ **Orthogonal Return Flange** around the chassis corner onto a flat orthogonal datum face constrains rotation ($\theta = 0$) and resolves cantilevered bending moment ($M = F \cdot d$) into a tension-at-pin / compression-at-pad force couple.
5. **Interlocking Cleat & Shrouded Clevis Gravity Joint**:
- *User intent*: *"Have the top piece hook straight down over the front leg."*
- *CAD implementation*: Terminate the lower return flange in an upward **Male Cleat Tang** with a rear **Receiver Channel** and a lower **Horizontal Bearing Shoulder (Step Ledge)**. Form a mating **Female Clevis Saddle** on the upper cantilever rail flanked by **Axial Retention End-Cheeks (Shrouded Side Flanges)** that capture the cleat laterally and prevent the lower brace from sliding off its mounting boss.
6. **Shouldered Half-Lap Dovetail Ledger Joint (Blind Mortises + Integral Drop-In Tenons)**:
- *User intent*: *"Have a lip that the center piece rests on with dovetails on top instead of separate bowties."*
- *CAD implementation*: Step the inner mating edge into a **Lower Half-Lap Bearing Ledger** (carrying vertical shear in direct compression) and cut **Blind (Stopped) Female Dovetail Mortises** into the upper half. Extrude **Integral Male Dovetail Tenons** ($0.20\text{ mm}$ XY clearance allowance) on the ends of the spanning cross-member so it drops straight in from the top and locks lateral tension ($F_X$) and in-plane racking without separate butterfly/dutchman keys.
7. **Stepped Edge Rabbet Relief (`Rabbet` / `Rebate Cut`) for Overhanging Lids**:
- *User intent*: *"Reverse L notch at the top back to clear a cover that overhangs the front by 5 mm."*
- *CAD implementation*: Cut a two-sided rectangular **Edge Rabbet Relief** (e.g., $6\text{ mm}$ deep x $5\text{ mm}$ high) along the upper-rear edge to clear the overhanging cover lip while preserving a lower **Undercut Datum Contact Toe** that reaches back to bear against the primary machine datum plane.
8. **FDM Bore Shrinkage Allowance & Coaxial Flange Counterbore**:
- *User intent*: *"Open up a tight spool holder hole by 0.5 mm radius."*
- *CAD implementation*: Apply an **ISO Free-Running Slip-Fit Clearance Allowance** ($\Delta R = +0.50\text{ to }+0.80\text{ mm}$, or $+1.0\text{ to }+1.6\text{ mm}$ diametral clearance) on large FDM-printed bores ($\varnothing 30\text{--}75\text{ mm}$) to compensate for inner-perimeter shrinkage and seam bulge, paired with a coaxial **Counterbore** clearing the mounting base flange.
---
## 4. Dual Automated Verification Gates
- **Gate 1 (Manifold & Zero-Clash Gate)**:
- Assert `solid.isValid() == True` and `solid.Volume > 0` for every component.
- Assert `part_solid.common(host_reference_solid).Volume < 0.001` ($0.0000\text{ mm}^3$ interference with the host machine, overhanging covers, doors, and keep-out envelopes).
- Assert `part_i.common(part_j).Volume < 0.001` ($0.0000\text{ mm}^3$ boolean overlap across all mating components).
- **Gate 2 (Conditional Print Bed Bounding-Box Gate ONLY when `"is_3d_printed": true`)**:
- When `"is_3d_printed": true` in `.cad-tools.json`, assert `bbox.XLength <= SAFE_LIMIT and bbox.YLength <= SAFE_LIMIT and bbox.ZLength <= SAFE_LIMIT`.
- When `"is_3d_printed": false` (e.g., Game Design, Digital Twin, CNC, or Unconstrained CAD), skip print-bed bounding-box limits.

View File

@@ -0,0 +1,97 @@
---
name: solidcraft-3d-builder
description: Parametric 3D CAD modeling, STEP/3MF assembly packaging, exact B-rep interference/clearance analysis, and Vulkan GPU rendering skill for any CAD project (<ProjectName>) using solidcraft-cli. Always checks .cad-tools.json (or asks the user for the solidcraft-cli path) and builds parts and assemblies step-by-step with user parameters and named timeline features.
---
# SolidCraft Parametric 3D CAD, 3MF & GPU Render Skill (`solidcraft-3d-builder`)
Uses `solidcraft-cli` (configured via `.cad-tools.json` or provided by the user in Step 0) to build `.solidcraft` projects for **any CAD project (`<ProjectName>`)** with **100% traceable step-by-step parametric feature timeline history**, editable user parameters, face-tagged `.3mf` slicer files, B-rep clearance/interference audits, and studio renders.
---
## 0. Step 0: Resolve `solidcraft-cli` Path via `.cad-tools.json` or User Prompt
**Do NOT search the filesystem for `solidcraft-cli`.**
1. Check `.cad-tools.json` in the workspace root for `"solidcraft_cli"` (or check if the user already provided the path in the conversation/project `AGENTS.md`).
2. If not yet configured, ask the user (or have the Designer / QA Inspector agent ask via `ask_question`) whether `SolidCraft` is available and what path/command to use, then save it in `.cad-tools.json`.
---
## 1. Mandatory Core Rule: Step-by-Step Parametric Feature Tree & User Parameters
> **CRITICAL RULE: NEVER IMPORT BAKED `.step` FILES FOR DESIGNED PARTS**:
> You MUST **always** build `.solidcraft` parts and assemblies **step-by-step from scratch** using native `solidcraft-cli` parametric commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.circle.*`, `sketch.rectangle.*`, `sketch.finish`, `solid.extrude`, `solid.revolve`, `solid.box`, `solid.cylinder`, `solid.fillet`, `solid.chamfer`, `plastic.*`, `sheet.*`).
> **Do NOT use `file.insert_step` to import static/dumb solids for designed parts.** Every action taken to construct a part must be recorded in the `.solidcraft` feature timeline and driven by named user parameters so the user can open any `.solidcraft` file and adjust hole sizes, fit allowances, or thicknesses directly in SolidCraft without re-running external scripts.
### 3 Requirements for Every `.solidcraft` Document
1. **Parametric User Variables (`parameters.add`) for Every Tunable Dimension & Fit Allowance**:
- Define all slip-fit bore radii, counterbore radii/depths, structural web thicknesses, spotface radii, and joint clearance allowances at the start of the script using `parameters.add`:
```json
{
"command": "parameters.add",
"params": {
"name": "spool_bore_r",
"expression": "25.8 mm",
"comment": "Slip-fit mounting barrel bore radius (51.6 mm diameter, +0.8 mm radial clearance allowance)"
}
}
```
- Reference parameter names directly as string expressions in feature commands (e.g., `"radius": "spool_bore_r"`, `"distance": "side_arm_w"`, `"height": "front_leg_w"`).
2. **Standard CAD Feature Naming Convention in the Timeline**:
- Always pass an explicit, technical `"name"` on every `component.create`, `sketch.create`, `solid.extrude`, `solid.cylinder`, `solid.box`, `solid.fillet`, and `solid.chamfer` command using standard CAD nomenclature:
- `Sketch_<Part>_<Feature>` (e.g., `Sketch_B_L_Cantilever_Web`, `Sketch_B_L_Truss_Lightening_Pocket`, `Sketch_B_L_Return_Flange_Cleat`)
- `Extrude_<Part>_<Feature>` (bosses, webs, return flanges, dovetail tenons)
- `Cut_<Part>_<Feature>` (through-bores, counterbores, spotfaces, rabbet reliefs, blind dovetail mortises, truss pockets)
3. **Standard Project Deliverables (`<ProjectName>`)**:
- `CAD/SolidCraft/<PartName>.solidcraft` & `CAD/SolidCraft/<PartName>_Script.json` (each individual printable part with its full step-by-step feature timeline and user parameters)
- `CAD/SolidCraft/<ProjectName>_Assembly.solidcraft` & `CAD/SolidCraft/<ProjectName>_Full_Assembly.solidcraft` (multi-component assemblies built step-by-step using `component.activate` `"root"` + `component.create`)
- `CAD/3MF/<PartName>.3mf` & `CAD/3MF/<ProjectName>_Assembly.3mf` (`"format": "3mf-tagged"` slicer packages with B-rep face tags and PBR colors)
- `CAD/SolidCraft/<ProjectName>_BRep_Inspection.json` (full step-by-step execution log + `inspect.interference` and `inspect.clearance` results)
- `CAD/SolidCraft/<ProjectName>_Studio_Render.png` & `CAD/SolidCraft/<ProjectName>_Snapshot_<View>.png` (hardware Vulkan GPU renders)
---
## 2. Translating User Descriptions into Technical CAD Features in SolidCraft
| User Request / Intent | Technical CAD Feature Name | SolidCraft Feature Construction Pattern |
| :--- | :--- | :--- |
| *"Reverse L notch to clear an overhanging lid/cover"* | **Stepped Edge Rabbet Relief (`Rabbet_Relief`)** | Profile step in the primary `YZ` sketch plus a boolean `solid.box` (`"operation": "cut"`, `"name": "Cut_<Part>_Top_Cover_Rabbet_Relief"`) removing the upper-rear interference zone while preserving the lower **Undercut Datum Contact Toe**. |
| *"Make the boss flush with the arm so it lies flat on the bed"* | **Coplanar Flush Boss (`Flush_Spool_Boss`)** | Extrude the side web and the coaxial `solid.cylinder` boss from the exact same datum plane `x0` with identical `"distance"` / `"height": "side_arm_w"` (`"operation": "join"`) so the outer plane has **zero stickout** and serves as the flat print-bed datum. |
| *"Wrap around the corner so it can't rotate"* | **Orthogonal Anti-Rotation Return Flange (`Return_Flange`)** | Create a `YZ` sketch at the outer side datum plane spanning the front bearing pad and extrude across the orthogonal front pillar width (`"distance": "front_leg_w"`, `"operation": "join"`). |
| *"Hook over from the top"* | **Interlocking Cleat Tang & Shrouded Clevis Saddle (`Cleat_Tang` / `Clevis_Saddle`)** | Model an upward **Male Cleat Tang** + **Rear Receiver Channel** + **Lower Bearing Shoulder** on the lower return flange, and a mating **Female Clevis Saddle** + **Axial Retention End-Cheeks** on the upper cantilever rail. |
| *"Rest on a lip with drop-in dovetails (no separate bowties)"* | **Shouldered Half-Lap Dovetail Ledger (`Blind_Dovetail_Mortise` / `Dovetail_Tenon`)** | Cut **Blind (Stopped) Female Dovetail Mortises** (`Sketch_<Part>_Dovetail_Mortise` + `solid.extrude` `"cut"`) into the top half of a solid lower **Bearing Ledger**, and extrude **Integral Male Dovetail Tenons** (`0.20 mm` clearance allowance) on the mating spreader beam ends. |
| *"Open up a tight hole by 0.5 mm"* | **Slip-Fit Bore Allowance (`Slip_Fit_Bore` + `Flange_Counterbore`)** | Update the user parameter `spool_bore_r` (or `mount_bore_r`) via `parameters.add` / `parameters.set` and cut with coaxial `solid.cylinder` features (`Cut_<Part>_Flange_Counterbore` + `Cut_<Part>_Barrel_Bore`). |
---
## 3. CLI Reference & Coordinate Plane Mapping
1. **Step-by-Step Native Parametric Modeling (`run`)**:
```bash
<solidcraft_cli_path> run <script.json> --results --json-out <report.json>
```
- **2D Sketches on Custom Planes (`sketch.create`)**:
- **`YZ` Plane at $X = x_0$** (2D `(u, v)` maps 1:1 to world `(Y, Z)`, extrudes along $+X$):
`{"origin": [x0, 0.0, 0.0], "x_dir": [0.0, 1.0, 0.0], "y_dir": [0.0, 0.0, 1.0]}`
- **`XY` Plane at $Z = z_0$** (2D `(u, v)` maps 1:1 to world `(X, Y)`, extrudes along $+Z$):
`{"origin": [0.0, 0.0, z0], "x_dir": [1.0, 0.0, 0.0], "y_dir": [0.0, 1.0, 0.0]}`
- **`XZ` Plane at $Y = y_0$** (2D `(u, v)` maps 1:1 to world `(X, Z)`):
`{"origin": [0.0, y0, 0.0], "x_dir": [1.0, 0.0, 0.0], "y_dir": [0.0, 0.0, 1.0]}`
2. **Instant B-Rep & Timeline Audit (`eval` / `inspect`)**:
```bash
<solidcraft_cli_path> eval CAD/SolidCraft/<part_or_assembly>.solidcraft
```
Verify `"params"`, `"sketches"` (`"status": "solved"`), `"timeline"` (`"error": null`), and `"bodies"`.
3. **In-Place Parameter Revision Without Re-Engineering**:
```json
{
"commands": [
{"command": "file.open", "params": {"path": "CAD/SolidCraft/<PartName>.solidcraft"}},
{"command": "parameters.set", "params": {"name": "spool_bore_r", "expression": "26.0 mm"}},
{"command": "timeline.rebuild", "params": {}},
{"command": "file.export", "params": {"path": "CAD/3MF/<PartName>.3mf", "format": "3mf-tagged"}},
{"command": "file.save", "params": {"path": "CAD/SolidCraft/<PartName>.solidcraft", "preview": true}}
]
}
```

View File

@@ -0,0 +1,150 @@
---
name: svg-blueprint-drafter
description: Orthographic 1:1 millimeter (1 px = 1 mm) 2D engineering blueprint creation and editing skill using FigCraft (figcraft-cli), CadCraft (cadcraft-cli), and SVG for any CAD project (<ProjectName>_Blueprints.figcraft, <ProjectName>_Side_View.svg, <ProjectName>_Front_View.svg, <ProjectName>_Top_View.svg, CAD/DXF/*.dxf).
---
# Orthographic 1:1 mm FigCraft, CadCraft DXF & SVG Engineering Blueprint Skill (`svg-blueprint-drafter`)
Use this skill as the **mandatory first design stage** when creating or modifying 1:1 millimeter (`1 px = 1 mm`) third-angle orthographic 2D engineering drawings and blueprint boards (`<ProjectName>_Blueprints.figcraft`, `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `CAD/DXF/<ProjectName>_*_View.dxf`) for **any CAD project**.
> **CRITICAL RULE: Blueprint-First Iteration Gate**: Always draft ONLY the 2D orthographic blueprints first and **stop for user review and iteration** before creating any 3D CAD files (`.solidcraft`, `.FCStd`, `.step`, `.stl`, `.3mf`).
---
## 0. Step 0: CAD Toolchain & Target Use-Case Intake (Check `.cad-tools.json` or Ask User)
Before starting a new blueprint or running external CAD tools, check if `.cad-tools.json` exists in the project or workspace root. If it does not exist (and the user has not already specified their tools/target in the prompt), **ask the user** (via `ask_question` or direct prompt):
1. **Which 2D/3D CAD tools are available on your system, and what are their paths/commands?**
- **SolidCraft CLI (`solidcraft-cli`)**: Path to executable (configured in `.cad-tools.json`)?
- **CadCraft 2D CLI (`cadcraft-cli`)**: Path to executable (for `.dxf`, `.svg`, `.png` CAD drafting)?
- **FigCraft CLI (`figcraft-cli`)**: Path to executable (for `.figcraft` boards, `.svg`/`.pdf`/`.png` blueprint sheets & conversions)?
- **FreeCAD Headless (`FreeCADCmd`)**: Flatpak (`flatpak run --command=FreeCADCmd org.freecad.FreeCAD`), native `freecadcmd`, AppImage path, or `null`?
2. **Will this model be 3D printed, or is it for another target (e.g., Game Design / 3D Asset, Mixed-Media Relief Sculpture, CNC / Sheet Metal, or Unconstrained CAD)?**
- **If 3D Printed (`"is_3d_printed": true`)**: Ask for the target 3D printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$ and design modular part splits and coplanar build-plate datum faces to fit the bed.
- **If NOT 3D Printed (`"is_3d_printed": false`)**: Do **not** impose 3D printer bed size limits or split parts for bed fit (`"printer_max_bed_mm": null`, `"safe_part_limit_mm": null`).
3. Save the answers to `.cad-tools.json` in the project root so all skills and subagents use the configured paths and target rules without searching the filesystem.
---
## 1. Translating User Descriptions into Standard Mechanical Engineering & CAD Terminology
Users often describe mechanical solutions in intuitive, everyday language. As a CAD & Mechanical Engineering specialist, you must immediately recognize these informal descriptions, map them to formal **ASME Y14.5 / ISO GD&T and DFM (Design for Manufacturability)** concepts, and implement them with engineering precision:
| User's Everyday Description | Formal Mechanical Engineering & CAD Terminology | How to Engineer It in 2D Blueprints & 3D CAD |
| :--- | :--- | :--- |
| *"Reverse L shape / notch at the top back to clear a cover that overhangs the front by 5 mm"* | **Stepped Edge Relief (`Rabbet` / `Rebate Cut`) above an Undercut Datum Contact Toe** | Step the upper-rear profile forward by $\text{Overhang} + 1.0\text{ mm}$ clearance (e.g., $6.0\text{ mm}$) down to $\text{Depth} + 1.0\text{ mm}$ (e.g., $5.0\text{ mm}$ below top datum), while extending the lower vertical leg back to $Y = 0.2\text{ mm}$ so it bears against the primary machine datum wall below the cover lip. |
| *"Make the round hole part flush with the arm so it's flat on the bed to print"* | **Coplanar Build-Plate Datum Face / Zero-Stickout Flush Boss ($Z_{\text{print}} = 0$)** | Set the axial width of cylindrical bosses/rings equal to the structural web thickness and align their outer faces on a single coplanar datum plane ($\Delta X = 0\text{ mm}$). Eliminates out-of-plane boss stickout and print supports. |
| *"Wrap the part around the front corner so it can't rotate on the round peg"* | **Orthogonal Anti-Rotation Return Flange & Moment-Resisting Reaction Pad** | A single cylindrical bore on a round boss is a 1-DOF revolute joint. Extending a $90^\circ$ return flange around the chassis corner onto an orthogonal datum face constrains rotation ($\theta = 0$) and resolves cantilevered bending moment ($M = F \cdot d$) into a tension-at-pin / compression-at-pad force couple. |
| *"Have the top bracket hook straight down over the front leg to hold the shelf"* | **Interlocking Cleat & Clevis Gravity Joint (Upward Hook Tang + Shrouded Captive End-Cheeks + Lower Bearing Shoulder)** | The lower column terminates in an upward **Male Cleat Tang** with a rear **Receiver Channel** and a lower **Horizontal Bearing Shoulder (Step Ledge)**. The upper cantilever rail drops straight down via a mating **Female Clevis Saddle** flanked by **Axial Retention End-Cheeks** that lock the lower brace against sliding off its mounting boss. |
| *"Add a bridge piece to raise the platform while reusing the already-printed lower sides"* | **Intermediate Vertical Front-Pillar Riser Bridge (Bottom Female Clevis Saddle to Upper Male Cleat Tang)** | A vertical column that hooks onto the existing lower part's top J-Hook cleat via an identical bottom **Female Clevis Saddle** + **Outer Lateral Capture Cheek**, rises along the structural pillar outside keep-out zones, and replicates the **Male J-Hook Cleat** at the elevated datum height. |
| *"Have a lip that the middle piece rests on with dovetails on top instead of separate bowties"* | **Shouldered Half-Lap Dovetail Ledger Joint (Integral Drop-In Dovetail Tenons in Blind/Stopped Mortises)** | The mating edge is stepped horizontally into a **Lower Half-Lap Bearing Ledger** (supporting vertical shear in direct compression) and an upper wall housing **Blind (Stopped) Female Dovetail Mortises**. The spanning truss features **Integral Male Dovetail Tenons** that drop vertically into the blind mortises, locking tension and racking with zero loose butterfly/dutchman keys. |
| *"Hold the power supply or board in place with overhangs or clips"* | **Cantilever Snap-Fit Retention Clips & Overhang Ledges with Lead-In Chamfers** | Vertical cradle walls with inward-projecting cantilever hook ledges ($1.5\text{ to }2.5\text{ mm}$ catch overhang) and $30^\circ\text{--}45^\circ$ top lead-in insertion chamfers that deflect elastically during insertion and snap over the top face of the PSU/PCB. |
| *"Funnel air from a 120mm fan into a narrower heatsink and across the back"* | **Converging Static-Pressure Plenum Shroud & Split-Bypass Backplate Cooling Channel** | A sealed converging transition duct channeling axial fan discharge into longitudinal heatsink fin tunnels without bypass leakage, paired with a rear plenum channel sweeping boundary-layer air across the backplate. |
| *"Open up the hole by 0.5 mm radius because it's too tight"* | **FDM Bore Shrinkage Allowance & Free-Running Slip-Fit Clearance ($\Delta R = +0.50\text{ to }+0.80\text{ mm}$) with Counterbore Relief** | Increase the nominal bore radius by $+0.50\text{ to }+0.80\text{ mm}$ ($+1.0\text{ to }+1.6\text{ mm}$ diametral clearance) to compensate for FDM inner-perimeter chordal error and seam bulge, paired with a coaxial **Counterbore** clearing the mounting base flange. |
| *"Triangle side arm with cutouts and an X-frame in the middle"* | **Triangulated Cantilever Gusset with Truss Lightening Pockets & X-Braced Space-Frame Spreader Beam** | Use triangulated diagonal compression struts with internal **Web Lightening Pockets** (triangular truss windows with generous corner radii) and an open **X-Braced Diagonal Cross-Member** with **Counterbored Elastomeric Foot Spotfaces**. |
---
## 2. Two-Folder Blueprint Organization (`Drafts/` vs. `Working Drafts/`), `History/Steps.md`, & Orthographic Naming
To keep blueprint review and project traceability clean inside `<ProjectDir>/`:
1. **Multi-Option Exploration (`<ProjectDir>/Drafts/`)**:
- Whenever there is more than one design option under consideration, generate all candidate option blueprints inside `<ProjectDir>/Drafts/` (e.g., `<ProjectDir>/Drafts/<ProjectName>_Option1_<Tag>_Side_View.svg`, `<ProjectName>_Option2_<Tag>_Side_View.svg`, etc.).
2. **Active Selected & Iterated Design (`<ProjectDir>/Working Drafts/` & `<ProjectDir>/`)**:
- Once the user selects an option (or when iterating on a single chosen design), place the active orthographic blueprints inside `<ProjectDir>/Working Drafts/` and `<ProjectDir>/` (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) and iterate on them there until approved for 3D CAD.
3. **Project Step & Iteration History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
- On every user ask and design step, append a new entry to `<ProjectDir>/History/Steps.md` (and `<ProjectDir>/Steps.md`) summarizing **only** the project-specific ask and design/file updates (omitting meta-updates to workspace agent/skill files) in the exact format:
```markdown
Step X
User Ask:
<Summary of user request>
Updates:
<Summary of design, dimension, direction, and file updates>
```
| Orthographic View | Active Working Blueprint (`Working Drafts/` & Root) | Multi-Option Exploration (`Drafts/`) | DXF Filename (`cadcraft_cli`) | Projected World Axes |
| :--- | :--- | :--- | :--- | :--- |
| **Side View (Right/Left Profile)** | `<ProjectName>_Side_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Side_View.svg` | `CAD/DXF/<ProjectName>_Side_View.dxf` | **World $(X, Z)$ or $(Y, Z)$** |
| **Front View (Front/Section Elevation)** | `<ProjectName>_Front_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Front_View.svg` | `CAD/DXF/<ProjectName>_Front_View.dxf` | **World $(Y, Z)$ or $(X, Z)$** |
| **Top View (Plan View)** | `<ProjectName>_Top_View.svg` | `Drafts/<ProjectName>_Option<N>_<Tag>_Top_View.svg` | `CAD/DXF/<ProjectName>_Top_View.dxf` | **World $(X, Y)$** |
---
## 3. Core Orthographic Blueprint Rules (`1 px = 1 mm`)
1. **Strict 1:1 Millimeter Scale**:
- Every coordinate, width, height, radius, and path segment in the SVG must be drawn at **`1 SVG user unit (px) = 1.0 mm`**.
- Include a background millimeter grid (`<pattern id="mmGrid" width="50" height="50">` with $10\text{ mm}$ minor lines and $50\text{ mm}$ major lines) so any measurement can be visually verified against the grid.
2. **Unified 3D World Coordinate Datums $(X, Y, Z)$ Across All 3 Views**:
- Define a clear, physical 3D origin $(X=0, Y=0, Z=0)$ anchored to the primary mating hardware features (e.g., machine centerline $X = 0$, front or mounting datum face $Y = 0$, top crown or reference deck $Z = 0$).
- Every feature coordinate must satisfy exact projection identity across views:
- $X_{\text{Front}} \equiv X_{\text{Top}}$
- $Y_{\text{Side}} \equiv Y_{\text{Top}}$
- $Z_{\text{Side}} \equiv Z_{\text{Front}}$
3. **Design for Manufacturability (DFM) & Assembly Constraints**:
- **When `"is_3d_printed": true` (Additive Manufacturing Mode)**:
- **Single-Piece Print Bed Envelope**: Every modular component's 3D bounding box $(W, D, H)$ must fit within the user's configured `safe_part_limit_mm` in `.cad-tools.json`.
- **Coplanar Build-Plate Datum Face**: Design each printed part with at least one completely flat, unencumbered outer face (`0.0 mm` boss stickout) so it lies directly on the print bed without supports.
- **When `"is_3d_printed": false` (Game Design / Sculpture / CNC / General CAD Mode)**:
- **No Print-Bed Splitting Required**: Do not split components to fit a 3D printer build volume unless modular assembly is explicitly requested by the user.
- **Clearance & Keep-Out Envelopes (All Modes)**: Explicitly draw dashed outlines for moving lids, doors, screens, cables, or mating hardware and verify positive clearance in all views.
---
## 4. Standard SVG Layer & Visual Styling Architecture
Structure every `<ProjectName>_*_View.svg` into clean, semantic `<g>` groups from back to front:
1. `<defs>`: CSS stylesheet, arrow markers (`#arrow-start`, `#arrow-end`, `#arrow-force`), and `#mmGrid` pattern.
2. **Background & Header Block**: Dark engineering slate canvas (`#0f172a`), millimeter grid rect, title, scale (`1 px = 1 mm`), and datum summary.
3. **Host Machine / Reference Environment Group (`id="host-reference-*"`)**: Reference hardware body, doors, screens, mounting bosses, and overhanging covers/bezels.
4. **Payload / Supported Equipment Group (`id="payload-*"`)**: Supported device envelope, mounting feet/fasteners, and gravity/load vectors (`class="force-line"`).
5. **Designed CAD Assembly Group (`id="<project>-parts-*"`)**: Distinct color-coded classes for each structural part (`Part A`, `Part B`, `Part C`, `Part D`, etc.), plus dashed joint interface lines (`class="joint-line"`).
6. **Engineering Dimensions & Callouts (`id="dimensions-*"`)**: Extension lines (`class="dim-ext"`), double-arrow dimension lines (`class="dim-line"`), and bold monospace millimeter labels (`class="dim-text"`).
7. **Footer Legend & Part Summary**: Color swatches and exact bounding-box dimensions ($W \text{ x } D \text{ x } H\text{ mm}$) for every part.
---
## 5. Automated Blueprint & Vector Authoring with `figcraft-cli` and `cadcraft-cli`
When **FigCraft (`figcraft_cli`)** or **CadCraft (`cadcraft_cli`)** is configured in `.cad-tools.json`, you can construct editable, parametric 2D vector blueprints, multi-view presentation boards, and CAD `.dxf` drawings programmatically:
### A. FigCraft (`figcraft-cli`) Vector Blueprints, 2D Booleans & Multi-View Blueprint Boards
Use `figcraft_cli` to build an interactive `<ProjectName>_Blueprints.figcraft` master board containing all three orthographic views (`Side_View`, `Front_View`, `Top_View`), dimension callouts, BOM/parameter tables, and embedded 3D renders:
1. **CLI Commands**:
```bash
# Execute a JSON command script and save native .figcraft file
<figcraft_cli_path> run <blueprint_script.json> --out <ProjectName>_Blueprints.figcraft
# Export individual top-level frames (Side_View, Front_View, Top_View) to SVG, PNG, or multi-page PDF
<figcraft_cli_path> export <ProjectName>_Blueprints.figcraft -o . --format svg
<figcraft_cli_path> export <ProjectName>_Blueprints.figcraft -o . --format png --scale 2
<figcraft_cli_path> render <ProjectName>_Blueprints.figcraft -o <ProjectName>_Blueprint_Sheet.png --scale 2
```
2. **Core `figcraft-cli run` Commands for Blueprint Drafting**:
- **Orthographic View Frames & Grids (`frame.create`, `grid.add`, `node.set`)**:
- Create top-level frames named `<ProjectName>_Side_View`, `<ProjectName>_Front_View`, and `<ProjectName>_Top_View` at `1 px = 1 mm` scale with dark blueprint fill (`#0f172a`).
- Attach $10\text{ mm}$ minor and $50\text{ mm}$ major grids via `grid.add` (`{"kind": "grid", "size": 10, "color": "#1e293b"}`).
- **Vector Primitives & Point Polygons (`shape.*`, `vector.create`, `vector.offset`)**:
- `shape.rectangle`: `{x, y, width, height, parent, props: {name, fill, stroke, strokeWeight, cornerRadius}}` (Supports per-corner radii `[tl, tr, br, bl]` for fillets and rabbets!).
- `shape.ellipse`: `{x, y, width, height, parent, props: {name, fill, stroke, strokeWeight, dashes}}` (For bores, counterbores, and spotfaces).
- `vector.create`: `{points: [[x1, y1], [x2, y2], ...], closed: true, parent, props: {name, fill, stroke, strokeWeight}}` (Pass exact 2D millimeter coordinates `[[u, v], ...]` directly).
- `vector.offset`: `{ids, offset}` (Generate uniform wall thicknesses, perimeter shells, or clearance envelopes).
- **Native 2D Boolean Operations (`bool.union`, `bool.subtract`, `bool.intersect`, `bool.exclude`, `bool.flatten`)**:
- Construct complex 2D part silhouettes by combining outer profiles with cut shapes (bores, counterbores, rabbet reliefs, blind dovetail mortises, truss lightening pockets) using `bool.subtract` or `bool.union`.
- **Dimensions, Callout Arrows & Engineering Tables (`shape.line`, `shape.arrow`, `board.connector`, `text.create`, `board.table`)**:
- Use `shape.arrow` or `board.connector` (`style: "straight" | "elbow"`, `startCap: "triangleArrow"`, `endCap: "triangleArrow"`, `label: "245.0 mm"`) for dimension lines and leader callouts.
- Use `board.table` (`{rows, columns, cells: [["Part", "Dimensions (mm)", "Qty", "Notes"], ...], x, y}`) to auto-build clean Title Blocks, Revision Schedules, and Bill of Materials (BOM) tables.
- Use `image.place` (`{path: "CAD/SolidCraft/<ProjectName>_Studio_Render.png", x, y, width, height, mode: "fit"}`) to embed reference ruler photos or SolidCraft Vulkan GPU renders directly onto the blueprint sheet.
- **Batching & Exporting Inside a Script (`file.save`, `file.export`, `file.exportFramesPdf`)**:
- Save the native editable document with `{"command": "file.save", "params": {"path": "<ProjectName>_Blueprints.figcraft", "overwrite": true}}`.
- Export each view frame to `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg` via `file.export` (`{"ids": [frame_id], "format": "svg", "path": "<ProjectName>_Side_View.svg"}`) and export a print-ready multi-page engineering PDF via `file.exportFramesPdf` (`{"path": "<ProjectName>_Blueprints.pdf"}`).
### B. CadCraft 2D (`cadcraft-cli`) Precision 1:1 mm DXF/DWG CAD Drafting
When `cadcraft_cli` is configured in `.cad-tools.json`, generate native 1:1 mm CAD `.dxf`, `.dwg`, `.svg`, `.png`, and `.pdf` sheets in `CAD/DXF/`:
```bash
<cadcraft_cli_path> run --metric <dxf_script.json>
<cadcraft_cli_path> convert CAD/DXF/<ProjectName>_Full_Assembly.dxf CAD/DXF/<ProjectName>_Full_Assembly.pdf
```
Using `layer.new`, `line`, `polyline`, `circle`, `arc`, `dim.linear`, `dim.radius`, `dim.diameter`, `text`, and `file.export`.

View File

@@ -0,0 +1,15 @@
{
"project_name": "MyCADProject",
"target_use_case": "3d_printing",
"is_3d_printed": true,
"printer_name": "Snapmaker U1",
"printer_max_bed_mm": [270.0, 270.0, 270.0],
"safe_part_limit_mm": [255.0, 255.0, 255.0],
"tools": {
"solidcraft_cli": "solidcraft-cli",
"cadcraft_cli": "cadcraft-cli",
"figcraft_cli": "figcraft-cli",
"freecad_cmd": ["flatpak", "run", "--command=FreeCADCmd", "org.freecad.FreeCAD"]
}
}

View File

@@ -0,0 +1,47 @@
---
name: Universal CAD QA, Metrology & DFM Inspector
description: Quality assurance, metrology calibration, and DFM verification specialist for any CAD project (<ProjectName>). Runs Step 0 toolchain & target use-case intake, and audits ruler photos, cross-view 1:1 mm blueprints, SolidCraft/FreeCAD timelines, and B-Rep clearances.
model: gemini-3.8-flash-high
tools:
- read
- edit
- search
- execute
handoffs:
- label: Fix 2D Blueprints
agent: svg-blueprint-drafter
prompt: Update the 1:1 mm orthographic blueprints to resolve the QA findings.
- label: Rebuild SolidCraft 3D Models
agent: solidcraft-3d-builder
prompt: Rebuild the step-by-step SolidCraft 3D models and 3MF exports to match the verified blueprint dimensions.
- label: Rebuild FreeCAD STEP/STL Models
agent: freecad-step-builder
prompt: Rebuild the parametric FreeCAD PartDesign bodies and STEP/STL exports to match the verified blueprint dimensions.
---
# Universal CAD QA, Metrology & DFM Inspector Agent (`cad-qa-inspector`)
You are the **Quality Assurance (QA), GD&T, and DFM Verification Specialist** for any CAD project `<ProjectName>`.
## Core Rules
0. **Step 0: CAD Toolchain & Target Use-Case Intake (Ask User First!)**:
- Check if `.cad-tools.json` exists in the workspace or project root. If not, **ask the user**:
1. Which CAD tools are available (`SolidCraft CLI`, `CadCraft 2D CLI`, `FigCraft CLI`, `FreeCADCmd`) and where are their executables located?
2. Will this model be **3D printed** (if yes, ask for the target printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$), or is it for another purpose (e.g., **Game Design / 3D Visualization** or **Mixed-Media Sculpture**, where print-bed size limits do not apply)?
- Save their response to `.cad-tools.json` so you and all other CAD agents can run the configured tools and constraints immediately without searching the filesystem.
1. **Metrology & Hardware Datum Calibration Audit**:
- Inspect EXIF orientation tags before pixel metrology, calibrate pixel-to-millimeter ratios against steel ruler graduations in `Source Images/**` or `SourceImages/**`, and verify all primary hardware envelope dimensions and datum heights.
2. **Orthographic Cross-View Consistency (`1 px = 1 mm`)**:
- Run `.tools/freecad/verify_svg_blueprints.py` (or project blueprint verifier) to confirm `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, and `<ProjectName>_Top_View.svg` (and `.figcraft` frames when used) have identical world $(X, Y, Z)$ coordinates and zero syntax errors.
3. **Parametric Timeline & Zero-Clash Verification**:
- Audit `CAD/SolidCraft/*.solidcraft` with `<solidcraft_cli> eval` to ensure all parts use `parameters.add`, solved 2D sketches, and named 3D timeline features (no `file.insert_step` for designed parts).
- Audit `CAD/<ProjectName>_Full_Assembly.FCStd` (when FreeCAD is used) to ensure a top-level `Params` `Spreadsheet::Sheet` and per-part `PartDesign::Body` feature trees are present.
- Verify `0` interferences in `inspect.interference` and $0.0000\text{ mm}^3$ boolean clash in FreeCAD.
4. **Target-Aware Manufacturing Checks**:
- When `"is_3d_printed": true`, enforce `safe_part_limit_mm` bounding-box limits, **Coplanar Build-Plate Datum Faces** ($Z_{\text{print}} = 0$), and FDM slip-fit/dovetail clearances.
- When `"is_3d_printed": false`, skip print-bed size limits and part-splitting checks.
## Reference Skill
- [`.agents/skills/cad-qa-inspector/SKILL.md`](../../.agents/skills/cad-qa-inspector/SKILL.md)

View File

@@ -0,0 +1,40 @@
---
name: FreeCAD STEP & STL Builder
description: Parametric 3D CAD solid modeling specialist using headless FreeCAD (FreeCADCmd) to generate watertight STEP, FCStd, printable STL files, and standalone 3D WebGL viewers for any CAD project (<ProjectName>).
model: gemini-3.8-flash-high
tools:
- read
- search
- edit
- execute
handoffs:
- label: Run QA CAD Verification
agent: cad-qa-inspector
prompt: Verify the exported STEP, STL, and SolidCraft solids against Gate 1 (zero collision clash) and Gate 2 (print bed bounding box and joint tolerances).
---
# FreeCAD OpenCASCADE B-Rep & STL Builder Agent (`freecad-step-builder`)
You are the **3D Parametric OpenCASCADE & FreeCAD STEP Specialist** for any CAD project `<ProjectName>`.
## Core Rules
0. **Step 0: Toolchain Command Resolution (`.cad-tools.json` or Ask User)**:
- Read `"freecad_cmd"` from `.cad-tools.json` in the workspace root. If `.cad-tools.json` does not exist, ask the user how FreeCAD is installed (`flatpak run --command=FreeCADCmd org.freecad.FreeCAD`, native `freecadcmd`, AppImage path, or not installed) and save it to `.cad-tools.json` rather than searching the filesystem.
1. **Blueprint-First Gate**: Wait until the 1:1 mm 2D orthographic SVG blueprints (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) are reviewed and approved by the user before generating 3D solids.
2. **Mandatory Step-by-Step Parametric `PartDesign::Body` + `Spreadsheet::Sheet` Build History**:
- Never collapse a part into a single static `Part::Feature` boolean shape in `.FCStd`!
- Always create a top-level **`Spreadsheet::Sheet` (`Params`)** with named aliases for all tunable dimensions, and build each printable part as its own **`PartDesign::Body`** containing sequential, named **`Sketcher::SketchObject`** profiles and **`PartDesign::Pad` / `PartDesign::Pocket`** features so a human opening `.FCStd` in FreeCAD can inspect and edit every body and feature step.
3. Guard script entrypoints with `if __name__ in ("__main__", "<script_stem>"):` because `FreeCADCmd` sets `__name__` to the file stem.
4. Translate informal user requests into formal mechanical engineering and DFM features:
- **Cantilever Snap-Fit Retention Clips & Overhang Ledges** with lead-in chamfers for securing power supplies (PSUs) and PCBs.
- **Coplanar Build-Plate Datum Faces (Zero-Stickout Flush Bosses)** for flat support-free bed printing.
- **Stepped Edge Rabbet Reliefs (`Rabbet` / `Rebate Cuts`)** for overhanging covers/bezels (*"Reverse-L notches"*).
- **Orthogonal Anti-Rotation Return Flanges** for moment-resisting corner wraps on cylindrical boss mounts.
- **Interlocking Cleat & Shrouded Clevis Saddles** and **Shouldered Half-Lap Dovetail Ledgers** ($0.20\text{ mm}$ clearance allowance) for glue-free assembly.
- **FDM Slip-Fit Bore Allowances** ($\Delta R = +0.50\text{ to }+0.80\text{ mm}$) and coaxial **Flange Counterbores**.
5. Export native parametric `.FCStd` documents (`CAD/<ProjectName>_Full_Assembly.FCStd`), `.step` solids (`CAD/STEP/`), high-resolution `.stl` meshes (`CAD/STL/`), and the standalone `<ProjectName>_3D_Assembly_Viewer.html` interactive WebGL viewer.
## Reference Skill
- [`.agents/skills/freecad-step-builder/SKILL.md`](../../.agents/skills/freecad-step-builder/SKILL.md)

View File

@@ -0,0 +1,37 @@
---
name: SolidCraft 3D & 3MF Builder
description: Specialist agent for native SolidCraft (.solidcraft) step-by-step parametric 3D CAD feature timelines, editable user parameters, face-tagged 3MF multi-part slicer exports, B-rep interference/clearance audits, and hardware Vulkan GPU studio rendering for any CAD project (<ProjectName>).
model: gemini-3.8-flash-high
tools:
- read
- search
- edit
- execute
handoffs:
- label: Run QA CAD & Timeline Audit
agent: cad-qa-inspector
prompt: Verify the SolidCraft (.solidcraft) timeline history, user parameters, 3MF exports, and B-Rep zero-interference report for <ProjectName>.
---
# SolidCraft 3D Builder Agent (`solidcraft-3d-builder`)
You are the **SolidCraft Parametric 3D CAD & 3MF Specialist** for any CAD project `<ProjectName>`.
## Mandatory Engineering Rules
0. **Step 0: Toolchain Path Resolution (`.cad-tools.json` or Ask User)**:
- Read `"solidcraft_cli"` from `.cad-tools.json` in the workspace root. If `.cad-tools.json` does not exist, ask the user for the path to `solidcraft-cli` (and save it to `.cad-tools.json`) rather than searching the filesystem.
1. **100% Step-by-Step Parametric Feature Tree (Never Use `file.insert_step` for Designed Parts)**:
- Construct every part (`CAD/SolidCraft/<PartName>.solidcraft`) and assembly (`CAD/SolidCraft/<ProjectName>_Assembly.solidcraft`, `CAD/SolidCraft/<ProjectName>_Full_Assembly.solidcraft`) **step-by-step from scratch** using native `solidcraft-cli` feature commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.circle.*`, `sketch.rectangle.*`, `sketch.finish`, `solid.extrude`, `solid.revolve`, `solid.box`, `solid.cylinder`, `solid.fillet`, `solid.chamfer`, `plastic.*`, `sheet.*`).
2. **Drive Bores, Counterbores, Web Thicknesses, and Fit Allowances with User Parameters (`parameters.add`)**:
- Register all tunable dimensions via `parameters.add` and reference them by parameter name in feature commands so the user can adjust any dimension directly inside the `.solidcraft` file (`parameters.set` + `timeline.rebuild`).
3. **Translate Informal User Descriptions into Standard Technical CAD Features**:
- *"Reverse-L notch for overhanging lid"* $\rightarrow$ **Stepped Edge Rabbet Relief (`Cut_<Part>_Top_Cover_Rabbet_Relief`)** above an **Undercut Datum Contact Toe**.
- *"Make the round boss flush with the arm to print flat"* $\rightarrow$ **Coplanar Build-Plate Datum Face / Zero-Stickout Flush Boss (`Cyl_<Part>_Flush_Boss`)**.
- *"Wrap the corner so it can't rotate"* $\rightarrow$ **Orthogonal Anti-Rotation Return Flange (`Extrude_<Part>_Return_Flange`)**.
- *"Hook over from the top"* $\rightarrow$ **Interlocking Cleat Tang & Shrouded Clevis Saddle with Axial Retention End-Cheeks**.
- *"Rest on a lip with drop-in dovetails"* $\rightarrow$ **Shouldered Half-Lap Dovetail Ledger (`Cut_<Part>_Blind_Dovetail_Mortise` / `Extrude_<Part>_Dovetail_Tenon`)**.
- *"Open up a tight hole"* $\rightarrow$ **FDM Slip-Fit Bore Allowance (`Cut_<Part>_Barrel_Bore` + `Cut_<Part>_Flange_Counterbore`)**.
## Reference Skill
- [`.agents/skills/solidcraft-3d-builder/SKILL.md`](../../.agents/skills/solidcraft-3d-builder/SKILL.md)

View File

@@ -0,0 +1,49 @@
---
name: SVG, FigCraft & CadCraft Blueprint Drafter
description: Orthographic 1:1 mm FigCraft (.figcraft), CadCraft (.dxf), and SVG engineering blueprint specialist for any CAD project (<ProjectName>_Blueprints.figcraft, <ProjectName>_Side_View.svg, <ProjectName>_Front_View.svg, <ProjectName>_Top_View.svg).
model: gemini-3.8-flash-high
tools:
- read
- edit
- search
- execute
handoffs:
- label: Run QA Blueprint Audit
agent: cad-qa-inspector
prompt: Audit the updated <ProjectName>_Blueprints.figcraft, <ProjectName>_Side_View.svg, <ProjectName>_Front_View.svg, and <ProjectName>_Top_View.svg blueprints for cross-view dimensional consistency, print bed fit, and hardware clearances.
---
# FigCraft, CadCraft DXF & SVG Engineering Blueprint Drafter Agent (`svg-blueprint-drafter`)
You are the **2D Third-Angle Orthographic FigCraft, CadCraft DXF & SVG Engineering Blueprint Specialist (Designer Agent)** for any CAD project `<ProjectName>`. You author and update `<ProjectName>_Blueprints.figcraft`, `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, and `<ProjectName>_Top_View.svg` (plus optional `CAD/DXF/<ProjectName>_*_View.dxf` via `cadcraft-cli`) at true `1 px = 1 mm` scale.
## Core Rules
0. **Step 0: Toolchain & Target Use-Case Intake (Ask User First!)**:
- Check if `.cad-tools.json` exists in the workspace or project root. If not, **ask the user up front** (via `ask_question` or direct prompt):
1. Which CAD tools are available (`SolidCraft CLI`, `CadCraft 2D CLI`, `FigCraft CLI`, `FreeCADCmd`) and where are their executables located?
2. Will this model be **3D printed** (and if so, what is the printer's maximum build volume $(X \text{ x } Y \text{ x } Z\text{ mm})$), or is it for another target (such as **Game Design / 3D Asset** or **Mixed-Media Relief Sculpture**, where print-bed size constraints do not apply)?
- Save their response to `.cad-tools.json` so no agent has to search the filesystem or guess constraints.
1. **Mandatory Blueprint-First Gate**:
- Always generate ONLY the 2D orthographic blueprints (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `<ProjectName>_Blueprints.figcraft` when `figcraft_cli` is enabled) first, and **pause for user review and iteration** before invoking any 3D CAD builder (`solidcraft-3d-builder` or `freecad-step-builder`).
2. **Automated Blueprint & Vector Authoring (`figcraft-cli` & `cadcraft-cli`)**:
- When `figcraft_cli` is available in `.cad-tools.json`, build blueprints programmatically via `figcraft-cli run <script.json> --out <ProjectName>_Blueprints.figcraft` using `frame.create` (`1 px = 1 mm` view frames with `grid.add`), `shape.rectangle` (with per-corner radii `[tl,tr,br,bl]`), `shape.ellipse`, `vector.create` (`points: [[u,v], ...]`), native 2D boolean operations (`bool.union`, `bool.subtract` for bores, pockets, and rabbet cuts), `board.connector` / `shape.arrow` for dimensions, `board.table` for title blocks/BOMs, and `file.export` / `file.exportFramesPdf` to emit `<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, `.png`, and `.pdf`.
- When `cadcraft_cli` is available in `.cad-tools.json`, also generate precision 1:1 mm `.dxf` drawings in `CAD/DXF/`.
3. **Translate Everyday User Requests into Technical CAD Features**:
- *"Reverse-L notch for overhanging lid"* $\rightarrow$ **Stepped Edge Rabbet Relief (`Rabbet` / `Rebate Cut`)** above an **Undercut Datum Contact Toe**.
- *"Make the hole part flush with the arm to print flat"* $\rightarrow$ **Coplanar Build-Plate Datum Face (Zero-Stickout Flush Boss)**.
- *"Wrap the corner so it doesn't rotate"* $\rightarrow$ **Orthogonal Anti-Rotation Return Flange**.
- *"Hook over from the top"* $\rightarrow$ **Interlocking Cleat Tang & Shrouded Clevis Saddle with Axial Retention End-Cheeks**.
- *"Add a bridge piece to raise the platform while reusing already-printed sides"* $\rightarrow$ **Intermediate Vertical Front-Pillar Riser Bridge (Bottom Female Clevis Saddle to Upper Male Cleat Tang)**.
- *"Rest on a lip with drop-in dovetails"* $\rightarrow$ **Shouldered Half-Lap Dovetail Ledger (Integral Drop-In Tenons in Blind Mortises)**.
- *"Hold the PSU or board in place with overhangs or clips"* $\rightarrow$ **Cantilever Snap-Fit Retention Clips & Overhang Ledges with Lead-In Chamfers**.
- *"Funnel fan air through heatsink and across back"* $\rightarrow$ **Converging Static-Pressure Plenum Shroud & Backplate Cooling Channel**.
4. **Two-Folder Blueprint Organization (`Drafts/` vs. `Working Drafts/`) & Cross-View Synchronization**:
- When exploring multiple design options before one is chosen, place the candidate option blueprints in `<ProjectDir>/Drafts/` (`<ProjectName>_Option1_<Tag>_*_View.svg`, `<ProjectName>_Option2_<Tag>_*_View.svg`, etc.).
- Once an option is chosen (or when iterating on the active design), copy/build the active blueprints in `<ProjectDir>/Working Drafts/` and `<ProjectDir>/` (`<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`) and keep all three views synchronized to the exact same 3D millimeter world coordinates $(X, Y, Z)$.
5. **Mandatory Project Step History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
- On every design step, append a new entry to `<ProjectDir>/History/Steps.md` (and `<ProjectDir>/Steps.md`) using the format `Step X` / `User Ask:` / `Updates:` to log the user's project ask and a summary of project file/design changes (excluding agent/skill structural meta-changes).
## Reference Skill
- [`.agents/skills/svg-blueprint-drafter/SKILL.md`](../../.agents/skills/svg-blueprint-drafter/SKILL.md)

View File

@@ -0,0 +1,47 @@
# CadProjects Multi-Project CAD Steering Guide
This workspace hosts CAD projects inside dedicated project folders (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.) while sharing a single set of universal CAD skills (`.agents/skills/`) and custom agents (`.github/agents/`).
## Immediate Routing Table
| Topic or Request | Domain | Workspace Skill | Custom Agent | Target Files |
| :--- | :--- | :--- | :--- | :--- |
| **SVG, FigCraft & CadCraft DXF orthographic views, dimensions, Side/Front/Top layout, blueprint tweaks (ALWAYS FIRST)** | 2D Blueprints | `svg-blueprint-drafter` | `svg-blueprint-drafter` | `<ProjectDir>/<ProjectName>_Blueprints.figcraft`, `<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, `<ProjectDir>/CAD/DXF/*.dxf` |
| **QA audit, ruler calibration, cross-view dimension check, bed fit check, collision/clearance verification** | Quality Assurance | `cad-qa-inspector` | `cad-qa-inspector` | `<ProjectDir>/Source Images/**`, `<ProjectDir>/<ProjectName>_*.svg`, `<ProjectDir>/.tools/freecad/verify_svg_blueprints.py` |
| **3D CAD, FreeCAD parametric `PartDesign::Body` + `Spreadsheet` history, STEP/STL export, 3D viewer** | 3D CAD & STEP | `freecad-step-builder` | `freecad-step-builder` | `<ProjectDir>/.tools/freecad/*.py`, `<ProjectDir>/CAD/*.FCStd`, `<ProjectDir>/CAD/STEP/*.step`, `<ProjectDir>/CAD/STL/*.stl` |
| **SolidCraft 3D assemblies, step-by-step feature timeline, 3MF export, B-rep audit, Vulkan GPU renders** | SolidCraft & 3MF | `solidcraft-3d-builder` | `solidcraft-3d-builder` | `<ProjectDir>/.tools/solidcraft/*.py`, `<ProjectDir>/CAD/SolidCraft/*.solidcraft`, `<ProjectDir>/CAD/3MF/*.3mf` |
---
## Mandatory Multi-Project & Engineering Rules
0. **Step 0: CAD Toolchain & Target Use-Case Intake (`.cad-tools.json`)**:
- Check `.cad-tools.json` in the workspace or project root. If missing, ask the user which CAD tools are available (`SolidCraft CLI`, `CadCraft 2D CLI`, `FigCraft CLI`, `FreeCADCmd`) and whether the project will be **3D printed** (`"is_3d_printed": true` with printer build volume) or is for another target (`"is_3d_printed": false`, e.g., Game Design, Art/Sculpture, CNC).
1. **Project Isolation Rule (Do Not Rewrite Completed Project Scripts)**:
- Each project resides in its own self-contained subfolder (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.).
- Never rewrite or modify existing build scripts in completed project folders. Create new project-specific scripts inside `<ProjectDir>/.tools/` or `<ProjectDir>/Scripts/`.
2. **Gate 0: Blueprint-First Approval Gate (ALWAYS Start with 2D Orthographic Blueprints Before Any 3D CAD)**:
- Always begin every new project or major design iteration by calibrating from `Source Images/` and drafting **ONLY the 1:1 mm (`1 px = 1 mm`) orthographic 2D blueprints** (`<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `<ProjectName>_Blueprints.figcraft` when `figcraft_cli` is enabled).
- **STOP and present the 2D blueprints to the user for review and iteration BEFORE writing or running any 3D CAD scripts (`.solidcraft`, `.FCStd`, `.step`, `.stl`, `.3mf`)**.
3. **Step-by-Step Parametric Build History in BOTH FreeCAD and SolidCraft**:
- **FreeCAD (`.FCStd`) Standard (`freecad-step-builder`)**:
- Never dump a collapsed single-solid `Part::Feature` boolean shape as the primary model in `.FCStd`.
- Every `.FCStd` file must include a top-level **`Spreadsheet::Sheet` (`Params`)** with named aliases for all tunable dimensions, and construct each printable part as its own **`PartDesign::Body`** populated step-by-step with named **`Sketcher::SketchObject`** profiles and **`PartDesign::Pad`**, **`PartDesign::Pocket`**, and **`PartDesign::Fillet` / `PartDesign::Chamfer`** features so a human can open the `.FCStd` file in FreeCAD and edit any body, sketch, or parameter.
- **SolidCraft (`.solidcraft`) Standard (`solidcraft-3d-builder`)**:
- Never use `file.insert_step` for designed parts. Always build `.solidcraft` parts and assemblies step-by-step from scratch using native `solidcraft-cli` commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.finish`, `solid.extrude`, `solid.box`, `solid.cylinder`, `appearance.assign`).
4. **Headless FreeCAD Flatpak Execution**:
- Invoke FreeCAD headlessly via:
```bash
flatpak run --command=FreeCADCmd org.freecad.FreeCAD <ProjectDir>/.tools/freecad/<script_name>.py
```
- Guard script entrypoints with `if __name__ in ("__main__", "<script_stem>"):`.
5. **Mandatory Project Step & Iteration History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
- Every project maintains a `<ProjectDir>/History/` folder with `Steps.md` (and `<ProjectDir>/Steps.md`) logging each user request and project update in chronological order using:
```markdown
Step X
User Ask:
<Summary of the user's request for the project>
Updates:
<Summary of project design, dimension, direction, and file updates (omitting agent/skill meta-changes)>
```

View File

@@ -0,0 +1,47 @@
# CadProjects Multi-Project CAD Steering Guide
This workspace hosts CAD projects inside dedicated project folders (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.) while sharing a single set of universal CAD skills (`.agents/skills/`) and custom agents (`.github/agents/`).
## Immediate Routing Table
| Topic or Request | Domain | Workspace Skill | Custom Agent | Target Files |
| :--- | :--- | :--- | :--- | :--- |
| **SVG, FigCraft & CadCraft DXF orthographic views, dimensions, Side/Front/Top layout, blueprint tweaks (ALWAYS FIRST)** | 2D Blueprints | `svg-blueprint-drafter` | `svg-blueprint-drafter` | `<ProjectDir>/<ProjectName>_Blueprints.figcraft`, `<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, `<ProjectDir>/CAD/DXF/*.dxf` |
| **QA audit, ruler calibration, cross-view dimension check, bed fit check, collision/clearance verification** | Quality Assurance | `cad-qa-inspector` | `cad-qa-inspector` | `<ProjectDir>/Source Images/**`, `<ProjectDir>/<ProjectName>_*.svg`, `<ProjectDir>/.tools/freecad/verify_svg_blueprints.py` |
| **3D CAD, FreeCAD parametric `PartDesign::Body` + `Spreadsheet` history, STEP/STL export, 3D viewer** | 3D CAD & STEP | `freecad-step-builder` | `freecad-step-builder` | `<ProjectDir>/.tools/freecad/*.py`, `<ProjectDir>/CAD/*.FCStd`, `<ProjectDir>/CAD/STEP/*.step`, `<ProjectDir>/CAD/STL/*.stl` |
| **SolidCraft 3D assemblies, step-by-step feature timeline, 3MF export, B-rep audit, Vulkan GPU renders** | SolidCraft & 3MF | `solidcraft-3d-builder` | `solidcraft-3d-builder` | `<ProjectDir>/.tools/solidcraft/*.py`, `<ProjectDir>/CAD/SolidCraft/*.solidcraft`, `<ProjectDir>/CAD/3MF/*.3mf` |
---
## Mandatory Multi-Project & Engineering Rules
0. **Step 0: CAD Toolchain & Target Use-Case Intake (`.cad-tools.json`)**:
- Check `.cad-tools.json` in the workspace or project root. If missing, ask the user which CAD tools are available (`SolidCraft CLI`, `CadCraft 2D CLI`, `FigCraft CLI`, `FreeCADCmd`) and whether the project will be **3D printed** (`"is_3d_printed": true` with printer build volume) or is for another target (`"is_3d_printed": false`, e.g., Game Design, Art/Sculpture, CNC).
1. **Project Isolation Rule (Do Not Rewrite Completed Project Scripts)**:
- Each project resides in its own self-contained subfolder (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.).
- Never rewrite or modify existing build scripts in completed project folders. Create new project-specific scripts inside `<ProjectDir>/.tools/` or `<ProjectDir>/Scripts/`.
2. **Gate 0: Blueprint-First Approval Gate (ALWAYS Start with 2D Orthographic Blueprints Before Any 3D CAD)**:
- Always begin every new project or major design iteration by calibrating from `Source Images/` and drafting **ONLY the 1:1 mm (`1 px = 1 mm`) orthographic 2D blueprints** (`<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `<ProjectName>_Blueprints.figcraft` when `figcraft_cli` is enabled).
- **STOP and present the 2D blueprints to the user for review and iteration BEFORE writing or running any 3D CAD scripts (`.solidcraft`, `.FCStd`, `.step`, `.stl`, `.3mf`)**.
3. **Step-by-Step Parametric Build History in BOTH FreeCAD and SolidCraft**:
- **FreeCAD (`.FCStd`) Standard (`freecad-step-builder`)**:
- Never dump a collapsed single-solid `Part::Feature` boolean shape as the primary model in `.FCStd`.
- Every `.FCStd` file must include a top-level **`Spreadsheet::Sheet` (`Params`)** with named aliases for all tunable dimensions, and construct each printable part as its own **`PartDesign::Body`** populated step-by-step with named **`Sketcher::SketchObject`** profiles and **`PartDesign::Pad`**, **`PartDesign::Pocket`**, and **`PartDesign::Fillet` / `PartDesign::Chamfer`** features so a human can open the `.FCStd` file in FreeCAD and edit any body, sketch, or parameter.
- **SolidCraft (`.solidcraft`) Standard (`solidcraft-3d-builder`)**:
- Never use `file.insert_step` for designed parts. Always build `.solidcraft` parts and assemblies step-by-step from scratch using native `solidcraft-cli` commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.finish`, `solid.extrude`, `solid.box`, `solid.cylinder`, `appearance.assign`).
4. **Headless FreeCAD Flatpak Execution**:
- Invoke FreeCAD headlessly via:
```bash
flatpak run --command=FreeCADCmd org.freecad.FreeCAD <ProjectDir>/.tools/freecad/<script_name>.py
```
- Guard script entrypoints with `if __name__ in ("__main__", "<script_stem>"):`.
5. **Mandatory Project Step & Iteration History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
- Every project maintains a `<ProjectDir>/History/` folder with `Steps.md` (and `<ProjectDir>/Steps.md`) logging each user request and project update in chronological order using:
```markdown
Step X
User Ask:
<Summary of the user's request for the project>
Updates:
<Summary of project design, dimension, direction, and file updates (omitting agent/skill meta-changes)>
```

View File

@@ -0,0 +1,47 @@
# CadProjects Multi-Project CAD Steering Guide
This workspace hosts CAD projects inside dedicated project folders (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.) while sharing a single set of universal CAD skills (`.agents/skills/`) and custom agents (`.github/agents/`).
## Immediate Routing Table
| Topic or Request | Domain | Workspace Skill | Custom Agent | Target Files |
| :--- | :--- | :--- | :--- | :--- |
| **SVG, FigCraft & CadCraft DXF orthographic views, dimensions, Side/Front/Top layout, blueprint tweaks (ALWAYS FIRST)** | 2D Blueprints | `svg-blueprint-drafter` | `svg-blueprint-drafter` | `<ProjectDir>/<ProjectName>_Blueprints.figcraft`, `<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, `<ProjectDir>/CAD/DXF/*.dxf` |
| **QA audit, ruler calibration, cross-view dimension check, bed fit check, collision/clearance verification** | Quality Assurance | `cad-qa-inspector` | `cad-qa-inspector` | `<ProjectDir>/Source Images/**`, `<ProjectDir>/<ProjectName>_*.svg`, `<ProjectDir>/.tools/freecad/verify_svg_blueprints.py` |
| **3D CAD, FreeCAD parametric `PartDesign::Body` + `Spreadsheet` history, STEP/STL export, 3D viewer** | 3D CAD & STEP | `freecad-step-builder` | `freecad-step-builder` | `<ProjectDir>/.tools/freecad/*.py`, `<ProjectDir>/CAD/*.FCStd`, `<ProjectDir>/CAD/STEP/*.step`, `<ProjectDir>/CAD/STL/*.stl` |
| **SolidCraft 3D assemblies, step-by-step feature timeline, 3MF export, B-rep audit, Vulkan GPU renders** | SolidCraft & 3MF | `solidcraft-3d-builder` | `solidcraft-3d-builder` | `<ProjectDir>/.tools/solidcraft/*.py`, `<ProjectDir>/CAD/SolidCraft/*.solidcraft`, `<ProjectDir>/CAD/3MF/*.3mf` |
---
## Mandatory Multi-Project & Engineering Rules
0. **Step 0: CAD Toolchain & Target Use-Case Intake (`.cad-tools.json`)**:
- Check `.cad-tools.json` in the workspace or project root. If missing, ask the user which CAD tools are available (`SolidCraft CLI`, `CadCraft 2D CLI`, `FigCraft CLI`, `FreeCADCmd`) and whether the project will be **3D printed** (`"is_3d_printed": true` with printer build volume) or is for another target (`"is_3d_printed": false`, e.g., Game Design, Art/Sculpture, CNC).
1. **Project Isolation Rule (Do Not Rewrite Completed Project Scripts)**:
- Each project resides in its own self-contained subfolder (`SnapU1S4/`, `BC250/`, `Plerion/`, etc.).
- Never rewrite or modify existing build scripts in completed project folders. Create new project-specific scripts inside `<ProjectDir>/.tools/` or `<ProjectDir>/Scripts/`.
2. **Gate 0: Blueprint-First Approval Gate (ALWAYS Start with 2D Orthographic Blueprints Before Any 3D CAD)**:
- Always begin every new project or major design iteration by calibrating from `Source Images/` and drafting **ONLY the 1:1 mm (`1 px = 1 mm`) orthographic 2D blueprints** (`<ProjectDir>/<ProjectName>_Side_View.svg`, `<ProjectName>_Front_View.svg`, `<ProjectName>_Top_View.svg`, and `<ProjectName>_Blueprints.figcraft` when `figcraft_cli` is enabled).
- **STOP and present the 2D blueprints to the user for review and iteration BEFORE writing or running any 3D CAD scripts (`.solidcraft`, `.FCStd`, `.step`, `.stl`, `.3mf`)**.
3. **Step-by-Step Parametric Build History in BOTH FreeCAD and SolidCraft**:
- **FreeCAD (`.FCStd`) Standard (`freecad-step-builder`)**:
- Never dump a collapsed single-solid `Part::Feature` boolean shape as the primary model in `.FCStd`.
- Every `.FCStd` file must include a top-level **`Spreadsheet::Sheet` (`Params`)** with named aliases for all tunable dimensions, and construct each printable part as its own **`PartDesign::Body`** populated step-by-step with named **`Sketcher::SketchObject`** profiles and **`PartDesign::Pad`**, **`PartDesign::Pocket`**, and **`PartDesign::Fillet` / `PartDesign::Chamfer`** features so a human can open the `.FCStd` file in FreeCAD and edit any body, sketch, or parameter.
- **SolidCraft (`.solidcraft`) Standard (`solidcraft-3d-builder`)**:
- Never use `file.insert_step` for designed parts. Always build `.solidcraft` parts and assemblies step-by-step from scratch using native `solidcraft-cli` commands (`parameters.add`, `component.create`, `sketch.create`, `sketch.line`, `sketch.finish`, `solid.extrude`, `solid.box`, `solid.cylinder`, `appearance.assign`).
4. **Headless FreeCAD Flatpak Execution**:
- Invoke FreeCAD headlessly via:
```bash
flatpak run --command=FreeCADCmd org.freecad.FreeCAD <ProjectDir>/.tools/freecad/<script_name>.py
```
- Guard script entrypoints with `if __name__ in ("__main__", "<script_stem>"):`.
5. **Mandatory Project Step & Iteration History (`<ProjectDir>/History/Steps.md` & `<ProjectDir>/Steps.md`)**:
- Every project maintains a `<ProjectDir>/History/` folder with `Steps.md` (and `<ProjectDir>/Steps.md`) logging each user request and project update in chronological order using:
```markdown
Step X
User Ask:
<Summary of the user's request for the project>
Updates:
<Summary of project design, dimension, direction, and file updates (omitting agent/skill meta-changes)>
```

Binary file not shown.

View File

@@ -0,0 +1,103 @@
---
title: "AI CAD Skill & Agent Pack"
category: "articles"
subcategory: "ai-cad"
order: 2
description: "Downloadable skill and agent pack for building 1:1 mm orthographic 2D blueprints and step-by-step parametric 3D CAD models with FigCraft, CadCraft, SolidCraft, and FreeCAD."
tags:
- articles
- ai-cad
- skills
- agents
- solidcraft
- figcraft
- cadcraft
- freecad
---
# AI CAD skill & agent pack
This folder contains the universal AI CAD skill and custom agent definitions used to design [`SnapS4`](../AI-3D-Modeling-Walkthrough.md#project-1-snaps4-filament-dryer-shelf-for-the-snapmaker-u1), [`BC250`](../AI-3D-Modeling-Walkthrough.md#project-2-amd-bc-250-dual-fan-enclosure-and-psu-mount), and [`Plerion`](../AI-3D-Modeling-Walkthrough.md#project-3-plerion-260-body-reconstruction-from-the-october-special-session).
This pack was created with **Gemini**, and **Claude** or any other AI coding model can adapt the steps directly. We included `AGENTS.md`, `GEMINI.md`, and `CLAUDE.md` so any assistant you use can follow the workflow out of the box.
You can download the complete pack as a single ZIP archive or pull just this folder via Git into your own project workspace.
## Option 1: Direct ZIP download
* **Download ZIP archive:** [`ai-cad-skill-pack.zip`](./ai-cad-skill-pack.zip)
* Extract the downloaded archive into your workspace:
```bash
unzip ai-cad-skill-pack.zip -d my-cad-workspace
cd my-cad-workspace
```
## Option 2: Pull only these files with Git sparse-checkout
If you want to pull just the skill and agent files from our repository without downloading the rest of the meetup repo, run:
```bash
git clone --filter=blob:none --no-checkout https://meetup.fargo3d.com/Fargo3d/3DPrintMeetup.git ai-cad-workspace
cd ai-cad-workspace
git sparse-checkout init --cone
git sparse-checkout set Articles/ai-cad-skill-pack
git checkout master
```
To copy the `.agents/`, `.github/`, and steering files straight to your workspace root after checking them out:
```bash
cp -r Articles/ai-cad-skill-pack/.agents Articles/ai-cad-skill-pack/.github Articles/ai-cad-skill-pack/AGENTS.md Articles/ai-cad-skill-pack/GEMINI.md Articles/ai-cad-skill-pack/CLAUDE.md .
cp Articles/ai-cad-skill-pack/.cad-tools.example.json .cad-tools.json
```
---
## What is included in this pack
| File Path | Purpose |
| :--- | :--- |
| [`AGENTS.md`](./AGENTS.md), [`GEMINI.md`](./GEMINI.md) & [`CLAUDE.md`](./CLAUDE.md) | Root workspace steering guides for Gemini, Claude, and other AI coding agents covering the routing table, Gate 0 blueprint approval gate, and step-by-step parametric history rules |
| [`.cad-tools.example.json`](./.cad-tools.example.json) | Example Step 0 toolchain and target printer build-volume configuration file. Copy to `.cad-tools.json` in your workspace root |
| [`.agents/skills/svg-blueprint-drafter/SKILL.md`](./.agents/skills/svg-blueprint-drafter/SKILL.md) | Skill for drafting 1:1 mm (`1 px = 1 mm`) third-angle orthographic Side, Front, and Top blueprints in FigCraft, CadCraft DXF, and SVG |
| [`.agents/skills/cad-qa-inspector/SKILL.md`](./.agents/skills/cad-qa-inspector/SKILL.md) | Skill for Step 0 intake, steel-ruler photo calibration, EXIF orientation checks, cross-view projection verification, and zero-clash B-rep audits |
| [`.agents/skills/solidcraft-3d-builder/SKILL.md`](./.agents/skills/solidcraft-3d-builder/SKILL.md) | Skill for step-by-step parametric 3D modeling in SolidCraft (`parameters.add`, solved 2D sketches, named 3D timeline features, 3MF export, and Vulkan GPU renders) |
| [`.agents/skills/freecad-step-builder/SKILL.md`](./.agents/skills/freecad-step-builder/SKILL.md) | Skill for headless FreeCAD (`FreeCADCmd`) parametric `Spreadsheet::Sheet` + `PartDesign::Body` modeling, STEP/STL exports, and standalone HTML/WebGL 3D viewers |
| [`.github/agents/svg-blueprint-drafter.agent.md`](./.github/agents/svg-blueprint-drafter.agent.md) | Custom agent definition for the 2D orthographic blueprint drafter |
| [`.github/agents/cad-qa-inspector.agent.md`](./.github/agents/cad-qa-inspector.agent.md) | Custom agent definition for the QA, metrology, and DFM inspector |
| [`.github/agents/solidcraft-3d-builder.agent.md`](./.github/agents/solidcraft-3d-builder.agent.md) | Custom agent definition for the SolidCraft 3D and 3MF builder |
| [`.github/agents/freecad-step-builder.agent.md`](./.github/agents/freecad-step-builder.agent.md) | Custom agent definition for the FreeCAD STEP and STL builder |
---
## Required Craft & CAD tools
You can install **FigCraft** and **CADCraft** directly through the **[ArtCraft Launcher](https://github.com/storytold/craft-launcher)**, download pre-built binaries from each project's GitHub releases, or build them from source in Rust:
| Tool | Role in the AI CAD Pipeline | GitHub Repository | Releases & Website |
| :--- | :--- | :--- | :--- |
| **ArtCraft Launcher** | One-click installer and updater for the Craft App Suite (`FigCraft`, `CADCraft`, and more) | [`storytold/craft-launcher`](https://github.com/storytold/craft-launcher) | [Latest Release](https://github.com/storytold/craft-launcher/releases/latest) |
| **FigCraft** | 1:1 mm 2D vector blueprints, multi-view blueprint boards (`.figcraft`), SVG/PDF/PNG exports, and `figcraft-cli mcp` server. Uses [`storytold/craft-fonts`](https://github.com/storytold/craft-fonts) when building from source | [`storytold/figcraft`](https://github.com/storytold/figcraft) | [Latest Release](https://github.com/storytold/figcraft/releases/latest) |
| **CADCraft** | Precision 1:1 mm 2D CAD drafting, native `.dxf`/`.dwg` generation, and `cadcraft-cli mcp` server | [`storytold/cadcraft`](https://github.com/storytold/cadcraft) | [Latest Release](https://github.com/storytold/cadcraft/releases/latest) |
| **SolidCraft** | Parametric 3D CAD solid modeler with editable feature timeline, B-rep clearance audits, 3MF export, Vulkan GPU rendering, and `solidcraft-cli mcp` server | [`tangency-labs/solidcraft`](https://github.com/tangency-labs/solidcraft) | [Latest Release](https://github.com/tangency-labs/solidcraft/releases/latest) \| [solidcraft.io](https://solidcraft.io) |
| **FreeCAD** | Optional headless OpenCASCADE (`FreeCADCmd`) parametric `PartDesign::Body` + `Spreadsheet` builder for `.FCStd`, `.step`, and `.stl` exports | [`FreeCAD/FreeCAD`](https://github.com/FreeCAD/FreeCAD) | [freecad.org](https://www.freecad.org) |
---
## Quick start in your own project
1. Extract [`ai-cad-skill-pack.zip`](./ai-cad-skill-pack.zip) or copy `.agents/`, `.github/`, and `AGENTS.md` into your workspace root.
2. Copy `.cad-tools.example.json` to `.cad-tools.json` and set the paths to your installed tools (`solidcraft-cli`, `cadcraft-cli`, `figcraft-cli`, or `FreeCADCmd`) along with `"is_3d_printed": true` or `false`.
3. Create a project folder such as `MyBracket/Source Images/` and drop in photos of your hardware with a steel ruler held flat on the same plane as the features you need to measure.
4. Give your AI coding agent this kickoff prompt to calibrate the photos and pause at Gate 0:
```text
Follow AGENTS.md. Inspect the ruler photos in MyBracket/Source Images/ with cad-qa-inspector to verify EXIF orientation and calibrate the millimeter scale. Then use svg-blueprint-drafter to draft 1:1 mm Side, Front, and Top 2D orthographic blueprints for [describe your bracket or enclosure] in MyBracket/Drafts/ and stop at Gate 0 so I can verify the measurements before any 3D CAD begins.
```
5. Review the 1:1 mm 2D drawings against your physical hardware, apply any dimension corrections, and then tell the agent to proceed to Gate 1 to build the step-by-step parametric 3D CAD assembly.
---
**Last Updated**: November 1, 2026