Agent skill

G-code Slicer Tool

by autonomous-ai in autonomous-ai/openharness

Slices 3D mesh files into printer-profiled plain G-code through real slicer CLIs, with backend discovery, input inspection, dry runs and static validation.

MITAuto-check passedDevelopment

Install G-code Slicer Tool

skills CLI
$ npx skills add autonomous-ai/openharness --skill gcode -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install autonomous-ai/openharness gcode --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/autonomous-ai/openharness.git skills-src && mkdir -p .claude/skills && cp -r skills-src/store/agents/text-to-cad/skills/gcode .claude/skills/gcode && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
gcode
GitHub stars
1.1k
Token cost
~1.5k tokens
SKILL.md length
590 words
Files
6 (incl. scripts, references)
Skills in repo
99
Repo updated
First seen
Licence
MIT

At a glance

Slices 3D mesh files into printer-profiled plain G-code through real slicer CLIs, with backend discovery, input inspection, dry runs and static validation.

  • Works in 7 steps: Confirm the input is a supported mesh:… → Require an explicit printer/profile… → Discover slicer backends when the… → …
  • Slicing an STL or 3MF model into G-code for a given printer profile
  • SKILL.md covers Workflow, Profile Contract, Backends And Inputs and Validation, plus 1 more section
  • Runs Python scripts from its folder; calls python and brew

What it does

This skill orchestrates real slicer command-line tools to turn mesh files (.stl, .obj, unsliced .3mf, .ply, .glb or .gltf) into plain FDM G-code. It is printer-agnostic and never uploads, starts or packages a print job. A bundled gcode_tool.py script offers discover to find local slicer backends, inspect to check that a mesh is ready to slice, slice with a dry run before the real run, and validate for the finished G-code.

Every slice needs a wrapper profile JSON, and the agent must not invent profiles for real printers. The wrapper points to the native slicer profile by absolute path, names the backend, for example OrcaSlicer, and supplies validation bounds such as bed size and an optional motion bounds setting. OrcaSlicer setups that split machine, process and filament files can use native_settings and native_filaments. Reference files cover slicer backends and G-code validation.

When your agent uses it

  • Slicing an STL or 3MF model into G-code for a given printer profile
  • Checking whether a mesh is ready to slice
  • Finding which slicer backends are installed locally
  • Validating generated G-code against printer bounds before handoff

Example prompts

  • “Slice ./models/bracket.stl with the profile in ./profiles/printer.json, and do a dry run first.”
  • “Which slicers are installed on this machine?”
  • “Check whether ./models/vase.3mf is ready to slice.”
  • “Validate /tmp/bracket.gcode against my printer profile.”

Requirements

  • Python, to run scripts/gcode_tool.py
  • A local slicer CLI such as OrcaSlicer
  • A wrapper profile JSON that points to a native slicer profile

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Confirm the input is a supported mesh: .stl, .obj, unsliced .3mf, .ply, .glb, or .gltf.
  2. Require an explicit printer/profile wrapper JSON. Do not invent real-printer profiles.
  3. Discover slicer backends when the backend is unknown
  4. Inspect the input
  5. Dry-run the slicer command before executing
  6. Execute only after the dry-run command and profile are appropriate
  7. Validate the generated G-code

What it can do on your machine

Read from SKILL.md and the folder at commit 54a1f1b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

G-code Slicer Tool loads about 1.5k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 97 tokens; SKILL.md has 590 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~97
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from autonomous-ai/openharness at commit 54a1f1b, republished under its MIT licence (© autonomous-ai). 590 words, ~1,521 tokens.

Download SKILL.mdSave it as .claude/skills/gcode/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
gcode
description
Generate, inspect, dry-run, and statically validate plain FDM `.gcode` from 3D mesh files by orchestrating real slicer CLIs. Use when Codex needs to slice `.stl`, `.obj`, unsliced `.3mf`, `.ply`, `.glb`, or `.gltf` into printer-profiled G-code, discover local slicer backends, inspect whether a mesh is slice-ready, or validate generated G-code before any printer-specific handoff.

G-code

Provenance: maintained in earthtojake/text-to-cad. Use the installed local skill files as the runtime source of truth; the repository link is only for provenance and release review.

