@rig-c/core
AI-authored 2D rigging and animation, verified before it is written. rigc is
a rig compiler: a rig spec and a motion spec in, skeleton data out — in the Spine 4.3
format, with rigc's own compiled model beside it —
gated by a list of named assertions before a byte is written — rigc's own validator in
the published package, held to a spine-core round trip's verdicts in this
repository's CI. Built so AI agents can author rigs and check their own work; it ships
as an agent skill. Its canonical npm package is @rig-c/core, under the toolchain's
scope. rig-c is the convenience install name; spine-rigc is the legacy install
name. Both remain published alongside it with the same product files.
What you get
Fourteen part PNGs drawn from scratch for this repo, one rig spec, one motion spec — the assembly,
the breathing and the wave are all rigc-compiled Spine animations, rendered with
rigc render. A 2x assembly film (1200x810) sits beside it.
Loose part PNGs and two small JSON files in; Spine 4.3 skeleton data out — a
skeleton.json and a skeleton.atlas that load in any Spine runtime and import
into the Spine editor. Nothing is written unless a list of named assertions comes
back green — assertions this repository holds to the verdicts of a round-trip through
Spine's own parser, all but the parse itself, which runs only where the runtime is
installed.
| You have |
You run |
You get |
| part PNGs, a rig spec and a motion spec |
rigc build |
skeleton.json + skeleton.atlas — or a failure named by rule, and nothing on disk |
| the same, and one texture instead of many |
rigc build --pack |
the parts arranged onto shared atlas pages, written beside the skeleton — losslessly, so the picture is the picture |
| a pack somebody already made |
rigc build --atlas-in |
the same skeleton, with every part resolved to a region of that atlas — or a named refusal, never a part that silently does not draw |
| a compiled rig |
rigc render |
every animation as PNG frames, plus one labelled contact sheet of the whole shot |
| a compiled rig and a question about its geometry |
rigc inspect |
one picture of its bones, axes, mesh edges and hulls, one bone's weights, the triangles folded over, the draw order, a world grid or a declared axis over the art — at the setup pose, one time or a sheet of several, zoomed to a bone or a slot, or beside a second build on one transform — and a legend that puts every mark back in world units |
| a compiled rig |
rigc preview |
one self-contained .html that plays it in Spine's own web player |
| two to four compiled rigs |
rigc vote |
one ballot page a human picks from, and the answer checked into a ledger |
| a picture of a key pose |
rigc pose |
where each loose part PNG sits in it, in spec coordinates — the movement between two poses is then yours to key (the motion recipe) |
| the same picture, and a rig |
rigc chainfit |
the parts pose refuses because something is drawn over them — read through the candidate's own draw order and hierarchy, with the share of each part the answer was measured on |
Everything in that table needs Bun and this package — preview and vote also
@esotericsoftware/spine-core installed beside it (see below) — and no clone, no
reference art, no art pipeline, no server.
Depth-driven rigging
Explicit depth, which a drawing alone does not state, makes facial features
shift by different amounts during a small head turn: the portrait depth example
uses per-part depths, while the mesh-depth look example
samples a depth map at the mesh vertices.
With @rig-c/parts' depth fields,
See-through's per-layer sheets are bound explicitly with near and zScale,
then consumed by head-turn roles in turn.roles.
The depth-yaw flow shows how a turning
surface and its alpha clipping aperture move together.
The value-driven turn is a
rig control; the consumer chooses when to move it, and
getting-started is the painting-to-rig
walkthrough.
Alpha-derived clipping
Alpha-derived clipping takes a named source slot/skin/attachment plus explicit
alpha threshold, drawing-pixel simplification tolerance and mapped vertex budget.
Region, authored/resolved linked mesh and generated grid/contour depth sources use
ordinary weighted clipping, with the existing validation gate before emission.
See AUTHORING: Alpha-derived clipping
for source-motion limits, fit reports and named refusals, and
the face guide for the depth-yaw flow
used in depth-driven rigging.
What rigc is, and what it is not
rigc emits Spine's own skeleton data format. That is the whole positioning, and
it cuts both ways:
- The output loads in any Spine runtime, and it imports into the Spine editor.
A compiled rig is a starting point on a timeline, not a finished shot — an AI
drafts, a human refines in the editor. That hand-off is what emitting somebody
else's format buys, and
tools/editor_roundtrip.ts measures that it survives
the trip in both directions.
- The published package links no Spine runtime.
@esotericsoftware/spine-core
is a development dependency: this repository uses it to hold rigc's own validator
to the round trip's verdicts — in CI, on the public example recipes and every
selftest call, and on a private corpus of production rigs measured before each
release. Of the 50 assertions, 49 run on both; A00_ROUNDTRIP_PARSE, the official
parser's own parse, runs only where the runtime is installed and is reported as a
SKIP elsewhere. There, in the parse's place, the report also carries the model
side's own two parse rules, A00_MODEL_READ and A00_MODEL_REGIONS_ON_PAGES,
which no round-trip rule matches and the registry does not hold — so its summary
totals 52 on the core entry, and its last line counts 42 rules on the model side
(AUTHORING §5.2 has a row for each). Install it beside rigc
(bun add -d @esotericsoftware/spine-core) and the same rigc runs the round
trip on every build. The
Spine Runtimes License Agreement
applies to that dependency wherever it is installed.
Licensing, stated plainly
See the licensing notice for licensing and third-party terms.
The problem rigc is aimed at is narrow. An agent asked to author a rig has no way
to tell whether it succeeded: Spine's JSON parser accepts a great deal of nonsense
without a murmur — a constraint in the 4.2 shape simply vanishes, a size: that
disagrees with the PNG collapses every UV, a four-number curve array yields NaN,
a mesh whose vertex count happens to equal its UV count silently loses its bone
weights. Every one of those loads clean, plays, and is wrong. rigc's answer is to
make the failure legible: compile from a spec, run a list of named assertions — held
to the real parser's verdicts in CI — and write nothing unless all of them are
green.
Install
📦 rigc measures loose PNGs directly, and emits one atlas page per image unless
you ask otherwise. rigc build --pack arranges every part onto shared pages and
writes them into --out; --atlas-in builds against a pack somebody else made.
Both are opt-in and both are narrow — no trimming, no rotation, no scaling — and
AUTHORING §0.1–§0.2 states the limits before you hit them.
rigc runs on Bun (engines.bun declares >=1.4.0). The
package ships its TypeScript sources and Bun runs them, so there is no build step
and no dist/ that can drift from the repository it was cut from. What is
measured is the install itself — pack, install into an empty directory, build,
render — on Linux, macOS and Windows runners on the Bun setup-bun resolves that
day (the installs and installs-matrix jobs in
ci.yml,
repository material, not in the npm package); a platform whose leg is red there
is not one the package is known to run on. The declared >=1.4.0 floor itself is
not pinned in CI — older 1.4.x releases are untested until a report arrives.
From a source checkout, bun run verify:nova -- --label "<issue + purpose>" --owner "<who>" --session "<session id>" [--bun <version>] sends the full
selftest to the remote job pool (NOVA_RUN names the runner, or
nova-run.sh is on PATH). --bun 1.4.0 selects that exact stable release. Before upload, the hand
fetches Bun's official SHASUMS256.txt and checks that the Linux x64 baseline
archive is available; on the pool it downloads the pinned archive, verifies its
SHA-256, checks its executable's version, and puts that private Bun first on PATH
for corpus fetch and selftest. The remote command's first line is
verify:nova: Bun 1.4.0. The temporary runtime is removed on exit. Without
--bun, the pool's Bun and existing command are unchanged; dependency installation
still uses the pool runner's installation step. The selftest's exit is returned
unchanged: selecting a runtime does not promise a green run. Memory ceilings
remain those of that platform and Bun major.minor's tracked row; a missing
measurement remains a reported HOLE. Malformed, duplicate or missing
versions, unavailable releases/assets and unreadable checksums are refused by
name with exit 2 before upload. Use a published exact X.Y.Z (no v prefix,
alias, range or prerelease), or retry a failed network fetch. This is repository
verification tooling, not an installed rigc command or a change to CI's matrix.
The canonical npm package is @rig-c/core; the command it installs is rigc.
rig-c remains a convenience install name. npm
refuses the name rigc as too similar to packages that already exist, so the
project and the executable keep their name; the convenience name rig-c carries one
hyphen; the repository is rig-c/core. spine-rigc is the legacy install name for the same package: it is the name
every version up to 2.20.4 shipped under, and it stays published as an alias —
every version from 2.20.4 on is on both names, with the same files — so a
project that depends on spine-rigc keeps receiving every release. A new
project installs @rig-c/core, the canonical package under the toolchain's scope.
bunx @rig-c/core --help # run it without installing
bun add -g @rig-c/core # or install the command
bun add -d @rig-c/core # or pin it in a project
npx @rig-c/core works too, as long as Bun is on PATH — the executable is a
Bun script, and npm only writes the shim that calls it.
Installed, the command is rigc. The examples below spell it bun cli.ts
because they are written from a clone of this repository (bun install, then run
the CLI in place). With @esotericsoftware/spine-core installed beside the package
the two are interchangeable — rigc build … is bun cli.ts build …. Without it,
rigc runs the entry that links none of the runtime (bun cli_core.ts in a clone):
build writes the same files gated without the parse, and a command that needs the
runtime is refused by name, saying how to get it (that entry's --help lists the
commands it runs). rigc --version names the entry that ran.
One command is a repository workflow rather than a package one: bench measures
against Spine's official example projects — fetched, never committed — and against
reference frames this project renders from them, which are committed, each
example's own license.txt beside them under the redistribution grant those files
carry; the images stay non-commercial only. The reasoning is in
bench/reference/README.md