Gen Part logo

Gen Part

Organization
partcad
gen-part

Generate a PartCAD part from a natural-language description (and optional reference images/requirements) by authoring a CAD script and validating it with the PartCAD CLI. Use for /pc:gen-part or when the user asks to generate, create, or model a single mechanical part.

Overview

Publisherpartcad
Repositorypartcad
Skill namegen-part
Stars
504
Forks
47
Bundled files
Instructions only
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by partcad on GitHub. Read the source before you install it.

Installation

Install the Gen Part AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/partcad/partcad/tree/devel/ai-agents/common/skills/gen-part
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/partcad/partcad.git /tmp/partcad
mkdir -p .claude/skills
cp -r /tmp/partcad/ai-agents/common/skills/gen-part .claude/skills/gen-part
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Gen Part in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Gen Part on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Gen Part is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

pc:gen-part

Generate one PartCAD part. The text after the command ($ARGUMENTS) is the part description — what to build. You author the CAD script yourself and prove it works with the PartCAD CLI; do not use any built-in ai-* part type or generation pipeline. Hard requirement: the finished part passes pc test (its geometry instantiates cleanly).

Steps 4–7 are the reference flow — the same shape the legacy pc add part --ai pipeline used (plan geometry → write script → validate → compare → refine). Treat it as a strong default, not a script: skip, reorder, or replace steps as the part warrants, but always finish by validating.

1. Understand the request

  • $ARGUMENTS is the description. Read it and any requirements, and view reference images directly. Ask the user to clarify only genuinely load-bearing ambiguities; otherwise proceed and state your assumptions.
  • Work in millimeters and degrees unless told otherwise.

2. Make sure PartCAD is available

Resolve a command as /pc:init does (pc, then partcad, then python -m partcad_cli.click.command). If none is found, stop and run /pc:setup executable first.

3. Choose a representation

Pick the script kind that best fits the part — you decide:

KindGood for
build123dgeneral parametric solids (recommended default)
cadqueryfluent / CSG-style modeling
scad (OpenSCAD)simple constructive geometry, no Python
sdforganic / implicit shapes

4. (Optional) Plan the geometry

For anything non-trivial, sketch the constructive-solid-geometry plan first — coordinate system, primitives with dimensions/positions/orientations, then unions/differences/intersections and fillets/chamfers. This mirrors the legacy "CSG" step and usually cuts iterations. Skip it for simple parts.

5. Author, register, and mark it

Write the script file first from $ARGUMENTS (plain type — never ai-*), then register it — pc add part requires the file to already exist:

sh
pc --no-ansi add part --desc "<the description>" <kind> <name>.<ext>   # e.g. build123d bracket.py

Language conventions for the script:

  • build123d / cadquery / sdf (Python): import everything you use (including math and the library itself); call show_object(<result>) to expose the part; do not export anything. For cadquery, avoid tetrahedron / hexahedron.
  • OpenSCAD: a complete script defining all functions and constants; no external modules; no export.

Then mark the part not manufacturable in partcad.yaml — a generated part is not a catalog/supplier item, and this is what lets pc test pass:

yaml
parts:
  <name>:
    type: <kind>
    path: <name>.<ext>
    desc: <the description>
    manufacturable: false

If the part was modelled from reference images — a drawing, a photo, a sketch — name them under images: as well, as paths relative to the package. That is what puts them beside the part in the README pc render writes, so a reader sees what the model was made to match; nothing else reads them.

yaml
    images:
      - drawing.png
      - photo.jpg

If you started the project with pc init, also delete the empty sketches: and assemblies: sections it leaves — a null section crashes pc render on older PartCAD (fixed in partcad/partcad#470).

6. Validate

pc test is the build gate: with manufacturable: false, its CAD check passes only if the geometry instantiates cleanly, and the manufacturability checks are skipped.

sh
pc --no-ansi test <name>

Three of its checks fail geometry that instantiates perfectly, and all three are about a part that would look right in the pictures rendered below: shell (the part is a surface rather than a body — the faces do not close, so it has no inside and every boolean against it is meaningless), degenerate (it has no size left in some direction) and solidity (its faces are oriented inward, so its volume is negative). None of them can be turned off on the part — there is no such setting, and inventing one is rejected by pc lint. Fix the geometry: close the shape, keep the feature that collapsed, orient the faces outward. A part that fails one of these is a part nothing downstream can compute with, however good the picture of it looks.

7. Render it from several angles, compare, and iterate

pc test proves the geometry instantiates. It says nothing about whether the geometry is the part that was asked for — that is decided by looking at it.

One picture is not enough to decide it. A projection hides everything behind it, so a hole in the wrong face, a feature on the wrong side, a chamfer that never got cut, or a shape that is right in outline and wrong in depth all survive the one view that happens to conceal them. Render four: front, top and right to read proportions and dimensions off, and iso to see how the features go together. A rendered file is named after the object, so give each view a directory of its own or they overwrite each other:

sh
for view in front top right iso; do
  mkdir -p /tmp/pc-render/$view                  # -O expects it to exist
  pc --no-ansi render -t png --view $view -O /tmp/pc-render/$view <name>
done

Then view all four — /tmp/pc-render/<view>/<name>.png — and compare them against the description and any reference images:

  • the overall form and the bounding size, in all three axes;
  • every dimension the description states — each is measurable in one of the orthographic views, and a dimension no view confirms is one still assumed;
  • every feature that was asked for, on the face it was asked for, and nothing present that was not.

Add back, left or bottom whenever the part is not symmetric about the axis in question: an asymmetric part has a face you have not seen, and a face you have not seen is a face you are guessing about. When no named view shows the feature you need to check, --viewport-origin X,Y,Z and --viewport-up X,Y,Z look from an arbitrary direction. /pc:render covers these options in full.

Fix any error or mismatch, then re-test and re-render. Iterate until every view matches — no fixed retry count. If the part is right and the numbers are what need checking, /pc:describe renders a dimensioned drawing of it.

8. Finalize

Summarize what you built — key dimensions and assumptions — and how to view it: pc ide view <name>.

If the part is meant to connect to something — a bolt pattern, a plug, a rail — say so and offer /pc:add-interfaces, which adds the ports and interfaces that let PartCAD mate it automatically. Once it has them, --with-all draws them on the very views you have been comparing against, so a port that is in the wrong place or facing the wrong way is visible rather than inferred:

sh
for view in front top right iso; do
  mkdir -p /tmp/pc-render/ports/$view
  pc --no-ansi render -t png --view $view -O /tmp/pc-render/ports/$view --with-all <name>
done

Four views again, and for the same reason: a port is a coordinate frame, and one projection collapses the axis it is offset along just as it does for geometry. --no-ansi because every port drawn is also named on stderr, which is where the exact string to write in an ASSY file comes from. /pc:add-interfaces covers reading these drawings in full.

Frequently asked questions

What does the Gen Part AI skill do?

Generate a PartCAD part from a natural-language description (and optional reference images/requirements) by authoring a CAD script and validating it with the PartCAD CLI. Use for /pc:gen-part or when the user asks to generate, create, or model a single mechanical part.

Why use Gen Part on TypingMind?

Because you install it once and use it with any model. Gen Part is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Gen Part in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/partcad/partcad/tree/devel/ai-agents/common/skills/gen-part. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Gen Part?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Gen Part?

As many as you like. As long as a model supports skills, you can use Gen Part with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Gen Part AI skill free?

Yes. It is published on GitHub by partcad under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