Use this skill for plain .gcode generation from mesh files. It is printer-agnostic and never uploads, starts, or packages print jobs.

Workflow

  1. Confirm the input is a supported mesh: .stl, .obj, unsliced .3mf, .ply, .glb, or .gltf.
  2. Require an explicit printer/profile wrapper JSON. Do not invent real-printer profiles.
  3. Discover slicer backends when the backend is unknown:
bash
python scripts/gcode_tool.py discover
  1. Inspect the input:
bash
python scripts/gcode_tool.py inspect --input path/to/model.stl --json
  1. Dry-run the slicer command before executing:
bash
python scripts/gcode_tool.py slice \
  --input path/to/model.stl \
  --output /tmp/model.gcode \
  --profile path/to/profile.json \
  --backend auto \
  --dry-run
  1. Execute only after the dry-run command and profile are appropriate:
bash
python scripts/gcode_tool.py slice \
  --input path/to/model.stl \
  --output /tmp/model.gcode \
  --profile path/to/profile.json \
  --backend auto \
  --execute
  1. Validate the generated G-code:
bash
python scripts/gcode_tool.py validate \
  --gcode /tmp/model.gcode \
  --profile path/to/profile.json \
  --json

Profile Contract

Every slice requires a wrapper profile JSON with an absolute native slicer profile path:

json
{
  "backend": "orcaslicer",
  "native_config": "/absolute/path/to/native-slicer-profile",
  "machine": {
    "name": "Example Printer",
    "bed_size_mm": [180, 180],
    "z_height_mm": 180,
    "motion_bounds_mm": {
      "x": [0, 180],
      "y": [0, 180],
      "z": [0, 180]
    }
  },
  "filament": {
    "type": "PLA",
    "nozzle_temp_c": 220,
    "bed_temp_c": 65
  }
}

The wrapper supplies validation bounds and backend selection. machine.motion_bounds_mm is optional; omit it for the default 0..bed_size and 0..z_height bounds, or set it from a native printer profile when start/end G-code intentionally uses safe wipe/purge positions outside the printable area. The native slicer profile remains the source of detailed process, printer, and filament behavior.

For OrcaSlicer, use native_settings and native_filaments when the real profile is split across machine, process, and filament JSON files. Keep native_config as an absolute path to the primary native profile for compatibility:

json
{
  "backend": "orcaslicer",
  "native_config": "/absolute/path/to/machine-or-process.json",
  "native_settings": [
    "/absolute/path/to/machine.json",
    "/absolute/path/to/process.json"
  ],
  "native_filaments": [
    "/absolute/path/to/filament.json"
  ],
  "machine": {
    "name": "Example Printer",
    "bed_size_mm": [180, 180],
    "z_height_mm": 180
  },
  "filament": {
    "type": "PLA",
    "nozzle_temp_c": 220,
    "bed_temp_c": 65
  }
}

Backends And Inputs

Preferred slicer backend order is orcaslicer, prusa-slicer, then curaengine. Prefer installing OrcaSlicer when no preferred backend is available; on macOS use brew install --cask orcaslicer and then rerun discover. The helper checks both PATH and the usual /Applications/OrcaSlicer.app cask location. Bambu Studio may be reported by discovery as available but is not preferred because its CLI export path has shown macOS instability.

Pass .stl, .obj, and unsliced .3mf directly to the slicer. Convert .ply, .glb, and .gltf to temporary STL at execution time with optional trimesh; if trimesh is unavailable, ask the user to install it or provide .stl, .obj, or unsliced .3mf.

Reject .step, .stp, .dxf, .svg, .urdf, and .sdf in v1. inspect and slice fail with a structured remediation object naming the skill and command that produce a sliceable mesh; use it instead of inferring a conversion workflow:

Show full SKILL.md (232 more words)Show less
  • .step, .stp: boundary-representation CAD, not a mesh. Export an STL sidecar with $cad (cadgen stl build <input.step> <output>.stl — the door takes the STEP document; a model script is refused, run python <model>.py first), then slice the exported .stl here.
  • .dxf, .svg: 2D drawings with no 2D-to-mesh conversion in this toolchain. Model the 3D solid in $cad as a @step model script and export an STL sidecar, then slice that. If the part is a flat cut rather than a print, use $sendcutsend instead of this skill.
  • .urdf, .sdf: robot descriptions that reference per-link mesh files. Slice the referenced .stl/.obj meshes one at a time; regenerate stale or missing ones from the owning CAD source with $cad first. Use $urdf or $sdf for the robot description itself.

