Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
earthtojake avatar

Sdf

  • 5k installs
  • 11k repo stars
  • Updated July 11, 2026
  • earthtojake/text-to-cad

SDFormat document or Python `gen_sdf()` generator that produces valid, simulator-ready `.sdf` files with correct poses, frames, joints, sensors, and physics.

About

SDF is a code generator and validator for SDFormat - the XML schema that describes simulator worlds, robot models, links, joints, poses, sensors, and physics. Developers use it when exporting CAD or robot descriptions to Gazebo or other physics simulators, or when authoring programmatic robot/world definitions via Python `gen_sdf()` functions. The skill manages the full workflow: reading design ledgers, editing generator source (not raw XML), regenerating targets via `python scripts/sdf`, running bundled and optional `gz sdf --check` validation, and handing off completed `.sdf` files to the CAD Viewer. It enforces SI units, frame semantics, design assumptions, and simulator-specific compatibility checks. Generate `.sdf` files from Python `gen_sdf()` sources or edit SDFormat XML with design ledger tracking Validate SDFormat syntax, frame semantics, poses, joints, inertials, and simulator metadata before handoff Support Gazebo

  • Generate `.sdf` files from Python `gen_sdf()` sources or edit SDFormat XML with design ledger tracking
  • Validate SDFormat syntax, frame semantics, poses, joints, inertials, and simulator metadata before handoff
  • Support Gazebo 1.12 and other simulator versions with target-specific version and plugin constraints
  • Multi-target batch generation with `source.py=output.sdf` syntax and optional `--gz-check` validation
  • Automatic CAD Viewer handoff and smoke-test reporting (assumptions, skipped checks, unresolved paths)

Sdf by the numbers

  • 5,007 all-time installs (skills.sh)
  • +625 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #137 of 4,386 Backend & APIs skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

sdf capabilities & compatibility

Capabilities
parse and generate sdformat xml from python sour · validate frame semantics, poses, joints, inertia · multi target batch generation with custom output · design ledger and assumption tracking · cad viewer handoff integration · bundled and optional `gz sdf check` validation
Use cases
api development
Platforms
macOS · Windows · Linux
Runs
Runs locally
Pricing
Free
From the docs

What sdf says it does

Use this skill when the deliverable is an SDFormat document or a Python `gen_sdf()` source.
skill:earthtojake/text-to-cad#sdf
After generation, run available checks: bundled validation, optional `gz sdf --check`, simulator load, joint motion, and plugin/sensor startup.
skill:earthtojake/text-to-cad#sdf
npx skills add https://github.com/earthtojake/text-to-cad --skill sdf

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5k
repo stars11k
Security audit2 / 3 scanners passed
Last updatedJuly 11, 2026
Repositoryearthtojake/text-to-cad

What it does

Generate, validate, and modify SDFormat XML documents and Python `gen_sdf()` sources for robot models, worlds, and simulator handoff.

Who is it for?

Robotics engineers, simulation developers, CAD-to-simulator workflows, model packages, world handoff, Gazebo integration, frame-semantic validation.

Skip if: Signed-distance-field geometry, raw 3D mesh generation, planning semantics, motion controllers, sensor data processing.

When should I use this skill?

Exporting robot models or worlds to simulators; authoring or editing SDFormat generators; validating frame transforms and inertials; testing simulator load and joint motion.

What you get

Valid, reusable SDFormat documents with documented design assumptions, passing bundled and optional Gazebo validation, and clear simulator compatibility.

  • SDF model files
  • validation results

By the numbers

  • SDFormat version 1.12 preferred for new outputs
  • Multi-target generation supports arbitrary `source.py=output.sdf` mappings
  • 9 reference documents provided (gen-sdf, frame-semantics, developers-helpers, validation, etc.)

Files

SKILL.mdMarkdownGitHub ↗

SDF

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 when the deliverable is an SDFormat document or a Python gen_sdf() source. SDFormat describes simulator and world behavior: models, worlds, frames, poses, links, joints, inertials, visuals, collisions, sensors, lights, physics, plugins, includes, and simulator metadata.

This skill is for SDFormat, not signed-distance-field geometry.

Core rules

