
Sdf
Generate SDFormat robot and simulator models from Python, validate them, and pass outputs to a CAD viewer skill when you are building robotics or simulation tooling with an agent.
Install
npx skills add https://github.com/earthtojake/text-to-cad --skill sdfWhat is this skill?
- Generates and updates SDFormat (SDF) robot and simulator models from Python sources.
- Validates SDF output against SDFormat expectations before use in simulators.
- Optional builder helpers reduce common LLM mistakes in XML construction without replacing libsdformat.
- Default workflow hands generated SDFs to $cad-viewer when that skill is available.
- MIT-licensed skill with explicit interface prompt for agent orchestration.
Adoption & trust: 1.7k installs on skills.sh; 5.8k GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Journey fit
Canonical shelf is Build → integrations because the skill wires Python sources into SDFormat XML and validation as part of product construction, not launch or ops monitoring. Integrations fits reading/writing structured model artifacts and optional handoff to $cad-viewer rather than pure UI or PM docs.
Common Questions / FAQ
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.
SKILL.md
READMESKILL.md - Sdf
interface: display_name: "SDF" short_description: "Generate and validate SDFormat robot models." default_prompt: "Use $sdf to generate, update, and validate SDFormat/SDF robot or simulator models from Python sources, handing generated SDFs to $cad-viewer when available." MIT License Copyright (c) 2026 earthtojake Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # SDF builder helpers Builder helpers are optional. They exist to reduce common LLM mistakes in XML construction, not to replace SDFormat or libsdformat. ## Why helpers exist LLMs often make these mistakes when writing raw XML: - wrong pose value length; - hidden degree/radian conversion; - missing `relative_to` or `expressed_in`; - zero or non-finite joint axes; - negative primitive dimensions; - mesh scale applied inconsistently; - inertial values copied from visuals; - plugin filenames invented from plausible names. Helpers should make the common path explicit, typed-ish, and auditable while still returning ordinary `xml.etree.ElementTree.Element` nodes. ## Design constraints - Standard library only. - No mandatory Gazebo, ROS, NumPy, lxml, CAD, or mesh dependency. - Return ElementTree elements. - Compose with raw ElementTree calls. - Validate local numeric shape and finiteness. - Do not attempt full SDFormat schema validation. - Do not silently invent frames, axes, inertials, plugins, or sensor parameters. ## Recommended helper surface Names may vary to match the current runtime package, but the helper surface should stay small. ```python # XML basics text(parent, tag, value, attrib=None) fmt_float(value) fmt_vector(values) # Poses and axes pose(parent, xyz=(0, 0, 0), rpy=(0, 0, 0), *, relative_to=None, rotation_format="euler_rpy", degrees=False) quat_pose(parent, xyz=(0, 0, 0), quat_xyzw=(0, 0, 0, 1), *, relative_to=None) axis(parent, xyz=(0, 0, 1), *, expressed_in=None) # Document structure sdf_root(version="1.12") world(parent, name) model(parent, name, *, static=None, pose=None) frame(parent, name, *, attached_to=None, pose=None) link(parent, name, *, pose=None, inertial=None) joint(parent, name, joint_type, parent_link, child_link, *, pose=None, axis_xyz=None, axis_expressed_in=None, axis2_xyz=None, limits=None) # Geometry visual(parent, name, *, pose=None) collision(parent, name, *, pose=None) box(parent, size_xyz) sphere(parent, radius) cylinder(parent, radius, length) capsule(parent, radius, length) mesh(parent, uri, *, scale=None) # Physics and metadata inertial(parent, mass, inertia, *, pose=None) sensor(parent, name, sensor_type, *, pose=None, topic=None, update_rate=None) plugin(parent, name, filename, params=None) include(parent, uri, *, name=None, pose=None) ``` ## Numeric behavior Helpers should reject: - non-finite numbers; - vectors with the wrong length; - negative or zero primitive dimensions; - zero joint axes; - zero-mass inertials; - zero-norm quaternions. Helpers may warn, but should not silently fix: - non-unit axes; - non-normalized quaternions;