Logo Gen Part

Gen Part

Tổ chức
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.

Tổng quan

Nhà phát hànhpartcad
Kho mãpartcad
Tên kỹ nănggen-part
Sao
504
Bản fork
47
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được partcad công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Gen Part trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/partcad/partcad/tree/devel/ai-agents/common/skills/gen-part
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

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
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Gen Part trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Gen Part ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Gen Part với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

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.

Câu hỏi thường gặp

Kỹ năng AI Gen Part làm được gì?

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.

Vì sao nên dùng Gen Part trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Gen Part là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Gen Part trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/partcad/partcad/tree/devel/ai-agents/common/skills/gen-part. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Gen Part?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Gen Part với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Gen Part với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Gen Part có miễn phí không?

Có. Kỹ năng này được partcad phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