1. Treat the Python file defining gen_sdf() as source of truth. Treat configured .sdf files as generated artifacts unless the user explicitly asks for direct XML editing. 2. Identify the target consumer before editing: Gazebo/libsdformat version, another simulator, visualization-only tooling, model package, or world handoff. 3. Decide document kind: model-level SDF, world-level SDF, or model-in-world. Prefer model-level SDF for reusable robot/object exports. 4. Use SI units unless the target explicitly requires otherwise: meters, kilograms, seconds, radians. 5. Prefer version="1.12" for new outputs unless the target consumer constrains the version. 6. Establish the design ledger before writing poses, frames, joint axes, mesh scales, inertials, sensors, or plugins. Use references/design-ledger.md and references/llm-guardrails.md. 7. Do not infer spatial transforms from visual impression alone. Derive poses, axes, scale, mass, inertia, and frame names from upstream source data, drawings, simulator documentation, measured values, or explicit assumptions. 8. Prefer helper functions and named constants over large XML string literals. Hidden numbers are a common SDF failure mode. 9. Generate only explicit targets with scripts/sdf or the repository's existing SDF launcher. Do not run directory-wide generation. 10. Regenerate upstream geometry, mesh, robot-description, render, topology, or package assets with their owning workflows before regenerating SDF that references them. 11. After generation, run available checks: bundled validation, optional gz sdf --check, simulator load, joint motion, and plugin/sensor startup. 12. Report assumptions, skipped checks, unresolved resource paths, and target-specific compatibility risks.

Scope

Use this skill for SDFormat outputs and generators. Do not use it for signed-distance-field modeling, raw geometry generation, planning semantics, or to paper over incorrect upstream robot/source data unless the task is explicitly simulator-only.

CAD Viewer Handoff

After completing SDF work that creates or modifies a .sdf, you must ALWAYS hand the explicit file path to $cad-viewer when that skill is installed. $cad-viewer must start CAD Viewer if it is not already running and return link(s) to the relevant created or updated file(s); if $cad-viewer is unavailable or startup fails, report that instead of silently omitting the handoff.

Workflow

1. Locate the gen_sdf() source and intended .sdf output. 2. Read or create the design ledger. 3. Read references/frame-semantics.md before editing any <pose>, <frame>, joint axis, relative_to, expressed_in, nested scope, sensor frame, or plugin frame. 4. Edit the generator source, not generated XML. 5. Use optional builder helpers when they make the generated structure clearer; raw ElementTree is still allowed. 6. Regenerate the explicit target. 7. Treat bundled validation as a guardrail, not simulator proof. 8. Run target-consumer smoke tests when available. 9. Report checks run, checks skipped, and assumptions. Static rendering does not execute SDF plugins or read file-authored motion metadata.

Commands

Run with the project or workspace Python environment. Treat python in examples as an interpreter placeholder; if bare python is unavailable, substitute python3, a project virtualenv interpreter, or the configured interpreter path.

python scripts/sdf path/to/source.py
python scripts/sdf path/to/source.py -o path/to/output.sdf
python scripts/sdf path/to/a.py=out/a.sdf path/to/b.py=out/b.sdf

Plain Python targets write sibling .sdf files beside their sources. -o / --output is valid only with one plain target. SOURCE.py=OUTPUT.sdf supports custom multi-target destinations.

If the runtime supports optional external checking:

python scripts/sdf path/to/source.py --gz-check auto
python scripts/sdf path/to/source.py --gz-check required
python scripts/sdf path/to/source.py --gz-check never

gz sdf --check is optional target-consumer validation. It should be reported as skipped when unavailable unless explicitly required.

Required report shape

When finishing an SDF task, include a compact report:

Generated: path/to/model.sdf from path/to/model.py
Checks run:
- bundled SDF validation: passed
- gz sdf --check: skipped, gz not installed
- simulator load: skipped, target simulator unavailable
- viewer handoff: `$cad-viewer` link returned
Assumptions:
- Assumed mesh units are meters.
- Assumed lidar frame is coincident with lidar_link.
Risks:
- Camera plugin filename was not verified in the target simulator environment.

References

  • Generation command: references/gen-sdf.md
  • Generator contract: references/generator-contract.md
  • SDF workflow: references/sdf-workflow.md
  • Builder helpers: references/builder-helpers.md
  • LLM guardrails: references/llm-guardrails.md
  • Design ledger: references/design-ledger.md
  • Frame semantics: references/frame-semantics.md
  • Validation scope: references/validation.md
  • Smoke tests: references/smoke-tests.md
  • Interoperability notes: references/interoperability.md
  • Examples: references/examples.md
  • Runtime notes and current limitations: references/implementation-notes.md

Related skills

How it compares

Choose sdf for SDFormat simulator models; use the sibling urdf skill when the target artifact is a URDF description instead.

FAQ

Should I edit the `.sdf` XML directly or the Python generator?

Edit the Python `gen_sdf()` source as the source of truth. Treat `.sdf` files as generated artifacts unless you are doing one-off XML fixes for validation testing.

What units should I use in SDFormat?

SI units (meters, kilograms, seconds, radians) unless your target simulator explicitly requires otherwise. Always document assumptions.

How do I validate my SDF before sending to a simulator?

Run bundled validation via `python scripts/sdf`, optionally enable `gz sdf --check auto`, and test simulator load and joint motion. Report all checks run and any skipped.

Is Sdf safe to install?

skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.