Generated banner for Omniverse Cad To Simready
Generated logo for Omniverse Cad To Simready

Omniverse Cad To Simready

NVIDIAOfficialCreated by OmniverseDistributed by NVIDIA

  • Skill
  • Workflow
  • Software development
  • Apache-2.0
  • Medium risk
  • Has scripts

From the author

Coordinate the end-to-end CAD/source-asset to SimReady workflow. Use for broad requests such as CAD to SimReady, source asset to simulation-ready USD, or prop packaging that require conversion, material/physics assignment, SimReady conformance, validation, and optional package creation; deploy or verify Content Agents services first when property assignment is enabled; route single-stage work through nested references.
— the description by Omniverse

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill acts as an orchestrator for the CAD to SimReady pipeline, coordinating a series of specialized stages including asset conversion, material and physics assignment via Content Agents, validation, and final packaging. It is designed to manage the flow between discrete tools rather than replacing them, ensuring that assets meet specific simulation requirements through a structured, documentation-driven process.

What it does

  • Coordinates end-to-end conversion from source CAD or mesh assets to SimReady USD.
  • Manages property assignment for materials and physics using Content Agents.
  • Performs multi-stage validation gates to ensure asset viability and conformance.
  • Automates the assembly of deliverable packages including thumbnails and USD dependencies.
  • Provides consolidated reporting on workflow status, validation findings, and stage outputs.
  • Supports flexible execution modes including conversion-only and validation-only paths.

When to use it

  • When you need to transform raw CAD or source assets into simulation-ready USD files.
  • When you require automated material and physics assignment for 3D assets.
  • When you need to validate assets against SimReady conformance profiles.
  • When you are preparing assets for packaging and distribution in a simulation environment.

Advantages

  • Provides a structured, repeatable pipeline for complex asset preparation.
  • Integrates multiple specialized stages into a cohesive workflow.
  • Ensures consistent validation and conformance across the asset lifecycle.
  • Supports modular execution by allowing specific stages to be skipped or isolated.

Usage examples

“Convert my CAD file at /path/to/model.step to a SimReady asset.”
The agent will initiate the preflight check, convert the file to USD, apply material and physics properties, validate the result, and output a report.
“Validate this existing USD file for SimReady conformance.”
The agent will run the validation-only workflow, checking the provided USD against SimReady profiles and reporting any findings.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/omniverse-cad-to-simready/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip omniverse-cad-to-simready.zip -d .agents/skills

Documentation by Omniverse

CAD to SimReady

When to Use

Use this workflow skill for an end-to-end pipeline from a source asset to a SimReady asset or package. It coordinates existing conversion, authoring, validation, conformance, rendering, and packaging references directly; do not replace it with a single monolithic runner command.

This skill is documentation-driven and does not ship scripts/run.py; it must not depend on a repository checkout. Shell is declared because this workflow invokes installed stage reference scripts directly, from each reference's installed directory, and it still must not grow a monolithic runner.

Prerequisites

  • Prefer preflight first for deterministic setup: it installs/verifies local upstream checkouts, writes a cad-to-simready-preflight.json manifest, and exports PHYSICAL_AI_PREFLIGHT_MANIFEST plus PHYSICAL_AI_REQUIRE_PREFLIGHT=1 for downstream references.

  • Python 3.12 and uv (per repo README.md).

  • A Content Agents model provider key when local deployment will run, or explicit endpoint variables plus usage tokens for already-running endpoints; see references/preflight/README.md for the full list.

  • Docker, NVIDIA Container Toolkit, and an NVIDIA GPU for Content Agents and OVRTX stages.

  • Local upstream checkouts under ${OMNIVERSE_CAD_TO_SIMREADY_UPSTREAM_ROOT:-$HOME/.omniverse-cad-to-simready/upstreams} when a stage needs upstream scripts or specs.

First Action

For any broad CAD/source-asset to SimReady request, assume property_assignment_intent=run unless the user explicitly asks for conversion-only, validation-only, or no material/physics assignment. For conversion-only requests, set property_assignment_intent=skip, do not deploy Content Agents, run convert-to-usd, then run validate-usd-minimum on the generated USD if conversion succeeds. For validation-only requests, set property_assignment_intent=skip and validate the USD the user provided without rerunning conversion.

Run preflight (or verify an existing PHYSICAL_AI_PREFLIGHT_MANIFEST) before any converter, validation, Content Agents, OVRTX, packaging, or FET step; treat it as dependency bootstrap, not workflow routing. Use --skip-content-agents for conversion-only/validation-only requests.

