AGENTS.md
Build, Lint, and Test Commands
Running Tests
# No explicit test framework found - the project consists mainly of asset configuration files.
Code Style and Conventions
Python Code Style
- Formatting: Use standard PEP 8 style with 4-space indentation
- Naming Conventions:
ITEMdictionary for object metadata (lowercase with underscores)find_all_items()andextract_item_dict()for function names (snake_case)usda_path,desc_path,combined_dictfor variable names (snake_case)ASSETS_PATH,CHROMA_DB_PATH,ASSETS_INDEXfor constants (uppercase_with_underscores)
- Data Structure Style:
- Use dictionary definitions with
ITEM = { ... }format initem.pyfiles - Keep dictionaries nested with clear keys for objects, shapes, properties
- Use list format
["name", "position", "quaternion", "scale", "size", "type"]consistently - Include
descriptionkey as empty dict{}when no description present
- Use dictionary definitions with
Python Imports
- Import standard library modules at top of file:
os,ast,hashlib - Import pathlib for path operations:
from pathlib import Path - Use absolute imports for core functions
- No external library imports in asset files (only dictionaries)
File Organization
- Asset files:
objects/{category}/{category}_{id}/{id}/item.py - Background files:
background/common/{category}/{category}_{id}/item.py - Keep
.usda,.usd,.json, and texture files in same directory as corresponding item - Organize by object category with unique identifiers
Code Organization Principles
# Dictionary-based configuration files
ITEM = {
"description": {}, # Optional description dict
"id": "{object_id}", # Unique identifier
"shapes": [ # List of mesh definitions
{
"name": "{shape_name}", # e.g., "bbox", "origin"
"position": [x, y, z], # Float position coordinates
"quaternion": [w, x, y, z],# Quaternion for rotation
"scale": [x, y, z], # Scale multipliers
"size": [x, y, z], # Physical dimensions
"type": "{geometry_type}", # e.g., "cube", "sphere"
}
],
"size": [], # Additional size specification
"url": "path/to/object.usda" # Path to USD file
}
Error Handling
- Use try-except for file reading operations
- Print informational messages for warnings and errors
- Skip files with errors instead of raising exceptions
- Provide meaningful error messages with file paths
Type Hints
- Use standard Python types in function signatures
- Path objects with
Pathtype hint - Dictionary types with
dicthint - List types with
listhint - Number types with
floator usenumberfrom typing
Documentation
- Document complex functions with docstrings
- Use descriptive comments for special cases
- Add error messages inline for critical operations
- Include WARN and ERROR prefixes for important messages
Asset Tools (Scripts)
The tools/ directory contains helper scripts for validating and batch-updating asset USD.
Detailed tool behavior (especially compile.py): see tools/AGENTS.md.
tools/cleanup.py: remove generated/cache files insideassets/subfolders.tools/compile.py: compileAligned.usda+item.pyfromobject_parameters.json/Aligned.usd(requires--dir; seetools/AGENTS.md).tools/review_physics.py: validate and updatePhysicsMaterialfriction parameters in.usdafiles.
Agent Docs (synced from tools/)
.agent/MODULE.CLEANUP_PY.md: documentation fortools/cleanup.py.agent/MODULE.REVIEW_PY.md: documentation fortools/review.py
Agent Docs Sync Rules
- Whenever you change
tools/cleanup.pyortools/review.py, update the corresponding module docs under./.agent/:./.agent/MODULE.CLEANUP_PY.md(fortools/cleanup.py)./.agent/MODULE.REVIEW_PY.md(fortools/review.py)
Recommendation for the agent:
- Re-generate/update the doc content based on
python3 tools/cleanup.py --helpandpython3 tools/review.py --help.
Examples (run from assets/ folder):
python3 tools/review.py --func check --skip-omni6dpose --limit 100
python3 tools/review.py --func check_update --static-friction 0.5 --dynamic-friction 0.3 --limit 100
python3 tools/review.py --func print --limit 50 > physics_material_friction.txt