Product walkthrough · Atomic Rig

How Atomic Rig is put together

A browser tool that assembles a rigged character out of parts. Bring in or generate a part, it attaches to a standard Mixamo skeleton by body region, and it exports to a named engine target with that engine's budget checked before the file is written. Rendering and export both run client-side.

Solo build Next.js · Three.js · Postgres · Clerk · Modal atomicrig.com
1 panel
five tabs, floating over the viewport
3 formats
GLB · FBX · USD / USDZ
5 targets
generic · VRChat ×3 · Roblox R15
26 tools
MCP surface over the same REST API
23 presets
PBR materials in four groups
10 MB
per-bit import ceiling, .glb only

The idea

Stacking building blocks

  • One repeated unit: a bit instance.
  • A collection is instances rooted at a bone. An avatar is instances rooted at the skeleton.
  • Only the bit row points at geometry. Everything above it is references.
bits[ ] bits[ ] appliedCollections[ ] bitId model_url jointId material marketplaceListingId? CONTAINER · WHOLE RIG Avatar avatars.data version · avatarId · name skeletonType: bipedal_v1 bits: BitInstance[ ] savedMaterials[ ] appliedCollections[ ] metadata: tags, isPublic, remixedFrom CONTAINER · ONE LIMB Bit collection bit_collections.data collectionId · name rootBone: e.g. LeftHand bits: BitInstance[ ] tags[ ] · thumbnail applied, mirrored, updatable THE REPEATED UNIT Bit instance one placement, same type in both containers instanceId bitId→ library row jointId→ one bone transformpos · rot · scale material→ PBR channels sourceCollectionId? marketplaceListingId? no geometry, no bytes: references only CATALOG Bit bit_library id: 'damaged-helmet' category · tags[ ] model_url thumbnail_url labels->region attachment_points[ ] is_active licence + provenance attached BYTES Geometry .glb file bucket or CDN the only mesh in the system LIBRARY ITEM Skeleton bipedal_v1 Mixamo bone set shared by every avatar bones, never meshes LIBRARY ITEM Materials 23 PBR presets metal · painted weathered · special resolved to channels LIBRARY ITEM Marketplace listing id on the bit ownership re-checked on every load never trusted from file
Blue is containment, grey is a reference, amber is the path to actual bytes. Both containers hold the identical instance type, which is why a collection can be applied to an avatar, mirrored, and later updated in place.

The one idea under all of it

A character is a document, not a mesh. Everything expensive (storage, cloning, sharing, remixing, the agent layer, the marketplace) gets cheap the moment the character is a list of references instead of baked geometry.

The surface

UI principles

  • The whole screen is the viewport.
  • One panel, floating, five tabs. No sixth.
  • Everything placed is a labelled bit on a bone. Nothing is loose geometry.
  • Checks and budgets live in the product, not in someone's head.
1 2 3 4 5 6 7 8 9
The editor with a starter character loaded. Blue marks global chrome, green marks the scene, amber marks the floating panel and its contents.
01

Navbar

Menu, quick load, profile, dashboard, tier badge. Tier comes from the session claim, not a lookup.

02

File / edit / view menu

New, save, share, download, sell. Undo and redo sit here too, backed by historyManager.

03

Transform mode

Move, rotate, scale. Acts on the selected bit instance, never on the skeleton.

04

Viewport

Full-bleed Three.js canvas, dynamically imported with SSR off. Green capsules are the bone attachment points.

05

Animation bar

Clip and speed. Proof the rig is real: the parts deform with the skeleton rather than riding along.

06

The panel

Glass, floating, right side. One panel for the whole app, because the thing people want to look at is the character.

07

Five tabs

library editor outliner upgrade assistant: one union type in the panel component.

08

Region filters

All, head, torso, arms, hands, legs. These are the same labels->region values the retrieval layer buckets on.

09

Import custom asset

Entry point to the checked import pipeline. Starter set, my uploads, marketplace and collections all land in the same list.

End to end

The system

  • The editor is the hub. It holds the skeleton, the avatar, the bits and the collections in memory and is the only place they are assembled.
  • Everything else is a spoke that either feeds the hub (import, generation, the assistant, identity, materials) or drains it (export, distribution).
  • The agent layer drives the same REST surface the UI drives. There is no agent-only path, so there is one authorization boundary.