When property_assignment_intent=run, verify or deploy Content Agents services immediately after confirming the source path and resolving intent, before asset-context inspection, converter dependency checks, conversion, validation, conformance, rendering, packaging, or upstream source builds. Treat explicitly provided healthy endpoints as user-owned; otherwise run deploy-content-agents, which deploys the shared standalone OVRTX renderer, then Material, Physics, and optional Texture service containers in order.

Instructions

  1. Confirm the source asset path exists, resolve output_root, and classify the request as end-to-end, conversion-only, validation-only, or packaging.

  2. Resolve property_assignment_intent before running any asset inspection, converter probe, conversion, validation, conformance, rendering, or packaging step.

  3. Run preflight for the selected workflow targets, unless a ready PHYSICAL_AI_PREFLIGHT_MANIFEST is already configured. Source the generated env file before running downstream scripts. Treat preflight as dependency setup only: it may use a provided --source-asset, --source-format, or --conversion-tools value to scope dependency checks, but convert-to-usd and the upstream converter references still decide actual conversion support.

  4. Verify or deploy Content Agents services first when property_assignment_intent=run; block on missing authentication or unhealthy services instead of continuing.

  5. Read references/workflow.md and references/commands.md, then run only the stage references needed for the current request.

  6. Run identify-asset-context on the original source asset when web search is available or property assignment will run.

  7. Route the source through convert-to-usd, or skip conversion for existing USD input and treat the source path as the current USD path.

  8. Run validate-usd-minimum before expensive downstream work. Treat this as a viability gate only: record unit/profile issues such as metersPerUnit != 1.0, but do not run simready-conform-profile, FET001, or any other FET repair before Content Agents assignment when property assignment will run.

  9. Run Content Agents material, physics, and optional texture assignment on the converted/minimum-valid USD when requested or required.

  10. Run simready-conform-profile on the latest simulation USD path after property assignment and preserve every selected FET repair report.

  11. Run validation gates in order: omni-asset-validate, omni-asset-validate-geometry, omni-asset-validate-physics, and simready-validate.

  12. Rerun simready-conform-profile when simready-validate reports a repairable requirement, then rerun profile validation on the newest authored USD.

  13. Run ovrtx-render-service when preview, thumbnail, or inspection images are requested. When package outputs are requested, run assemble-package-source next to create the clean deliverable/ package source from the final USD and thumbnail, then run nv-core-package-sample and nv-core-package-sample-validation on that deliverable folder only.

  14. Emit the consolidated workflow report with the final USD path, all stage reports, validation findings, rerun reasons, and next work.

Output Format

Emit a consolidated workflow report in Markdown, and include JSON when the workflow writes structured artifacts. Report overall status as passed, blocked, failed, or needs_rerun. See references/workflow.md for the required Markdown and JSON report fields.

Detailed References

Read only the references needed for the current request:

  • references/preflight/README.md: deterministic local setup, manifest/env contract, wrappers, deployment opt-out, and guardrail behavior.

  • references/workflow.md: inputs, source routing, detailed workflow, validation policy, output report fields, and next steps.

  • references/commands.md: concrete portable script command patterns.

  • references/assemble-package-source/README.md: two-zone package source assembly, root USD naming, thumbnail placement, and deliverable checks.

  • references/troubleshooting.md: symptom/cause/fix table plus FET (GSP.001/RB.MB.001) repair-routing detail.

  • references/publishing-layout.md: frontmatter compatibility-field notes and layout rationale for this skill's own file tree.

Publishing Layout Notes

Use skills/omniverse-cad-to-simready/ as the source of truth for this product repo's skill. The .agents/skills symlink is a compatibility alias for local agentskills.io-style discovery, and the nested references/ tree is intentional. See references/publishing-layout.md for the alias list, frontmatter field placement, and flattening rules.

Limitations

  • This workflow coordinates existing conversion, property assignment, conformance, validation, rendering, and packaging skills; it does not replace them with a single monolithic runner command.

Troubleshooting

Read references/troubleshooting.md only when a specific stage or validation gate is failing; it owns the symptom/cause/fix table and FET repair routing.

