Skill instructions
kernelcad-cookbooks1.11 KB
View saved version →
---
name: kernelcad-cookbooks
description: Find and run kernelCAD cookbook recipes (machined housing, NEMA motor plate, robot arm, planetary gearbox, T-slot frame, enclosures) through the hosted MCP. Use before freehand authoring of an industry part.
---
# kernelCAD cookbooks
1. `lookup_cookbook({ query: "<what the user wants>", k: 5 })` returns ranked
recipes `{ ok, hits[] }`. Empty `hits` is a valid answer: author freehand.
2. Run a hit in one step: `execute_cookbook({ id, openInStudio: false })`.
Read `stage` on failure (`resolve` | `evaluate` | `open_in_studio`).
`dryRun: true` is not proof that the recipe builds a solid.
3. Adapt the returned `code` to the user's dimensions, then go through the
`kernelcad-design-loop` skill.
Useful ids: `multi-feature-machined-housing`, `nema-motor-mounting-plate`,
`multi-body-mechanism-real-proportions`, `multi-dof-robot-arm-4axis`,
`planetary-gearbox-shop-release`, `gt2-shop-release-actuator`,
`clamshell-enclosure-release-pack`, `tslot-frame-fastener-bom`,
`scissor-lift-closed-loop`, `holeless-board-cradle` (no-hole development board rail and connector opening).
kernelcad-design-loop2.44 KB
View saved version →
---
name: kernelcad-design-loop
description: Build or revise a CAD model with the hosted kernelCAD MCP — write .kcad.ts source, evaluate, review with design_loop until green. Use for any "design / model / make a part" request when the kernelcad MCP server is connected.
---
# kernelCAD design loop (hosted MCP)
The `kernelcad` MCP server (https://mcp.kernelcad.com/mcp) runs the OpenCASCADE
kernel for you. Nothing needs to be installed locally. Discover the live tool
list from the server; tool availability depends on whether the user is signed in.
## Loop
1. Check for a canonical pattern first: `lookup_cookbook({ query })`
(see the `kernelcad-cookbooks` skill). Start from a hit when one exists.
2. Write `.kcad.ts` source. Use `lookup_api({})` for the API surface instead of guessing.
3. Iterate fast with `evaluate_script({ code, dryRun: true })`, then finish with a
full `evaluate_script({ code })`. A dry run is not evidence that the solid builds.
4. For housings, mechanisms, gearboxes, robot arms and other production builds,
call `design_loop({ goal, attempts: [{ code }] })`. Apply its
`nextActionPrompt` / `revisionAssist` patches and repeat until `ok: true`
or `convergence.escalate` says to stop and ask the user.
5. On failure, `why_did_this_fail({ code })` then `repair_script({ code })`.
`lookup_diagnostics({})` explains any diagnostic code.
6. For assemblies that must be built, run
`verify({ check: 'assembly-path', sequence: true })`. Declare helical
fastener motion and press/snap fits on the fastened mate
(`{ fastener: { part?, axis, pitchMm?, tool? }, fit?: { kind, part? } }`);
the planner reports `helical`, `requires-force` and `tool-blocked` steps
instead of guessing. Add `stability: true` (with `gravity`/`fixtures` when
needed) to flag steps whose part cannot be proven to rest on an
already-stable part: read `sequence.needsHold` and `Step.heldBy`. That is an
approximate support projection, not physics. Tool reach is a swept
envelope, not a hardware check.
7. Show the result once with `open_in_studio` (see `kernelcad-studio-paint`),
then export (see `kernelcad-export`).
## Rules
- Report the numbers the tools return (volumes, bbox, diagnostics); do not
describe geometry you have not evaluated.
- Keep the source as the deliverable: give the user the final `.kcad.ts`.
- If a tool says sign-in is required, tell the user to complete the OAuth
prompt their client shows for the `kernelcad` server.
kernelcad-export1.75 KB
View saved version →
---
name: kernelcad-export
description: Export a kernelCAD model to STEP, STL, 3MF, GLB, OBJ, PLY, USD, DXF or G-code through the hosted MCP, and check it before handing it over. Use when the user asks for a file to print, machine, simulate or import into other CAD.
---
# Export
- Whole model: `export({ target: "model", code, format, output_path })` with
`format` one of `step`, `stl`, `3mf`, `glb`, `obj`, `ply`, `usd`, `dxf`, `gcode`.
`obj` is a Wavefront triangle mesh. `ply` is a Stanford PLY triangle mesh
(mm, Z-up; binary little-endian by default) with per-vertex normals and
the part colour from `.finish()` / `.material()` / `.color()`; an assembly is
one file with every part in world space. Options: `encoding: 'ascii'`,
`colors: 'face'` or `'none'`, `normals: false`; a bad key fails with
`export.ply.invalid-options`. `usd` is an ASCII USDA triangle mesh
with millimeter units and Z-up coordinates; it is not B-rep USD. NVIDIA's
usd-brep BrepArray is not emitted because this writer consumes tessellated
vertices and triangle indices, while BrepArray requires full B-rep topology
and curve/surface data. Use `usd-isaac` separately for an assembly physics
stage. Options: `3mf` takes `printUnit` and `embedSource`; `dxf` takes `unit`,
`tolerance`, `layers`; `glb` takes `axis`.
- Per part of an assembly: `export({ target: "part", code, output_dir })`.
- Before exporting for print: `inspect({ of: "part-stats", code })`. For a
bill of materials: `inspect({ of: "bom", code })`.
- Verify a STEP after export with `inspect({ of: "step", file })`.
- The hosted server returns a download link or file reference; give the user
that link and say which format and units it is in. Keep verification on
(do not pass `no_verify: true`) unless the user asks.
kernelcad-studio-paint1.17 KB
View saved version →
---
name: kernelcad-studio-paint
description: Show a kernelCAD model in Studio and act on the user's painted review marks. Use when the user wants to see the model, or says they marked/painted/circled something in Studio.
---
# Studio viewer and paint review
## Show the model
- After a green full `evaluate_script`, call `open_in_studio` **once** per
project per response and give the user its URL. Reuse that URL; do not call
it again in the same response. While `meshStatus` is `building`, poll
`get_project`, not `open_in_studio`.
- For a later revision call `open_in_studio({ project: "<slug>", ... })` once;
the new viewer replaces the old one.
## Paint review
In Studio the user can paint over the model to mark what to change. Fetch the
newest marks with `review_paint_peek_latest({})` (pass `paths_only: true` to
skip inline PNGs). The packet holds a screenshot, a red mask and the list of
parts the paint hit. Edit only those parts, re-evaluate, and show the revision.
If the tool returns `empty`, ask the user to paint and submit again. This tool
is only listed when the server can see the Studio session; if it is absent, ask
the user to describe the change in words.