Developer Guide
Project Structure

Project Structure

dexter/
├── .opencode/
│   └── agents/                  # Agent prompts (source of truth for behavior)
│       ├── orchestrator.md      # Orchestrator agent, owns all control flow
│       ├── analyze.md           # Analyze subagent, parts decomposition
│       └── critic.md            # Critic subagent, critique IR writer
│
├── configs/
│   └── base.yaml                # Pipeline knobs (loops, fal, render, USD)
├── opencode.json                # Agent definitions, permissions, prompt paths
├── AGENTS.md                    # Agent-facing pipeline semantics (OpenCode /init)
│
├── schemas/                     # JSON Schema validation files
│   ├── parts.schema.json
│   ├── assembly.schema.json
│   ├── critic.schema.json
│   ├── render_views.schema.json
│   └── component_dims.schema.json
│
├── tool_scripts/                # Deterministic pipeline scripts
│   ├── generate_components.py
│   ├── initialize_placement.py
│   ├── update_placement.py
│   ├── blender_measure_glbs.py
│   ├── blender_assemble.py
│   ├── blender_render_views.py
│   ├── blender_export_usd.py
│   └── common.py
│
├── input_images/                # Bundled source photos
│   ├── dishwasher.png
│   ├── oven.png
│   ├── refrigerator.png
│   └── washingmachine.png
│
├── requirements.txt             # Python dependencies
├── pyproject.toml               # Ruff lint/format config for tool_scripts/
├── test_fixtures/               # Valid/invalid JSON for schema validation
├── LICENSE                      # Apache 2.0
├── README.md                    # Repo overview
│
├── docs/                        # This documentation site (Nextra)
│   ├── pages/                   # MDX content
│   ├── public/assets/           # Images and videos
│   └── package.json
│
└── .intermediate/               # Pipeline output (gitignored)
    └── <asset>/<NNN>/           # Per-run artifacts

Key files explained

opencode.json

Defines all agents: mode (primary/subagent), temperature, prompt file path, and permissions (edit, bash, read, task, webfetch).

The orchestrator agent has broad bash permissions (python*, blender*). Subagents are tightly scoped.

configs/base.yaml (base.yaml)

Read by the orchestrator agent at run start. Contains:

  • paths: directories and blender binary
  • loop: iteration exit conditions
  • image_generation: OpenAI model settings
  • fal: fal.ai 3D model settings
  • placement_init: paths for initialize_placement.py
  • render: Blender render defaults
  • usd: USD export settings

AGENTS.md

Concise pipeline semantics for agents: step order, gates, gotchas. When in doubt, trust opencode.json and agent prompts over AGENTS.md.

.opencode/agents/*.md

The actual instructions each agent follows. The orchestrator agent prompt is the most detailed; it specifies exact step ordering and gate behavior.

schemas/

JSON Schema Draft 2020-12 files. All use additionalProperties: false.

tool_scripts/

Python scripts (stdlib + requirements.txt deps) and Blender scripts (import bpy). Blender scripts parse args after -- in sys.argv.

Run directory (.intermediate/)

Gitignored. Structure per run:

.intermediate/<asset>/<NNN>/
  source.png
  parts.json
  component_dims.json
  component_images/
  component_glbs/
  iterations/<NNN>/
    assembly.json
    assembled.blend
    render_views.json
    renders/
    critic.json
  robot.usda
  robot_prim_map.json
  textures/

What is NOT in the repo

MissingWhy
Test suiteNo CI; validate with common.py + manual runs
Python package manifestOnly requirements.txt
Pipeline driver scriptOpenCode orchestrator agent is the only entrypoint
API keysEnvironment variables only
Run artifacts.intermediate/ is gitignored