Hard Rules

  • Prefer the preflight manifest for local upstream roots, converter executables, SimReady validation runtime, OVRTX endpoint, and Content Agents service URLs. When PHYSICAL_AI_REQUIRE_PREFLIGHT=1 is set, do not bypass the manifest with direct upstream discovery.

  • Do not run asset inspection, converter probes, local upstream builds, conversion, validation, conformance, rendering, or packaging before Content Agents readiness when property assignment will run.

  • Use stage-specific installed reference scripts directly. Do not add or call a single omniverse-cad-to-simready runner command.

  • For source conversion, delegate to the convert-to-usd reference; do not substitute another converter for CAD or mesh formats.

  • For property assignment, use Content Agents references as separate atomic steps: material first, then physics, then texture only when requested.

  • When property assignment will run, do not run simready-conform-profile or any FET helper before Content Agents. Validate minimum USD first, then run Content Agents on that converted/minimum-valid USD, then apply FET repairs to the latest service-authored USD.

  • When property assignment will run, do not run simready-validate or any SimReady profile validation before Content Agents. The only validation gate allowed before service calls is validate-usd-minimum, which is a basic USD viability check.

  • Stop at the first failing deployment, conversion, property-assignment, or conformance authoring gate unless the user explicitly asks for best-effort continuation.

  • Do not stop at validation findings after a meaningful USD artifact exists. Continue remaining diagnostic gates and mark the result needs_rerun.

  • Do not leave a GSP.001 profile failure as an unclassified final finding. Route it to upstream simready-foundation-conform-fet-005-simulate-grasp-physics; if the current agent cannot inspect renders or no explicit grasp points are available, report a blocked FET005 repair with the visual evidence path or missing input reason.

  • Preserve every stage report and pass the concrete output USD path from each report into the next stage.

Files

references/simready-validate/scripts/run.py

#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

from __future__ import annotations

import argparse
import json
import os
from pathlib import Path
import re
import shutil
import subprocess
import sys
import tempfile
from typing import Any
from urllib.parse import urlparse

sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "shared"))

from script_utils import emit_json_report
from upstream_versions import (
    UPSTREAM_VERSION_MANIFEST_PATH,
    expected_versions,
    git_upstreams,
    runtime_package_names,
    runtime_requirements,
    version_mismatches,
    version_probe_code,
)

from preflight_manifest import (
    load_preflight_manifest,
    manifest_path_value,
    preflight_required,
    preflight_status_check,
    ready_executable_from_runtime,
    ready_path_from_runtime,
    ready_path_from_upstream,
    runtime_entry,
)


SKILL = "simready-validate"
TOOL = "simready-validate"
DEFAULT_PROFILE = "Prop-Robotics-Neutral"
DEFAULT_PROFILE_VERSION = "1.0.0"
DEFAULT_UPSTREAM_ROOT = Path.home() / ".omniverse-cad-to-simready" / "upstreams"
DEFAULT_FOUNDATION_REPO_URL = "https://github.com/NVIDIA/simready-foundation"
DEFAULT_FOUNDATION_BRANCH = git_upstreams()["simready_foundation"]["ref"]
NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT = "RB.MB.001"
SIMREADY_RUNTIME_REQUIREMENTS = runtime_requirements("simready_validate")
SIMREADY_NO_DEPS_REQUIREMENTS = runtime_requirements("simready_validate", no_deps=True)
SIMREADY_RUNTIME_PACKAGE_NAMES = (
    *runtime_package_names("simready_validate"),
    *runtime_package_names("simready_validate", no_deps=True),
)


def _checkout_name_from_repo_url(repo_url: str) -> str:
    name = urlparse(repo_url).path.rstrip("/").rsplit("/", 1)[-1]
    if name.endswith(".git"):
        name = name[:-4]
    return name


DEFAULT_FOUNDATION_CHECKOUT = _checkout_name_from_repo_url(DEFAULT_FOUNDATION_REPO_URL)


def _empty_counts() -> dict[str, int]:
    return {"ERROR": 0, "FAILURE": 0, "WARNING": 0, "INFO": 0}


def _empty_topology(reason: str | None = None) -> dict[str, Any]:
    return {
        "inspected": False,
        "reason": reason,
        "default_prim_path": None,
        "mesh_count": 0,
        "geom_subset_count": 0,
        "mesh_with_geom_subset_count": 0,
        "component_count": None,
        "single_prim_or_geomsubset": False,
    }


def _inspect_asset_topology(asset_path: Path) -> dict[str, Any]:
    try:
        from pxr import Usd, UsdGeom
    except Exception as exc:
        return _empty_topology(f"OpenUSD Python APIs are unavailable: {exc}")

    try:
        stage = Usd.Stage.Open(str(asset_path))
    except Exception as exc:
        return _empty_topology(f"Could not open USD stage: {exc}")
    if stage is None:
        return _empty_topology("Could not open USD stage")

    default_prim = stage.GetDefaultPrim()
    root = default_prim if default_prim and default_prim.IsValid() else stage.GetPseudoRoot()
    mesh_count = 0
    geom_subset_count = 0
    mesh_paths_with_subsets: set[str] = set()
    for prim in Usd.PrimRange(root):
        if not prim.IsActive():
            continue
        if prim.IsA(UsdGeom.Mesh):
            mesh_count += 1
        is_geom_subset = prim.GetTypeName() == "GeomSubset"
        try:
            is_geom_subset = is_geom_subset or bool(UsdGeom.Subset(prim))
        except Exception:
            pass
        if is_geom_subset:
            geom_subset_count += 1
            parent = prim.GetParent()
            if parent and parent.IsA(UsdGeom.Mesh):
                mesh_paths_with_subsets.add(str(parent.GetPath()))

    component_count = 0
    if mesh_count == 1:
        component_count = max(geom_subset_count, 1)
    elif mesh_count > 1:
        component_count = mesh_count

    return {
        "inspected": True,
        "reason": None,
        "default_prim_path": str(default_prim.GetPath()) if default_prim and default_prim.IsValid() else None,
        "mesh_count": mesh_count,
        "geom_subset_count": geom_subset_count,
        "mesh_with_geom_subset_count": len(mesh_paths_with_subsets),
        "component_count": component_count,
        "single_prim_or_geomsubset": component_count == 1,
    }


