claude-cad
CLAUDE.md5 starsChanged 3 months agoMITView on GitHub
This repo is **a toolkit and the default workspace**. It ships a Claude Code skill, prompts, and docs for generating CadQuery parts whose STEP files reliably open in SolidWorks. The defining idea: never trust generated geometry — verify it before export. The skill is committed at .claude/skills/cadquery-modeling/, so a fresh clone arrives with it already active — no install, no reload. The default workflow is: clone → open in VS Code → describe a part. Parts go in the top-level…
- Installs packages
In this repositoryOne other file it gives its agents.
- cadquery-modelingSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
If someone asks you to model something while this repo is the working directory,
- Distinctive: line 30
keep several unrelated projects apart, or
- Distinctive: line 31
keep this clone pristine as a reference they git pull to update.
- Distinctive: line 33
Don't push it by default; the point of the new layout is that most people never need it.
- Very specific: line 44
If OCP fails to import they're on too-new a Python (see below).
- Very specific: line 48
If /skills doesn't list cadquery-modeling, they likely opened a subfolder as the workspace root instead of the repo root, or need to reload …
- Very specific: line 78
Read docs/occ_pitfalls.md (each pitfall's Verified behaviour block) before writing code that shells, fillets, or lofts.
- Distinctive: line 101
Examples and templates must stay generic: No proprietary, confidential, or patent-pending designs.
≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
claude-cad — notes for Claude Code
This repo is a toolkit and the default workspace. It ships a Claude Code skill, prompts, and docs for generating CadQuery parts whose STEP files reliably open in SolidWorks. The defining idea: never trust generated geometry — verify it before export.
The clone is the workspace (default)
The skill is committed at .claude/skills/cadquery-modeling/, so a fresh clone
arrives with it already active — no install, no reload. The default workflow
is: clone → open in VS Code → describe a part. Parts go in the top-level parts/
(a diagnose.py is shipped there so imports resolve); output lands in output/.
Both are git-ignored, so the user's work stays out of git status and git pull
(to update the toolkit) stays clean.
If someone asks you to model something while this repo is the working directory, that is now the intended path — just do it. Mention the standalone alternative only when it actually fits.
When to suggest a separate project (the alternative)
A standalone project folder elsewhere — set up by pasting
prompts/workflows/project_init.md, producing the three-folder claude-cad/ +
parts/ + output/ layout that examples/sbc-case/ demonstrates — is worth
suggesting when the user wants to:
- version their own designs (the clone git-ignores
parts/, and committing there tangles with toolkitgit pulls), - keep several unrelated projects apart, or
- keep this clone pristine as a reference they
git pullto update.
Don't push it by default; the point of the new layout is that most people never need it.
Helping someone who just arrived
Most people who open Claude Code here have just cloned the repo. The skill is
already active (committed at .claude/skills/), so there's little to set up:
- Point them at
QUICKSTART.md— clone → Python → open in VS Code → confirm the skill is already listed (/skills) → describe a part. Don't re-explain it. - Check their Python —
py -3.11 -c "import cadquery, OCP; print('env OK')". IfOCPfails to import they're on too-new a Python (see below). - Then just build. First part goes in
parts/; run it withpy -3.11 parts/<name>.py; batch-verify withpy -3.11 preflight.py.
If /skills doesn't list cadquery-modeling, they likely opened a subfolder as
the workspace root instead of the repo root, or need to reload the window — skills
load at session start.
Conventions that differ from what you'd assume
These are the things that bite people. They're not derivable from the code:
- Python 3.11, not the newest release. The
OCPkernel binding lags new Python versions, sopip install cadquerysucceeds whileimport OCPfails. - Export paths resolve from the script file, never the working directory. A
bare
"../output/x.step"silently writes one folder too high when the script is run from the project root. AlwaysPath(__file__).resolve().parent.parent / "output", and print the resolved path. from diagnose import ...resolves againstparts/diagnose.py, which is shipped in the clone. In a standalone project,project_initcopies it there (and keeps the canonical copy in that project'sclaude-cad/). The skill's master copy lives in.claude/skills/cadquery-modeling/scripts/.- A green
[OK]proves nothing — and neither do validity + solid count alone. A.shell()that silently no-ops returns a valid, single, un-hollowed solid. Assert volume against a range derived from the parameters (neverVolume()measured and pasted back — that checks the geometry against itself; keep any measured figure only as a labelledregression_volume), and useassert_points()— the strongest intent check — for any feature whose position matters. Seedocs/verification.mdand Pitfall 4b. - The one verified silent-corruption trap is
.shell()on a solid whose removed face was filleted (Pitfall 4b — returns the part un-hollowed,IsValid=True). The historically blamed operations (countersinks on shelled walls, face-selectedcutThruAll, lofted domes) do not reproduce on the current kernel; their replacement patterns are kept as preferred constructions. Readdocs/occ_pitfalls.md(each pitfall's Verified behaviour block) before writing code that shells, fillets, or lofts; re-test with.claude/tests/repro_pitfalls.pyafter a kernel upgrade. - Auto-repair is deliberately conservative. It only discards unambiguous debris; it never patches invalid topology, because that would hide real design errors. Don't "improve" it into something that silently fixes more.
Editing this repo
- The skill lives in exactly one place:
.claude/skills/cadquery-modeling/— the path Claude Code loads, and the canonical source. Edit it directly; there is no second copy to sync. (This replaced a former two-copy setup —skills/plus.claude/skills/— and the drift guard that policed it. One copy can't drift, so the guard is gone.) - Five
docs/*.mdfiles are still mirrored into the skill's references at.claude/skills/cadquery-modeling/references/*.md(occ_pitfalls,verification,diagnosis,environment→python_env_setup,solidworks_checks→solidworks_integration). If you change one, sync its twin by hand — they must stay byte-identical..claude/tests/test_mirrors.pyfails if they drift; run it (or the whole.claude/tests/suite) before committing. - The same rule often appears in the skill, the docs, and the prompts. After changing a rule, grep for it — leaving one copy stale is the most common defect in this repo.
- Examples and templates must stay generic. No proprietary, confidential, or patent-pending designs. Abstract the method, never someone's product.
- Any Python added here must pass its own verification block before it's presented as working.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

