/iki:iki-import-illustrationfrom iki
Rigs a single finished front-facing character illustration (PNG/JPEG/WebP) into an animated Iki `.iki` model using MCP tools for landmark reading, layer cutting, and auto-rigging. Use when a user wants to animate or VTuber-rig one existing picture.
Ships in iki. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
.iki)Turn one finished character picture into a rigged .iki that, at rest, is the
picture itself, pixel for pixel, and that blinks, gazes, lip-syncs, turns, nods
and tilts its head with its hair swaying behind it.
picture → view_illustration_grid (survey, zoomed views) → landmarks.json → view_illustration_grid (landmarks drawn)
→ cut_layers_from_illustration → auto_rig_from_layers → render_poses
Nothing is generated by default: every layer is cut out of the picture, and what a layer hides when the rig moves it (the forehead under the bangs, the hair behind the face, the neck behind the chin, the skin under each feature) is filled in from the paint around it. There is no automatic detection: the cut finds every part from landmarks you read off the picture, and it reports numeric checks that name the landmark to move. The work is reading coordinates carefully; most of this file is how.
examples/editor), or auto_rig_from_layers directly
with role-named PNGs.Some pictures this cannot do well. Check the survey (Step 1) against this list and, on a match, stop and tell the user plainly what is wrong and what picture would work, before reading a single landmark:
eyes); bangs across the brows and locks beside the eyes are fine.… backdrop is not one flat colour …). The user can give the same picture
with a transparent background.body). Arms raised or in front of the body stay painted on the torso and
never move; a full-body picture leaves the face small (next point). A bust
crop of the picture is what works.h be the chin's
row minus the eye row (the irises' centres): a picture whose bottom edge
lies less than 1.2 h below the chin is refused at the rig
(INVALID: auto-rig: layer "body.png": the body is too short between its hips … would fold …), and nothing in the landmarks fixes it. Ask for a
wider crop; never pad or stretch the picture yourself.iki MCP server the plugin bundles:
view_illustration_grid and cut_layers_from_illustration (both need
@ikijs/mcp 0.38.0 or later), auto_rig_from_layers, probe_rig and
render_poses. In Claude Code they are plugin-scoped
(mcp__plugin_iki_iki__cut_layers_from_illustration, …); Codex may use other
prefixes, so resolve them by tool name. Look before anything else. If
view_illustration_grid and cut_layers_from_illustration are not listed,
the server is older than 0.38.0: tell the user that this skill needs
@ikijs/mcp 0.38.0 or later and the plugin's bundled server is older, so the
plugin needs updating (or, in an Iki checkout, build the working tree with
pnpm --filter @ikijs/mcp build and drive packages/mcp/dist/cli.js over
stdio as the iki-character skill's Prerequisites show). Do not try to cut
the picture by other means.render_poses (Step 9); set
CHROME_PATH for a non-standard install.iki-char/ (this file writes iki-char/; put yours in its place). The
tools refuse to write outside the directory the MCP server runs in (the
project), and every output folder must exist before the call:
mkdir -p iki-char/grid iki-char/layers iki-char/renders iki-char/renders/close
cp <the user's picture> iki-char/picture.png # keep its own extension if JPEG or WebP
Keep it out of version control (iki-char/ is already gitignored in the
iki repo; elsewhere add yours to .gitignore before the first run). The
user's picture and everything cut from it are theirs: never commit them.Every coordinate in this skill, in the landmarks, on the grid views and in the
cut's and probe_rig's output is canvas px on a canvas 1100 px wide: the
picture scaled to 1100 px wide, its height by its aspect. Origin top-left, x
right, y DOWN: x runs 0 to 1099 and y 0 to the height minus 1, so the canvas's
right edge is x 1099, not 1100 (a point past it is refused). A coordinate
names one pixel; on the grid view, a line labelled v runs along the left
(top) edge of pixel v, so the pixel just right of (below) the line labelled
450 is 450.
Boxes are [x0, y0, x1, y1], both corners inside the box.
L and R are the CHARACTER's left and right. eyes.L is the eye on the
VIEWER's right, so it has the larger x; the same goes for brows.L and for a
part you name tail_L. Two keys are in the viewer's frame instead:
mouth.cornerL is the viewer's LEFT end of the mouth line (the smaller x), and
a custom part's side: "left" takes the hair at smaller x.
Sanity rule: every
Lkey has the LARGER x of its pair, exceptmouth.cornerL, which has the smaller. The cut refuses a swapped eye pair (INVALID: landmarks.eyes.L.box centre x … is not right of …) but cannot catch swapped brows.
// view_illustration_grid
{ "imagePath": "iki-char/picture.png", "outputPath": "iki-char/grid/whole.png" }
Defaults: the whole canvas, zoom 1, step 50. The text result's second line
gives the canvas size (… on the 1100x1320 canvas …): note the height. Open
whole.png and check the "cannot do well" list above, the crop's depth below
the chin included (read the eye row and the chin's row off a zoom 2 view of
the head). Then note, roughly, the
boxes to zoom into: the head, each eye, each brow, the nose, the mouth, each
lock hanging in front of an ear, and the root of every tail or ponytail.
Decide which locks are side locks (Landmark reference, sideHair) and which
parts are custom parts (customParts).
Never read a coordinate off the whole-canvas view. One canvas px is one output px there, and a 1 px error is a missed eyelash. Every landmark comes from a zoomed view of its own part:
| Part | zoom | step | crop (canvas px) |
|---|---|---|---|
| the head, hair and shoulders | 2 to 3 | 20 | the whole head with its hair |
| each eye | 4 to 6 | 10 | the eye with 20 to 30 px around it |
| each brow | 4 | 10 | the brow with 15 px around it |
| the nose, the mouth | 6 | 5 or 10 | the feature with 15 to 20 px around |
| each lock in front of an ear | 3 to 4 | 10 | the lock from the bangs to its tip |
| each tail or ponytail root | 3 to 4 | 10 | the knot or ribbon and the hair round |
| the neck and the clothes | 2 | 20 | the chin down to the canvas's bottom |
// view_illustration_grid
{
"imagePath": "iki-char/picture.png",
"outputPath": "iki-char/grid/eye-L.png",
"crop": { "x": 580, "y": 400, "w": 120, "h": 100 },
"zoom": 6,
"step": 10,
}
Keep each view under about 1500 px a side (w × zoom, h × zoom; split a
bigger crop into two views): a bigger image is shrunk when you look at it,
which undoes the zoom. The labels along the top and left edges are canvas px;
count from the nearest labelled line.
iki-char/landmarks.jsonFill it in this order, each key from its zoomed view, by the Landmark reference below. The skeleton has every key the cut needs, in that order; every number in it is a placeholder for the shape of the value, not a default — replace each one with what you read off the grid.
{
"samples": {
"hair": {
"base": [
[550, 200],
[420, 260],
[690, 260]
],
"shadow": [[380, 420]],
"highlight": [[520, 170]]
},
"skin": {
"base": [
[470, 540],
[630, 540],
[550, 360]
],
"shadow": [[550, 690]]
}
},
"eyes": {
"L": {
"box": [590, 410, 690, 490],
"iris": { "cx": 635, "cy": 455, "rx": 22, "ry": 28 }
},
"R": {
"box": [410, 410, 510, 490],
"iris": { "cx": 465, "cy": 455, "rx": 22, "ry": 28 }
}
},
"brows": {
"L": {
"line": [
[700, 392],
[665, 380],
[630, 377],
[600, 382]
]
},
"R": {
"line": [
[400, 392],
[435, 380],
[470, 377],
[500, 382]
]
}
},
"nose": { "box": [540, 510, 562, 540] },
"mouth": {
"box": [510, 568, 590, 592],
"cornerL": [518, 580],
"cornerR": [582, 580]
},
"frontHair": [
[550, 140],
[450, 170],
[380, 240],
[350, 330],
[360, 400],
[740, 400],
[750, 330],
[720, 240],
[650, 170]
],
"sideHair": {
"L": [
[735, 330],
[760, 330],
[770, 420],
[765, 520],
[745, 525],
[740, 420]
],
"R": [
[365, 330],
[340, 330],
[330, 420],
[335, 520],
[355, 525],
[360, 420]
]
},
"skull": [
[355, 470],
[350, 360],
[380, 260],
[450, 195],
[550, 175],
[650, 195],
[720, 260],
[750, 360],
[745, 470]
],
"shellLower": [
[330, 470],
[360, 560],
[450, 620],
[550, 635],
[650, 620],
[740, 560],
[770, 470]
],
"skinSeeds": [
[470, 540],
[630, 540],
[550, 380],
[345, 500],
[755, 500]
],
"bodySeeds": [
[550, 700],
[550, 900]
],
"neckTopY": 560,
"customParts": []
}
Optional keys: brows (each side optional), nose, sideHair (each side
optional; drop it when there is no side lock), customParts (leave [] or
drop it when there is none), and backgroundSeeds, paintSeeds and
bodyOnly, which you add only when a check asks for them (Step 6). Any other
key is refused.
// view_illustration_grid, with the landmarks.json contents as `landmarks`
{
"imagePath": "iki-char/picture.png",
"outputPath": "iki-char/grid/check-eye-L.png",
"crop": { "x": 580, "y": 400, "w": 120, "h": 100 },
"zoom": 6,
"step": 10,
"landmarks": { "…": "the whole landmarks object" },
}
Each shape is drawn in its key's colour between a dark and a light stroke, so it
reads over any paint, and labelled with its key (eyes.L.iris, skinSeeds[2]).
Go part by part at the same zooms as Step 2: does each eye box hold the whole
eye with its lash wings and lower lashes, does each iris ellipse sit on the
disc, does each brow line run along its brow's middle, are the mouth corners
on the line's ends, does frontHair run along the parting and the strands'
own edges, does each sideHair polygon hug its lock from inside frontHair
down to its tip, does skull stay inside the ears, does every seed
and sample sit on flat paint of its class? Then one whole-head view (zoom 2,
step 20) for the polygons. Fix what is off now: this costs nothing and catches
most errors before a cut.
// cut_layers_from_illustration
{
"imagePath": "iki-char/picture.png",
"outputDir": "iki-char/layers",
"landmarks": { "…": "the whole landmarks object" },
}
INVALID: landmarks.<path> … means the landmarks broke a rule (a missing key,
a point off the canvas, cornerL not left of cornerR, a swapped eye pair):
the message names the field; fix it and call again. A refusal writes nothing.
The text result lists the written files (role layers, then custom/<id>.png
per custom part, then preview-labels.png and preview-landmarks.png), then
one line per check, CHECK <id>: pass|WARN|FAIL <value> (limit <limit>) <hint>,
then the MEASURE: lines, and last CUT pass or CUT FAIL: <failed check ids>.
Every round, do all three:
Read every CHECK line and the last line (The checks, below). Every hint
names the landmark to move, often with the numbers.
Read iki-char/layers/preview-labels.png: each label tinted over the
picture at 60 %: peach = face, red = front hair, orange = a side lock,
purple = back hair, blue = body, green = the features lifted off the face (eyes, brows, nose, mouth),
and the custom parts in order cyan, green, yellow, magenta (a second custom
part's green is close to the features': tell them apart by where they are).
Untinted means keyed as backdrop, in no layer. It is canvas-sized, so look
at it once whole, then through view_illustration_grid (its imagePath,
the same canvas px) at zoom 3 to 4 on the places that go wrong: each ear,
each eye's corners, both shoulders, and every place the hair meets the
neck or the clothes. Every painted pixel takes some label (paint no flood
reached takes its nearest one), so look for paint under the wrong colour:
| you see | it means | do |
|---|---|---|
| a shoulder's or a garment's edge tinted hair | its outline touches the hair and went with it: it rides the head and shows as a ghost line on a turn | a bodyOnly polygon round that stretch of outline, clear of the hair |
| a whole garment tinted hair | its colour is nearer the hair samples | a bodyOnly polygon over the garment |
| hair tips beside the neck tinted body | a tone no hair sample covers, or a thin tip lying on the clothes read as their outline: it will not move | a samples.hair point on the tip (a piece holding a hair sample is never read as an outline); no bodyOnly over it |
| an ear, or an ear lobe, tinted hair (purple, or orange inside a side lock's polygon) or body | no skin seed reaches it (a line or a lock cuts it off from the face) | a skinSeeds point on it, one per piece; skull stays off the ear |
| a lock in front of an ear tinted purple | it is not in a sideHair polygon: on a turn the face slides over it and the ear behind it reads as an island | a sideHair polygon round it (Landmark reference) |
| back hair beside a lock tinted orange | the sideHair polygon is wider than the lock: that hair will ride the face | trace the polygon closer to the lock |
| skin tinted hair, or hair tinted face | a sample on a line or on the other class's paint, or a tone no sample covers | move that sample onto flat paint (seeds may name it), or add one on the tone |
| a tail or ponytail tinted purple | it is not cut out as a custom part, or its line / polygon misses it | a customParts entry, or move its line |
| backdrop tinted anything | backdrop the figure encloses (between the neck and a tail, under an arm), which the border's flood missed | its point (pockets names it) in backgroundSeeds |
| figure paint left untinted | paint keyed as a gap between strands | a point inside it in paintSeeds (pockets names the keyed points) |
Look at the eye layers as Landmark reference, eyes, "Checking the
eye layers" says: every round, and after any change to an eye landmark.
Move the landmarks the hints name, add the optional keys a check asks for, view
the changed landmarks (Step 4), and cut again into the same outputDir (files
are overwritten; a role this cut no longer writes is removed).
A hint can chase the wrong thing. It reads paint, not intent: a hair wisp or a crease touching an eye box, a hair outline along a brow. Before obeying a hint, view the place it names (its x and y) at zoom 6 or 8 and check that what it describes is the part. If you followed the same hint twice and it asks again, stop following it: look at the layer and the preview, decide, and say in Step 10 which hint you left and why.
At most three fix rounds after the first cut. Then stop fixing, keep the
best cut that ends CUT pass, and report what still warns or fails rather than
looping. A cut that still ends CUT FAIL after three rounds is not rigged:
report the failing lines and the preview to the user.
CUT pass with WARN lines is normal (The checks, below).
A closed-mouth picture never drew the one thing lip-sync needs: the open mouth. Two routes:
mouth
role, and the rig stretches it open on ParamMouthOpenY (as tall as 0.8 of
its width, and a little wider). Free and exactly the picture at rest; fine for a portrait, a blurred
band when it talks.mouth_keyed.png (an open mouth, its inside
flat #00FF00) and mouth_interior.png (the cavity, teeth and tongue alone)
and pass both to the cut, which places the set on the drawn corners: the
mouth then folds open like the eyelid and lip-syncs cleanly. The cost: the
closed mouth at rest becomes the generated line, not the drawn one, and the
drawing sends the user's picture to the image service and may be billed.Ask the user before generating, in plain words, for example: "Your picture has a closed mouth, so there is no open mouth for talking. I can have an image model draw one to match your picture: that sends your picture to the image service and may cost money, and the mouth at rest becomes the drawn-in line instead of yours. Or I keep your mouth and stretch it open, which is free but looks blurry when talking. Which do you prefer?" If they decline or do not answer, keep the drawn mouth. (Asking at the start lets the images draw while you place landmarks.)
To generate: run gen-images.sh from the iki-create-image skill's
directory (skills/iki-create-image/ in the plugin) with the user's picture
as --ref, two variants of each file, into iki-char/parts/
(mkdir -p iki-char/parts first). The prompts are the two quoted bullets
mouth_keyed.png and mouth_interior.png in the iki-character skill's
Step 1: open that file, copy both verbatim, and set <STYLE> to the picture's
own drawing style, hair and skin colours. Pick the keyed mouth whose green is
flat and even, whose outline closes all round and whose upper line is of
medium weight and ends at the corners; pick the interior with the least lip:
gen-images.sh --ref iki-char/picture.png iki-char/parts \
"<mouth_keyed prompt>::mouth_keyed-a.png" "<mouth_keyed prompt>::mouth_keyed-b.png" \
"<mouth_interior prompt>::mouth_interior-a.png" "<mouth_interior prompt>::mouth_interior-b.png"
Copy the picked variants to iki-char/parts/mouth_keyed.png and
iki-char/parts/mouth_interior.png, then re-cut with
"mouthKeyed": "iki-char/parts/mouth_keyed.png",
"mouthInterior": "iki-char/parts/mouth_interior.png",
added to Step 5's call. The cut writes mouth_inner, lip_lower, lip_upper
(and mouth_teeth / mouth_tongue when the interior has light paint) instead
of mouth, scaled so the set's corners land on mouth.cornerL and
mouth.cornerR, and adds a MEASURE: lips: opening … line. A key the composer
refuses comes back as INVALID: … naming the file: regenerate that one. Corners
too close for the set's outline to close are refused naming the least distance
that works.
// auto_rig_from_layers
{
"layers": [
{ "path": "iki-char/layers/hair_back.png" },
{ "path": "iki-char/layers/body.png" },
{ "path": "iki-char/layers/face.png" },
// … every role PNG the cut listed, nothing under custom/ and no preview*.png
{ "path": "iki-char/layers/hair_front.png" },
],
"outputPath": "iki-char/character.iki",
"quantizeColors": 256,
// only with custom parts, one entry per part, tie = its landmark's tie:
"customParts": [
{
"id": "tail_L",
"path": "iki-char/layers/custom/tail_L.png",
"anchor": "hair_back",
"tie": [800, 200],
"after": "hair_back",
},
],
}
Pass exactly the role layers the latest cut listed, the side locks
(hair_side_L, hair_side_R) among them: a feature that was not found writes
no layer, and passing a stale file is refused or wrong. Leave
rigPlan, turnTargets and patches out.
What the text result shows, in order: the .iki path; the RIGPLAN:
line; the fold report (FOLD … lines or FOLDS: none over N poses, then
FOLDS expected: …); the PHYSICS lines; with side locks and a nose, the
HAIRSIDE lines; with custom parts, the CUSTOM, BAKE and gate lines.
HAIRSIDE cover <role> says how far the lock's outer edge lies outside the
head's edge at the turn and at rest (negative: the turn bares cheek the lock
hides at rest), and HAIRSIDE tail <role> how far the eye and its lash lie
from the lock's face-side edge on the turn (negative: under the lock, as
intended). They are report-only: quote them in Step 10 and look at the ears
in the close-ups. It does not print the head's width or the turn the
rig settled on (turn.achieved, turn.clamped): those are only in the
structured result. What tells you the turn is cut down or the head mis-measured:
frontHairWidth passing, and no tail or side hair beside
the head left purple on preview-labels.png (both widen the head the turn
is fitted to);RIGPLAN: line, turn.amount=<v> (requested 1, clamped at <v>): the
art left the far eye too little room and the turn was cut down. Report it.
With no nose layer no turn is fitted at all;SWEEP turn lines and turn/sheet.png.FOLD lines are report-only and never refuse the rig. FOLDS expected:
lists the closures the rig draws on purpose (an eye or the mouth shut): not
findings. A FOLD flip … or FOLD collapse … line names the part, its
pose [<settings>] and where it rests in model px (canvas px). One whose only
pose is the stress pose (ParamAngleX, ParamAngleY and ParamAngleZ all at
-30, the mouth open, the brows apart) is the extremes stacked: report it to
the user, do not chase it. Any other: render that pose with a crop round the
point it names (Step 9) and report what shows.
No custom parts: skip the bake, go to Step 9. An unbaked custom part does not move with the head: the head turns away from it. The simplest bake that passes the gate is:
customParts included) but
without bakes, to iki-char/bare.iki. Its gate fails; that is
expected, and this model is only for measuring.probe_rig call on iki-char/bare.iki with
"outputPath": "iki-char/bare.probe.json" and 16 queries, each
{ "op": "displacement", "part": "hair_back", "points": [<every part's tie>], "pose": { <one parameter>: <value> } }
for ParamAngleX at -30, -15, 15, 30; ParamAngleY at -30, -15, 15, 30;
ParamAngleZ at -30, -20, -10, 10, 20, 30; and ParamHairBackSway at -20
and 20. Keep that list of (parameter, value) in your script: the file is a
JSON array of { op, part, points }, one per query in query order,
without the pose. Each points entry is the back hair's [dx, dy] at that
tie. A null means the tie is not on the back hair: move it onto the
head's hair at the knot.bakes (a short Node script reading bare.probe.json is easiest).
Per part and per head parameter, one target on a 1 column × 6 row lattice,
whose 14 control points (2 per row, rows top to bottom, row-major) ALL take
the displacement measured at that part's tie at that stop: the part then
hangs from its knot and stays plumb on a roll instead of swinging out with
the head. Plus one ParamHairBackSway target per part at -20 and 20: row
r (0 at the top to 6 at the tip) takes the measured [dx, dy] plus a
sideways (value / 20) × (h / 30) × (r / 6)² px on dx, h the part's
height in px (its paint's top to its tip): a swing that grows with the
square of the depth, a thirtieth of the part's height at the tip. No target
takes a stop at 0: rest is implicit, and a stop there is refused.
"bakes": { "targets": [
{ "id": "tail_L-ParamAngleX", "param": "ParamAngleX", "parts": ["tail_L"],
"grid": { "cols": 1, "rows": 6 },
"stops": { "-30": [[dx, dy], … 14 times], "-15": […], "15": […], "30": […] } },
// … ParamAngleY, ParamAngleZ, then the ParamHairBackSway target, for every part
] }
bakes, to iki-char/character.iki.
Each part prints BAKE lines and the gate's CUSTOM <id> … lines; the
text ends CUSTOM GATE pass or CUSTOM GATE FAIL: ….The gate's lines, per part: FOLDS (its least triangle area ratio), TIE
(the tie staying on the back hair where the head does not turn), SLIDE (the
same where it turns), EXPOSED (the art it hides showing), TIP (where its
free end lands, report-only). FOLDS, TIE and SLIDE must pass. On a part
cut from a picture, EXPOSED often fails: the back hair filled in under the
part's root shows at the most extreme poses (a full roll with a full swing),
where the drawing had nothing to show. That is acceptable: report it to the
user and do not chase it. A gate that throws
(CUSTOM GATE FAIL: gate error: …) or an INVALID: BAKE ERROR … is a package
bug: report it verbatim. The iki-character skill's Step 3 and the
iki-character-artist agent's "Baking the custom parts" go deeper (a far
tail going behind the head, rigid parts).
// render_poses
{
"modelPath": "iki-char/character.iki",
"outDir": "iki-char/renders",
"sweep": { "name": "turn", "preset": "turn" },
// with custom parts, also: "sweeps": [{ "name": "roll", "preset": "roll" }]
}
An INVALID saying no browser was found: tell the user to install Chrome,
Edge or Chromium or set CHROME_PATH, and report without renders. The
standard shots are 560 px on a transparent ground (most viewers show it
white). Look at rest.png beside the picture (it should be the picture),
turn-m30.png and turn-p30.png (no tear, no hole, the hair and any tails
staying on), mouth-open-1-form-0.png (the mouth open) and turn/sheet.png
(the turn in motion; turn/index.html is the flipbook). The SWEEP turn
lines give each eye's and the nose's travel in face widths (fw): there is
no pass mark; for scale, a cut bust with no custom parts read eyes 0.23, nose
0.34, plate 0.14. SWEEP nod gives, at a turn of -30, 0 and +30, how much
the gap between the eyes (and the mouth's width) changes over a full nod;
SWEEP corner how far each eye and the nose land at the four turn-and-nod
corners from where the turn and the nod alone would add up to. On a rig
straight from the cut both read 0.000; report any other value. A picture
whose hair touches its top edge is cut off there in
every frame: that is the picture, not a defect.
560 px is too small to judge a brow, a blink's leftovers or the neck's edge,
so render close-ups too: poses (which replaces the standard set) with a
crop in canvas px round the head, drawn 720 px wide. Take the crop from the
skull box with 20 to 40 px around it and down past the chin:
// render_poses
{
"modelPath": "iki-char/character.iki",
"outDir": "iki-char/renders/close",
"poses": [
{ "name": "rest", "values": {}, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "turn-m30", "values": { "ParamAngleX": -30 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "turn-p30", "values": { "ParamAngleX": 30 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "nod-m30", "values": { "ParamAngleY": -30 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "nod-p30", "values": { "ParamAngleY": 30 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "eyes-shut", "values": { "ParamEyeLOpen": 0, "ParamEyeROpen": 0 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "brows-up", "values": { "ParamBrowLY": 1, "ParamBrowRY": 1 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "mouth-open", "values": { "ParamMouthOpenY": 1 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } },
{ "name": "gaze", "values": { "ParamEyeBallX": 1, "ParamEyeBallY": 1 }, "crop": { "x": 330, "y": 150, "w": 440, "h": 560 } }
]
}
Look for, in each: turns and nods, a gap or an edge where the chin meets
the neck (the neck's top showing: move neckTopY up), a line left behind on
the shoulders (Step 5's table), hair coming apart from the head; at each ear
with a side lock, the near ear whole with the lock riding over it, and on the
far side the part of the ear the lock covered at rest filled in without the
ear's drawn lines (a known limit: report it, no landmark fixes it); eyes shut, the lid folded down with no white, iris
colour or lash left above or below it; brows up, the brow moved whole,
with no trace of it left on the skin or in the hair where it was; mouth
open, the mouth opening without a smear round it; gaze, the iris moving
inside the white with no ring of its old edge and no white showing at its
old place. Crop tighter (an eye, the chin) on anything that looks off.
.iki is (iki-char/character.iki), and that it plays in the Iki
playground (https://zeikar.dev/iki/playground/, Model picker → "Load a .iki
file…").WARN lines left, any hint you chose not to follow and
why, a clamped turn.amount, a FOLD line, the HAIRSIDE lines, an
EXPOSED gate line) and what
shows in the renders: a soft face edge on a big turn, a stretched mouth.In filling order. "Off" says what goes wrong when it is placed wrong.
samples{ "hair": { "base", "shadow"?, "highlight"? }, "skin": { "base", "shadow"? } },
each a list of [x, y] points (base: 1 or more; at most 32 points per class). A
pixel is hair or skin by which set its colour is nearer, so these decide the
whole cut. Each point reads a 5 × 5 px patch: keep it 3 px or more from any line.
hair.base: two or three points on flat mid-tone hair, spread over the head,
away from lines and strand edges.hair.shadow: on the darkest flat shading of the hair.hair.highlight: on the sheen, if the hair has one. A pale sheen can lie
near a pale garment's colour and pull its shading into the hair (cloth
shading tinted hair on preview-labels.png): drop or move the highlight
point, and put a bodyOnly polygon over the cloth.skin.base: a cheek and the forehead, away from the blush.skin.shadow: the shade under the bangs, or under the chin on the neck.Never on a line, never on a blush. To check a point, view it at zoom 8, step
5: its 5 × 5 patch is one grid cell and must be one flat colour. seeds is
the test the cut runs: a bad point fails it as <path> [x, y] reads as <class> to the other samples: … or … is on the backdrop …. Off: a wrong sample is
the commonest cause of hair and skin swapping, across the whole picture.
eyes.L, eyes.R{ "box": [x0, y0, x1, y1], "iris": { "cx", "cy", "rx", "ry" } }.
box: the whole eye drawing with 2 to 4 px to spare on every side: the lash
wing's tip, the lower lashes, the lower lid line. Not the brow, not hair.
The boxes opening's hints suggest leave the same 2 to 4 px. Off: a box that
clips the eye leaves the clipped paint on the face and tears the lash on a
blink (opening fails and says how far to grow it); a loose box takes the
shading round the eye into it (opening warns).
Strands at the box's edge. A hair wisp or a line that crosses into the
box without touching the eye's ink is left out of the eye by itself: never
grow a box along one. One that touches the eye's ink (a strand lying on the
lash wing) is not: it is cut into the eye layers and folds with the lash on
a blink, and no check says so. Where the hair is as dark as the lash, the
tool cannot tell them apart at all: everything in the box that is not skin
is the eye's. It shows as hair-shaped pieces in the eye layers (below).
Pulling the box in off
such a strand clips the eye (the strand now counts as eye), so opening
turns from WARN to FAIL and asks for the box back: keep the box that passes
and report the strand. When opening warns that an edge cuts a stroke it
cannot tell from the eye, look: hair or a line, leave that edge; the eye's
own lash wing, grow as the hint says.
iris: the full coloured disc as an ellipse, INCLUDING the part hidden under
the upper lash. Place it by eye on the disc first. cy is the disc's widest
row; rx is half that row's width; ry runs from cy down to the disc's
bottom edge, not to the lower lid line, which must stay outside the ellipse.
Its centre must lie inside box. A disc drawn squarer than an ellipse gives
its corners to the iris by itself (iris-coloured paint up to a quarter of the
radius past the ellipse): do not enlarge the ellipse to catch them. iris's
hint (the disc's x span, how far down it reaches, which way to move) is a
suggestion to verify, not an order: it can chase the lash, and the check can
then pass on a worse cut. Off: an ellipse wider than the disc or up in the
lash pulls white or lash into the iris; one off the disc can make an open eye
read as drawn closed (iris and eye warn).
Checking the eye layers. The checks passing is not proof. View
eye_<side>.png, iris_<side>.png, lash_<side>.png and
lash_lower_<side>.png with view_illustration_grid, one call per PNG at the
same crop and zoom as the eye's view (they are canvas-sized, so the
coordinates match). The sclera should be the eye's whole shape, filled white
under the iris; the iris a full disc; the lash the upper lid's dark ink only;
the lower lash the lower lid's ink. A bad iris fit shows as a dark,
lash-coloured band across the top of the iris layer, or as iris-coloured paint
left in the white or the lower lash: move the ellipse back by eye, and revert a
change that makes the layers worse even if the number improves. Hair-shaped
pieces in any of them are a strand at the box's edge (above). A dark ring line
drawn inside the iris along its bottom can land in the lower lash, and no
landmark fixes it: it shows on the gaze close-up as a dark arc left where the
iris was; report it.
brows.L, brows.R (optional, each side){ "line": [[x, y], …], "halfWidth"?, "tailHalfWidth"? }. line runs along
the brow's middle, 2 or more points, tail first (the outer end, toward the
face's edge). halfWidth (default 8) is the half-width of the band the brow is
cut from; tailHalfWidth (default 5) the same at the tail, narrowing to it
over the first third of the line. Set both from the brow's own thickness,
read at zoom: halfWidth half its thickest part plus 1 px, tailHalfWidth
half the tail's plus 1 px (the cut takes a 2 px soft rim past the ink by
itself). A thin brow of 3 to 4 px wants halfWidth 3 and tailHalfWidth 2:
the defaults' 17 px band is far too wide for it. A brow mostly hidden behind
the bangs is cut as the short pieces that show between the strands; raised,
they go under the strands and mostly vanish: a limit to report. A brow drawn
in the hair's own colour where it meets the bangs cannot be told from them:
put the line on what shows, read brow and browBand there as less reliable,
look at brow_<side>.png, and report it. Off: a line
off the brow leaves it on the face (brow warns when the band holds none,
browBand when some of its ink lies past the band, saying where and how far
to move the line or widen the band); a band too wide takes hair or lash, and
where a strand crosses the brow, refills the strand far from its own hair
(fills.hair_front.strands). A brow left out stays painted on the face and
never moves.
nose (optional){ "box": [x0, y0, x1, y1] } round the drawn nose marks with a few px to spare.
Off: a box that clips the nose leaves paint on the face. Left out, the nose
stays painted on the face, MEASURE: nose: missing … follows, and the head
turn loses its strongest depth cue.
mouth{ "box": [x0, y0, x1, y1], "cornerL": [x, y], "cornerR": [x, y] }. box: the
whole drawn mouth with a few px to spare. cornerL / cornerR: the two ends
of the mouth line, cornerL the VIEWER's left (smaller x); both inside box.
Off: a box that clips the mouth leaves paint on the face; a box on bare skin
fails mouth; with a lip set, a corner off the line's end skews the mouth.
frontHairA polygon (3 or more points) round the bangs and the strands that hang in
front of the face, from the parting at the top. Every hair pixel inside it is
hair_front; the rest of the head's hair is back hair, except what a
sideHair polygon takes. Run its edges where the hair itself divides: along
the parting, or along a strand's own edge. Never run an edge straight down
through continuous hair (at the temple, say) or across a strand: the part
inside moves with the bangs and the part outside with the back hair, so that
edge opens as a seam on a turn. Take a strand whole down to its tip or leave
it out whole. Hair hanging in front of an ear is a side lock (sideHair);
hair beside and behind the head is back hair (customParts says what that
means for long hair). A small clip or pin lying on the hair goes with the hair
round it (paint no flood claims takes its nearest label): keep it inside
frontHair if it sits on the bangs; it is not worth a custom part. Off:
frontHairWidth warns and the turn is clamped (The checks say what it
compares): move a side edge in to the next strand's edge. Narrower than the
bangs leaves their edge in the back hair.
sideHair.L, sideHair.R (optional, each side)A polygon (3 or more points) round a side lock: a lock that hangs from under
the bangs in FRONT of the ear and the cheek's edge (a bob's front locks), and
that is distinct along its whole length, with its own edges on both sides
down to its tip or to where it joins the hair below the ear. L is the
character's left, on the viewer's right. Its hair is hair_side_<side>, drawn
over the face and under hair_front, and it rides the face on a turn; left in
the back hair, it stays behind as the face slides, and the ear behind it reads
as a detached island. Hair that is part of a continuous mass beside the face
(wavy hair whose locks merge into the hair below) is back hair: a polygon edge
drawn through a mass shows as a straight tear on a turn, with the ear in
pieces round it. When in doubt, leave it in the back hair and report the ear
as a known limit. Placing it, in this order of priority:
frontHair so the two overlap (the front hair keeps
what both claim): the lock's top row needs the front hair right above it,
and its root is then carried up to 12 px under the bangs. If its top lies
outside frontHair, add a small wedge to frontHair over it.shellLower on that side to where the lock ends, so there is back
hair behind its lower end.Thin wisps over an ear are not a side lock. One lying wholly on the ear is
taken into the face and stays painted on the ear; one crossing the ear's edge
stays in the back hair, and the ear shows its gap on a turn: report it.
Under the lock, skin is filled only inside skull and where the lock crosses
the face's own paint (the ear on one side, the cheek on the other): the ear
joins the face there by itself, but still needs its own skinSeeds point.
Off: sideHair.<side> warns (The checks).
skullA polygon (3 or more points): the head's skin as if bald, WITHOUT the ears.
Follow the face's own edge inside the ears, then continue it up under the
hair to a rounded top. It is where hidden skin is filled in: under the bangs,
and under a side lock where the lock lies on the cheek. Never draw it out over
an ear: that lays skin under a lock where the picture has hair behind it, and
shows as a pale patch on a turn (the ear joins the face under a lock by
itself, sideHair). Off: too small shows hair through the forehead on a
turn; far past the head's outline makes the fill up far from any skin
(fills.face.forehead).
shellLowerA line, left to right (x strictly ascending, 2 or more points): where the back of the head's hair ends behind the face. Hair is filled in behind the face and the bangs down to it. Around the ear lobes for tied-up hair; lower, behind the neck, for hair that hangs down; on a side with a side lock, down to where the lock ends. Off: too high shows a gap under the jaw on a turn.
skinSeedsPoints (1 or more) on the face's skin: each cheek, the forehead, and each
ear (an ear is cut off from the face by the hair in front of it, and the
face is a flood from these points that lines stop). Skin no seed reaches is
left out of the face and takes the nearest other label. Off: a seed on hair, a line or the backdrop fails
seeds; a missing ear seed leaves the ear out of the face (look at
preview-labels.png).
bodySeedsPoints (1 or more) on the neck and the clothes. The body is a flood from them
over every solid paint that is not hair-coloured (by the samples) and not the
face: it crosses drawn lines, trims and thin stripes, so one seed takes a
uniform of many panels joined through such paint, and seams need no seed of
their own. It stops at hair-coloured paint (a dark jacket, and with
near-black hair, the lines inked in the same black) and at the face: put one
seed in each piece such paint walls off, and a bodyOnly polygon over a
garment that is itself hair-coloured. A thin hair-coloured stripe or outline
on the clothes is given back to the body by itself; a wider band (a dark tie,
a belt) is not: bodyOnly. A seed reads one pixel: put it on flat cloth or
skin, a few px from any line. Off: paint no seed reaches stays out of the
body and takes the nearest other label, so it moves with the head or the hair
(Step 5's table).
neckTopYThe canvas row the neck is carried up to behind the chin: the nose's bottom
row (nose.box's y1), or with no nose, halfway between the irises' cy and
the chin's lowest row. The neck is drawn up there only behind the face and the
front hair, which hide it at rest; it must reach high enough that they still
hide its top when the head turns, nods and tilts. Off: too low shows a gap or
an edge under the jaw on a turn or a nod (Step 9's close-ups).
customParts (optional)Anything tied off at one point that hangs from the head and would widen it:
twin tails, a ponytail, big ribbons, a long braid. Long loose hair that hangs
from the whole head, behind the shoulders or in front of them, is not a
custom part: it is back hair, and shellLower sits lower, behind the neck.
Back hair is drawn behind the body, and the body has no paint under hair
lying over it: hair drawn over the shoulders or a collar slides under the
body's edge when it sways or the head turns, leaving pale streaks or empty
spots on the body. This is a known limit: report it. Each custom part is cut out of the back hair into
custom/<id>.png and rigged as a custom part (Step 8). Left in the back hair
they make the rig measure the head far wider than it is (one pair of twin tails:
1.6 times), and the turn goes wrong. A part's id is a plain identifier (letters, digits, _, not starting
with a digit) that no role takes, nor a part id a role yields (elbow_L,
forearm_R): tail_L, tail_R, ponytail. Two forms:
{
"id": "tail_R",
"tie": [300, 200],
"side": "left",
"line": [
[315, 170],
[300, 200],
[290, 260],
[285, 340],
[290, 420]
],
"below": 400,
"ribbonBox": [270, 150, 335, 225]
}
{
"id": "tail_L",
"tie": [800, 200],
"polygon": [
[785, 170],
[1000, 170],
[1000, 900],
[800, 900],
[815, 420],
[800, 260]
]
}
side, line, below, ribbonBox?): line traces where
the part leaves the head's hair, top to bottom (y strictly ascending, 2 or
more points); the back hair on side of it ("left": smaller x, as the
viewer sees it) is the part. Under the line's last point, the part is
everything on that side of the column x = below: set it between the part
and the hair or body beside it. ribbonBox is a box round a ribbon or tie at
the knot, whose coloured paint then goes with the part.polygon is the part. Simpler when
the part hangs clear of everything else.tie: the knot, where the part hangs from the head; the part swings about it,
and Step 8 passes it to the rig, which needs it inside both the part's paint
and the back hair's (the cut fills back hair in under the root for this). Put
it on the hair at the root, a few px inside the part. Off: a tie off the root
tears the part from the head as it swings.Off: a line or polygon that misses a strand leaves it in the back hair (where
it widens the head); one inside the part leaves its root in the back hair
(fills.custom.<id>.root warns when the hair under the root is made up far
from any hair).
backgroundSeeds, paintSeeds, bodyOnly (only when a check asks)backgroundSeeds: points in backdrop the figure encloses (a gap between the
neck and a tail), which the border's flood cannot reach. Add the points the
pockets hint names for backgroundSeeds when they are backdrop showing
through; the cut accepts every one. A region the hint calls pale paint near
the backdrop's colour is paint and needs nothing.paintSeeds: points in backdrop-coloured paint inside the hair that is paint,
not backdrop (a pale clip between two locks). Add one when pockets lists a
point it keyed by itself that is really paint.bodyOnly: polygons (3 or more points each) where paint the samples call hair
belongs to the body: a dark jacket under near-black hair, a hair-coloured bow
on the chest. Add one when seeds says a body seed reads as hair, or when
preview-labels.png shows clothes tinted as hair.In about the order they print (each eye's opening, eye and iris lines
print together, L first, then each brow's brow and browBand; a custom
part's fill follows the fill it belongs with; each sideHair check follows
frontHairWidth). Levels: a fail-level check that does not pass makes
the cut CUT FAIL; a warn-level one prints WARN and the cut still passes.
A limit of none means the check only reports.
| id | level | measures | limit | fix |
|---|---|---|---|---|
stack | fail | the layers stacked in role order against the picture: the share of canvas px off by more than 24 levels outside the mouth's box (the box's own share is printed apart, as the mouth is replaced) | 0.003 | find the paint no layer took (untinted on preview-labels.png) or a fill drawn over paint, and move the seed or outline that left it out |
seeds | fail | seeds and samples on the backdrop or on the wrong class, counted | 0 | the hint names each point: move it onto flat paint of its class, add a samples.*.shadow point on that tone, or a bodyOnly polygon |
opening.L, opening.R | fail (box clips the eye); warn (box loose, or an edge cuts a stroke it cannot tell from the eye) | clipped: the eye's least margin inside its box, px; loose: the share of the box the eye covers | 1 (margin); 0.2 (loose) | as the hint says, after a look; a strand at the box's edge: Landmark reference, eyes |
eye.L, eye.R | warn | the eye's share of white | 0.06 | under it the eye is cut either open (a tinted white: look at eye_<side>.png) or as drawn closed (for an open eye, eyes.<side>.iris is off the disc: move it) |
iris.L, iris.R | warn | the iris ellipse against the disc found by its own colour: overlap (intersection over union) and centre offset | 0.7 | the hint's move is a suggestion: make it only if the eye layers then look right (Landmark reference, eyes) |
brow.L, brow.R | warn | brow px found in the band | 1 | the line is off the brow: put it along the brow's middle, tail first |
browBand.L, browBand.R | warn | the share of the brow's ink left on the face past its band | 0.05 | as the hint says (move the line's points over the x span it names, widen the band, or extend an end); a hair outline or a crease along the brow can warn falsely: zoom first |
mouth | fail | px of drawn mouth in mouth.box | 1 | move the box onto the drawn mouth; a picture with no mouth drawn needs a lip set |
fills.face.features | warn | the skin under the features, filled by construction | none | — |
fills.face.forehead | warn | the share of the skin under the bangs made up over 40 px from any skin | 0.25 | pull skull in to the head's outline; add a skinSeeds point on forehead skin between strands |
fills.face.sideHair | warn | the share of the skin under the side locks made up over 40 px from any skin | 0.25 | a skinSeeds point on the cheek and on the ear beside each lock; skull off the ears |
fills.hair_back.shell | warn | the hair behind the face and the bangs, filled by construction | none | — |
fills.hair_back.sideHair | warn | the back hair behind the side locks down to shellLower, filled by construction | none | — |
fills.custom.<id>.root | warn | the head's hair under the part's root made up far from any back hair | 0.25 | move that part's line or polygon to where the part leaves the head's hair |
fills.hair_back.underBody | warn | the back hair carried under the body's edge, made up far from any back hair | 0.25 | check on preview-labels.png that the hair above the shoulders is tinted as hair; add samples.hair points on its tones |
fills.custom.<id>.underBody | warn | the same for a custom part | 0.25 | make the part's cut take its hair down to the shoulder |
fills.body.neck | warn | the neck carried up to neckTopY, filled by construction | none | — |
fills.hair_front.strands | warn | the share of a strand refilled through a brow's band made up over 40 px from its own hair | 0.25 | narrow brows.<side>.halfWidth to the brow |
fills.hair_side_<side>.root | warn | the share of the lock's root, carried up under the bangs, made up over 40 px from the lock's own hair (a lock of strands thinner than about 5 px has none clear of its lines) | 0.25 | it never shows at rest; check on preview-labels.png that the polygon holds the lock |
frontHairWidth | warn | hair_front's whole width (its widest extent on any row) over the face layer's width on the eye row (the irises' mean cy); side locks not counted | 1 | move a side edge of frontHair in to the next strand's edge; with no value, put skinSeeds on the cheeks |
sideHair.L, sideHair.R | warn (one per polygon given) | the number of problems with the lock | 0 | a polygon holding no hair: move it onto the lock, or add samples.hair points on the lock's tones if the preview shows it not as hair; a top row with no front hair right above it (the root shows at rest): move the polygon's top up into frontHair, or bring frontHair down over it; the lock over its eye's outer corner at rest: move the polygon's inner edge outward and widen frontHair over the hair it leaves |
pockets | warn | the gaps between strands it keyed as backdrop by itself, plus the backdrop-coloured regions the border's flood cannot reach, counted; pale paint near the backdrop's colour is named, not counted | 0 | a region named for backgroundSeeds that is backdrop: its point there; a keyed point that is really paint: paintSeeds; pale paint: nothing |
The last line. CUT pass means no fail-level check failed; CUT FAIL: <ids> lists the ones that did. CUT pass with WARN lines is normal. On most
pictures expect:
fills.face.forehead under heavy bangs: the forehead is mostly hidden, so
little skin is there to fill from. Check skull and the forehead seeds once;
if it still warns, it is the picture.pockets whenever it keyed gaps between strands by itself (it always warns
then): look at each listed point on preview-labels.png, and only act when
one is really paint.eye.L / eye.R on a tinted or heavily shaded eye white, when the eye layer
looks right.Every other WARN deserves one look and, usually, the fix in the table.
MEASURE: lines are the layer-geometry checks a cut can act on, after the
checks. MEASURE: all geometry checks passed when there is nothing to say.
Otherwise:
nose: missing — …, hair_back: missing — …, body: missing — …: that
role was not written. Add the nose box (or accept a turn with no nose
lead); a missing hair_back or body means the samples or seeds missed it.lips: opening W px wide, H px tall at its centre under a L px line — …
(with a lip set): the opening the rig reads. Report it.hair_side_<side>: needs hair_front …, a root showing past the bangs and
the lock over its eye's outer corner (fix as for sideHair.<side>), and
… the lock leans inward about N px and leaves bare pixels … (nothing is
painted behind the lock there on a turn: lower shellLower under it).the written layers could not be measured) is a fault in the
cut, not in your landmarks: report it verbatim and do not rig on it.turn-m30 / turn-p30 close-ups as a pale
patch at the temple; report it to the user, and do not move the brow line
for it (that only leaves the tail on the face).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
iki, vtubers, character-rigging, illustration-animation, mcp-tools
npx claudepluginhub zeikar/iki --plugin iki4 skills in this plugin
/iki-characterGenerate 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 head motions (Nod, Shake, Tilt) and, with a pose forearm, a Wave, and up to six default expressions (smile, laugh, angry, sad, surprised, shy; 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-loopDrive a generator/critic loop that refines a rigged Iki character (`.iki`) until it matches a reference illustration. Draws a reference with the iki-create-image skill, then alternates the iki-character-artist agent (draws, composes, tunes, rigs) with the iki-character-critic agent (scores a rubric, emits typed findings) until the critic says ship and the user has nothing to add, or a cap is hit. The iki-character-appeal-critic judges the renders for appeal without the reference each round. Use when a generated character is renderable but not good-looking enough, or when the user asks to iterate a character toward a target look./iki-create-imageDraw the images an Iki character is built from — the front reference, the role-separated part PNGs drawn against it, the 30° turned reference, and for a full-body character the full-body reference drawn from the front one and the waving reference drawn from that — with the Codex CLI's image tool on a model the plugin pins, or hand the user the prompts to run in another image tool when Codex is not set up. Used by the iki-character, iki-character-loop and iki-import-illustration skills; not for general image requests.Other plugins' skills for the same job