def _issue_requirement_id(issue: dict[str, Any]) -> str | None:
    for key in ("requirement_id", "requirement"):
        value = issue.get(key)
        if value:
            return str(value)
    text = str(issue.get("message", ""))
    match = re.search(r"\b[A-Z]+(?:\.[A-Z]+)*\.\d+\b", text)
    return match.group(0) if match else None


def _recount_issues(issues: list[dict[str, Any]]) -> dict[str, int]:
    issue_counts = _empty_counts()
    for issue in issues:
        severity = str(issue.get("severity", "INFO")).upper()
        issue_counts[severity] = issue_counts.get(severity, 0) + 1
    return issue_counts


def _issue_messages(issues: list[dict[str, Any]], severities: set[str]) -> list[str]:
    return [
        str(issue.get("message", issue))
        for issue in issues
        if str(issue.get("severity", "")).upper() in severities
    ]


def _apply_single_component_rbmb001_policy(report: dict[str, Any], asset_path: Path) -> dict[str, Any]:
    topology = _inspect_asset_topology(asset_path)
    issues = [issue for issue in report.get("issues", []) if isinstance(issue, dict)]
    ignored_issues: list[dict[str, Any]] = []
    remaining_issues: list[dict[str, Any]] = []
    can_ignore_rbmb001 = bool(topology.get("single_prim_or_geomsubset"))

    for issue in issues:
        if can_ignore_rbmb001 and _issue_requirement_id(issue) == NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT:
            ignored = dict(issue)
            ignored["nonblocking_reason"] = (
                f"{NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT} is non-blocking for assets with a single mesh "
                "component or a single GeomSubset component."
            )
            ignored_issues.append(ignored)
        else:
            remaining_issues.append(issue)

    ignored_requirements = sorted(
        {
            str(_issue_requirement_id(issue))
            for issue in ignored_issues
            if _issue_requirement_id(issue)
        }
    )
    report["asset_topology"] = topology
    report["ignored_issues"] = ignored_issues
    report["validation_policy"] = {
        "single_component_rb_mb_001_nonblocking": can_ignore_rbmb001,
        "ignored_requirements": ignored_requirements,
    }

    if not ignored_issues:
        return report

    report["issues"] = remaining_issues
    report["issue_counts"] = _recount_issues(remaining_issues)
    requirement_counts = dict(report.get("requirement_counts", {}))
    for requirement_id in ignored_requirements:
        requirement_counts.pop(requirement_id, None)
    report["requirement_counts"] = requirement_counts

    for feature in report.get("feature_results", []):
        if not isinstance(feature, dict):
            continue
        failing_requirements = _parse_failing_requirements(feature.get("failing_requirements"))
        if NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT not in failing_requirements:
            continue
        remaining = [
            requirement
            for requirement in failing_requirements
            if requirement != NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT
        ]
        feature["failing_requirements"] = remaining
        ignored = _parse_failing_requirements(feature.get("ignored_requirements"))
        if NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT not in ignored:
            ignored.append(NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT)
        feature["ignored_requirements"] = ignored
        if not remaining:
            feature["passed"] = True

    errors = _issue_messages(remaining_issues, {"ERROR", "FAILURE"})
    warnings = _issue_messages(remaining_issues, {"WARNING"})
    warnings.append(
        f"Ignored non-blocking {NONBLOCKING_SINGLE_COMPONENT_REQUIREMENT} for single-component asset topology "
        f"(mesh_count={topology.get('mesh_count')}, geom_subset_count={topology.get('geom_subset_count')})."
    )
    passed = not errors
    report["errors"] = errors
    report["warnings"] = warnings
    report["passed"] = passed
    report["status"] = "PASS" if passed else "FAIL"
    if passed:
        for profile_result in report.get("profile_results", []):
            if isinstance(profile_result, dict):
                profile_result["passed"] = True
    report["next_step"] = "simready-profile-validation-complete" if passed else "simready-conform-profile"
    return report


