Iki Character
ASecurityGenerate a renderable, auto-rigged Iki character (`.iki`) from one gesture — draw a front reference, then role-separated transparent part PNGs against it with the iki-create-image skill (eyeless, noseless face base, nose, sclera, iris, a keyed open mouth and its interior (or a closed + open mouth pair for a style that cannot fold), lash, brow, front and back hair, torso, an optional cheek blush, an optional front side lock beside the ear, and for an optional full body a body from the neck to ...
- 62 stars
- 0 votes
- 0 copies
- 1 view
- Added October 5, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add zeikar/iki --skill iki-character --agent claude-codeAre you the author of Iki Character?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/zeikar-iki-character)---
name: iki-character
description: Generate a renderable, auto-rigged Iki character (`.iki`) from one gesture — draw a front reference, then role-separated transparent part PNGs against it with the iki-create-image skill (eyeless, noseless face base, nose, sclera, iris, a keyed open mouth and its interior (or a closed + open mouth pair for a style that cannot fold), lash, brow, front and back hair, torso, an optional cheek blush, an optional front side lock beside the ear, and for an optional full body a body from the neck to the shoes and one arm, drawn against a full-body reference), compose them into canvas-aligned role layers with the `compose_layers_from_parts` MCP tool, then `auto_rig_from_layers` to emit a rigged `.iki` that blinks, gazes, lip-syncs, turns, nods and tilts its head with swaying hair, and emotes with its brows — drawn full body, also raises and bends its arms and turns its body, and with a pose forearm waves — and that declares motions (Nod, Shake, Tilt, Flinch, Bounce, Droop) and, with a pose forearm, a Wave, and up to eight default expressions (smile, laugh, angry, sad, surprised, shy, nervous, relieved; shy needs the blush), each with a description a host picks by. Use whenever the user asks to "make/generate/create an Iki character" from scratch (no existing art); for one finished picture the user already has, use iki-import-illustration instead.
---
# Iki Character (gen-AI → compose → auto-rig)
Turn "make me a character" into a renderable, animated `.iki` in one autonomous chain. This is the **skills** leg of the Iki north star ("good models FAST via gen-AI + MCP + skills") — the gen-AI leg (an image model, driven by the iki-create-image skill) and the MCP leg (`@ikijs/mcp`) already exist; this skill binds them.
```
reference → role-separated part PNGs → compose_layers_from_parts → auto_rig_from_layers → rigged .iki → render-verify
└──────── iki-create-image ────────┘ └────────────────── @ikijs/mcp ──────────────────┘
```
The hard part is **getting clean role-separated parts out of the image model** (an eyeless face base, an iris-free white sclera) — most of this file is the hard-won prompt patterns and pitfalls that make that reliable.
## When to use
- The user asks to generate/create/make an Iki character, avatar, or model **from scratch** (there is no existing art to import).
- You want to demo the full gen-AI → rig pipeline end to end.
## When NOT to use
- The character comes back renderable but not good-looking enough, and you want
it refined against a target look → that is the **iki-character-loop** skill,
which drives this pipeline in a generator/critic loop. This skill is the
single pass it calls.
- The user already has layered art (PNG layers or a PSD) → use the editor's "Import layer set" / PSD import path (`examples/editor`), not generation.
- The user already has ONE finished picture of the character and wants that picture rigged → the **iki-import-illustration** skill, which cuts it into layers in place instead of generating them.
- The user wants engine/format/rig _capability_ work (new deformer, new role, blink mechanics) → that's a normal code slice, not this skill.
- The user wants to tweak an existing `.iki`'s parameters/poses → open the playground and drive it directly (deployed, via the Model picker; in a checkout, via `iki-visual-test`), don't regenerate.
## Prerequisites
- **An image generator** for Steps 0 and 1: the **iki-create-image** skill. It runs the Codex CLI's image tool on a cheap model the plugin pins, and when Codex is not set up it hands the user the prompts to run in another tool. **Billed, minutes per image** — confirm the user is OK spending before starting. Anything that returns transparent, role-separated PNGs works; the prompts below are the substance, the driver is not.
- **The three tools this skill needs** reachable: `compose_layers_from_parts` (Step 2), `measure_layers` (the same geometry checks on their own) and `auto_rig_from_layers` (Step 3). The plugin bundles the server (`.mcp.json` → `npx -y @ikijs/mcp`), so they are normally already in the tool list, plugin-scoped as `mcp__plugin_iki_iki__compose_layers_from_parts`, `mcp__plugin_iki_iki__measure_layers` and `mcp__plugin_iki_iki__auto_rig_from_layers` in Claude Code. Codex may use different prefixes; resolve the bundled `iki` server's tools by their tool names. Look before doing anything else. When they are absent (server disabled) or you are developing `packages/mcp` and want the working-tree build, drive the **bin** over stdio instead:
```bash
npx -y @ikijs/mcp # standalone
pnpm --filter @ikijs/mcp build # in an iki checkout: produces packages/mcp/dist/cli.js
```
then send JSON-RPC `tools/call` frames to that process (see Step 3). Either way the tools **confine everything they write to the server's cwd** (realpath-checked, atomic rename), so the MCP server's cwd — or the dir you launch the bin from — is where the layers and the model can be written.
- **A scratch workdir inside that cwd**, `iki-char/`, holding `parts/` (the generated part PNGs), `layers/` (the composed role layers), `layout.json` (the per-role placement overrides, starting as `{}` the first time), `mirror-parts.json` once a part has needed flipping (Step 2), `canvas.json` for a full body (`full-body.md` Step 0), `custom/` and `custom-parts.json` only for a character with custom parts (Step 3, `customParts`; made when the first custom part is placed, never seeded) and the finished `.iki`. Create it up front — but only seed `layout.json` if it is not already there, so re-running this skill in a workdir you already tuned (Step 2) does not throw that tuning away; the workdir is gitignored, so there is no repository copy to recover it from. Every example below uses these paths.
```bash
mkdir -p iki-char/parts iki-char/layers
[ -f iki-char/layout.json ] || echo '{}' > iki-char/layout.json
```
## The role set this skill generates (full-expression default)
Mirrors `@ikijs/editor` `ROLE_TABLE` / `REQUIRED_ROLES`. **Required:** `face`, `eye_L`, `eye_R`, and `mouth` or the lip set (`mouth_inner` / `lip_lower` / `lip_upper`, below). The composer additionally emits `iris_L/R` (gaze), `lash_L/R` (blink-fold cover), `lash_lower_L/R` (the lower lid, when the eyewhite draws one), `brow_L/R` (expression), `hair_front`, and the optional `nose`, `mouth_open`, `hair_back`, `body`, cheek blush `blush_L/R` and side locks `hair_side_L/R`. That set gives a character that **blinks (eyelid-fold), gazes, lip-syncs, turns / nods / tilts its head with hair that sways behind it, and raises/tilts its brows** — on a torso that breathes and follows the head a little. The rigged model also declares motions (Nod, Shake, Tilt, and Flinch, Bounce and Droop, which also move the body where there is one) and up to eight default expressions (smile, laugh, angry, sad, surprised, shy, nervous, relieved), each with a description a host picks by — `shy` only with the blush, `angry` and `sad` only with brows, `nervous` with brows or an iris. The rig also accepts `hair_side_L` / `hair_side_R`, a front side lock per side hanging beside the ear, drawn over the face, the brows and the lashes and under `hair_front`; each needs `hair_front`, and the rig refuses a lock without it. `compose_layers_from_parts` composes both from one `hair_side.png` (the lock on the screen LEFT, `hair_side_R` as drawn, `hair_side_L` mirrored). The rig also accepts `arm_L` / `arm_R`, each a whole arm drawn hanging with the shoulder at the top: each becomes an elbow cap, an upper arm and a forearm on `ParamArmL/R` (the shoulder) and `ParamElbowL/R`, and needs a `body`. `compose_layers_from_parts` composes both arms from one `arm.png` (the arm on the screen LEFT, `arm_R` as drawn, `arm_L` mirrored), hung on the body's shoulders unless `layout.arm_L` / `arm_R` place them. The rig also accepts `forearm_pose_L` / `forearm_pose_R`, a second forearm per side drawn raised, which needs its arm: one part each, hung from the arm's elbow, swapped in for the hanging forearm by `ParamArmPoseL/R` (0 the hanging forearm, 1 the drawn one), rocked about the elbow by `ParamArmPoseAngleL/R`, and drawn above the face and the hair; a model with them also declares a `Wave` motion on the right hand. The rig also accepts the lip set, `mouth_inner` / `lip_lower` / `lip_upper` (the interior with its lower outline, the lower lip's skin, the upper lip with its line), all three or none, never with `mouth` or `mouth_open`, and with it the optional `mouth_tongue` / `mouth_teeth` clipped to `mouth_inner`: MouthOpen folds it like the eyelid, closed = the lips meeting on one line, so lip-sync never shows two drawings. `compose_layers_from_parts` makes it from `mouth_keyed.png` + `mouth_interior.png` (below), the default mouth of this skill; the `mouth.png` + `mouth_open.png` crossfade stays for a style that cannot fold — a dot, a single line, a `:3`, fangs. A full body — `body.png` drawn from the neck to the shoes, plus `arm.png` — is opt-in, and its prompts and procedure are in `full-body.md` beside this file (resolve `full-body.md` from the loaded skill directory); a bust never reads it.
| generated part | composer output role(s) | drives |
| --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `body.png` (a bust's torso to the waist, long slender neck, NO head; full body: `full-body.md`) | `body` | `bodyWarp` — breathes, follows the head's turn and tilt a little and turns on BodyAngleX/Y/Z; the head rides it, and the face still slides over its neck |
| `arm.png` (the arm on the screen LEFT, hanging, shoulder at the top; a full body: `full-body.md`) | `arm_R` / `arm_L` (mirrored) | an elbow cap, a forearm and, drawn over it, an upper arm on `ParamArmL/R` and `ParamElbowL/R`, hung from `bodyWarp` |
| `forearm_pose.png` (the raised forearm on the screen LEFT, standing up from the elbow end; optional, a full body: `full-body.md`) | `forearm_pose_R` / `forearm_pose_L` (mirrored) | a second forearm swapped in for the hanging one on `ParamArmPoseL/R`, rocked on `ParamArmPoseAngleL/R`, hung from the arm's elbow; the default `Wave` |
| `hair_back.png` (hair behind the head) | `hair_back` | the head's shell: follows the head on the turn and the nod by about a third of the face's motion, while the face and front hair slide further in front of it; its ends swing on their own back spring (`ParamHairBackSway`), a beat behind the front hair |
| `face.png` (NO eyes, NO mouth, NO neck) | `face` | its own turn × nod keyforms: the plate translates, the chin leading; drawn without a neck, it is all head and slides over the torso's neck (art whose face paints a neck under the jaw still works: that neck is cut off and stays on the torso while the chin, and its shade, slides over it); ears painted on its sides lag it, the far one going partly under the cheek on the turn (about half of an ear of the default size); roll about the chin, breath |
| `blush.png` (one cheek blush, optional) | `blush_L/R` (`blush_L` mirrored) | its own turn × nod keyforms, baked from the face plate's motion, so it stays on the cheek through the turn and nod; roll about the chin, breath; draws over the face, under the nose; rests faint, and `ParamCheek` raises it to the drawn look |
| `mouth.png` (closed; legacy: only for a style that cannot fold) | `mouth` | MouthForm; fades out as MouthOpen rises when `mouth_open` is present |
| `mouth_open.png` (open, same width; legacy: only for a style that cannot fold) | `mouth_open` | MouthOpen cross-fade — this is what makes lip-sync read as a mouth, not a smear |
| `mouth_keyed.png` (open, inside flat #00FF00) + `mouth_interior.png` (cavity, teeth, tongue) | `mouth_inner` / `lip_lower` / `lip_upper` | MouthOpen fold: the lips slide apart over the interior and meet on one line closed — lip-sync never shows two drawings; MouthForm on one shared frame |
| `mouth_interior.png`'s light paint (with the lip set) | `mouth_teeth` / `mouth_tongue` | the teeth ride the upper line and the tongue the opening's bottom, both clipped to the cavity (`mouth_inner`); `skipped` when the interior has none |
| `eyewhite.png` (white almond + dark lashes, **NO iris**) | `eye_L/R` (split sclera) + `lash_L/R` (split lashes) + `lash_lower_L/R` (split lower lid) | blink-fold (sclera = clip mask + fold; lash folds over the seam; the lower lid, drawn over the iris, folds with the white) |
| `iris.png` (colored disc + pupil + highlight) | `iris_L/R` | gaze (EyeballX/Y), auto-clipped to the sclera |
| `brow.png` (one eyebrow) | `brow_L/R` (mirrored) | BrowY / BrowAngle |
| `hair_side.png` (one lock, the screen-LEFT one, beside the ear, root at the top; optional) | `hair_side_R` / `hair_side_L` (mirrored) | moves exactly as the front hair down to the row where it first shows under the bangs, then eases to the face plate's own motion and keeps its width; sways on the front hair's springs (`ParamHairSwayX` / `ParamHairSwayZ`); under a roll it turns back toward plumb about where it leaves the bangs, by 45 % of the roll; drawn over the face, brows and lashes and under `hair_front`, which it needs |
| `hair_front.png` (bangs) | `hair_front` | rides the face where it lies over it and turns the head's outline, where it draws it, only as the back hair turns, though on rows where the back hair paints behind that edge it may ride further, as far as that back hair reaches; on the turn its crown turns with its cap, one piece, its top edge drawing the head's top outline where the back hair above it is thinner than that turn; on its cap the turn never carries its outer edge further outside the back hair painted behind it than the nod alone does, following less where that back hair reaches less, at the cap's edges only (its bangs over the face still ride the face); on the nod its cap slides with the face as far as the back hair covers the crown; its ends swing on the hair springs |
| `nose.png` (the nose only) | `nose` | leads the turn and the nod furthest of all the features — the turn's strongest depth cue; at full turn it also tilts its tip toward the far side |
The **nose** is a part of its own, like the eyes and the mouth. The features slide across the face on the turn and nod (depth parallax): the plate slides, the nose leads it, and the eyes, brows and mouth lead it by less, which is what stops a turn from reading as a plate without making it read as a slide. Without a `nose` layer the plate and the other features still turn on the profile, but the turn loses its strongest cue and fits nothing — `turnTargets` is inert and the result carries no `turn` report (Step 3) — and `measure_layers` flags the nose as missing. `face.png` must therefore come back WITHOUT a nose: a nose that leaks onto the face stays on the plate while the real one moves, and the two drift apart on every turn.
On the legacy route, without `mouth_open`, MouthOpen stretches the closed mouth open (to 0.8 of its width) — fine for a portrait, a blurred band for lip-sync.
`body` rides the rig's `bodyWarp`, which the head hangs from, and it carries the neck: the neck follows the head only by the body's small follow, so drawing it with the torso keeps the neck–shoulder junction one drawing and leaves the face nothing to cut. Without `body` the character has no neck or shoulders and reads as a floating head; painting shoulders into `face.png` instead is worse, because `face` rides the head's turn and the shoulders would slide with the head.
Each upper lash layer becomes three parts (`@ikijs/mcp` 0.39.2 on): `lash_L` (`lash_R`), the lash as drawn; over it `lash_closed_L` (`lash_closed_R`), the lash's body mirrored about its own middle; and `lash_smile_L` (`lash_smile_R`), the lash again. The eye shuts on a line that sags along the lower lid; the drawn lash comes down onto it and thins to nothing shut (it is one of the `FOLDS expected:` closures), and the closed lash fades in over the end of the blink (it shows at (1 - open)^6, so not at rest), which gives a shut eye the downward curve of a drawn one instead of a ruled line. `ParamEyeLSmile` / `ParamEyeRSmile` (0 to 1, declared with the upper lash) choose the shape the eye shuts into: the smiling lash is the lash whole on an arch, the upward curve of a laughing eye, and it shows in the closed lash's place as the smile goes to 1, which is what the default `laugh` expression shows. An open eye is the same at any smile; a shut eye between 0 and 1 shows both lashes in part. From `@ikijs/mcp` 0.39.3 on the closing eye bends toward the arch with the smile (the white, the lower lash and both lashes shut onto one line), so at smile 1 it bends toward the arch as it closes and lies on it shut; a 0.39.2 server renders the closing line under a fading arch instead, and from about a quarter open a closing eye shows the arch over its closing line, faint at first. A patch may not land on `lash_L` at eye-open 0 (its stop at 0.25 takes one), nor on the closed or the smiling lash. All three sample the lash's own crop: nothing is drawn for them, and a lid crease drawn apart above the lash in the same layer stays out of the closed lash. `describe_iki`, the `FOLD` lines and `hideParts` name all three parts.
`eye_L/R`, `lash_L/R` and `lash_lower_L/R` all come from the **single** `eyewhite.png` — the composer's eye split divides its dark pixels by luminance and height: those in the top fraction are the **upper-lash** layer and are recolored white in the sclera; those below it — the lower lid's line and lashes — are the **lower-lid** layer, which draws over the iris so it covers the iris's bottom edge as a drawn eye does, and stay as drawn in the sclera, whose alpha is the whole drawing's (the clip-mask shape). An eyewhite with no dark lower lid writes no lower-lid layers (`skipped` lists them). All three are cropped to the **same** eye bbox and placed with `noTrim` — the lower lid by the `eye_*` layout, as it has no key of its own — so the lash stays anchored ABOVE the sclera center — on blink it folds DOWN over the eye instead of the whole eye shrinking in place. This is deliberate: asking the image model for a _separately clean_ sclera and lash is less reliable than splitting one lashed white deterministically. A light mark drawn **detached above the white** — a double-eyelid crease — is dropped from the sclera, because the sclera is the iris's clip: kept, the fold carried it down into the iris's path at half blink, and the iris showed through it as a dashed line. Dark strokes there stay lash ink, so a dark crease line still shows, with the lash, and folds with it on blink. For the same reason the warm lid skin an eyewhite often draws **attached** above the white, between the white and the lash, is dropped from the sclera wherever lash ink lies above it; a band over the lash-free tear duct stays, as it can't be told from that corner's own shading.
## Procedure
### Step 0 — Draw the reference
Every part is drawn against one front-facing reference, so the set reads as one character: parts drawn from a style string alone drift in hue, line weight and rendering. If `iki-char/reference.png` already exists (a re-run), reuse it. If the user supplied a reference, copy it there. Otherwise draw one with the **iki-create-image** skill — its front-reference prompt, filled with the user's character and the `<STYLE>` the parts will share — into `iki-char/reference.png`, and check it against that skill's criteria before drawing any part. It is one more billed image.
A full body also draws `reference-full.png` from this one and sets the canvas's height: `full-body.md` Step 0.
### Step 1 — Generate role-separated parts against the reference
Use the **iki-create-image** skill to draw the parts **in parallel** into the parts dir (`iki-char/parts/`), with `iki-char/reference.png` attached to every job (`--ref`). Keep a **shared style descriptor** in every prompt so the parts read as one character (same hair color, eye color, line weight, flat anime cel-shading). Demand a **transparent background, front-facing, centered** part. (If a part comes back opaque-on-white instead of transparent, the composer's `keyWhiteToAlpha` fallback keys near-white to alpha — but transparent is better.)
A full body draws `body.png` and `arm.png` against `reference-full.png` instead, in a second run with prompts of their own, and `forearm_pose.png` against `reference-wave.png` in a third: `full-body.md` Step 1.
Prompt skeleton (fill `<STYLE>` consistently, e.g. "flat anime cel-shaded, soft lavender hair, blue eyes, clean line art"):
- **face.png** — "Front-facing anime character face base, `<STYLE>`. Skin, ears and the face shape only, with the jaw's outline drawn all the way round and CLOSED under the chin. **NO neck**: the drawing ends at the chin's outline. **NO eyes, NO eyebrows, NO nose, NO mouth, NO hair** — bare skin where features go. Transparent background, centered." _(The neck belongs to `body.png`. A face drawn without one is read as all head and slides over the torso's still neck; a neck painted on the face has to be cut out of it, and the cut shows as seams on the turn. "NO neck" is a negation like "NO nose", so generate 2 variants and pick the one that ends at its chin. A neckless face's box is its skull, and the default layout centres it above the eye row (`face.cy` 437 against the eyes' 475, bob's placement), where a skull sits. If the turn ever shows a still sliver at the chin's tip, the rig read a long tapering chin as a painted neck — report it.)_
- **mouth_keyed.png** — "A single anime mouth open mid-speech, `<STYLE>`, the reference character's mouth drawn alone: a MEDIUM-weight dark upper lip line — not bold, not the thickest line in the drawing — curving over the opening and ending exactly at the two mouth corners with NOTHING past them — NO flick, hook, tick or fork at, past or below the corners — below the opening, the lower lip is a soft shade only — a solid, opaque patch of skin colour a little deeper than the face's, its lower edge soft, with NO outline of its own: no line under or around the lower lip, no lip-liner; the opening's outline is the only line below the green — and ONE clean, closed outline running all the way round the opening with no break. Paint the ENTIRE inside of the opening, everything between the upper line and the lower lip, ONE flat pure green #00FF00 — a chroma-key fill: NO teeth, NO tongue, NO shading, NO gradient, nothing drawn inside the green. Transparent background, centered, nothing else." _(Generate 2 variants and pick a flat even green with the outline closed all round and the upper line medium, ending at the corners. The composer keys the green out and cuts the three lip layers from it, so an outline with a break, green outside the opening, or more than one green region is refused naming this file. The rig thins the drawn line to `UPPER_THIN` (0.7 — `packages/editor/src/auto-rig/mouth.ts`) of its height at every key and tapers its closed ends, so draw it medium and never thinner than the reference's mouth line: a thin one still comes back as `lip_upper: the upper line is N px` — regenerate it bolder. Anything drawn past a corner is a regeneration too: shut, the rig pulls a drawn flick toward the corner and thins it, but a small tick stays on the closed mouth. Closed, the skin tucks under the upper line, so a lower lip drawn with its own outline stays visible as a second line under the first (bob's first generation read as a separate pouty lip): an outlined lower lip is a regeneration too. The patch must be painted opaque: the composer reads the skin's top edge at alpha ≥ 128 and refuses a set with no skin under the opening, and a faint wash is not skin.)_
- **mouth_interior.png** — "The inside of an open anime mouth, `<STYLE>`, drawn alone and filling the image: a mid red-brown mouth cavity shaped like the opening — not near-black, and clearly darker than the tongue — a WIDE white band of upper teeth along its top edge, about a third of its height, and a pink tongue at its bottom. NO lips, NO lip line, NO skin, NO outline around it — only the cavity, the teeth and the tongue. Transparent background, centered, nothing else." _(Generate 2 variants. Both interiors of the spike drew a peach lower lip despite the negation, so the composer trims skin-coloured paint at the drawing's rim and refuses one that is nothing else. It is stretched to the keyed opening and masked by it, so its shape hardly matters; its colours and its teeth do. The composer splits it by lightness: what is under luma 100 is the cavity, and what is not is cut into `mouth_teeth` (above each column's middle, riding the upper line) and `mouth_tongue` (below it, riding the opening's bottom), so a cavity as light as the tongue comes back as light paint: its upper half as `mouth_teeth` (riding the line) and its lower half as `mouth_tongue`. Pick the one with the least lip.)_
- **eyewhite.png** — "A single anime eye, `<STYLE>`: an almond-shaped **white sclera** with **dark upper eyelashes** along the top. **NO iris, NO pupil, NO colored disc** — just the white interior and the dark lash line. **NO double-eyelid crease line above the eye.** **The outer corner, where the lash flicks out into a wing, is at the LEFT end of the image; the inner corner, the tear duct with no lash, is at the RIGHT end.** Transparent background, one eye only." _(The "NO iris" negation is the flaky part — see Pitfalls. Generate 2–3 variants and pick the cleanest iris-free one. The direction is in image terms on purpose — see the left/right pitfall. The crease is negated because the eye split keeps only part of one — see the eye-split paragraph above.)_
- **iris.png** — "A single round anime iris disc, `<STYLE>` eye color: radial colored iris with a dark round pupil and a small white highlight glint, top. Transparent background, just the disc, no eyelid, no sclera, no lashes."
- **brow.png** — "A single anime eyebrow, `<STYLE>`. Transparent background, one brow only, gentle arch, **its thick head at the LEFT end of the image, tapering to a thin tail at the RIGHT end**."
- **nose.png** — "A single anime nose, `<STYLE>`, seen from the front, drawn EXACTLY the way the attached reference character draws the nose: the same style, the same amount of shading and the same size relative to the face. If the reference draws a minimal nose — only a tiny soft highlight and a short shadow tick — draw only that, small and soft, with NO shaded bridge, nostril or volume the reference does not have; if it draws a shaded nose, keep its shading. Transparent background: only the nose marks themselves, NO skin-coloured patch or rectangle, NO face, NO eyes, NO mouth, NO outline around it. Centered, one nose only." _(Optional but the whole head-turn depth cue hangs on it. Generate 2–3 variants — a run on a minimal-nose reference got 3 usable of 3. The nose follows the reference because a nose drawn in another style reads wrong at any size: a shaded bump scaled down on a face whose reference draws a highlight and a tick still reads as the wrong nose. On a shaded nose, a skin fill slightly darker than the face reads as the bump's shadow, so keep it. The composer sizes the nose by its DENSE CORE — the tight box of its pixels at alpha ≥ 128, about 20 px wide by default — and puts the core's tip 0.66 of the way from the eye row to the mouth. Retune `layout.nose` with `w`/`h` sizing that core and `cx` centring its columns; a minimal nose wants a narrower core than the default (one 400-px face took `w` 12). Leave `cy` unset so the tip stays on that 0.66 row and follows a retuned `eye_L`/`eye_R` `cy` and the mouth's (`mouth_inner.cy` on the lip set, `mouth.cy` on the legacy route); setting `cy` places the core's CENTRE row there instead of its tip, so the same number puts the nose about half the core's height lower. A core under a quarter of the part's width or height — a lone nostril mark or highlight — composes as the whole part instead and the report warns; regenerate the nose with its shading painted denser, not a layout retune.)_
- **hair_front.png** — "Front hair / bangs for an anime character, `<STYLE>`, framing an empty face from above: ONLY the bangs and the hair over the top of the head, NARROW, no wider than the face itself, its sides ending at the temples so the head's outer silhouette is left to the back hair. Drawn as ONE inner layer that a fuller back hair will surround: its strands converge into a single crown point at the top; its top and outer edges have NO outline stroke and NO stray flyaway strands, so they blend into the back hair behind them, while the bang tips keep their line art. No side curtains, no hair over or beside the ears. Transparent background, front layer only (no back hair, no face)." _(Drawn as a whole hairstyle of its own — an outline, flyaways and a parting at its top — the front hair reads as a second head inside the back hair; on bob, the inner-layer wording largely removed that. Keep it about face-wide: the back hair then has room beside it at its natural size. The no-stroke top matters on the nod: looking down, the cap slides below the back hair's rim, and a top edge drawn with a line, or the crown point inked dark where the strands meet, shows there as a second crown above the first — merged into the back hair's rim line at rest, a few px inside it (silver-hood). On bob, a front hair spanning the whole bob, side hair included, turned its cap 0.45× the face; redrawn face-wide at `layout.hair_front` {cx 550, cy 330, w 420} over the same back hair it turned 0.83–0.86×, its crown included, while blowing the back hair up to make room instead read as too big a head. The lock beside the ear is `hair_side.png`'s, drawn alone: never ask this drawing for side curtains.)_
- **hair_back.png** — "Back hair for an anime character, `<STYLE>`: the whole back of the head's hair, drawn as a FULL CROWN reaching up past where the bangs' top will sit, with an even, rounded top and NO parting dip, falling behind the head and shoulders. Transparent background, no face, no bangs." _(Compose it larger and higher than the front hair, so its crown surrounds the front hair's top: the layout box, not the drawing, sets where that top lands. On bob, the back hair's box at the front hair's height left its top level with the front hair's and 24–33 px short at the crown's shoulders; `layout.hair_back` {cx 550, cy 390, w 555, h 522} (from {cy 405, w 545, h 493}: its top raised 30 px, its width +10) cleared the front hair's top by 5 px in every crown column. The front hair's cap slides on the nod only as far as back hair is painted behind its top, so a back hair that stops short of it, or dips at the parting, holds the cap's top nearly still. The front hair's outer edge turns with the face only as far as the back hair's solid mass reaches past it, about 0.084 hh on every row beside the crown and temples (≈ 15 px at bob's 184 px head unit; the back hair turns with the head itself, so it has to reach past the edge only by the rest of the front hair's turn), a little more where the dome slopes. That reach is the back hair's painted edge as composed against the front hair's: check it on the composed layers, row by row, not on the boxes. Get it from a narrow front hair (above) rather than a bigger back hair.)_
- **hair_side.png** — "ONE front side lock of hair for an anime character, `<STYLE>`, drawn alone: a single lock hanging straight down, its upper part a long plain root section tapering to a soft point a little below the image's top edge, with clear transparent space above it and NO outline stroke at its top. **Its inner edge, the face side, faces the RIGHT of the image; its outer edge faces the LEFT; if the lock curves, its tip curves toward the RIGHT.** NO ear, NO face, NO bangs, NO second lock, NO accessory. Transparent background, one lock only." _(Optional: a parts dir without it composes, and both side locks are listed in `skipped`. Generate 2 variants with `--ref` and pick the one with a single lock, its root tapering inside the frame, no ear, and its tip (if it curves) toward the right. The composer mirrors the lock into the other side, so draw only the screen-left one. The rig needs `hair_front` for it: the root is meant to hide under the bangs. The geometry report flags a root that shows past the bangs, a lock over the eye's outer corner, two locks in one image and nothing painted behind the lock's inward lean on the turn (Pitfalls). The ear belongs to `face.png`, so a lock drawn with an ear doubles it. Where the lock goes, root under the bangs and body beside the ear, is set by `layout` (Step 2), not by the drawing.)_
- **Legacy mouth — only for a style that cannot fold (a dot, a single line, a `:3`, fangs), in place of the two mouth files above; never beside them (the composer refuses the mix).**
- **mouth.png** — "A single small closed anime mouth / lips, `<STYLE>`. Transparent background, centered, nothing else."
- **mouth_open.png** — "The same anime mouth as `mouth.png` but open mid-speech, `<STYLE>`: parted lips, dark interior, a hint of teeth. Same width and line weight as the closed mouth. Transparent background, centered, nothing else." _(The default layout gives it the same `cx`/`w` as `mouth` and aligns the top lip, so draw it the same width.)_
- **body.png** (a bust's; a full body: `full-body.md`) — "A front-facing anime character's torso shown down to the waistline, `<STYLE>`, simple clothing. Out of the collar rises a SLENDER, LONG neck, part of the same drawing: about one EIGHTH of the shoulder width, sticking up above the collar by more than its own width, its top cut flat (the face is drawn over it) and its side outlines flaring gently into the shoulders at the bottom. The neck is ONE flat, even skin-shadow tone a shade darker than face skin, from the cut down to the collar: NO cast shadow, NO V-shaped shadow, NO gradient, NO highlight. Keep the neck's side outlines. **Do not draw any head, face, chin, jaw line or hair.** Transparent background, centered, the composition about one and a half times as wide as it is tall." _(The neck follows the head only a little while the face slides over it, so its top must stay hidden behind the face through the turn, the nod and the roll. The framing sets the torso's scale against the face: `w` caps at the canvas and a torso that reaches its bottom fills it, so a chest-only drawing came out about 15% wider at the shoulders than bob's necked-face torso and made the face look small, while a waist-length one came out about 2% narrower. Place the torso so the neck's flat top sits well above the chin, behind the face's widest rows, and its bottom reaches the canvas's: on bob, `layout.body` {cx 550, cy 906, w 1100} put the top about 200 px above the chin. Tops 60–80 px above it showed their flat corners beside the jaw at the extremes (a full turn, looking up and a full roll at once), while 120 px did not; `h` may stretch a flat-toned torso by about 10% to lift a short neck's top, and shrinking `w` instead lowers it. The width matters too: on bob a 176 px neck showed its corners at the same extremes while ~145 px did not (bob's face-painted neck was 135). Word it as a torso: "upper body of an anime girl" came back as the whole character, head and all. Fire the two variants with differently worded prompts: the same prompt fired twice at once came back as two identical images.)_
- **blush.png** — "A single soft anime cheek blush, `<STYLE>`, for the cheek on the screen LEFT: one soft pink flush about twice as wide as tall, fading to fully transparent at its edges. **Its outer end, toward the face's edge, is at the LEFT end of the image; its inner end, toward the nose, is at the RIGHT end.** NO face, NO skin-coloured patch, NO outline, NO hatching lines or strokes. Transparent background, one blush only." _(Optional: a parts dir without it composes, and the geometry report does not flag it missing. It is not only decoration: `ParamCheek` fades it, faint at rest and as drawn at 1. Keep it soft colour: a dark hatch or stroke would read as marks on the cheek rather than a flush. (This prompt has not yet been run through the image model; the blush path was checked with a script-drawn ellipse.) The default layout puts it 56 px wide just outside and below each eye, picked on bob's face for a 2:1 blush: the face narrows fast below the eye row, and a box further out reached the ears on the turn. `blush_L` and `blush_R` are separate `layout` keys that only default to mirror images, so retune both.)_
Save each to the parts dir with the **exact filenames above** (`compose_layers_from_parts` expects them).
A part the role list has no name for (twin tails, a hairpin) is drawn on its own, and it is not a role file: it goes in `iki-char/custom/`, not the parts dir (Step 3, `customParts`). Its prompt: "A single `<what it is>` for an anime character, `<STYLE>`, drawn alone and whole on a transparent background, in the orientation it has on the character (`<for example: hanging straight down, root at the top>`): the complete shape with NO face, NO hair around it and NO other accessory. Its root end, where it attaches, extends as a plain stretch of the same colour past the attachment point, with NO outline stroke across it and NO flat filler band." Draw that root stretch at least a tenth of the face's width past where the part meets the anchor (its largest slide on a turn: about 40 px on a 400 px face), and keep it inside the anchor's outline by the same margin, so the part never shows a bare edge as it slides. When a custom part hangs from a role, that role's own prompt draws it complete under the tie and without the part: a hair_back with the tails cut off ends in the head's own outline, not in the stubs of the tails, because where the part goes behind its anchor on a turn (a far tail behind the head's hair) the anchor's own art is what shows.
### Step 2 — Compose into canvas role layers
Call `compose_layers_from_parts` with the parts dir, the layers dir, whatever
`iki-char/layout.json` holds right now, and `iki-char/mirror-parts.json` when it
exists:
```jsonc
{
"partsDir": "iki-char/parts",
"outDir": "iki-char/layers",
// the contents of iki-char/layout.json — `{}` until you tune something
"layout": {},
// the contents of iki-char/mirror-parts.json — leave it out until a part needs it
"mirrorParts": [],
// the canvas's height, an even integer in 1100..4096 — leave it out for a bust
// "canvasHeight": 3650,
}
```
A full body passes `canvasHeight` from `iki-char/canvas.json` and places its body and arms against `reference-full.png`: `full-body.md` Step 2.
It alpha-trims (leaving out a faint speck detached from the drawing, which
would pull the part off its centre), resizes, mirrors L/R and pastes each part
at its layout center on a shared transparent canvas 1100 wide and
`canvasHeight` tall (1100 unless a full body sets it), which grows downward so
every part keeps its place, writing
role-named PNGs (`face.png`, `eye_L.png`, …) plus a flattened `preview.png` into
`iki-char/layers/` — which must already exist, since the tool never creates
it. The result carries the
written layer paths and, inline, the geometry report — which encodes the failure
modes that each cost a real regeneration round to find by eye
(iris/sclera ratio, a sclera too flat to hold a round iris, an iris off the
white's centre of mass, lash/sclera drift, an eye drawn facing the other way,
art cut through by its own frame, and on a full body feet cut by the canvas's
bottom and an arm's shoulder cap that misses the torso).
Iterate until it reports `all geometry checks passed`.
An eye **drawn facing the other way** is fixed before anything else, and never
by retuning its iris: add `"eyewhite.png"` to `iki-char/mirror-parts.json` (a
JSON array) and recompose with it as `mirrorParts`. The composer flips the
source, so both eyes and both lashes flip together — free, no regeneration.
`brow.png` flips the same way if its head came out on the right, and
`blush.png` if its outer end did, and `hair_side.png` if its tip curves toward the LEFT of the image (a straight lock that is near-symmetric left to right needs no flip; one whose shading or root slant faces the wrong way does).
**Read `preview.png`** to check alignment. The built-in default layout assumes
the standard framing prompted above. The face and its features default to the
bob's placement, and the features' defaults are proportions of the face:
move or resize the face with `face.cx` / `cy` / `w` and the eyes, irises,
lashes, brows, nose, mouth, blush and side locks follow (`face.h` stretches the face
alone), so fit the face first. If eyes/mouth/brows are still off, edit
`iki-char/layout.json` (per-role `cx`/`cy`/`w`/`h`, e.g. `{ "eye_L": { "cx": 660 } }`; `h` stretches a part instead of keeping its aspect, which is how a sclera too flat to hold a round iris is fixed for free — set it on the sclera and its lash together or the blink fold tears)
and call the tool again — free, deterministic, and it does **not** re-bill, so
iterate freely. Before you change any `w`, read the iris pitfall below: `eye_*`,
`lash_*` and `iris_*` are four keys that have to move together.
`layout.mouth_inner` is the lip set's one key (`cx`/`cy`/`w`/`h`, `mouth_open`'s place by default): its layers are cut from one frame and move together, and `lip_lower` / `lip_upper` / `mouth_tongue` / `mouth_teeth` have no key. With the lip set `layout.mouth` and `layout.mouth_open` are ignored: retune `mouth_inner`. `preview.png` shows the mouth closed, as the rig draws the rest pose.
`layout.hair_side_R` (the lock on the screen LEFT) and `layout.hair_side_L` (`cx`/`cy`/`w`/`h`) place the side locks; they move and scale with the face like its features, and default to one character's tuned placement, proportional to the face; check it on `preview.png` and retune per character. They are two keys that only default to mirror images, so retune both. A lock sits with its root under the bangs (its top above the brow row, so `hair_front` covers it), its inner edge outside the eye's outer corner, and the ear showing beside it. Outward is a lower `cx` for `hair_side_R` and a higher one for `hair_side_L`; a lower `cy` is up.
`measure_layers` re-runs that same report over an existing layers dir
(`{ "layersDir": "iki-char/layers" }`) — for re-checking a layer set you did not
just compose.
### Step 3 — Auto-rig to a renderable `.iki` via MCP
Call `auto_rig_from_layers` with the layer paths `compose_layers_from_parts` returned (everything it wrote but the previews, `preview.png` and `preview-pose.png`) and an `outputPath` ending in `.iki` whose parent directory already exists. A full body adds `arm_L` / `arm_R` to the layers: `full-body.md` Step 3. Input shape:
```jsonc
{
"layers": [
{ "path": "iki-char/layers/body.png" },
{ "path": "iki-char/layers/hair_back.png" },
{ "path": "iki-char/layers/face.png" },
{ "path": "iki-char/layers/blush_L.png" },
{ "path": "iki-char/layers/blush_R.png" },
{ "path": "iki-char/layers/nose.png" },
{ "path": "iki-char/layers/eye_L.png" },
{ "path": "iki-char/layers/eye_R.png" },
{ "path": "iki-char/layers/iris_L.png" },
{ "path": "iki-char/layers/iris_R.png" },
// only when the compose wrote them (an eyewhite with no dark lower lid writes none)
{ "path": "iki-char/layers/lash_lower_L.png" },
{ "path": "iki-char/layers/lash_lower_R.png" },
{ "path": "iki-char/layers/lash_L.png" },
{ "path": "iki-char/layers/lash_R.png" },
// the lip set; a legacy mouth lists mouth.png + mouth_open.png here instead
{ "path": "iki-char/layers/mouth_inner.png" },
// only when the compose wrote them (an interior with no light paint writes none)
{ "path": "iki-char/layers/mouth_tongue.png" },
{ "path": "iki-char/layers/mouth_teeth.png" },
{ "path": "iki-char/layers/lip_lower.png" },
{ "path": "iki-char/layers/lip_upper.png" },
// only when the compose wrote them (a parts dir with hair_side.png, and hair_front present)
{ "path": "iki-char/layers/hair_side_L.png" },
{ "path": "iki-char/layers/hair_side_R.png" },
{ "path": "iki-char/layers/brow_L.png" },
{ "path": "iki-char/layers/brow_R.png" },
{ "path": "iki-char/layers/hair_front.png" },
],
"outputPath": "iki-char/iki-character.iki",
"quantizeColors": 256,
}
```
Role is derived from the file basename (override per layer with `fileName` if needed). The tool decodes/crops/atlases itself (sharp, internal) and writes a renderable `.iki`, returning its path. A missing required role or a layer whose size ≠ the canvas comes back as `{ ok: false, error }` — fix the layers and retry.
`quantizeColors` palette-quantizes the atlas PNG. Flat-shaded art keeps its look at 256 colours and the model drops well below its lossless size (the hero demo: 3.18MB lossless → 1.28MB with `quantizeColors: 256`), which is what makes it loadable on a page. With a `nose` layer present, the nose alone stays on a second, lossless atlas page, because its soft shading would otherwise pick up the hair's palette entries and draw a rim. Leave it out while iterating on the art; put it in for the model you ship.
`rigPlan` is optional per-character tuning from the profile the rig defaults to. Leave it out, or pass `{}`, for the profile itself, and name only the fields you change. It applies with or without a `nose` layer. It has three groups, and a field is named `group.key`:
| Path | What it tunes | Was `style.` |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- |
| `turn.amount` | the whole head turn, as a multiple of the profile's — plate, features, hair and the eyes' foreshortening; ignored when `turnTargets.eyeShift` is given | `turn` |
| `turn.featureLead` | how far the features lead the face plate, as a multiple of the profile's | `featureLead` |
| `turn.eyeForeshorten` | how much the far eye narrows on the turn, as a multiple of the profile's — turn only, the nod untouched; ignored when `turnTargets.farEyeRatio` is given; amount × eyeForeshorten must stay ≤ 4 | — |
| `turn.noseLead` | how far the nose leads the face plate on the turn, as a multiple of the profile's — turn only, the nod keeps the nose depth; ignored when `turnTargets.noseShift` is given | — |
| `turn.farEar` | how far the far ear's outer edge follows the face on the turn, as a share of the face plate's slide (0: it holds and the head slides over it, about half of a default-sized ear going under the face; 1: it rides with the face and stays whole) | — |
| `hair.follow` | the front hair's share of the face's turn (never less than the back hair's own turn, 0.3 of the face's: a share under that has no effect) | `hairFollow` |
| `hair.outlineFollow` | its outer edge's share where the front hair draws the head's outline (never less than the back hair's own turn: at 0 the outline turns only as the back hair does, though where back hair paints behind it, it may ride further, as far as that back hair reaches; at `hair.follow` the front hair's side strands ride whole) | `outlineFollow` |
| `hair.sway` | the hair sway amplitude, as a multiple of the profile's | `sway` |
| `eyes.blink` | how far the upper lid comes down at the eye's ends, over the eye's height (its middle lands lower, along the lower lid) | `blink` |
`turn.eyeForeshorten` and `turn.noseLead` carry provisional recommended spans (planner choices, not yet picked by an A/B on our own characters), flagged `provisional` in `describe_rig_plan`; the loop gates these two blind before it keeps a change (see the **iki-character-loop** skill). Call `describe_rig_plan` for the live defaults, hard ranges, recommended spans, steps and the poses each field shows at; this table keeps no numbers, because that tool is their one source. The recommended span is where a character's tuning stays — the span that still reads well on our own characters (at its top end, `turn.amount` and `turn.featureLead` start to crowd the far eye against the head's edge on some art); the range is only what the tool accepts.
A value out of its range comes back as `INVALID: rigPlan.turn.amount 4 is outside [0, 3] (recommended 0.7–1.3)`, and so does a group or key not in the catalog. A passed `style` is refused too — `INVALID: style was removed: pass rigPlan — style.turn is rigPlan.turn.amount, …` — with no alias. Over MCP a `rigPlan` that is not an object, or a field that is not a number, never reaches the tool: its input schema refuses it, and the SDK answers with an `isError` result reading `MCP error -32602: Input validation error: …`. A `turn.amount` the art has no room for is not refused — it comes back clamped (below).
The result carries a `RIGPLAN:` line after the path (and the result's `rigPlan` echo): every field's `effective` value the rig built with, each annotated `(requested …, clamped at …)` where the art's room cut a field, or `(fitted by turnTargets.…)` where a `turnTargets` cue fitted it instead (`overriddenBy`). A result without it is a server before 0.30.0.
`patches` is optional too, and local where `rigPlan` is global: each op ADDS a displacement to one EXISTING keyform stop of one target, and every other stop and the rest pose stay as the rig generates them. Between stops the engine blends linearly, so a fix at `ParamAngleX` −30 shows at half strength at −15 and fades to nothing at rest. Leave it out, or pass `[]`, for the rig as generated.
```jsonc
{
"patches": [
{
"target": "eyeWarp_R",
"at": { "ParamAngleX": -30, "ParamAngleY": 0 },
"region": { "role": "eye_R", "x": [0.0, 0.2], "y": [0.3, 0.5] },
"by": { "dx": 0.02, "dy": 0.0 },
"falloff": 0.03,
"why": "one line",
},
],
}
```
- `target` — a feature grid or a mesh part. The grids are the `warp2d` deformers `eyeWarp_L`, `eyeWarp_R`, `browWarp_L`, `browWarp_R`, `noseWarp` and `mouthWarp`, those the layer set rigs: their `at` names BOTH `ParamAngleX` and `ParamAngleY`, each −30, 0 or 30, never both 0. A part's own `keyforms2d` (`@ikijs/mcp` 0.39.3 on, shown by `describe_iki` beside its `warps`; an older server's summary has no such key) is not a target: a patch names one of the part's `warps` stops or a feature grid. A mesh part with warps (`face`, `hair_front`, `lash_L`, …) takes an `at` naming exactly ONE parameter at a value the part has a warp keyform at, e.g. `{ "ParamAngleX": -30 }`, never that parameter's default (the part's rest) nor the stop where the rig shuts the part on purpose — `eye_*` and `lash_lower_*` at their `ParamEye*Open` 0, the lip set with its tongue and teeth at `ParamMouthOpenY` 0 — which the fold check exempts, so a fold a patch made there would never be reported. The rest pose is the drawn art, which no patch changes: change it with the layout or by regenerating the layer. `bodyWarp` and the matrix deformers are not targets, and a patch adds no stop and changes no parameter range.
- `region` — a rectangle in fractions of the REST layer box of part `role` (its opaque box in the layer PNG), origin top-left, x right, y DOWN; it may reach past the box (below 0 or above 1). The target's points whose REST position falls inside take the whole of `by`, points within `falloff` of it a smooth share, the rest nothing. The region is located at REST, even though the defect shows on a posed render.
- `by` — the displacement at that stop, in FACE WIDTHS (the `face` layer's opaque box width), on screen axes: +`dx` toward the viewer's right, +`dy` DOWN. A character's Left (`_L`) is the viewer's RIGHT. On a 400 px face, `dx: 0.02` is 8 px to the right at that stop.
- `falloff` — in face widths; 0 or absent is a hard edge.
- `why` — one line for whoever edits the patches next; the rig ignores it.
The ops replay on the freshly generated rig every time it is rigged, added to whatever it now bakes, so a patch survives a layout or `rigPlan` retune: pass the whole list on every call. Ops on one stop add up, whatever their order. Each op prints one line after the path and before the fold report — `PATCH 0 eyeWarp_R at ParamAngleX=-30 ParamAngleY=0: 4 of 25 points (cols 0-1, rows 1-2), largest move 8 model px`, with `(vertices)` in place of the columns and rows for a mesh part, the move in model px (the layer PNGs' own pixels) — and the result's `patches` carries the same reports, `[]` for `[]`. An op the tool's input schema accepts but the rig refuses comes back as `INVALID: patches[i]…` and nothing is written: an unknown key, target, role or stop (the message lists the keys, the grids and mesh parts, the roles or the target's stops there are), the rest stop, a shut stop or a `ParamAngleZ`/`ParamBodyAngleZ` stop of a mesh part, which roll the deformers it hangs under so its displacement would not stay on screen axes (each names where to patch instead), or a region that runs backwards or catches none of the target's points (it gives where they lie at rest, in fractions of the role's box). Over MCP an op with a missing field, or a field of the wrong type, never reaches the tool: the SDK answers with an `isError` result, as for `rigPlan`.
`patches` needs `@ikijs/mcp` 0.26.0 or later. An older server drops the field silently and rigs WITHOUT it: the result then has no `PATCH` line and no `patches` field. On such a server treat `patches` as unavailable, and never trust a model from such a call as patched.
`customParts` is optional and adds a part the rig has no role for, such as twin tails or a hairpin. Each entry is `{ id, path, anchor, tie, after, deformer?, rigid?, occlusion? }`:
```jsonc
"customParts": [
{
"id": "tail_L", // a plain identifier, never a role's name or a part id a role yields
"path": "iki-char/custom/tail_L.png", // a PNG the size of the layers, the part alone
"anchor": "hair_back", // the role it is fixed against
"tie": [310, 420], // [x, y] canvas px where it meets the anchor: inside both layers' alpha boxes
"after": "hair_back", // a role of the set: drawn right after that role's last part
"occlusion": { // optional: hidden where these roles' paint covers it
"by": ["hair_back"], // roles of the set
"parameter": "ParamAngleX", // a declared parameter, never a physics output
"stops": [{ "value": 5, "amount": 0 }, { "value": 15, "amount": 1 }] // ascending values, amount 0 to 1
}
}
]
```
`deformer` is optional and accepts only `headDeformer`, the default. The part goes in the model as an unrigged mesh on the head. Keep the custom layers in `iki-char/custom/`, never in `layers/`: `measure_layers` and the role parse refuse a name that is no role, and a custom layer must not be measured as a role anyway, since a tail across the eye row would widen the head the turn is fitted to. The composer places no custom part, so the PNG is canvas-sized and supplied by the caller: put the drawn part on a transparent canvas of the model's size at the position it should sit, scaling it first if needed, e.g. `magick -size <W>x<H> xc:none <part.png> -geometry +<x>+<y> -composite iki-char/custom/<id>.png`. `tie` is a canvas-px point that both the placed part and its anchor's layer paint, where the part is attached. Pass the whole list on every call, as with `patches`. The result carries `customParts` (`parts`: `id`, `box`, `mesh`, `order`, atlas `page`, `[]` for `[]`), and one `CUSTOM <id>: …` line per part follows the `HAIRSIDE` lines (the `BAKE` lines and the gate, below, come after). An empty or wrong-size layer, or an entry the rig refuses, comes back as `INVALID: customParts[i]…` and nothing is written. All custom parts share one extra atlas page, the last. `customParts` needs `@ikijs/mcp` 0.34.0 or later. An older server drops the field silently and rigs WITHOUT the parts: the result then has no `customParts` field and no `CUSTOM` line, so check for it before trusting the model.
`occlusion` hides the part where the named roles' paint covers it, by the amount its stops give on the parameter: linear between stops, held before the first and after the last, 1 hiding the part wherever the roles lie over it, 0 not at all (a model that declares none draws as before). The edge is hard: cover is where a role's drawn alpha at that pose is at least 0.5, so the part's edge follows the roles' half-opaque contour and no softer. A role that fades (`mouth_open`, a blush, a pose forearm) covers only while it is drawn at half strength or more, and the gate never counts it as cover. A role drawn after the part already covers it where they overlap, so for a role drawn before the part (the head's hair on a turn) the occlusion is what puts the part behind it. Make the stops a switch, not a fade: amount 0 a degree or more off rest (twin: 5), so the rest pose never sits on the switch and the part cannot flicker at rest; the idle turns the head to about 12° on `ParamAngleX`, 9° on `ParamAngleY` and 4° on `ParamAngleZ`, so a far part switching on the idle's larger turns is expected, and amount 1 about one degree later (twin: 6), where the part barely overlaps its cover so little changes in that frame. That overlap is the part's root around the tie, which the gate keeps on the anchor's paint; if more of the part lies on the cover at the switch, the pop is a bake or art fix, never a wider band or a tie moved off the paint. What makes the part go behind progressively is its baked travel toward the head's axis on the far side, which slides it under the cover's edge; a longer band makes the covered art translucent for that stretch, which reads as a ghost. `by` names roles, not part ids; an arm role is its three parts, and a role whose part is clipped or has no mesh (`iris_L`, a brow drawn on the face, which the rig clips to it from `@ikijs/mcp` 0.38.2 on, `forearm_pose_L`) is refused as `INVALID: customParts[i].occlusion…`. The result's part carries `occlusion` and its `CUSTOM <id>:` line ends `, hidden by <id>,<id>… on <parameter> at <value>:<amount> <value>:<amount>…`. `occlusion` needs `@ikijs/mcp` 0.35.0 or later; an older server refuses the key as an unknown key (`INVALID: customParts[i]…` naming `occlusion`). Declare `occlusion` only for a part that really goes behind its cover in the turned reference, never to clear a `TIE`, `SLIDE` or `EXPOSED` failure: the gate still reads the stretch up to amount 1. On such a server remove the `occlusion` key and rig without it: the model is valid but the far part then draws in front of its cover, so say so in your report instead of passing it off as hidden.
`bakes` is optional, needs `customParts`, and makes the custom parts move: without it a custom part stays where it was placed and the head turns away from it. The tool's `bakes` field is `{ "targets": [ … ], "meshes"?: { … } }` (a `bakes.json` file wraps it as `{ "bakes": { … } }`), and a target is a lattice of control points with a displacement at each stop of one parameter:
```jsonc
"bakes": {
"targets": [
{
"id": "tail_L-sway", // a label for reports
"param": "ParamHairBackSway", // a parameter the model declares
"parts": ["tail_L"], // custom part ids only
"grid": { "cols": 1, "rows": 1 }, // (cols + 1) x (rows + 1) control points, integers 1 to 32
"stops": { "20": [[0, 0], [0, 0], [6, 0], [6, 0]] } // one [dx, dy] per control point, row-major from the top-left
}
]
}
```
Every position and displacement is in canvas px, origin top-left, x right, y DOWN, the frame `probe_rig` answers in. A stop is the part's TOTAL displacement from rest when that parameter alone is at the stop value and the others are at their defaults: the head's own carry is inside it, so a neighbour's displacement as `probe_rig` measures it is written as it is. The head does not move on `ParamHairBackSway`, so the stop above holds the top row, where the tail is tied on, still and swings the lower edge 6 px right at 20. Stop keys are values inside the parameter's range, never its default (rest is implicit); the landing is exact at rest, at each stop and at one end key the rig adds at the range end on a side whose outermost stop is inside the range (it holds that stop's displacement); a side with no stop does not move. Between keys the offsets blend linearly, so under the head's roll the path bows off the line by about a pixel midway over 15°: put a stop where the path matters. `box` (canvas px) is the lattice's extent and defaults to the parts' rest boxes grown by 2 px. `mirror: true` fills a missing stop from the one at the mirrored value, the lattice reflected about the box's vertical centre line with `dx` negated. Targets that name the same part and parameter add. `meshes` (`{ "tail_L": { "rows": [y0, y1, …], "cols": 6 } }` or `{ "tail_L": { "cellPx": 12 } }`) gives a long part more vertices to bend with. `rigid: true` on a `customParts` entry marks art that does not bend (a hairpin): a stop that bends it is refused, so give such a part one displacement for every control point of a stop, or a rotation (a roll turns it with the head).
The written rig is landed through the engine at every stop and at the range end each side holds its outermost stop to, and the result prints one `BAKE <part> <param>: <n> vertices, stops <values>, error <px> px` line per part and parameter after the `CUSTOM` lines (the result's `customParts.bakes`); the error is under 0.1 px, or the call is `INVALID: BAKE ERROR <part> <param>=<value>: …` (or `<part> at rest`) and nothing is written; that one means the rig and the engine disagree, which is a bug in the packages. An input the rig refuses is `INVALID: bakes…` with its path. `bakes` needs `@ikijs/mcp` 0.34.0 or later; an older server drops the field, rigs WITHOUT the motion, and returns no `BAKE` line, so look for one.
With `customParts` the written rig is also measured per part, over the engine's fold poses, each of the part's own stops alone and every combination of the stops of each pair of parameters it is baked on (the stops of its `occlusion` on the key parameter count as its stops, so a bake key where the amount reaches 1 changes no verdict), and the text ends with the gate: per part a `CUSTOM <id> <LINE>: …` line, each with its worst value in px and in face widths (the `face` layer's width), its pose and `pass` or `FAIL: <reason>`, then `CUSTOM GATE pass` or `CUSTOM GATE FAIL: <part LINE, …>` as the text's last line (the result's `customParts.gate`: `ok`, the limits, each part's measures). `FOLDS` is the part's least triangle area ratio (≥ 0.1, the engine's collapse). `TIE` is, at the tie and a ring around it, the part's displacement less its anchor's, the largest over the poses where `ParamAngleX` is at its default (≤ 0.005 face widths); a tie with no ring point on both the part and its anchor fails it with that reason. `SLIDE` is the same length over the poses that turn the head (≤ 0.1), and the distance from where the part lands its tie to the nearest painted point of the anchor as the anchor lands it (≤ 0.015: the tie stays on the anchor's paint). `EXPOSED` counts the hidden art showing: the pixels within 0.15 face widths of the tie that both the part and its anchor paint, one of which hides the other's art at rest; at a pose each such pixel is landed through the part drawn below and counted when no painted point of the part drawn above lands over it. Where the head does not turn the count is limited (≤ 0.0009 face widths²); where it turns it is printed beside it with no limit, since a tie allowed to slide uncovers what lies under it. A part has one `order`, so only this pair is read, unless the part declares an `occlusion`: the gate excuses a reading only where it can establish that the player hides what the reading measures, and keeps the check everywhere else. Cover is the paint of an occluder in `occlusion.by`, as that occluder lands at the pose, and only from one the player draws at full alpha in every pose (colour alpha 1, no opacity under 1, no `opacity` binding: `mouth_open`, a blush and a pose forearm give none). A pose is left out only when the part is fully hidden across the stretches to the neighbouring sampled values of the key parameter on both sides, so the gate still reads every pose up to and including the stop where the part becomes fully hidden, and the one where it starts to show again. At such a pose `TIE` and `SLIDE` leave it out when all of the ring is under cover, and `EXPOSED` does not count a hidden-art pixel under cover; every other pixel and pose is read as before, and an amount under 1 is judged in full. `FOLDS`, `RIGID` and `TIP` read every pose. A `HIDDEN` line (needs `@ikijs/mcp` 0.35.0) reports the occluders and which give cover, the amount at rest, where it leaves its rest value and reaches 1, and how many poses `TIE` and `SLIDE` left out; it never fails. `RIGID` (a `rigid` part only) is how far the landed vertices are from a rigid copy of rest, over the pose set and the midpoint of each neighbouring pair of the part's stops (≤ 0.0025). `TIP` reports where the part's free end lands at each baked parameter's ends, where it lands with the part's warps removed, and its travel, with no limit. A fail of any of the five limited lines blocks: the model is written either way so it can still be rendered, but it is not kept, rendered for judging or handed on as the character. Fix the bake from the `FAIL` lines. From 0.34.0 on `customParts` always carries `gate`, so a result with no `customParts` field is a server before 0.34.0 that rigged without the parts and was never gated: never trust it. If the gate itself throws, the file is still written and the text ends `CUSTOM GATE FAIL: gate error: <message>` (`gate.failed` names it): that is a package bug, not a bake to fix.
Leave `turnTargets` out: the rig then renders the profile, which is the default and every character's starting point, and `rigPlan` is how a character is tuned from it. Pass `turnTargets` only to match a measured front/turned pair literally — the cues `measure_turn_reference` reads off a front view and the same character turned at the same scale (`eyeShift`, `farEyeRatio`, `silhouetteRatio`, and optionally `noseShift` / `mouthShift`; the shifts are magnitudes, the sign is the turn's own business). Each cue given is fitted — `eyeShift` by the turn's amount (so `rigPlan.turn.amount` is ignored beside it), `farEyeRatio` by the eyes' foreshortening, `silhouetteRatio` by the hair's width at full turn, `noseShift` / `mouthShift` by that feature's own shift — and an omitted one stays at the profile. The **iki-character-loop** skill no longer measures a pair: its drawn turned reference is a style check the critic reads by eye. `headHalfWidth` is not an input — the rig measures it off the layers and refuses one passed in — and a field not named here is refused too. A pair that shows a custom part crossing the eye row reads a wider head than the rig fits to, since the rig measures the role layers alone: measure a pair drawn without the custom parts.
Either way the result reports that measured `headHalfWidth` alongside a `turn` report: `turn.achieved` is what the turn reaches (with no `turnTargets`, what the cues read on the profile's own turn), and `turn.clamped` names what the rig cut down to what this art can do — the turn itself, as `eyeShift` (yours, or the profile's times `rigPlan.turn.amount`), past the room the art leaves: the far eye inside the face plate's edge, the chin over a neck the face paints (a torso's neck bounds nothing, so the turned renders are its check), and the far iris clear of the bangs' side strand where the rig measured one; and a profile `noseShift` / `mouthShift` past its own room; and a passed `silhouetteRatio` that would narrow a face drawn without hair too far for the head to cover its far ear's slide. A clamp is not a refusal: the rig still built. A layer set with no `nose` (see Step 1) still turns on the profile and its `rigPlan` but fits nothing: the values in `turnTargets` are inert (a field not named here is still refused) and the result carries no `turn` report.
`turn.strandOverlap` gives, per side where the bangs cover the far iris, how much of its painted row they cover at its worst stop (`px`, `hh`), and how much at rest (`restPx`). `held: true` means the rig kept the iris no deeper under the bangs than it is painted; `held: false` means the art left no room, as with a fringe spanning the face, and `px` is what stays covered.
The written model records what generated it, as `generator` right after its `name`: `tool` (`@ikijs/mcp@<version>`), `rigger` (`@ikijs/editor@<version>`) and `plugin` (`iki@<version>`, from the plugin's own launch of the server; absent when the server was started another way). It is no input of the tool. `describe_iki` returns it in its summary: quote it when you report a rig problem, and when a model misbehaves, check it first to see which versions rigged it (`@ikijs/mcp` 0.39.0 on; an older model has none).
With side locks and a `nose` (the turn solve needs one) the result also prints `HAIRSIDE` lines after the `PHYSICS` lines, one or two per lock, labelled by its role (`hair_side_R` is the screen-left lock, the far one on a −30 turn). Nothing refuses or clamps on them, and the numbers are model px. Each is the least over that lock's far stops (`hair_side_R` at `ParamAngleX` −15 and −30, `hair_side_L` at +15 and +30), and its line names the stop it came from, which can be ±15. `HAIRSIDE cover <role>` is how far the lock's outer edge lies outside the head's edge (the face plate's edge, with any ear replaced by the head's edge beneath it) at its least-covered row among those the lock covers at rest, with that row's cover `at rest` beside it: positive, the lock still covers the edge; negative, the turn bares cheek the lock hides at rest. A lock hung inside the head's edge by design (its root under the bangs, the ear showing beside it) has no such rows over its inner part and is not a defect there; a lock covering no head edge at rest prints no `cover` line. `HAIRSIDE tail <role>` is how far the far eye's and lash's outer tail lie from the lock's face-side edge (negative: under the lock, which is intended) and the eye's corner's signed distance from that head edge (positive: inside it; negative: past it). `HAIRSIDE <role>: no cover or tail row` means the lock covers no head edge at rest on any face-plate row and paints no run on the far eye's centre row; `HAIRSIDE <role>: unavailable — no rowRuns` means the layers carry no row runs, so nothing was read. Quote the lines in your report; a negative `cover` means moving that lock outward by at least that many px, which keeps the cheek covered on the turn, unless the lock lies flush with the head's edge at rest (a `rest` cover within about 2 px of zero): its small negative on the turn bares no cheek a viewer can see (the directions are in Step 2's `layout.hair_side_*` paragraph).
Any other target **you** passed that it cannot reach is still refused as `INVALID: … turnTargets.<field> …` — a `farEyeRatio` or `silhouetteRatio` out of the rig's reach, or a `noseShift` / `mouthShift` past its room. That is a fact about this character's geometry, not a number to tune: re-rig once without `turnTargets` and report the message verbatim, rather than loosening the measurement to make it fit.
Driving the **bin** over stdio when the server isn't registered — run it from the project dir, the same cwd the plugin's server has, so the `iki-char/…` paths resolve:
```bash
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"e2e","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"auto_rig_from_layers","arguments":{"layers":[...],"outputPath":"iki-char/iki-character.iki"}}}' \
| node <iki-checkout>/packages/mcp/dist/cli.js
```
#### Measuring a rig
`probe_rig` reads numbers off a written `.iki` that a render cannot give exactly: how far a point of a part moves in a pose, and where a layer is painted. It needs `@ikijs/mcp` 0.34.0 or later (an older server has no such tool). Use it to check a custom part's tie, or to size a retune before you spend a round on it. Each call is `{ modelPath, queries, outputPath? }`, and a query is one of:
- `{ "op": "land", "part": "tail_L", "points": [[310, 420]], "pose": { "ParamAngleX": -30 } }` gives where each point lands in the pose.
- `{ "op": "displacement", … }` gives the landing minus the point, so a part that must stay with its anchor reads as a small `[dx, dy]`.
- `{ "op": "paint", "path": "iki-char/custom/tail_L.png" }` gives the layer's opaque runs per canvas row, `{ y0, rows }` with `[x0, x1)` runs.
The frame is canvas px, origin top-left, x right, y down, the one the layer PNGs and `describe_iki`'s boxes use. A point must lie on the part at rest; one off its mesh comes back `null`, not a guess, so a `null` means the point was not on the part. `pose` names only the parameters you move: the rest stay at their defaults, and a value past a parameter's range is clamped, as the player does. `paint` reads the layer PNG you give (the part's own file, canvas-sized), not the atlas.
Pass `outputPath` (a name ending in `.probe.json`, such as `iki-char/custom/bare.probe.json`, under the working directory, its folder existing) for any call whose answer is long, a layer's paint above all: the results are written there as the same JSON, the text is the path and one line per query, and you read the file with a script instead of carrying the rows in your context. An entry the tool refuses comes back as `INVALID: queries[i].<field> …`.
### Step 4 — Render-verify
Load the `.iki` and confirm it renders + animates. On a host without browser automation, the
`render_poses` tool's PNGs (with an empty `failedTextures`) satisfy that check;
the paragraphs below are the interactive one. Its standalone and checkout
paths both use the Model picker's "Load a .iki file…" entry to load it and drive the same parameters —
only the load order and how you address them (id vs. panel label) differ.
For a character with custom parts, `render_poses` (0.34.0 on) also takes a
`roll` sweep in `sweeps` (`ParamAngleZ` on the turn's curve, a nine-frame
labelled sheet and no kymograph; it adds no `SWEEP` line and changes none)
and `hideParts`, part ids left out of the drawn frames while the
reports still read the whole model. A part named in the `occlusion.by` of a part that stays
cannot be hidden alone (`INVALID: hideParts[i] …` names the part to hide with
it), as a clip mask cannot; hide both (0.35.0 on). A server before 0.34.0 refuses
`preset: "roll"` as an input validation error and strips `hideParts`, so every
part is drawn.
The playground frames a full-body model whole by itself, in a view 2.5 × its
width. To see it at the bust's scale, before loading, set the canvas's CSS size to
1400 px wide and ceil(560·H/1100) px tall, H being its `canvasHeight`
(`browser_evaluate`).
**Standalone (default):** open https://zeikar.dev/iki/playground/ (Playwright
MCP or a normal browser) and **uncheck Idle before loading anything** —
`load()` resets every parameter to its default, and idle only restarts if the
checkbox is still checked at load time, so unchecking first is what makes the
rest screenshot genuine. Unchecking Idle _after_ loading is too late: idle has
already written a live pose (angle, gaze, breath) into the parameters by then,
and this build has no `reset()` to undo it. With Idle off, open the Model
select, choose the trigger entry, and pick the model's **absolute** path
(`browser_file_upload` requires one — the relative `iki-char/iki-character.iki`
will not resolve). The panel's sliders carry no `id`/`data-*`, only each
parameter's friendly label, so drive it **by label**: find the `.control`
block whose label text matches, set that block's `input[type=range]` value,
and dispatch an `input` event (`browser_evaluate`), then screenshot
before/after.
| id | panel label |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ParamEyeLSmile` / `ParamEyeRSmile` | Eye L Smile / Eye R Smile (the shut eye's shape: 0 a resting curve, 1 a laughing arch; with an upper lash) |
| `ParamEyeLOpen` / `ParamEyeROpen` | Eye L / Eye R (blink-fold) |
| `ParamEyeBallX` / `ParamEyeBallY` | Gaze X / Gaze Y |
| `ParamMouthOpenY` / `ParamMouthForm` | Mouth Open / Mouth Form |
| `ParamAngleX` / `ParamAngleY` / `ParamAngleZ` | Head Angle / Head Angle Y / Head Angle Z (turn / nod / tilt) |
| `ParamBrowLY` / `ParamBrowRY` / `ParamBrowLAngle` / `ParamBrowRAngle` | Brow L Y / Brow R Y / Brow L Angle / Brow R Angle |
| `ParamCheek` | Cheek (only with a blush) |
| `ParamBodyAngleX` / `ParamBodyAngleY` / `ParamBodyAngleZ` | Body Angle X / Body Angle Y / Body Angle Z (±10; + = turn to screen right / up / tilt clockwise; only with a body; the body also follows the head's turn and tilt a little) |
| `ParamArmL` / `ParamArmR` / `ParamElbowL` / `ParamElbowR` | Arm L / Arm R / Elbow L / Elbow R (degrees; Arm −8..32, + raises the arm outward; Elbow −10..90, + bends the forearm toward the body; mirrored per side; only with arm layers) |
| `ParamArmPoseL` / `ParamArmPoseR` | Arm Pose L / Arm Pose R (0..1; 0 the hanging forearm, 1 the drawn pose forearm; only with the pose forearm) |
| `ParamArmPoseAngleL` / `ParamArmPoseAngleR` | Arm Pose Angle L / Arm Pose Angle R (degrees, −15..15, picked by eye on street; + tips the raised hand outward, mirrored per side; only with the pose forearm) |
A clean console (no `IkiFormatError`/WebGL error) plus visibly-driving
parameters = success.
**Inside an `iki` checkout:** `pnpm playground`, load the file through the same
picker, then drive `window.__iki.setParam` / `reset` / `nextFrame` by id per
the **iki-visual-test** skill (repo-local, not part of this plugin) — same
parameters and success criterion as above.
`ParamHairSwayX`/`ParamHairSwayZ` (panel label "Hair Sway X"/"Hair Sway Z", the
front hair) and `ParamHairBackSway` ("Hair Back Sway", the back hair, a beat
behind the front) are physics OUTPUTS: the springs write them, so do not judge the hair from a
frozen pose — physics only advances inside the playground's idle loop.
`ParamAmbientSway` ("Ambient Sway") is the idle's own slow drift the hair
follows in idle, written every frame like Breath, so a slider move on it is
overwritten. Rigs from `@ikijs/mcp` 0.28.0 on declare it; a rig from an older
server lacks it, and its hair barely moves in idle. Rigs from `@ikijs/mcp`
0.29.0 on declare `ParamHairBackSway` when both hair layers are present; an
older server's rig swings both layers on `ParamHairSwayX`/`Z` in step.
Recheck Idle and watch, or drive the hair-sway outputs directly — `setParam` in
a checkout, the panel slider standalone — to see the root-pinned swing shape.
## Pitfalls (hard-won — read before generating)
- **"NO nose" on the face is the same kind of negation.** A leaked nose stays painted on the face plate while the `nose` layer moves, so the two drift apart on the turn. Generate 2 face variants and pick the nose-free one; if both leak, strengthen the negation ("smooth bare skin between the eyes, no nose at all").
- **"Left" and "right" do not say which way a part faces.** "Draw the left eye" reads as the viewer's left or the character's, and a prompt that names no side leaves it to chance: all three eyewhite variants of one run came back reversed, with the lash wings pointing at the nose. The iris-offset warnings that follow tempt an iris retune, which hides the fault instead of fixing it. So the prompts above name the direction in image terms, and the geometry report flags an eye whose lash stops short of its outer corner instead of its tear duct; the fix is `mirrorParts` (Step 2). The entry describes the part FILE, not the character — when you regenerate that part, take it out of `mirror-parts.json` and let the report say again.
- **"NO iris" on the eyewhite is the flakiest prompt.** The image model often paints an iris anyway. Generate **2–3 eyewhite variants** and pick the cleanest iris-free one; a leaked colored iris breaks `prepEyeSplit` (the luminance split would misclassify a dark/saturated iris as lash). If all variants leak, regenerate with a stronger negation ("empty white interior, absolutely no colored circle").
- **The eyewhite must be a SOLID FILLED white almond, not an outline.** The first generation often comes back as a thin line-art ring with a transparent interior — useless as a clip mask. Demand "SOLID FILLED pure-white almond, the entire interior painted opaque white". The blink-fold also reads best when the **upper lash is the boldest dark element**; a heavy full-almond outline still works (only the top fraction is the lash via `LASH_KEEP_FRACTION`; the dark lower part becomes the lower lid, so a heavy outline there shows as a heavy lower lid over the iris), but a clean white with a distinct top lash folds most cleanly.
- **The face base must have NO eyes and NO mouth.** A face with baked eyes can't blink/gaze (the eye stack would double up). Re-prompt until the eye/mouth sockets are bare skin.
- **The mouth key is strict.** A thin upper line composes, with a measure warning to regenerate `mouth_keyed.png` bolder. These are refused, each naming `mouth_keyed.png`: an outline that is broken or not closed at the composed size, no green, green outside the opening, more than one opening, no skin under the opening. A lower lip with its own outline is not refused but shows as a second line on the closed mouth: regenerate `mouth_keyed.png` with the lower lip as a shade. `mouth_interior.png` is refused only when it is nothing but lips, or opaque on a non-white ground, or on a white one too noisy or shaded to key (a fake-transparency checkerboard). An off-green or shaded fill, teeth drawn into the green, or green on the lip are the usual causes. Generate 2 variants of each and pick the flat one.
- **The interior is split by lightness.** What is under luma 100 is the cavity, the rest becomes `mouth_teeth` / `mouth_tongue`: a cavity drawn as light as the tongue comes back as light paint, its upper half as `mouth_teeth` (riding the line) and its lower half as `mouth_tongue`, and an interior with nothing lighter writes neither (both in `skipped`). Ask for a mid red-brown cavity clearly darker than the pink tongue, and a wide white teeth band.
- **Size the iris off the sclera, not by eye.** The default layout sizes the iris at 0.51 of the sclera width (bob's 50 px in a 98 px eye; a reference measured 0.70–0.73; anything under ~0.45 reads as a bead). `lash_L`/`lash_R.w` are separate keys that merely default to the same width, so an override of `eye_L`/`eye_R.w` must set all four, plus a matching `iris_L`/`iris_R.w` — otherwise `compose_layers_from_parts` rejects the lash that no longer matches its sclera, or the geometry report flags the iris ratio. The auto-rig clips iris→sclera at runtime, so a big iris cannot spill — the real failure is the opposite one, and it already shipped: the first generated sample had an iris 32% of the sclera width and read as a bead floating in white.
- **Opaque-on-white parts** are handled by `keyWhiteToAlpha` (keys >238 RGB to alpha), but transparent output is cleaner — ask for it. White-rimmed parts (e.g. a white highlight on the iris) can be clipped by the key; prefer transparent generation for those. A white garment keys out with the ground the same way — a full body's white shirt, socks or shoes come back as holes — so a part that wears white has to come back transparent.
- **The side lock's warnings, and the free move for each.** `measure_layers` names the free `layout` move before the billed one. `hair_side_R` is the lock on the screen left: outward is a lower `cx` for it and a higher `cx` for `hair_side_L`, and a lower `cy` is up. `hair_side_R: its top row (canvas y N) shows past hair_front on M px` — the root is visible at rest: lower `cy` (up) or move `cx` toward the face until the bangs cover it, else regenerate `hair_side.png` with a longer root. `hair_side_R: covers eye_R's outer corner at rest` — the eye's tail may only slide under the lock on the turn: move `cx` outward by the px the warning gives, else regenerate `hair_side.png` narrower. `hair_side_R: when the head turns away from it the lock leans inward …` — the near lock leans inward, uncovering the ear and the back hair behind it, and leaves bare pixels where neither `hair_back` nor the face is painted: raise `layout.hair_back.w`, else regenerate `hair_back.png` fuller behind the locks (without a `hair_back`, draw one). `hair_side.png draws two locks` — draw ONE; the composer mirrors it, so two locks come out as four: regenerate. `hair_front` is a required part, so compose refuses a parts dir without `hair_front.png` (`missing part source for role "hair_front": …`). On a layers dir assembled without `hair_front`, `measure_layers` warns `hair_side_R: needs hair_front …` and the rig refuses the set (`auto-rig: hair_side_R needs a hair_front layer (…)`): drop the lock layers, or add `hair_front`. A lock whose root is cut flat at the top of its image also trips the generic `<role>: N% of its top edge is opaque` check: regenerate it with the root tapering to a point inside the frame.
- **Style drift across parts.** Independent generations can mismatch hue/line-weight. Keep one `<STYLE>` string identical across every prompt; regenerate the outlier, not the whole set.
- **Don't commit generated character art or reference models — and don't derive art from one.** The workdir sits inside the project, so `.gitignore` is the only thing keeping it out of the repo: the `iki` repo ignores `iki-char/`; in any other project, add `iki-char/` before the first run. Keep every generated PNG and `.iki` under it — written anywhere else, they land in a commit. Never feed a licensed model's _art_ to the image model, as a reference or otherwise: the generated character then carries that character's design, which such terms forbid. `.gitignore` stops distribution, not derivation. The plugin ships the **skill and its prompts** — no art.
## What this skill does NOT change
No engine or format changes — this is prompts and procedure. The composer and the geometry checks ship in `@ikijs/mcp` (`compose_layers_from_parts`, `measure_layers`) beside the capability that already shipped in earlier slices (`auto_rig_from_layers`, the role table, blink-fold/gaze/brow rigging); the plugin pins that server at `^0.39.2` in `.mcp.json` (the nose part and the nose-keyed parallax need 0.7; `measure_turn_reference` and the `turnTargets` input of `auto_rig_from_layers` need 0.8; the iris-strand bound and the clamped `eyeShift` need 0.9; `mirrorParts`, the check for an eye drawn facing the other way and the refusal of an eye pair placed apart need 0.10; the nose's dense-core sizing, its turn tilt and its lossless atlas page need 0.11; the speck-core nose guard needs 0.11.1; the parallax-profile rig, its `style` knobs and the refusal of an unknown `turnTargets` or `style` field need 0.12; the blush part and the sclera that drops a detached crease need 0.13; the crop that leaves out a stray speck needs 0.13.1; the front hair riding over painted back hair on the turn and its cap sliding on the nod need 0.13.2; its crown riding with the face on the turn needs 0.13.3; the front hair's cap held inside the back hair on the turn, the far ear's narrowing and the clamped `silhouetteRatio` need 0.13.5; the auto-rig's own default values, picked by eye, need 0.14; the lower lid split from the eyewhite (`lash_lower_L/R`) needs 0.15; the face and feature defaults taken from bob, as proportions of the face, need 0.16; `ParamCheek` with the blush's fade and the default expressions and motions need 0.17; the body warp that follows the head, the arms with an elbow and their standard ids need 0.18; the composer's `canvasHeight`, one mirrored `arm.png` and the full-body measure checks need 0.19; the elbow cap as its own part behind the upper arm, `ParamElbow` bending toward the body and the narrower arm ranges need 0.19.1; the pose forearm (`forearm_pose.png`, `preview-pose.png` and its checks) and the Wave need 0.20; the lip set (`mouth_inner` / `lip_lower` / `lip_upper`) accepted by `auto_rig_from_layers` needs 0.21; the keyed mouth and its interior (`mouth_keyed.png`, `mouth_interior.png`) split into the lip set, its closed preview and the lip checks need 0.22; the interior's light paint cut into `mouth_teeth` / `mouth_tongue` clipped to the cavity, and the upper line thinned with its closed ends tapered, need 0.23; `render_poses`, which renders the loop's poses through an installed Chrome, Edge or Chromium, needs 0.24; the `stress` pose and the fold report in `auto_rig_from_layers` and `render_poses` need 0.25; `patches` on `auto_rig_from_layers`, `describe_iki`'s `modelPath` and writer's view, and `render_poses`'s `poses` with crops need 0.26; the physics report in `auto_rig_from_layers` and `render_poses` needs 0.27; the pendulum hair that lags the head and follows `ParamAmbientSway`, the idle's slow drift, needs 0.28; the back hair's own spring and `ParamHairBackSway`, and the larger swing, need 0.29; the `rigPlan` input, its echo and `describe_rig_plan` need 0.30 (`style` is refused from 0.30 on), and so do the `turn.eyeForeshorten` / `turn.noseLead` fields; and `render_poses`'s `sweep` — the turn sweep's frames, manifest, sheet, kymograph, flipbook and `SWEEP` lines — needs 0.31; the front hair turning as one piece, its crown included, needs 0.31.1; `render_poses`'s `sweeps` list with the `turn-nod` preset, its by-angle sheet, the version-2 manifest and the `SWEEP nod` / `SWEEP corner` lines need 0.32; the front side locks (`hair_side.png` → `hair_side_L/R`, their `layout` keys, the lock checks and the `HAIRSIDE` lines) need 0.33; custom parts (`customParts`, `bakes`, `probe_rig`, the `CUSTOM` gate lines), the `roll` sweep and `hideParts` need 0.34; a custom part's `occlusion`, the gate's `HIDDEN` line and `hideParts` refusing an occluder need 0.35; the far ear going partly under the cheek on the turn needs 0.35.1, and its `turn.farEar` field 0.36; from 0.37 on the back hair follows the head on the turn and the nod, where it held nearly still before, so a custom part's `bakes` measured against an earlier server miss their anchor and fail the gate's `TIE`: measure them again with `probe_rig`; `view_illustration_grid` and `cut_layers_from_illustration`, which the **iki-import-illustration** skill drives, need 0.38; a server before 0.35 refuses `occlusion` as an unknown key, so rig without it and say so) and calls the tools. No changeset — the plugin is not an npm package.
Files in this skill
- SKILL.md
- gen-parts.sh
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.