gcode

gcode is a skill for Claude Code, Codex from earthtojake/text-to-cad. It costs 102 tokens per session (1,553 once invoked), scanned A, original, MIT.

A tool guide for creating and checking G-code, the machine instructions used by FDM 3D printers, from 3D model files. It works with local slicer programs and requires a printer-profile wrapper.

In plain words
What is it for?
Use it to inspect STL, OBJ, 3MF, PLY, GLB, or GLTF models, discover available slicers, dry-run slicing, and produce printer-profiled G-code.
Why use it?
It reduces mistakes when preparing models for slicing and lets you inspect or preview the slicer command before running it.

Skill for Claude CodeCodex

Part of the cad plugin — 12 skills shipped together

About the project

text-to-cad is a collection of agent workflows for creating, examining, finding, preparing, and transferring CAD, engineering, manufacturing, and robot-description files. It is for agents working with mechanical design, fabrication, simulation, and robotics projects. Catalogue skills, instructions, and a plugin implement these workflows.

earthtojake/text-to-cad · 14,351 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/earthtojake/text-to-cad/gcode
Any agent
npx skills add earthtojake/text-to-cad --skill gcode
Clone the repo
git clone --depth 1 https://github.com/earthtojake/text-to-cad

Made for: Claude Code, Codex.

Or install cad, the plugin that ships this one along with the rest of its 12 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gcode

README.md
[![agentmods](https://agentmods.dev/badge/skills/earthtojake/text-to-cad/gcode.svg)](https://agentmods.dev/skills/earthtojake/text-to-cad/gcode)
Your own site
<a href="https://agentmods.dev/skills/earthtojake/text-to-cad/gcode"><img src="https://agentmods.dev/badge/skills/earthtojake/text-to-cad/gcode.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,553 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00102 $0.01553
Opus 5 $0.00051 $0.00776
Sonnet 5 $0.00020 $0.00311
Haiku 4.5 $0.00010 $0.00155

Measured today against content hash c0c08cb2989a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gcode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/gcode_tool.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/gcode/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:
python scripts/gcode_tool.py discover
  1. Inspect the input:
python scripts/gcode_tool.py inspect --input path/to/model.stl --json
  1. Dry-run the slicer command before executing:
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:
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:
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:

{
  "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.

Read the full file on GitHub · 138 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed c0c08cb2989a
  2. 5d ago First seen · 138 lines · 102 tokens per session scan A fb7fb0ce9c71

Subscribe to this mod's changes

gcode is a skill published in the GitHub repository earthtojake/text-to-cad (14,351 stars, last pushed today), licensed MIT. It adds 102 tokens to every session and 1,553 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cad

Create, modify, inspect, validate, and review STEP-first build123d/Python CAD parts and assemblies. Use for natural-language CAD specs, STEP/STP generation, build123d source, build123d source-level joints, @cad references, geometry facts, measurements, mating deltas, CAD Explorer links, conditional review renders, and…

cedrickchee/text-to-cad · 80 tokens

robot-motion

Robot motion setup, generation, and validation for URDF-based inverse kinematics and path planning. Use when Codex needs to install ROS 2 or MoveIt 2 dependencies, run or test the local motion server, generate CAD Explorer motion artifacts for a .urdf, create MoveIt/SRDF/kinematics/planning sidecars, debug IK or…

cedrickchee/text-to-cad · 87 tokens

urdf

URDF generation and validation for robot model outputs. Use when the agent needs to create, edit, regenerate, inspect, or validate .urdf files, genurdf() envelopes, robot links, joints, joint limits, parent/child kinematic structure, visual or collision mesh references, collision geometry, or URDF-specific XML…

cedrickchee/text-to-cad · 114 tokens

FluidCAD-from-drawing

Turning a 2D engineering drawing into a parametric FluidCAD model. Use this skill whenever the user supplies a drawing, blueprint, dimension sheet, hand sketch, screenshot, PDF, or photo of a part and wants it modeled — "model this", "build this part", "make this in CAD", "here's the drawing". Trigger it alongside the…

Fluid-CAD/FluidCAD · 114 tokens

gap

Program robots with GaP (graph-as-policy) — compile natural-language tasks into typed, verified robot skill graphs and run them on simulators or real robots. Use when the user mentions GaP or graph-as-policy, robot manipulation, robot skills, robot tools or capabilities, skill registries, open-robot-skills, LIBERO or…

graph-robots/graph-as-policy · 195 tokens

step-parts

Find, evaluate, and download low-level common standard CAD parts from step.parts, such as screws, bolts, nuts, washers, bearings, standoffs, electronics parts, motors, connectors, and other off-the-shelf components. Use when Codex needs to search the hosted step.parts catalog, resolve fuzzy part names, standards…

earthtojake/step.parts · 107 tokens