def _blocked_report(asset_path: Path | None, command: list[str], profile: str, profile_version: str, error: str) -> dict[str, Any]:
    return {
        "asset_path": str(asset_path.resolve()) if asset_path else "",
        "validator_skill": SKILL,
        "validator_tool": TOOL,
        "passed": False,
        "status": "BLOCKED",
        "profile_name": profile,
        "profile_target": {"name": profile, "version": profile_version},
        "command": command,
        "available_profiles": [],
        "profile_results": [],
        "feature_results": [],
        "requirement_counts": {},
        "issue_counts": _empty_counts(),
        "issues": [],
        "warnings": [],
        "errors": [error],
        "next_step": "fix-simready-profile-validation",
    }


def _normalize_report(
    asset_path: Path,
    command: list[str],
    profile: str,
    profile_version: str,
    payload: dict[str, Any],
    completed: subprocess.CompletedProcess[str],
) -> dict[str, Any]:
    issues = payload.get("issues", [])
    if not isinstance(issues, list):
        issues = []
    issue_counts = _empty_counts()
    for issue in issues:
        if not isinstance(issue, dict):
            continue
        severity = str(issue.get("severity", "INFO")).upper()
        issue_counts[severity] = issue_counts.get(severity, 0) + 1
    errors = [
        str(issue.get("message", issue))
        for issue in issues
        if isinstance(issue, dict) and str(issue.get("severity", "")).upper() in {"ERROR", "FAILURE"}
    ]
    if completed.returncode != 0 and not errors:
        errors.append(completed.stderr.strip() or completed.stdout.strip() or f"{TOOL} exited with {completed.returncode}")
    warnings = [
        str(issue.get("message", issue))
        for issue in issues
        if isinstance(issue, dict) and str(issue.get("severity", "")).upper() == "WARNING"
    ]
    status = str(payload.get("status", "PASS" if not errors else "FAIL")).upper()
    report = {
        "asset_path": str(asset_path.resolve()),
        "validator_skill": SKILL,
        "validator_tool": TOOL,
        "passed": not errors,
        "status": "PASS" if not errors else status,
        "profile_name": str(payload.get("profile_name", profile)),
        "profile_target": payload.get("profile_target", {"name": profile, "version": profile_version}),
        "command": command,
        "available_profiles": payload.get("available_profiles", []),
        "profile_results": payload.get("profile_results", []),
        "feature_results": payload.get("feature_results", []),
        "requirement_counts": payload.get("requirement_counts", {}),
        "issue_counts": issue_counts,
        "issues": issues,
        "warnings": warnings,
        "errors": errors,
        "next_step": payload.get("next_step", "simready-conform-profile" if errors else "simready-profile-validation-complete"),
    }
    return _apply_single_component_rbmb001_policy(report, asset_path)


def _runtime_venv_dir() -> Path:
    override = os.environ.get("PHYSICAL_AI_SIMREADY_VALIDATE_VENV")
    if override:
        return Path(override).expanduser().resolve()
    manifest, _, _ = load_preflight_manifest()
    venv_dir = manifest_path_value(runtime_entry(manifest, "simready_validate"), "venv")
    if venv_dir is not None:
        return venv_dir
    cache_home = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache")).expanduser()
    return (cache_home / "omniverse-cad-to-simready" / "simready-validate-venv").resolve()


def _venv_bin_dir(venv_dir: Path) -> Path:
    return venv_dir / ("Scripts" if os.name == "nt" else "bin")


def _venv_python(venv_dir: Path) -> Path:
    return _venv_bin_dir(venv_dir) / ("python.exe" if os.name == "nt" else "python")


def _venv_executable(venv_dir: Path) -> Path:
    suffix = ".exe" if os.name == "nt" else ""
    return _venv_bin_dir(venv_dir) / f"{TOOL}{suffix}"


def _runtime_dependencies_ready(python: Path) -> bool:
    return _runtime_version_error(python) is None


def _runtime_version_error(python: Path) -> str | None:
    code = (
        "import numpy; import omni.asset_validator; from pxr import Usd; "
        + version_probe_code(SIMREADY_RUNTIME_PACKAGE_NAMES)
    )
    completed = subprocess.run(
        [str(python), "-c", code],
        capture_output=True,
        text=True,
        timeout=120,
        check=False,
    )
    if completed.returncode != 0:
        return completed.stderr.strip() or completed.stdout.strip() or f"version probe exited {completed.returncode}"
    try:
        installed = json.loads(completed.stdout.strip().splitlines()[-1])
    except (IndexError, json.JSONDecodeError) as exc:
        return f"version probe did not return JSON: {exc}"
    mismatches = version_mismatches(expected_versions(SIMREADY_RUNTIME_PACKAGE_NAMES), installed)
    return "; ".join(mismatches) if mismatches else None


