New to Claude Skills? Learn how to install them โ†’

earthtojake on GitHub

CAD Viewer

Free

Open and review CAD files with ease.

Get this skill

Free ยท Opens the source repo

What CAD Viewer does

CAD Viewer is a specialized tool designed for visualizing and reviewing various CAD file formats, including explicit CAD, implicit CAD, and robot-description files. This skill allows you to start or reuse a local CAD Viewer instance, providing live review links for a range of file types such as .step, .stp, .glb, .stl, .gcode, .dxf, .urdf, .srdf, and .sdf. It is particularly useful when working with files generated from CAD, G-code, or URDF/SRDF generation skills, making it an essential part of a developer's or designer's toolkit.

The skill operates by checking if a local CAD Viewer is already running on the default port. If it is, it reuses that instance; if not, it starts a new server instance. This dynamic approach ensures that you can serve multiple directories without needing to launch separate servers for each one, thereby streamlining the review process. The server binds to an available port and provides a URL that you can use to access the viewer directly.

When using CAD Viewer, you can easily generate links for specific files or entire directories. The skill ensures that the requested files exist before returning links, promoting accuracy in your workflow. It also provides mechanisms to handle errors gracefully, ensuring that you are informed if a file is missing or if the viewer fails to start. This reliability makes CAD Viewer a valuable asset for anyone involved in CAD design or robotic simulations.

Overall, CAD Viewer is tailored for engineers, designers, and developers who need a robust solution for reviewing CAD files. Its ability to integrate with existing workflows and handle various file types makes it a versatile tool for enhancing productivity in CAD-related tasks.

When to use it

Use CAD Viewer when you need to visually inspect CAD files or G-code generated from other skills in your workflow.

When not to use it

This skill may not be suitable for users who do not work with CAD files or require advanced editing capabilities beyond simple viewing.

What you can build with it

Reviewing CAD Models

Use CAD Viewer to visually inspect and evaluate CAD models generated from various design tools.

Inspecting G-code Files

Quickly open and review G-code files for 3D printing or CNC machining to ensure accuracy before production.

Collaborative Design Reviews

Share live links to CAD models with team members for real-time feedback during design iterations.

How to install CAD Viewer

View source

1. Install with the skills CLI

npx skills add earthtojake/text-to-cad/cad-viewer --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by earthtojake

CAD Viewer

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 to open existing or newly generated CAD, implicit CAD, robot-description, DXF, or plain FDM G-code files in CAD Viewer and hand back live review links. The expected input is one or more explicit file paths.

Start Viewer

Use one local CAD Viewer per machine and serve every directory through ?dir=. The Viewer advertises dynamic-root, so a single server answers for any absolute directory; you never need a second server just to change directories.

First check whether a reusable Viewer is already running on the default port:

curl -sS -m 2 http://127.0.0.1:4178/__cad/server

Reuse that server when the response is JSON with "app": "cad-viewer" and "dynamicRoot": true. Take its url and port from the response and skip straight to Links. Start your own server instead when the probe fails, or when the response's viewerVersion differs from the version in scripts/viewer/package.json โ€” a different version is another checkout's Viewer, not this skill's runtime.

To start one, run from this skill directory:

npm --prefix scripts/viewer run serve -- --host 127.0.0.1 --dir <absolute-model-root> --shutdown-after 12h --json

Choose --dir as the absolute directory that contains the model artifacts and sidecars, commonly <repo>/models or the consuming project's equivalent model directory. The file= value must be relative to that --dir.

The server binds 4178 when it is free and scans forward when it is not, so do not pick ports by hand or probe for a free one. Read the bound port from the --json startup line described under Claude Preview rather than assuming 4178, then append file=:

http://127.0.0.1:<bound-port>/?dir=/absolute/project/models&file=path/to/model.step

In sandboxed agent environments, local binding or probe failures such as EPERM or EACCES can be expected; rerun the same command with the needed permission/escalation.

Links

  • Before returning any file= link, resolve <dir>/<file> and confirm the artifact exists. Pass the generated artifact (e.g. .step), not its generator source (e.g. .py). If the resolved path is missing, do not return the link, and instead report the problem and point to the correct generated artifact path.
  • Return one Viewer URL per requested file.
  • Start/reuse the Viewer once per absolute directory --dir, then append file=<path> for each requested file. The file path must be relative to --dir.
  • For directory-only review links, return the started or reused Viewer URL without adding file=.
  • Do not stop an existing Viewer server unless the user asks.
  • If Viewer startup fails, report the failure and continue with the owning skill's non-GUI validation or artifacts.

Claude Preview

The viewer port is dynamic โ€” 4178 is only the first candidate, and the server scans forward when it is taken. To integrate with the Claude Preview tool, pass --json when starting the server:

npm --prefix scripts/viewer run serve -- --host 127.0.0.1 --dir <absolute-model-root> --shutdown-after 12h --json

The server writes a JSON result line to stdout after the human-readable lines. Parse it by taking the last line of stdout that begins with {:

{"url":"http://127.0.0.1:<port>/?dir=<absolute-model-root>","host":"127.0.0.1","port":<port>,"action":"start"}

The line is written once the listener is bound, so url is ready to hand to the Claude Preview tool without further probing. When you reused an existing Viewer from the /__cad/server probe instead of starting one, use that response's url and append ?dir=<absolute-model-root> yourself.

References

  • Read references/development.md when the user asks to modify, debug, or iterate on CAD Viewer source.
  • Read references/viewer-features.md when you need supported file types, Viewer controls, or file-specific feature details.
  • Read references/moveit2-server.md only when the user specifically needs optional SRDF MoveIt2 IK or path-planning controls.

Frequently asked questions about CAD Viewer

Similar skills