agentleFS
gugu-2gugu-2/Prompt-CAD/skills/sdf/SKILL.md

sdf

Skill2 starsChanged 6 months agoMITView on GitHub

SDFormat/SDF model and world generation, validation, and simulator handoff. Use for `.sdf` files, SDFormat XML, Python `gen_sdf()` sources, models, worlds, links, joints, poses, frames, inertials, visual/collision geometry, mesh URIs, sensors, lights, physics, plugins, includes, Gazebo, CAD Explorer static SDF review, or simulator-specific metadata. Do not use for signed-distance-field geometry.

3 other projects use a version of this, 3 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 5 are common, 6 are distinctive, and 6 are very specific to this project.

  • 5

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when the deliverable is an SDFormat document or a Python gen_sdf() source.

    line 8
  2. Very specific:

    Treat the Python file defining gen_sdf() as source of truth.

    line 14
  3. Common:

    Use SI units unless the target explicitly requires otherwise: meters, kilograms, seconds, radians.

    line 17
  4. Very specific:

    Prefer version="1.12" for new outputs unless the target consumer constrains the version.

    line 18
  5. Common:

    Do not infer spatial transforms from visual impression alone.

    line 20
  6. Distinctive:

    Prefer helper functions and named constants over large XML string literals.

    line 21
  7. Very specific:

    After generation, run available checks: bundled validation, optional gz sdf --check, simulator load, joint motion, plugin/sensor startup, …

    line 24
  8. Common:

    Use this skill for SDFormat outputs and generators.

    line 29
  9. Distinctive:

    Read or create the design ledger.

    line 34
  10. Very specific:

    Read references/frame-semantics.md before editing any <pose>, <frame>, joint axis, relative_to, expressed_in, nested scope, sensor frame, …

    line 35
  11. Distinctive:

    Use optional builder helpers when they make the generated structure clearer.

    line 37
  12. Distinctive:

    Treat bundled validation as a guardrail, not simulator proof.

    line 39
  13. Common:

    Run target-consumer smoke tests when available.

    line 40
  14. Very specific:

    After creating or modifying .sdf output, always hand the explicit generated path to $render when available.

    line 41
  15. Distinctive:

    Run with the project or workspace Python environment.

    line 47
  16. Distinctive:

    If the runtime supports optional external checking:

    line 57
  17. Common:

    When finishing an SDF task, include a compact report:

    line 69

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SDF

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, plugin/sensor startup, and $render handoff when available.
  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.

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. After creating or modifying .sdf output, always hand the explicit generated path to $render when available; $render checks/reuses a live viewer and returns a link. CAD Explorer does not execute SDF plugins or read file-authored motion metadata.
  10. For visual feedback during generation review, prefer $render snapshots over opening the viewer manually or using Playwright. Use still snapshots only; SDF review should not generate GIFs.
  11. Report checks run, checks skipped, and assumptions.

Commands

Run with the project or workspace Python environment.

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
- visual review: render viewer link returned; snapshot run/skipped
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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.