def _foundation_requirements_path(root: Path) -> Path:
    candidates = [
        root / "requirements.txt",
        root / "nv_core" / "validator_sample" / "requirements.txt",
    ]
    return next((path for path in candidates if path.is_file()), candidates[0])


def _run_pip_install(python: Path, args: list[str], *, timeout: int = 900) -> subprocess.CompletedProcess[str]:
    return subprocess.run(
        [str(python), "-m", "pip", "install", "--disable-pip-version-check", *args],
        capture_output=True,
        text=True,
        timeout=timeout,
        check=False,
    )


def _install_cli_with_locked_runtime(python: Path, executable: Path) -> str | None:
    runtime_install = _run_pip_install(python, list(SIMREADY_RUNTIME_REQUIREMENTS))
    if runtime_install.returncode != 0:
        detail = runtime_install.stderr.strip() or runtime_install.stdout.strip()
        return f"Failed to install pinned SimReady runtime from {UPSTREAM_VERSION_MANIFEST_PATH}: {detail}"

    simready_install = _run_pip_install(python, ["--no-deps", *SIMREADY_NO_DEPS_REQUIREMENTS])
    if simready_install.returncode != 0:
        detail = simready_install.stderr.strip() or simready_install.stdout.strip()
        return f"Failed to install pinned {TOOL} runtime: {detail}"
    if not executable.is_file():
        return f"Installed pinned SimReady runtime, but {executable} was not created"
    version_error = _runtime_version_error(python)
    if version_error:
        return f"Pinned SimReady runtime verification failed: {version_error}"
    return None


def _install_cli_from_foundation_repo(foundation_root: Path | None) -> tuple[str | None, str | None]:
    root = foundation_root or _resolve_foundation_root(None)
    if root is None:
        return None, (
            f"{TOOL} CLI was not found on PATH, and no SimReady Foundation checkout was found at "
            f"$SIMREADY_FOUNDATION_ROOT, $OMNIVERSE_CAD_TO_SIMREADY_UPSTREAM_ROOT/{DEFAULT_FOUNDATION_CHECKOUT}, "
            f"or $HOME/.omniverse-cad-to-simready/upstreams/{DEFAULT_FOUNDATION_CHECKOUT} "
            f"checked out to {DEFAULT_FOUNDATION_BRANCH}"
        )
    requirements_path = _foundation_requirements_path(root)
    if not requirements_path.is_file():
        return None, f"{TOOL} CLI was not found on PATH, and {requirements_path} does not exist"

    venv_dir = _runtime_venv_dir()
    executable = _venv_executable(venv_dir)
    if executable.is_file() and _runtime_dependencies_ready(_venv_python(venv_dir)):
        return str(executable), None

    venv_dir.parent.mkdir(parents=True, exist_ok=True)
    create = subprocess.run(
        [sys.executable, "-m", "venv", str(venv_dir)],
        capture_output=True,
        text=True,
        timeout=300,
        check=False,
    )
    if create.returncode != 0:
        detail = create.stderr.strip() or create.stdout.strip()
        return None, f"Failed to create {TOOL} runtime venv at {venv_dir}: {detail}"

    python = _venv_python(venv_dir)
    install_error = _install_cli_with_locked_runtime(python, executable)
    if install_error:
        return None, install_error
    return str(executable), None


def _resolve_cli(foundation_root: Path | None) -> tuple[str | None, str | None]:
    manifest, _, _ = load_preflight_manifest()
    manifest_executable = ready_executable_from_runtime(manifest, "simready_validate")
    if manifest_executable is not None:
        return manifest_executable, None
    executable = shutil.which(TOOL)
    if executable is not None:
        return executable, None
    return _install_cli_from_foundation_repo(foundation_root)


def _parse_failing_requirements(value: Any) -> list[str]:
    if value is None:
        return []
    if isinstance(value, list):
        return [str(item) for item in value]
    if isinstance(value, str):
        text = value.strip()
        if not text:
            return []
        try:
            import ast

            parsed = ast.literal_eval(text)
        except Exception:
            return [text]
        if isinstance(parsed, list):
            return [str(item) for item in parsed]
        return [str(parsed)]
    return [str(value)]