user · tier · credits validated bits generated bit validated actions presets avatar state autoSave · load glb → bucket row → Postgres exported bytes cleared rows IDENTITY Clerk session cookie or API key tier baked into the JWT claim profile, credits, purchases sub → every row-level policy IN · PARTS Import & check .glb only, 10 MB ceiling normals checked, optionally rebuilt pivot moved to bbox centre fingerprinted, labelled, stored IN · GENERATED Image → 3D credits charged atomically first job row, concurrency capped Modal.com webhook does the work client polls job-status, saves bit IN · INTENT Assistant + MCP brief → resolver → retrieval Voyage embeddings + geometry fit code checks gate every step 26 MCP tools, same REST routes LOOK Material library 23 PBR presets metal · painted weathered · special preset → channel values per-channel override rows procedural map slots saved per bit instance, not per bit THE HUB Editor · browser, Three.js, WebGL HOLDS skeleton · Mixamo bone set avatar · placedBits[] + metadata bits · GLB instances on bones collections · curated bit sets materials · resolved channels DOES viewport, gizmo, selection outliner + properties undo / redo history animation playback autoSave to the avatar row OUT · PIPE Export 1 · collect scene meshes 2 · formatter + processing options 3 · target transform generic · vrchat pc / quest ×2 roblox r15 → R15 part names 4 · validate against target limits tris · bones · meshes · materials 5 · write GLB / FBX / USD / USDZ STATE Data layer POSTGRES · RLS avatars · bit_library collections · licenses credits · marketplace ~20 tables, policy per row BUCKETS public-bits user-uploads thumbnails generated-models CLOUDFLARE CDN large GLB / FBX / PLY kept out of the repo immutable + versioned query-string cache bust OUT · REACH Distribute /share/<12 hex> public page listing → integrity validator checkout → fulfilment → access one-time download links export credits per download OUT · GATE Quality check export, then re-parse the bytes render in a fresh Three.js context diff per mesh against the editor triangles · materials · textures catches silent export regressions
Blue feeds the hub, green drains it, amber is persistence. The dashed amber line is the import side-effect: the GLB goes to a bucket and the row goes to Postgres before the bit ever reaches the editor.

Boundary one

Authorization lives in the database

  • Clerk's sub is the key every row policy compares against
  • Same policy shape on all three main tables: owner, or public
  • A bug in a route cannot hand you someone else's avatar

Boundary two

Model output is filtered, not trusted

  • Bit ids must be in the retrieved catalog or already placed
  • Materials must be real presets, bones must be real Mixamo bones
  • What got dropped is reported, so nothing fails silently

Boundary three

Budgets belong to the export

  • The library stays full quality
  • Limits are declared per target and checked before writing
  • Adding a platform is a registry entry, not an exporter rewrite

In

An upload is not an import

GATE validateFile .glb only 10 MB ceiling REPAIR normals flat / missing found rebuilt on request REPAIR pivot bbox centre → origin per mesh, local space MEASURE analyse triangles, materials textures IDENTIFY fingerprint shape hash, dedupe provenance chain LAND stored as a bit GLB → bucket / CDN row + labels → Postgres Region label is written here. Everything downstream (attachment, retrieval, filters, export grouping) reads it.

Why the checks exist

  • The failure mode is silent: it looks right in the editor and arrives broken in the engine
  • Off-centre pivots were the top cause of bits auto-placing in the wrong spot
  • Flat or missing normals shade correctly here and wrongly downstream

Why uniformity matters

  • The hard part was never the export call
  • It was making arbitrary inbound parts uniform enough that one target transform applies to all of them
  • That is the whole reason import is a pipeline and region labels are mandatory

In

Generation and intent

  • Two ways in besides upload: make a part from an image, or describe what you want.
  • Both end in the same place: an ordinary bit row, through the same checks.
