/kernelcad-design-skills:kernelcad-partsfrom kernelCAD — Parametric CAD & MCP
Bundled parts catalog — discover, fetch, and mate standard fasteners, bearings, motors, headers, and connectors. Use whenever the model needs an off-the-shelf component instead of hand-modeled placeholder geometry.
Ships in kernelCAD — Parametric CAD & MCP. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Load this skill when the agent needs an off-the-shelf component (M-series fastener, deep-groove ball bearing, NEMA stepper, pin header, JST-XH housing) and does not already know a STEP file path.
The catalog ships bundled with the npm package — npm install resolves
every bundled id offline. When a query has no bundled match, discovery and
fetch fall through to a built-in public parts catalog by default (see "Remote
tier" below), so kernelCAD can find off-the-shelf parts it does not bundle.
Set KERNELCAD_PARTS_BASE_URL=off to stay offline on the bundled seed only.
When the agent does not know which id covers the intent, walk the discovery chain. Each step narrows the search:
inspect({ of: 'part-categories' }) → top-level buckets (e.g. fastener, bearing,
motor, connector, shaft).inspect({ of: 'part-families', category }) → families within the bucket
(e.g. socket-head-cap-screw, deep-groove-ball-bearing).find_part { query, family?, standard?, tag?, licenseClass? } → ranked
records that match the fuzzy query plus filters. Tokens AND-combine;
cross-facet filters AND-combine. licenseClass ('permissive' |
'share-alike' | 'fetch-only') filters by redistribution license; records
with no class are treated as permissive (the bundled catalog).fetch_part { id } → resolves the id to a record, writes the STEP into
the cache, returns the cache path + sha256.For tasks where the id is already known, skip straight to fetch_part or
use the typed lib.standard.* shortcuts.
fetch_part { url } pulls geometry on demand from an allowlisted host
(GitHub/GitLab raw + release-asset hosts and the kernelCAD parts host) — it is
cached locally, never re-hosted (redistribution: 'fetch-only'):
.step/.stp URL → inspected, connectors synthesized, returned as a record..stl/.dae/.obj URL → returned as a mesh-import handle (non-BREP,
attributes.geometryKind = 'mesh') for blockout/reference.{ kind: 'link_out', url, instruction }. Download the STEP from the
configurator and ingest it locally with fetch_part { file }.{ error: 'url_host_not_allowed' }.Inside a .kcad.ts script, three entry points cover the matrix:
// 1. Generic verbs — work for ANY id (bundled or remote).
const motor = await lib.fetchPart('nema-17');
const matches = await lib.findPart('M3 screw');
// 2. Typed shortcuts — bundled-only, autocomplete-friendly.
const bolt = await lib.standard.boltSHCS({ thread: 'M3', lengthMm: 12 });
const nut = await lib.standard.nutHex({ thread: 'M3' });
const washer = await lib.standard.washerFlat({ thread: 'M3' });
const bearing = await lib.standard.bearing608();
const stepper = await lib.standard.nema17();
const header = await lib.standard.pinHeader254({ pins: 8 });
const conn = await lib.standard.jstXH({ pins: 4 });
lib.fetchPart('iso-4762-m3x12') and
lib.standard.boltSHCS({ thread: 'M3', lengthMm: 12 }) resolve to the same
record; pick the typed call when arguments are static, the generic call
when ids are computed.
Every bundled record carries connector frames so the part participates in
assemblies without any partRef.connector(...) boilerplate. Naming follows
the @kc grammar (kebab, alpha-leading) so refs round-trip.
| Family | Connectors |
|---|---|
| socket-head-cap-screw | head-bearing, thread-tip, head-top |
| button-head-cap-screw | head-bearing, thread-tip, head-top |
| flat-head-countersunk | mating-face, thread-tip |
| hex-nut / lock-nut | mating-face, top-face, inner-bore |
| flat-washer / lock-washer | mating-face, top-face, inner-bore |
| heat-set-insert | mating-face, top-face, inner-bore |
| deep-groove-ball-bearing | inner-bore, outer-face, mating-face, top-face |
| linear-shaft | end-a, end-b, axis |
| stepper-motor | mounting-face, output-shaft, back-face, bolt-holes-1..4 |
| pin-header (2.54 / 1.27 mm) | mating-face, pin-1 |
| jst-xh | mating-face, back-face |
The head-bearing frame on a bolt points DOWN (-Z), so mating it against a
bracket's hole top face places the bolt with the shank sticking into the
hole — the canonical "bolt through bracket" configuration with no manual
flip.
Canonical form is arm.mate(name, aRef, bRef, type, opts?) where
aRef / bRef are 'partName.connectorName' strings and type is one of
fastened | revolute | prismatic | cylindrical | planar | ball |
pin_slot.
Do not use the retired 3-arg form arm.mate(a, b, { kind }) — capture
rejects it. Catalog cookbooks and kernelcad-assemblies all use 4-arg.
bolt-holes-N auto-ruleAny .hole(...) or .holes(...) feature on an authored or imported Shape
automatically receives bolt-holes-N connector frames at the hole's
bottom face plus through-axis. Names are numbered first by feature order,
then by (u, v) to break ties, so the same script always emits the same
connector names across re-runs.
Caveat (agent-facing): those auto frames attach to the holes feature
id, not the assembly part name. A mate ref like 'bracket.bolt-holes-1'
will not resolve after arm.part('bracket', shapeWithHoles). Prefer
manual partRef.connector('bolt-holes-N', { type: 'frame', origin: { kind: 'vec3', value: [...] } }) on the part (same pattern as cookbook
nema-motor-mounting-plate). Bundled / catalog parts already expose
bolt-holes-N on the part itself — those refs work without a manual
frame.
const arm = assembly('arm');
const bracketShape = box(40, 20, 3).holes('top', {
positions: [{ u: -10, v: 0 }, { u: 10, v: 0 }],
diameter: 3.2,
depth: 'through',
});
const bracket = arm.part('bracket', bracketShape);
// Manual frame on the PART — .holes() auto-connectors stay on the feature id.
bracket.connector('bolt-holes-1', {
type: 'frame',
origin: { kind: 'vec3', value: [-10, 0, 1.5] },
});
const bolt = await lib.standard.boltSHCS({ thread: 'M3', lengthMm: 10 });
arm.part('bolt', bolt);
// Catalog bolt already has head-bearing on the part; plate side is manual.
arm.mate('bolt-1', 'bolt.head-bearing', 'bracket.bolt-holes-1', 'fastened');
return arm.model();
@kc[...] ref formBundled connectors and the bracket-side auto-emitted ones expose the same ref grammar as authored faces and edges:
@kc[bolt/connector/head-bearing] // typed shortcut for bolt.head-bearing
@kc[bracket/connector/bolt-holes-1] // typed shortcut for bracket.bolt-holes-1
Either form works as the source / target of add_mate and survives
query({ mode: 'resolve' }). The dot form is shorter for human-authored scripts;
the @kc form is canonical in MCP tool outputs and diagnostic payloads.
See kernelcad-mcp for the full grammar.
Bundled tier coverage (273 records on the seed catalog):
Bundled parts ship under kernelCAD's MIT license — see record.license.
When a query has no bundled match, discovery and fetch fall through to a built-in public parts catalog automatically — this is how kernelCAD finds off-the-shelf parts (motors, bearings, connectors, brackets) it does not bundle. No configuration is required.
// Falls through to the public catalog when not bundled — nothing to configure.
const matches = await lib.findPart('flanged linear bearing');
const bearing = await lib.fetchPart('linear-bearing-lmk10luu');
What kernelCAD adds on top of the raw catalog, so a found part is as usable as a bundled one:
~/.cache/kernelcad/parts/ and
verified against the catalog's sha256 before use.mating-face / top-face from
the bounding box, bolt-holes-N from detected mounting holes (coaxial
segments collapsed; deterministically numbered), and bore from a distinct
central hole. The part participates in add_mate with no manual
partRef.connector(...). Oddly-shaped parts may still need a hand-authored
frame — inspect the synthesized set before relying on it.license (commonly
'CC-BY-3.0') plus attribution. Read record.license / record.attribution
rather than assuming — a record's terms govern it. Keep the attribution when
shipping a deliverable that embeds the geometry.Overriding or disabling the source:
/v1/parts schema) with partsBaseUrl per call or the
KERNELCAD_PARTS_BASE_URL env var.KERNELCAD_PARTS_BASE_URL=off (or none) to disable the remote tier
entirely; unmatched lookups then return parts.fetch.remote-disabled and you
stay fully offline on the bundled seed.Bytes returned from the remote tier are cached under
~/.cache/kernelcad/parts/<sha256>.step with sha256 verification at write
time, so a flaky upstream cannot poison the cache.
Every record carries license + optional attribution. The assembly's
provenance manifest records which parts came from where so downstream
review (CHANGELOG, license audit) has a single source of truth.
const arm = assembly('arm');
const bracketShape = box(40, 20, 3).holes('top', {
positions: [{ u: -10, v: 0 }, { u: 10, v: 0 }],
diameter: 3.2,
depth: 'through',
});
const bracket = arm.part('bracket', bracketShape);
bracket.connector('bolt-holes-1', {
type: 'frame',
origin: { kind: 'vec3', value: [-10, 0, 1.5] },
});
const bolt = await lib.standard.boltSHCS({ thread: 'M3', lengthMm: 10 });
arm.part('bolt', bolt);
arm.mate('bolt-1', 'bolt.head-bearing', 'bracket.bolt-holes-1', 'fastened');
return arm.model();
There is no lib.standard.* shortcut for linear shafts — fetch the catalog
record by id (shaft-d<diameter>-l<length>, Ø3..Ø12 × 20..200 mm). The
shaft's axis connector mates into the bearing's inner-bore. Catalog
parts already carry those connectors on the part — no manual frames.
Use the 4-arg mate (see cookbook shaft-and-bearing-cylindrical-mate for
the offline BREP stand-in when the catalog is absent).
const arm = assembly('arm');
const shaft = await lib.fetchPart('shaft-d8-l50'); // Ø8 × 50 mm linear shaft
const bearing = await lib.standard.bearing608(); // Ø8 bore deep-groove bearing
arm.part('shaft', shaft);
arm.part('bearing', bearing);
arm.mate('seat', 'shaft.axis', 'bearing.inner-bore', 'cylindrical');
return arm.model();
Catalog nema17 already exposes bolt-holes-1..4 on the motor part.
Plate-side .holes() auto-connectors stay on the holes feature id, so
declare matching frames on the plate part (cookbook
nema-motor-mounting-plate).
const arm = assembly('arm');
const plateShape = box(80, 80, 5).holes('top', {
positions: [
{ u: -15.5, v: -15.5 }, { u: 15.5, v: -15.5 },
{ u: -15.5, v: 15.5 }, { u: 15.5, v: 15.5 },
],
diameter: 3.2,
depth: 'through',
});
const plate = arm.part('plate', plateShape);
const offs = [[-15.5, -15.5], [15.5, -15.5], [-15.5, 15.5], [15.5, 15.5]] as const;
offs.forEach(([u, v], i) => {
plate.connector(`bolt-holes-${i + 1}`, {
type: 'frame',
origin: { kind: 'vec3', value: [u, v, 2.5] },
});
});
const motor = await lib.standard.nema17();
arm.part('motor', motor);
arm.mate('b1', 'motor.bolt-holes-1', 'plate.bolt-holes-1', 'fastened');
arm.mate('b2', 'motor.bolt-holes-2', 'plate.bolt-holes-2', 'fastened');
arm.mate('b3', 'motor.bolt-holes-3', 'plate.bolt-holes-3', 'fastened');
arm.mate('b4', 'motor.bolt-holes-4', 'plate.bolt-holes-4', 'fastened');
return arm.model();
| Code | When | Recover by |
|---|---|---|
parts.input.id-or-query-required | find_part / fetch_part called with no id and no query. | Pass id (known record) OR query (fuzzy). |
parts.fetch.offline-and-uncached | Remote needed, network unreachable, cache miss. | Call find_part { source: 'local' }; or restore network. |
parts.fetch.checksum-mismatch | Downloaded bytes sha256 ≠ record sha256. | Bytes discarded; do not retry against the same endpoint without verifying upstream. |
parts.fetch.checksum-drift | Cached bytes still match; remote now reports a different sha256. | Re-fetch with --refresh-parts-cache to opt in to the new bytes. |
parts.fetch.api-error | Remote returned non-2xx or network failed. | Retry later, check partsBaseUrl reachability, or fall back to source: 'local'. |
parts.fetch.remote-disabled | A tool needed remote, but no partsBaseUrl (arg or env) was set. | Pass partsBaseUrl, set KERNELCAD_PARTS_BASE_URL, or stick to bundled ids. |
What SKILL.md sets; muted values are Claude Code's defaults
28 skills in this plugin
/blockout-modelCoarse parametric blockout of the primary masses before committing to detail. Establishes the bounding envelope, canonical-view alignment, and reference-image plane, then confirms the blockout is plausible before detail work begins./image-replicatorThe render→score→iterate loop for reference-photo reconstruction. How to invoke kernelcad render, run scoreAgainstReference, interpret per-gate numbers, and decide which gate to chase next./kernelcadkernelCAD entry decision tree — what skill to load when, universal conventions that apply everywhere. Load this FIRST; it points at the right specialty skill for your task.Other plugins' skills for the same job
npx claudepluginhub w1ne/kernelcad-skills --plugin kernelcad-design-skills