home / skills / tomkrikorian / visionosagents / usd-editor

usd-editor skill

/skills/usd-editor

This skill guides safe, minimal edits to USD ASCII files, helping you preserve stage structure and correct specifiers during hand edits.

npx playbooks add skill tomkrikorian/visionosagents --skill usd-editor

Review the files below or copy the command above to add this skill to your agents.

Files (14)
SKILL.md
5.0 KB
---
name: usd-editor
description: Guide for modifying USD ASCII (.usda) files, including prims, properties, composition arcs, variants, and transforms. Use when editing or reviewing .usda files by hand.
---

# USD Editor

## Description and Goals

This skill guides safe, minimal edits to USD ASCII (.usda) files and the proper use of USD command-line tools. It focuses on preserving stage structure, using correct specifiers and property types, and avoiding composition mistakes while making targeted changes.

### Goals

- Make precise edits without disrupting existing USD composition
- Preserve file formatting and authoring style
- Use correct prim specifiers, property types, and relationships
- Avoid common USD pitfalls (wrong paths, missing xformOpOrder, broken connections)
- Guide safe manipulation and inspection of USD assets using the command-line tools

## What This Skill Should Do

When asked to modify a .usda file, this skill should:

1. **Inspect the stage structure** - Identify root prims, scopes, and relevant paths.
2. **Choose the correct specifier** - Use `over` for edits to existing prims, `def` for new prims.
3. **Edit only what is necessary** - Preserve unrelated content and formatting.
4. **Respect composition** - Avoid changing subLayers, references, or variants unless asked.
5. **Validate connections and paths** - Ensure `SdfPath` targets are valid and type-compatible.

If the change is material- or shader-related for RealityKit, prefer the `shadergraph-editor` skill for node-specific guidance.

### Quick Start Workflow

1. Locate the prim path you need to edit (search by prim name or `SdfPath`).
2. Determine whether you should `over` an existing prim or `def` a new one.
3. Apply the smallest possible change (attribute value, relationship target, or child prim).
4. If adding transforms, update `xformOpOrder` to match your new ops.
5. Re-check any paths or connections you touched.

## Information About the Skill

### Core Concepts

#### Stage and Layer
A USD stage is composed of one or more layers. A .usda file is a single ASCII layer that can sublayer or reference others.

#### Prim and Specifier
A prim is a scene graph node. Specifiers control behavior: `def` creates, `over` modifies, `class` defines a reusable template.

#### Properties
Attributes store typed data; relationships (`rel`) point to other prims.

#### Composition Arc
Mechanisms like sublayers, references, and payloads that bring other USD data into the stage.

#### SdfPath
A path to a prim or property, written like `</Root/Child>` or `</Root/Mat.outputs:surface>`.

#### List Editing
USD list ops (`prepend`, `append`, `delete`, `add`) modify lists without replacing them.

#### Variants
Variant sets provide alternative content branches for a prim.

#### Time Samples
Animated or time-varying data stored in `timeSamples` dictionaries.

### Reference Tables

| Reference | When to Use |
|-----------|-------------|
| [`usd-syntax`](references/usd-syntax.md) | When you need a refresher on .usda syntax, values, and path formats. |
| [`prims-properties`](references/prims-properties.md) | When adding or editing prims, attributes, or relationships. |
| [`composition-variants`](references/composition-variants.md) | When touching sublayers, references, payloads, or variant sets. |
| [`transforms-units`](references/transforms-units.md) | When editing transforms, xformOps, or stage units/up axis metadata. |
| [`time-samples`](references/time-samples.md) | When modifying animated/time-sampled properties. |
| [`command-line-tools`](references/command-line-tools.md) | When you need a quick reference for common USD command-line tools. |
| [`usdcat`](references/usdcat.md) | When converting, flattening, or inspecting USD files. |
| [`usdchecker`](references/usdchecker.md) | When validating USD or USDZ assets, including RealityKit-focused checks. |
| [`usdrecord`](references/usdrecord.md) | When rendering images from USD files. |
| [`usdtree`](references/usdtree.md) | When inspecting the prim hierarchy of a USD file. |
| [`usdzip`](references/usdzip.md) | When creating or inspecting USDZ packages. |
| [`usdcrush`](references/usdcrush.md) | When compressing USD or USDZ assets for size. |
| [`usdextract`](references/usdextract.md) | When extracting files from USD-compatible packages. |

### Implementation Patterns

#### Override an Existing Prim

```usda
over "Mesh"
{
    token visibility = "invisible"
}
```

#### Add a Simple Xform with Translate

```usda
def Xform "Pivot"
{
    double3 xformOp:translate = (0.0, 0.1, 0.0)
    uniform token[] xformOpOrder = ["xformOp:translate"]
}
```

#### Bind a Material Relationship

```usda
rel material:binding = </Materials/Mat>
```

### Pitfalls and Checks

- Don't replace a prim with `def` when you only need an `over`.
- Keep `xformOpOrder` consistent with the ops you add or remove.
- Verify `SdfPath` targets exist and match the expected property type.
- Avoid editing composition arcs unless explicitly requested.
- Preserve existing formatting and comments to minimize diff noise.

Overview

This skill guides safe, minimal edits to USD ASCII (.usda) files, focusing on preserving stage composition and authoring style. It helps you choose correct prim specifiers, update attributes, and validate paths and connections. Use it to make targeted changes while avoiding common USD pitfalls.

How this skill works

The skill inspects the stage structure to locate root prims, scopes, and exact SdfPaths you plan to edit. It recommends whether to use "over" for existing prims or "def" for new ones, and shows minimal edit patterns for attributes, relationships, transforms, variants, and list ops. It also suggests checks for xformOpOrder, timeSamples, and reference/variant composition so changes remain composition-safe.

When to use it

  • Editing attribute values or relationship targets by hand in a .usda file
  • Adding a small child prim or transform without altering composition arcs
  • Fixing incorrect SdfPath targets or broken connections
  • Making non-destructive overrides to existing prims
  • Reviewing a .usda by hand before committing changes to a repo

Best practices

  • Inspect stage and layer composition first; identify sublayers, references, and payloads before editing
  • Prefer minimal edits: change attribute values or add a small over/def block instead of replacing sections
  • Use 'over' for modifying existing prims and 'def' only for new prims or classes
  • Update xformOpOrder whenever you add or remove xform ops to keep transform evaluation correct
  • Validate SdfPath targets and types after edits to avoid invalid connections or type mismatches
  • Avoid touching subLayers, references, or variants unless explicitly required

Example use cases

  • Make an attribute value change (visibility, translate) using an over block to minimize diff noise
  • Add a small Xform child with translate and corresponding xformOpOrder entry
  • Bind a material relationship by setting rel material:binding to a valid SdfPath
  • Fix a broken connection by correcting a relationship target path and verifying the target prim exists
  • Inspect a stage with usdtree/usdcat guidance before performing manual edits

FAQ

Should I ever replace an existing prim with def?

No — replacing an existing prim with def can break composition. Use over to modify an existing prim and def only for new prims or classes.

How do I handle xform changes?

Add or remove xform ops and then update uniform token[] xformOpOrder to list the ops in evaluation order so transforms remain consistent.