poll by job id UI Image panel drop an image, ≤ 10 MBquality presetcost shown up frontfast ≈ 90 s GATE Limits auth + tierstale jobs swept firstconcurrency cappedrate limited per user PAY Charge credits atomic deductiontiered by qualitycharged before the jobis allowed to exist QUEUE Job row image → user-uploadsrow inserted, pendingtimeout marks it failed OFF PLATFORM Modal worker webhook, bearer tokenfailure is non-fatal;the job stays pendingGPU work happens here WAIT Job status client polls by idfour-step progress UIno socket, no queue daemon LAND Back into the catalog GLB lands in generated-modelssaved through the same import checks as any upload a generated part is not a special kind of part
Image → 3D. Credits are spent before the job row exists, and the worker is fire-and-forget: the client's poll is the only thing that closes the loop.
unsure fail pass repair: stops at the step cap, after three passes that change nothing, or when the decision model is unavailable UI Assistant panel prompt, ≤ 500 charsyour own bits ride alongper-region statusa readable decision logone region = one undo step DECIDE · TYPED MODEL Reads the request closed questions · a choice + a confidence ESCALATE · CLAUDE Called once, if at all fills only the fields that came back unsure THE BRIEF What was asked for, as structured fields archetypecolour schemestyle familiesadd-ons bit sourceexport targetper-region overridesconfidence + who decided anything still unknown falls back to the archetype's defaults; the colour scheme is never Claude's to set RESOLVE · NO MODEL Brief + overrides + bits you already placed → the concrete slot list for one region body-plan segments such as upper_arm.L · cover rules · joint types · tier and coverage levels · region triangle budget · same inputs, same slots, every time POOL Candidates Postgres, explicit columnsthe embedding column isnever selectedownership + listing context EMBED · VOYAGE voyage-3.5-lite 1024 dimensionsbatched, backs off on 429recipe version pinnedbump it → everything re-embeds RANK Score each candidate hard filter first, never relaxedcosine via pgvector HNSW+ style overlap + aspect fit+ collection · − polys, reuse PICK · TYPED MODEL One per slot 12 candidates per slottop-ranked as the fallbacka primitive if nothing fitsembeddings down → labels only PLACE Place & fit validated tool calls onlyfitted onto the segment proxyyour own bits never moved placement pose held throughoutmanual editing locked CHECK · CODE Nine checks filled · coverageproximal_end · distal_endproportion · proxy_fillrole_colour · mirror · share named levels, never numbers REPAIR One step scope = this region's open slots13 tools, ids and levels onlytyped model decides firstClaude after three failures Claude capped at three per region GATE Verdict runs only once code passesnames the weakest slotreads as · style matchsilhouette finish unlocks here GUARANTEE However the loop ends, a thrown error included, every required body slot is filled: its pick if that places, otherwise a primitive. region done
The assistant, region by region. Blue is the main path, amber is escalation, green is deterministic code. The slot list and the nine checks are the two places where no model gets a vote.

Two models, two jobs

  • A typed decision model answers closed questions and returns a distribution with a calibrated confidence, not a sentence
  • Claude is the escalation path: reading an ambiguous request, and repair steps the first model could not resolve
  • Neither writes a number. Models pick ids and named levels; calibration owns the thresholds

Deliberately not a model

  • The slot list. Resolved in code from the brief and the body plan, so the same request yields the same slots
  • The nine checks. Run after every step, with failures on your own bits reported but never blocking
  • The fallback. A slot that cannot be filled takes a primitive rather than another attempt

How it is kept honest

  • Decisions record to fixtures and replay offline, so a build is reproducible with no network
  • An eval harness scores a run: cost, gate pass rate, steps per region, escalation rate
  • A missing recording is counted as a miss, never quietly answered live

Operations

System services

/ADMIN/STATUS Service check nine probes, run in parallel five second timeout each read-only: never writes, sends mail or starts a job latency recorded per probe LEVELS ok degraded down not configured RULES a missing key reads as not configured, not down any env value appearing in an error is redacted first details capped at 200 chars IDENTITY & MONEY DATA & DELIVERY WORK & MAIL WATCHING Clerk · auth GET users/count flags a development key on production Stripe · payments GET balance flags a test-mode key on production Supabase · database selects one row from the bits table Asset CDN · R2 HEAD the bucket origin Upstash · rate limits ping, expects PONG back Modal · GPU inference deliberately not pinged: a request cold-starts the container, and a slow start reads as down Resend · email lists domains and checks the sending domain is actually verified Sentry API · reading errors project reachable with the stored token Sentry ingest · errors arriving seven-day event counts for this project; none in our environment reads degraded