def _normalize_feature_summary_report(
    asset_path: Path,
    command: list[str],
    profile: str,
    profile_version: str,
    payload: dict[str, Any],
    completed: subprocess.CompletedProcess[str],
) -> dict[str, Any]:
    entry = payload.get(str(asset_path)) or payload.get(str(asset_path.resolve()))
    if not isinstance(entry, dict) and payload:
        first_value = next(iter(payload.values()))
        entry = first_value if isinstance(first_value, dict) else {}
    if not isinstance(entry, dict):
        entry = {}

    profile_name = str(entry.get("profile_id", profile))
    resolved_profile_version = str(entry.get("profile_version", profile_version))
    feature_results: list[dict[str, Any]] = []
    issues: list[dict[str, Any]] = []
    requirement_counts: dict[str, int] = {}
    features_summary = entry.get("features_summary", {})
    if isinstance(features_summary, dict):
        for feature_id, feature_payload in features_summary.items():
            if not isinstance(feature_payload, dict):
                continue
            failing_requirements = _parse_failing_requirements(feature_payload.get("failing requirements"))
            passed = bool(feature_payload.get("passed")) and not failing_requirements
            feature_results.append(
                {
                    "feature_id": str(feature_id),
                    "version": str(feature_payload.get("version", "")),
                    "passed": passed,
                    "failing_requirements": failing_requirements,
                    "dependencies": feature_payload.get("dependencies"),
                }
            )
            for requirement_id in failing_requirements:
                requirement_counts[requirement_id] = requirement_counts.get(requirement_id, 0) + 1
                issues.append(
                    {
                        "severity": "FAILURE",
                        "feature_id": str(feature_id),
                        "requirement_id": requirement_id,
                        "message": f"{feature_id} failed requirement {requirement_id}",
                    }
                )

    issue_counts = _empty_counts()
    issue_counts["FAILURE"] = len(issues)
    errors = [str(issue["message"]) for issue in issues]
    if completed.returncode != 0 and not errors:
        errors.append(completed.stderr.strip() or completed.stdout.strip() or f"{TOOL} exited with {completed.returncode}")
    passed = not errors
    report = {
        "asset_path": str(asset_path.resolve()),
        "validator_skill": SKILL,
        "validator_tool": TOOL,
        "passed": passed,
        "status": "PASS" if passed else "FAIL",
        "profile_name": profile_name,
        "profile_target": {"name": profile_name, "version": resolved_profile_version},
        "command": command,
        "available_profiles": [],
        "profile_results": [{"profile_id": profile_name, "profile_version": resolved_profile_version, "passed": passed}],
        "feature_results": feature_results,
        "requirement_counts": requirement_counts,
        "issue_counts": issue_counts,
        "issues": issues,
        "warnings": [],
        "errors": errors,
        "next_step": "simready-profile-validation-complete" if passed else "simready-conform-profile",
    }
    return _apply_single_component_rbmb001_policy(report, asset_path)


def _normalize_runtime_payload(
    asset_path: Path,
    command: list[str],
    profile: str,
    profile_version: str,
    payload: dict[str, Any],
    completed: subprocess.CompletedProcess[str],
) -> dict[str, Any]:
    if "issues" in payload or "profile_results" in payload or "feature_results" in payload:
        return _normalize_report(asset_path, command, profile, profile_version, payload, completed)
    return _normalize_feature_summary_report(asset_path, command, profile, profile_version, payload, completed)


def _resolve_foundation_root(explicit: Path | None) -> Path | None:
    if explicit:
        return explicit
    manifest, _, _ = load_preflight_manifest()
    manifest_root = ready_path_from_runtime(manifest, "simready_validate") or ready_path_from_upstream(manifest, "simready_foundation")
    if manifest_root is not None:
        return manifest_root
    env_value = os.getenv("SIMREADY_FOUNDATION_ROOT")
    if env_value:
        return Path(env_value)
    upstream_root = Path(os.getenv("OMNIVERSE_CAD_TO_SIMREADY_UPSTREAM_ROOT", str(DEFAULT_UPSTREAM_ROOT)))
    candidate = upstream_root / DEFAULT_FOUNDATION_CHECKOUT
    return candidate if candidate.exists() else None


def _resolve_spec_root(foundation_root: Path | None, explicit: Path | None) -> Path | None:
    if explicit:
        return explicit
    env_value = os.getenv("SIMREADY_FOUNDATION_SPEC_ROOT")
    if env_value:
        return Path(env_value)
    if foundation_root:
        candidate = foundation_root / "nv_core" / "sr_specs" / "docs"
        return candidate if candidate.exists() else None
    return None


def _cli_help(executable: str) -> str:
    completed = subprocess.run([executable, "--help"], capture_output=True, text=True, timeout=30, check=False)
    return f"{completed.stdout}\n{completed.stderr}"


