cadspec

Generates and validates declarative CAD geometry in TOML files compiled to DXF drawings.

Updated Jun 12, 2026
One-click install
npx skills add https://github.com/UniverLab/univerlab --skill cadspec-univerlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cadspec
Source: https://github.com/UniverLab/univerlab/tree/main/public/.well-known/agent-skills/cadspec
Command: npx skills add https://github.com/UniverLab/univerlab --skill cadspec-univerlab

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing CAD drawings by hand in GUI tools is hard to version, review, and automate. This Skill lets an agent author geometry as code in .cf TOML files, validate it, preview it visually, and compile it deterministically to DXF. ## Core Features & Use Cases - CAD as code authoring: Declare lines, polylines, circles, arcs, text, dimensions, hatches, arrays, mirrors, and 3D solids with CSG booleans in .cf TOML layers orchestrated by project.toml. - Validation and visual verification: Run cadspec check --json for machine-readable validation and cadspec preview to render PNG/SVG previews with entity highlight markers so edits can be confirmed visually. - Live preview and DXF pipeline: Use cadspec serve for a browser live preview that refreshes on save, cadspec build to compile DXF, and cadspec import to convert existing DXF files into .cf layers. - Use Case: Ask the agent to scaffold a floor plan project, draw walls and dimension annotations in .cf files, preview the render to verify placement, then build the final DXF for delivery. ## Quick Start Ask the agent to create a new cadspec project, start the live preview server, and add a dimensioned rectangle to the main layer.

Frequently Asked Questions about cadspec

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a CAD drawing as code with cadspec?

Run cadspec new to scaffold a project, then declare geometry in .cf TOML files using primitives like line, polyline, circle, text, dim, and hatch. Compile the layers to DXF with cadspec build or preview them with cadspec preview.

How do I preview cadspec drawings while editing?

Run cadspec serve to start a live preview server on port 4377 that daemonizes by default and refreshes the browser about 80ms after each save. Stop it with cadspec serve --stop, or use cadspec preview to render a static PNG or SVG.

Does cadspec support 3D models?

Yes, cadspec renders a real extruded 3D view via cadspec preview --3d or the viewer's 3D button. Primitives accept extrude and elevation attributes, and [[solid]] blocks with [[boolean]] operations support difference, union, and intersection.

Can I import an existing DXF file into cadspec?

Yes, cadspec import <file.dxf> converts an existing DXF drawing into .cf TOML layers, optionally targeting a named layer with --layer. The resulting files can then be edited, validated, and rebuilt like any cadspec project.

Why does cadspec check not produce a DXF file?

cadspec check only validates layers, entity counts, and constraints without writing output; build --check behaves the same way. To generate the DXF artifact, run cadspec build, optionally with --layer or --output flags.

What are the limitations of cadspec 3D modeling?

cadspec supports extrusion and CSG booleans on box and cylinder solids, but not a B-rep feature tree or interactive sketch-on-a-face workflows. Cutting operations require positioning the tool solid by coordinates rather than selecting faces interactively.