What it is for

One page to answer the first question of any outage: is it me or is it them. Nine dependencies, checked live and read-only, with a missing key reported as unconfigured rather than broken, so a half-set-up environment never looks like a failure.

Out

Three formats, five targets

Runtime

GLB

  • Smallest, skinned, loads anywhere
  • What the engine actually wants

Artist

FBX

  • Material textures extracted and written out
  • What a DCC opens without an argument

Pipeline

USD / USDZ

  • Joint paths built from the bone tree, skin weights normalised
  • Survives being handed to a system you do not control

What a target actually is

  • A formatter pipeline that restructures the scene
  • A validator that says yes or no
  • Exporter options for that platform
  • Explicit limits: triangles, bones, skinned meshes, materials

Roblox R15 rebuilds the generic character into the part names R15 expects. Adding a platform means adding one of these, not touching the exporter.

Out

The quality gate

LEFT PANEL Editor quality raw meshes off the live scene, untouched THE ROUND TRIP export → re-parse → re-render a fresh context, so no stale state hides the bug RIGHT PANEL Download quality what the file actually contains per-mesh diff triangles · materials · textures

What it catches

  • Triangle drift introduced by the formatter
  • Materials collapsing or being dropped
  • Textures lost, resized, or never referenced in the written file
  • Anything the target's options change without saying so

Why it is a panel and not a habit

  • The worst bug class here is the editor looks right and the file is wrong
  • Checking that by eye does not scale past a couple of targets
  • Same instinct as the validation report: make the silent failure say something

Shipping

Testing and distribution

  • Cheap gates first. Milliseconds, then minutes, then a deploy, so a failure should cost the least it can.
  • One suite, three places. The same specs run locally and against the preview; there is no second suite to keep honest.
  • Every branch gets a real URL, so a change can be seen and tested before it is real.
push promote LOCAL On the machine Unit · Vitest 155 files, 2,129 cases jsdom, no browser, milliseconds resolver, gate, schemas, tools End to end · Playwright 29 specs against a real build signed-in session saved once server reused locally, rebuilt in CI Assistant evals recorded answers replayed deterministic, one worker, no retries costs nothing and needs no network Lint and types eslint, strict TypeScript the cheapest gate runs first STAGING Preview sandbox Preview deploy one URL per branch shareable before it is real minutes, not a release window The same specs, remotely a base-URL env var repoints the suite no second test suite to maintain Protection bypass exchanged for a cookie, scoped to the sandbox origin a header would leak to third parties Excluded on purpose the sandbox shares live services anything that bills is skipped PRODUCTION Live Promote the build the artifact that passed is the one that ships Service status nine probes, read-only, in parallel is it me or is it them Config drift caught a test-mode key on production reads degraded, not ok Then it leaves five export targets, marketplace share links, MCP Stale specs sit in a named quarantine list rather than being deleted: the gate stays green without the suite quietly shrinking.
Amber marks the decisions that keep the pipeline fast rather than merely thorough.

Why the evals replay

  • Model calls are slow, priced and non-deterministic: three bad properties for a gate
  • Recorded once, replayed forever: a build is reproducible with the network off
  • A missing recording is counted as a miss, never silently answered live
  • Going live is an explicit, separate command

What the sandbox is for

  • Catches what a local build cannot: real auth, real CDN, real cold starts
  • It shares live services, so the specs that would bill are excluded by name
  • The bypass is a cookie scoped to that origin, because a header would ride along to third parties and break their CORS

Distribution is the other half

  • Shipping the app is a promote; shipping a character is five export targets, a marketplace and a share link
  • Both get the same treatment: a named target, checked limits, and a gate before anything leaves
  • Adding a platform is a registry entry, so distribution widens without the pipeline changing

Work with me

I build 3D products end to end: real-time rendering, asset pipelines, avatar systems and the tooling around them, with twenty years of production 3D underneath.