Read references/slicer-backends.md when backend behavior, profile expectations, or source links matter.

Validation

Always validate generated G-code before handing it to printer-specific workflows. The validator checks for non-empty content, temperature commands, movement commands, extrusion moves, XYZ bounds, and unknown command warnings.

Read references/gcode-validation.md when interpreting validation output or deciding whether a warning is acceptable.

Bambu Boundary

This skill generates plain .gcode only. It does not create Bambu .gcode.3mf archives and does not contact printers. For Bambu upload/start workflows, hand off the validated plain .gcode to $bambu-labs. Let $bambu-labs choose the printer-specific LAN handoff, such as an A1 Mini template project or an explicitly enabled bambox project package.

© autonomous-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references) in store/agents/text-to-cad/skills/gcode of autonomous-ai/openharness.

  • SKILL.md
  • LICENSE
  • agents/openai.yaml
  • references/gcode-validation.md
  • references/slicer-backends.md
  • scripts/gcode_tool.py

Open the folder on GitHubat commit 54a1f1b

Compare with similar skills

G-code Slicer Tool next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

G-code Slicer Tool compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
G-code Slicer Tool this skillautonomous-ai/openharness1.1k—~1.5kAutomated safety check: PassMIT
Parametric CAD Modelingearthtojake/text-to-cad18k—~2.8kAutomated safety check: PassMIT
Image to Three.js Modelimg2threejs/img2threejs18k1 repos~8.2kAutomated safety check: PassApache-2.0
OrcaSlicer G-code Slicingearthtojake/text-to-cad18k—~989Automated safety check: PassMIT
Phantom Motionpixelxzen/phantom-motion185—~1kAutomated safety check: PassApache-2.0
Procedural Geometry for Blender Scriptslukapiskorec/craftbot143—~1.4kAutomated safety check: PassCustom licence

Similar skills

  • Parametric CAD Modeling

    earthtojake/text-to-cad

    Creates and edits parametric CAD parts in Python, organizes multi-model projects, exports to STEP, STL, 3MF or GLB, and opens existing CAD files for visual review.

    18k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Image to Three.js Model

    img2threejs/img2threejs

    Rebuilds the object in a reference image as a procedural, animation-ready Three.js model written entirely in code, using staged sculpting with quality checks.

    18k GitHub starsUsed in 1 repo~8.2k tokens
    Game DevelopmentAuto-check passed
  • OrcaSlicer G-code Slicing

    earthtojake/text-to-cad

    Slices STL, 3MF or OBJ models into printer-ready G-code with OrcaSlicer, either headless from the command line or by opening the model in the app.

    18k GitHub stars~989 tokensUpdated today
    Media & CreativeAuto-check passed
  • Phantom Motion

    pixelxzen/phantom-motion

    交互式动态视觉叙事生成器 v11.0 (Hybrid Drive Edition)。基于用户输入的任意主题关键词, 通过多轮交互式对话收集需求,利用 React 19 + Tailwind 4 驱动的 Minimal Mono 极简编辑器, 实时操纵隔离在 Iframe 中的硬核 GSAP/WebGL 影视级叙事引擎。

    185 GitHub stars~1k tokensUpdated 4 mo ago
    Frontend & DesignAuto-check passed
  • Guides Blender Python that generates construction geometry from derived parametric expressions instead of hand-typed coordinates, so changes propagate and overlaps stay checkable.

    143 GitHub stars~1.4k tokensUpdated 6 days ago
    Game DevelopmentAuto-check passed
  • Higgsfield 3D

    OSideMedia/higgsfield-ai-prompt-skill

    A skill your agent uses when the user wants a 3D model, mesh or GLB out of Higgsfield — image-to-3D, multi-view-to-3D, text-to-3D, rigging or animating a mesh, remesh / retopology, retexture, or 3D…

    697 GitHub stars~6.8k tokensUpdated 10 days ago
    Game DevelopmentAuto-check passed

