一键导入
nanousd-readonly-backend
Use this skill when implementing or verifying a generated read-only backend for nanousd's C API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use this skill when implementing or verifying a generated read-only backend for nanousd's C API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Map unfamiliar or multi-repository codebases before refactoring, integration, or feature work. Use when Codex needs to analyze submodules, ownership boundaries, APIs, duplicate implementations, build/test surfaces, risk areas, and a practical refactor sequence before changing code.
Coordinate multiple AI agents or subagents on software work without duplicating effort or causing conflicts. Use when Codex is explicitly asked to delegate exploration, implementation, review, testing, integration, or parallel analysis across a codebase.
Maintain C ABIs and language bindings as exact, testable contracts. Use when evolving public headers, ctypes/cffi/pybind/Rust/JS bindings, shared libraries, struct layouts, GPU/native APIs, or any cross-language boundary where drift can cause crashes or silent corruption.
Debug rendering, viewer, shader, material, camera, lighting, and GPU integration bugs with reproducible visual evidence. Use when scenes render blank, only appear after camera motion, show incorrect shading, diverge across backends, crash in GUI mode, or need pixel/screenshot verification.
Refactor disjoint or duplicated projects into clear layered architecture with canonical contracts and thin adapters. Use when viewers, renderers, bindings, data libraries, plugins, or services overlap and need maintainable ownership boundaries without losing behavior.
Identify and remove obsolete legacy, fallback, staging, compatibility, duplicate, generated, and reference code before creating clean initial commits or new project history. Use when a repo is being reset, consolidated, or prepared for a cleaner public history.
| name | nanousd-readonly-backend |
| description | Use this skill when implementing or verifying a generated read-only backend for nanousd's C API. |
| metadata | {"author":"NVIDIA"} |
Use this skill when implementing or verifying a generated read-only backend for nanousd's C API.
include/nanousd/nanousdapi.hinclude/nanousd/nanousd_backend.hThe source headers define a broad backend vtable. This skill owns only the first read-only slice of that surface.
NanousdBackend_v1 vtable partitionnanousd_create_backend_v1 entry point with C linkageNanousdBackend_v1 function pointer populationnanousd_open and traversal behavior for supported local USDA
fixtures through usd-composed-stage-opennanousd_diagnostics and
nanousd_diagnostics_jsonThis skill owns:
contracts/capabilities/nanousd-readonly-c-api-backend.jsoncontracts/handles/nanousd-readonly-backend.handle.jsoncontracts/performance/nanousd-readonly-backend.performance.jsoncontracts/capabilities/semantic-runtime-types.json as a cross-cutting
dependencyThe backend must consume the graph's stage, document-model, foundational value, path, token, and listOp capabilities. It must not keep a separate parser-local stage or infer typed values by reparsing canonical JSON dumps.
Do not store stage paths, prim paths, property paths, field keys, child/property names, typeName/kind tokens, variant set names, or selected variant names as raw strings in backend query state. The nanousd C API exposes C strings at the ABI boundary, but generated backend state should retain graph path, token, name, field, and value abstractions internally.
Generated backend code must export nanousd_create_backend_v1, return a
non-null NanousdBackend_v1*, and assign every vtable field. Read-only and
utility fields point to generated implementations. Mutating or deferred fields
point to deterministic unsupported stubs; they must not be left null.
Generated C ABI functions must never crash the caller. Treat null handles,
invalid handles, null input pointers, malformed text, missing values,
out-of-range indices, type mismatches, and unsupported features as ordinary
failure cases with deterministic nanousd return values. Do not let C++
exceptions cross the C ABI boundary. Non-owning const char* return slots must
return a stable empty string on failure rather than null.
Owning string APIs, including nanousd_write_usda_string and
nanousd_diagnostics_json, must return null on failure or memory compatible
with nanousd_free_string; never return a borrowed string literal from those
slots.
Path, listOp, and math slots are utility slots. Do not satisfy them with a generic unsupported fallback. Generate typed path handles, standalone listOp handles, and stateless math functions with explicit null and invalid-input behavior. Opaque handle factories must return either null or a fully initialized handle whose companion functions are total.
Generated C++ output must include portable CMake build infrastructure. The
CMake project should build the nanousd backend shared library and adapter when
NANOUSD_INCLUDE_DIR resolves to headers containing
nanousd/nanousd_backend.h. Do not rely on the Windows-only build.ps1 path
as the sole build mechanism.
The runnable benchmark slice must open supported local USDA files through
usd-composed-stage-open, receive a graph-owned populated stage, and serve
benchmark_stage_load calls through the NanousdBackend_v1 vtable. Do not
construct reference or payload namespace sources with empty dependency maps when
usd-composed-stage-open can discover and open direct local dependency assets.
Do not keep a parser-local shadow stage to answer nprims, prim, nattribs,
diagnostics, or layer path queries.
Diagnostic callbacks must report diagnostics collected by
usd-composed-stage-open and stage population. The array result must be
allocated for nanousd_free_diagnostics, string fields must be owned by that
array, and nanousd_diagnostics_json must return nanousd_free_string
compatible memory. Relocate diagnostics use arc_type = 8 and invalid
relocate category 8 until a richer warning/error taxonomy is contracted.
The backend may interpret shaped foundational payloads through a generic array
container when the field's stored type identity and payload metadata are
available. Dedicated Vec, Quat, Matrix, or typed-span storage can be added
later for performance, but is not required by this first contract.
For quaternion reads, USD payload order is i,j,k,w. The nanousd C API exposes
quaternions as w,i,j,k; generated backend code must reorder explicitly.
Zero-copy array access is not required in this first contract. arraydata*
functions may return null until a later performance contract requires
contiguous native array storage.
Do not implement mutation through this skill. Setters, creation, clear/block, composition arc writes, variant writes, schema registration, and file writers must be unsupported stubs in the read-only backend.
Do not bypass the namespace-source/stage-population boundary to recover prims from parser-local state.
Do not infer type identity by looking at JSON serialization or value text. Consume document-model typed reads and foundational payload metadata.
Do not claim schema fallback, instancing/prototype, clip, spline, xformOp, or full diagnostic parity behavior until those contracts exist in the graph.
nanousd_create_backend_v1 entry pointNanousdBackend_v1 function pointer slots populated with non-null
generated implementations or unsupported stubsharness/nanousd_backend_benchmark.pyi,j,k,w to C API w,i,j,kgoldens/unit/nanousd-readonly-backend/nanousd-readonly-backend.json