Files
3DPrintMeetup/Articles/ai-cad-skill-pack/CLAUDE.md

48 lines
5.0 KiB
Markdown
Raw Normal View History

# 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)>
```