More from autonomous-ai/openharness

All 99 skills in this repo
  • Home Assistant Automation Builder

    autonomous-ai/openharness

    Turns a home-automation request into standard, testable automations.yaml, run against Home Assistant Core's real triggers and verified with its own trace tool.

    1.1k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Score Music Composer

    autonomous-ai/openharness

    Turns a musical brief into LilyPond concert-pitch music, checked parts for each instrument and a playable practice pack.

    1.1k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • OrcaSlicer 3MF and G-code Workflow

    autonomous-ai/openharness

    Turns an STL and explicit printer and material requirements into compared OrcaSlicer plans, an editable 3MF project, checked G-code and a portable handoff.

    1.1k GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Sheets and Docs Report Builder

    autonomous-ai/openharness

    Builds an editable DOCX report, a formula-driven XLSX workbook and a fresh LibreOffice PDF preview from one structured source file, then checks them together.

    1.1k GitHub stars~708 tokensUpdated today
    Auto-check passed
  • Bambu Labs

    autonomous-ai/openharness

    Dry-run, upload, and cautiously initiate local Bambu Lab print jobs from validated plain .gcode, using Bambu LAN FTPS/MQTT handoffs.

    1.1k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check: warnings
  • CAD Viewer Launcher

    autonomous-ai/openharness

    Starts a local CAD Viewer server for a directory of CAD, robot-description or DXF files and returns a live review link, reusing a running instance when one already serves that directory.

    1.1k GitHub stars~1.9k tokensUpdated today
    Auto-check passed

Works with

Questions about G-code Slicer Tool

What does G-code Slicer Tool do?

Slices 3D mesh files into printer-profiled plain G-code through real slicer CLIs, with backend discovery, input inspection, dry runs and static validation. gltf) into plain FDM G-code. It is printer-agnostic and never uploads, starts or packages a print job.

When should I use G-code Slicer Tool?

G-code Slicer Tool fits situations like: slicing an STL or 3MF model into G-code for a given printer profile; checking whether a mesh is ready to slice; finding which slicer backends are installed locally; validating generated G-code against printer bounds before handoff.

How do I install G-code Slicer Tool in Claude Code?

Run `npx skills add autonomous-ai/openharness --skill gcode -a claude-code`. Or copy the skill folder (store/agents/text-to-cad/skills/gcode in autonomous-ai/openharness) into .claude/skills/gcode in your project. Claude Code loads it when a task matches its description.

How do I install G-code Slicer Tool in Codex?

Run `npx skills add autonomous-ai/openharness --skill gcode -a codex`. Or copy the skill folder (store/agents/text-to-cad/skills/gcode in autonomous-ai/openharness) into .agents/skills/gcode in your project. Codex loads it when a task matches its description.

Can I use G-code Slicer Tool in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add autonomous-ai/openharness --skill gcode -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/gcode, .gemini/skills/gcode, .github/skills/gcode and .opencode/skills/gcode in your project.

What does G-code Slicer Tool need to run?

Going by SKILL.md and its folder, G-code Slicer Tool needs Python for the scripts in its folder and the command-line tools its instructions call (python and brew). Our summary lists: Python, to run scripts/gcode_tool.py; A local slicer CLI such as OrcaSlicer; A wrapper profile JSON that points to a native slicer profile.

Does G-code Slicer Tool access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is G-code Slicer Tool safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does G-code Slicer Tool use?

G-code Slicer Tool is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does G-code Slicer Tool use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to G-code Slicer Tool?

Skills that share tags, products or a category with G-code Slicer Tool: Parametric CAD Modeling (earthtojake/text-to-cad, 18k stars), Image to Three.js Model (img2threejs/img2threejs, 18k stars), OrcaSlicer G-code Slicing (earthtojake/text-to-cad, 18k stars) and Phantom Motion (pixelxzen/phantom-motion, 185 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains G-code Slicer Tool?

autonomous-ai (a GitHub organization) maintains it in autonomous-ai/openharness, which has 1,137 GitHub stars. The repository holds 99 skills in this directory. The repository was last updated on October 7, 2026.

Source: autonomous-ai/openharness on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.