def _build_command(
    executable: str,
    asset_path: Path,
    *,
    profile: str,
    profile_version: str,
    foundation_root: Path | None,
    foundation_spec_root: Path | None,
    output_path: Path,
) -> list[str]:
    help_text = _cli_help(executable)
    if "--json-output" in help_text:
        command = [executable, str(asset_path), "--profile", profile, "--profile-version", profile_version]
        if foundation_root:
            command.extend(["--foundation-root", str(foundation_root)])
        if foundation_spec_root:
            command.extend(["--foundation-spec-root", str(foundation_spec_root)])
        command.extend(["--json-output", str(output_path)])
        return command

    command = [executable, str(asset_path), "--profile", profile, "--version", profile_version]
    if foundation_spec_root:
        capabilities = foundation_spec_root / "capabilities"
        features = foundation_spec_root / "features"
        profiles = foundation_spec_root / "profiles" / "profiles.toml"
        if capabilities.exists():
            command.extend(["--rules-path", str(capabilities)])
        if features.exists():
            command.extend(["--features-path", str(features)])
        if profiles.exists():
            command.extend(["--profiles-path", str(profiles)])
    command.extend(["--output", str(output_path)])
    return command


def validate_profile(
    asset_path: Path,
    *,
    profile: str,
    profile_version: str,
    foundation_root: Path | None,
    foundation_spec_root: Path | None,
) -> dict[str, Any]:
    if preflight_required() and foundation_root is None:
        preflight_check = preflight_status_check("simready-validate", "simready_validate")
        if not preflight_check["passed"]:
            return _blocked_report(
                asset_path,
                [TOOL, str(asset_path), "--profile", profile, "--profile-version", profile_version],
                profile,
                profile_version,
                preflight_check["message"],
            )
    foundation_root = _resolve_foundation_root(foundation_root)
    foundation_spec_root = _resolve_spec_root(foundation_root, foundation_spec_root)
    command = [TOOL, str(asset_path), "--profile", profile, "--profile-version", profile_version]
    executable, cli_error = _resolve_cli(foundation_root)
    if executable is None:
        return _blocked_report(asset_path, command, profile, profile_version, cli_error or f"{TOOL} CLI is required but was not found on PATH")
    with tempfile.TemporaryDirectory() as tmpdir:
        output_path = Path(tmpdir) / "simready-profile-report.json"
        run_command = _build_command(
            executable,
            asset_path,
            profile=profile,
            profile_version=profile_version,
            foundation_root=foundation_root,
            foundation_spec_root=foundation_spec_root,
            output_path=output_path,
        )
        completed = subprocess.run(run_command, capture_output=True, text=True, timeout=300, check=False)
        if not output_path.exists():
            return _blocked_report(asset_path, run_command, profile, profile_version, f"{TOOL} did not produce JSON output")
        payload = json.loads(output_path.read_text(encoding="utf-8"))
    return _normalize_runtime_payload(asset_path, run_command, profile, profile_version, payload, completed)


def emit(payload: dict[str, Any], report_path: Path | None, markdown_report_path: Path | None) -> None:
    emit_json_report(
        payload,
        report_path,
        markdown_report_path,
        f"# SimReady Profile Validation Report\n\n- Passed: `{payload['passed']}`",
    )


def main(argv: list[str] | None = None) -> int:
    parser = argparse.ArgumentParser(description="Validate an OpenUSD asset against a SimReady Foundation profile.")
    parser.add_argument("asset_path", type=Path)
    parser.add_argument("--profile", default=DEFAULT_PROFILE)
    parser.add_argument("--profile-version", default=DEFAULT_PROFILE_VERSION)
    parser.add_argument("--foundation-root", type=Path)
    parser.add_argument("--foundation-spec-root", type=Path)
    parser.add_argument("--report", type=Path)
    parser.add_argument("--markdown-report", type=Path)
    args = parser.parse_args(argv)
    payload = validate_profile(
        args.asset_path,
        profile=args.profile,
        profile_version=args.profile_version,
        foundation_root=args.foundation_root,
        foundation_spec_root=args.foundation_spec_root,
    )
    emit(payload, args.report, args.markdown_report)
    return 0 if payload["passed"] else 1


if __name__ == "__main__":
    raise SystemExit(main())

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs Python

The author says: Orchestrator skill. Managed Content Agents deployment requires a configured model provider key matching the selected backend, such as NVIDIA_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY, or GEMINI_API_KEY, Docker + NVIDIA Container Toolkit + GPU, Python 3.12, and an upstream checkout of nvidia-omniverse/content-agents at the ref pinned in upstream-versions.lock.json. Reused/provided endpoints may instead use explicit endpoint and usage-token environment variables. Linux/macOS only.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs
  • Instructions that use the network
  • Downloads piped into a shell
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Omniverse
Publisher
NVIDIA (Official)
Distributed by
NVIDIA
Source
NVIDIA/skills · skills/omniverse-cad-to-simready · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Omniverse or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download omniverse-cad-to-simready.zip