This is the Skill Heaven specialization of Gaia Image Production. It governs
every generated Lucy raster, background removal, upscale, crop, filter, and
WebP export in this repository.
The assigned job in docs/lucy/production/ASSET_PRODUCTION_PLAN.md
The final sheet and written canon win over every earlier iteration. Lucy is one
character. Her anatomy and outfit do not transform between states.
Paid generation contract
Use gpt-image-2 only.
Make exactly one generation call for each assigned GEN-* job.
Do not request alternates, variations, or a second attempt.
Include the authority images in the generation context.
Preserve the first result even when it fails a gate; mark the job blocked.
Self-review the result once. Continue only with deterministic local
processing: crop, resize, alpha extraction, cleanup, compositing, inversion,
color filtering, and WebP export.
An owner-authorized candidate brief may define multiple named candidates.
Treat each named candidate or bounded edit as its own one-call job. Never add
replacements beyond the explicit candidate count, and never promote a
candidate before the brief's human selection gate.
As-is backup: run scripts/assets/backup-lucy-pngs.sh after any PNG lands.
Production deliverables:
packages/site/src/assets/lucy/ as WebP.
The canonical sheet and owner-approved source masters already retained under
src/assets/lucy/*/masters/ may stay in Git for authority and provenance,
but frontend code must never import those PNGs directly; browsers load
delivery WebPs only.
Write a receipt to docs/lucy/production/runs/<job-id>.md with model,
prompt path or full prompt, input authorities, raw path, outputs, dimensions,
alpha result, self-review results, and any blocked item.
Transparency and chroma fallback
When a brief says transparent, the final production WebP must contain real
alpha. No white, black, gray, or colored matte may remain in translucent edges.
Request a transparent background in generation.
Inspect the PNG alpha channel itself. A painted checkerboard is opaque art,
not transparency, even when the RGB preview looks correct.
If the generator returns an opaque background, accept that one result and
use deterministic removal. Prefer a flat #00FF00 chroma field requested in
the original brief; chroma green is deliberately distant from Lucy's cyan,
blue, gold, red, silver, and skin palette.
Reject opaque white, gray, scene, simulated transparency, and baked-checker
sources at the matte gate. Do not reconstruct a checker into speculative
alpha. Never use purple or magenta as a Lucy chroma field.
Run scripts/assets/lucy-matte-guard.py for native-alpha validation or
verified flat-green extraction. Supply a semantic-region JSON for character
masters so face core, head, hair, torso, both arms/hands, both legs/feet,
wings, and weapons must each pass alpha-density gates. The face-core region
must have at least 70 percent of pixels at alpha 192 or higher and median
nonzero alpha of at least 224. Head and hair must also meet the tool's
median-alpha floors; nonzero ghost pixels do not count as completeness.
Inspect the generated white, black, mid-gray, light-checker, dark-checker,
inverted-RGB checker, and raw-alpha audits for halos, holes, ghost pixels,
missing pale features, and contaminated glass edges.
Require zero strong-green and zero strong-magenta pixels in the
exterior-connected partial-alpha band for chroma-key work. An approved
native-alpha prismatic source may use the guard's explicit
--source-native-prism exception only when the receipt records the source
provenance and edge counts and browser QA confirms the inherited hues are
art, not matte contamination. Do not infer completeness from RGB; the alpha
silhouette is the authority.
Export a lossless-alpha WebP and re-open it to verify alpha survived.
Chroma is a workbench surface, never a brand color. Do not regenerate because
alpha removal is inconvenient.
Keep reusable processing logic in scripts/assets/; do not hide the workflow
inside an untracked one-off command. Derivatives from the same generation—wide
composites, state cards, portraits, social crops, filtered plates, and mobile
crops—are not new image-generation jobs.
Supersampling modes
Generation/master authority, enhancement workbench, delivery master, web
encoding, and verification are separate stages. The approved source always
owns Lucy's pose, identity, composition, and silhouette. An enhancer may
recover bounded image detail; it never owns alpha geometry.
standard: direct deterministic resampling for ordinary derivatives.
high: a 4x enhancement workspace collapsed to the requested delivery
dimensions.
overkill: offline hero/key-art production. Separate luma, chroma, and
canonical alpha; use a neural detail oracle only on luma with
face_enhance=false; keep conservative resampling as the structural owner;
then use a tiled 16x numerical workspace and staged Lanczos
16x -> 4x -> 2x collapse. Never commit or ship the 4x/8x/16x workspace.
The v5 reference implementation is
scripts/assets/lucy-v5-overkill-export.py. Reproduce it from a clean checkout
with Python 3.11 and the pinned
scripts/assets/requirements-lucy-overkill.txt; the script downloads the
checksum-pinned MIT-licensed ArtCNN R16F96 ONNX model into the ignored
workbench. Its hybrid path bounds the ArtCNN luma residual, reconstructs BT.709
Cb/Cr independently, resamples the source alpha independently, produces exact
2x delivery dimensions, encodes lossy RGB with lossless/high-fidelity alpha,
reopens the WebP, and refuses any encoded alpha change.
Use --provider cpu when Core ML is unavailable. Provider choice is recorded
in the manifest and may alter RGB bytes; dimensions, bounded-detail policy, and
decoded-alpha verification remain identical.
Every supersampled run must record:
source and model provenance plus SHA-256;
exact source, theoretical workspace, and delivery dimensions;
model/runtime/provider versions and face_enhance=false;
luma residual bounds, chroma method, and alpha method;
encoded dimensions, byte count, alpha counts/hash, and output hash;
white, black, gray, light/dark checker, inverted-RGB, and raw-alpha audits;
real browser verification on every consuming route at desktop and mobile.
The delivery size and byte budget are quality targets, not permission to
damage the approved art. Report misses honestly. A delivery must still be a
smaller modern-format browser asset than its retained source PNG.
State gates
Zero: seated zen, closed eyes, normal gravity, one katana, no wings and
absolutely no shards.
Heaven: unique falling pose, both diamond eyes open, one katana, ordered
saturated cyan-blue glass-shard wings.
Hell: generate a complete Heaven-palette source with both eyes naturally
closed and one continuous tear from the eyelid down the full face, then apply
one exact full-foreground RGB inversion. The source tear must be the cyan
complement that becomes the final vivid red tear. Use one katana and
fragmented shards. Never patch eyelids or recolor the tear after inversion;
all Hell-related derivatives descend from the untouched inverted master.
Ultra: unique decisive falling pose, one gold diamond eye open, the other
closed with a red tear, two matching katanas, gold shards, never inverted.
All states retain shoulder-length silver-white hair, dark sailor uniform,
prismatic ribbon, barefoot anatomy, real steel katana construction, and glass
shards with no feathers or membranes.
One-pass self-review checklist
Same canonical Lucy, proportions, uniform, hair length, ribbon, bare feet.
No text, labels, signature, watermark, frame, or accidental UI.
Full silhouette and required effects are not clipped.
Transparent deliverables have real alpha and no matte/halo.
Head, face, hair, torso, limbs, wings, and weapons have nonzero alpha in
their declared semantic regions.
White, black, gray, normal-checker, dark-checker, and inverted previews
preserve hair, skin, glass, and steel edges.
Exterior partial-alpha edges contain no strong green or magenta pixels.
The two-pixel interior foreground boundary contains no strong green key
spill. This includes opaque hair/glass edge pixels: exact Hell inversion
would turn missed green spill into a magenta rim.
For Hell, enforce that green-boundary rule on the pre-inversion source.
The final exact-inverted Hell may use the guard's explicit
--exact-inverted-hell mode only after the source report passes and the
inversion report proves full-foreground RGB inversion plus byte-identical
alpha. This avoids misclassifying legitimate green produced by inverting
canonical source magenta.
Hell inversion receipts must verify the source tear contains vivid cyan
pixels in the declared face-core, the exact inversion contains the same
number of vivid-red pixels, and the red pixels span at least 35 percent
of the face-core height. Human composite review still decides eyelid
contact and unbroken eyelid-to-jaw continuity.
Output dimensions and file paths match the production plan.
Production WebP re-opens successfully and stays within its target size.
Raw PNG was backed up as-is.
Receipt records pass/fail honestly; failed gates are not silently hidden.
1---2name: lucy-image-production3description: One-shot Lucy asset generation and deterministic export for Skill Heaven.4---56# Lucy Image Production78This is the Skill Heaven specialization of Gaia Image Production. It governs9every generated Lucy raster, background removal, upscale, crop, filter, and10WebP export in this repository.1112## Authority1314Read these before production, in this order:15161. `packages/site/src/assets/lucy/authority/lucy-character-sheet-master.png`172. `docs/lucy/authority/LUCY_CANONICAL_CHARACTER_SHEET.md`183. `docs/lucy/authority/lucy-canon.json`194. `packages/site/src/assets/lucy/authority/lucy-original-reference.jpg`205. The assigned job in `docs/lucy/production/ASSET_PRODUCTION_PLAN.md`2122The final sheet and written canon win over every earlier iteration. Lucy is one23character. Her anatomy and outfit do not transform between states.2425## Paid generation contract2627- Use `gpt-image-2` only.28- Make exactly one generation call for each assigned `GEN-*` job.29- Do not request alternates, variations, or a second attempt.30- Include the authority images in the generation context.31- Preserve the first result even when it fails a gate; mark the job blocked.32- Self-review the result once. Continue only with deterministic local33 processing: crop, resize, alpha extraction, cleanup, compositing, inversion,34 color filtering, and WebP export.35- An owner-authorized candidate brief may define multiple named candidates.36 Treat each named candidate or bounded edit as its own one-call job. Never add37 replacements beyond the explicit candidate count, and never promote a38 candidate before the brief's human selection gate.3940## Storage contract4142- Raw/master/intermediate PNGs:43 `packages/site/assets/workbench/lucy/<job-id>/` (gitignored).44- As-is backup: run `scripts/assets/backup-lucy-pngs.sh` after any PNG lands.45- Production deliverables:46 `packages/site/src/assets/lucy/` as WebP.47- The canonical sheet and owner-approved source masters already retained under48 `src/assets/lucy/*/masters/` may stay in Git for authority and provenance,49 but frontend code must never import those PNGs directly; browsers load50 delivery WebPs only.51- Write a receipt to `docs/lucy/production/runs/<job-id>.md` with model,52 prompt path or full prompt, input authorities, raw path, outputs, dimensions,53 alpha result, self-review results, and any blocked item.5455## Transparency and chroma fallback5657When a brief says transparent, the final production WebP must contain real58alpha. No white, black, gray, or colored matte may remain in translucent edges.59601. Request a transparent background in generation.612. Inspect the PNG alpha channel itself. A painted checkerboard is opaque art,62 not transparency, even when the RGB preview looks correct.633. If the generator returns an opaque background, accept that one result and64 use deterministic removal. Prefer a flat `#00FF00` chroma field requested in65 the original brief; chroma green is deliberately distant from Lucy's cyan,66 blue, gold, red, silver, and skin palette.674. Reject opaque white, gray, scene, simulated transparency, and baked-checker68 sources at the matte gate. Do not reconstruct a checker into speculative69 alpha. Never use purple or magenta as a Lucy chroma field.705. Run `scripts/assets/lucy-matte-guard.py` for native-alpha validation or71 verified flat-green extraction. Supply a semantic-region JSON for character72 masters so face core, head, hair, torso, both arms/hands, both legs/feet,73 wings, and weapons must each pass alpha-density gates. The face-core region74 must have at least 70 percent of pixels at alpha 192 or higher and median75 nonzero alpha of at least 224. Head and hair must also meet the tool's76 median-alpha floors; nonzero ghost pixels do not count as completeness.776. Inspect the generated white, black, mid-gray, light-checker, dark-checker,78 inverted-RGB checker, and raw-alpha audits for halos, holes, ghost pixels,79 missing pale features, and contaminated glass edges.807. Require zero strong-green and zero strong-magenta pixels in the81 exterior-connected partial-alpha band for chroma-key work. An approved82 native-alpha prismatic source may use the guard's explicit83 `--source-native-prism` exception only when the receipt records the source84 provenance and edge counts and browser QA confirms the inherited hues are85 art, not matte contamination. Do not infer completeness from RGB; the alpha86 silhouette is the authority.878. Export a lossless-alpha WebP and re-open it to verify alpha survived.8889Chroma is a workbench surface, never a brand color. Do not regenerate because90alpha removal is inconvenient.9192Example fail-closed matte invocation:9394```bash95python3 scripts/assets/lucy-matte-guard.py \96 --input packages/site/assets/workbench/lucy/JOB/raw.png \97 --output packages/site/assets/workbench/lucy/JOB/intermediate/alpha.png \98 --audit-dir packages/site/assets/workbench/lucy/JOB/audit \99 --report packages/site/assets/workbench/lucy/JOB/matte-report.json \100 --regions packages/site/assets/workbench/lucy/JOB/semantic-regions.json \101 --candidate JOB102```103104## Deterministic processing105106Use free local processing wherever possible. The preferred portable runtime is:107108```bash109npx -y --package=tsx --package=sharp --package=@img/sharp-wasm32 tsx <script>110```111112Keep reusable processing logic in `scripts/assets/`; do not hide the workflow113inside an untracked one-off command. Derivatives from the same generation—wide114composites, state cards, portraits, social crops, filtered plates, and mobile115crops—are not new image-generation jobs.116117## Supersampling modes118119Generation/master authority, enhancement workbench, delivery master, web120encoding, and verification are separate stages. The approved source always121owns Lucy's pose, identity, composition, and silhouette. An enhancer may122recover bounded image detail; it never owns alpha geometry.123124- **standard:** direct deterministic resampling for ordinary derivatives.125- **high:** a 4x enhancement workspace collapsed to the requested delivery126 dimensions.127- **overkill:** offline hero/key-art production. Separate luma, chroma, and128 canonical alpha; use a neural detail oracle only on luma with129 `face_enhance=false`; keep conservative resampling as the structural owner;130 then use a tiled 16x numerical workspace and staged Lanczos131 `16x -> 4x -> 2x` collapse. Never commit or ship the 4x/8x/16x workspace.132133The v5 reference implementation is134`scripts/assets/lucy-v5-overkill-export.py`. Reproduce it from a clean checkout135with Python 3.11 and the pinned136`scripts/assets/requirements-lucy-overkill.txt`; the script downloads the137checksum-pinned MIT-licensed ArtCNN R16F96 ONNX model into the ignored138workbench. Its hybrid path bounds the ArtCNN luma residual, reconstructs BT.709139Cb/Cr independently, resamples the source alpha independently, produces exact1402x delivery dimensions, encodes lossy RGB with lossless/high-fidelity alpha,141reopens the WebP, and refuses any encoded alpha change.142143```bash144python3.11 -m venv packages/site/assets/workbench/lucy/ISSUE-73-OVERKILL/.venv145packages/site/assets/workbench/lucy/ISSUE-73-OVERKILL/.venv/bin/pip install -r scripts/assets/requirements-lucy-overkill.txt146packages/site/assets/workbench/lucy/ISSUE-73-OVERKILL/.venv/bin/python scripts/assets/lucy-v5-overkill-export.py --provider coreml --force147python3 scripts/assets/validate-lucy-v5-delivery.py148```149150Use `--provider cpu` when Core ML is unavailable. Provider choice is recorded151in the manifest and may alter RGB bytes; dimensions, bounded-detail policy, and152decoded-alpha verification remain identical.153154Every supersampled run must record:155156- source and model provenance plus SHA-256;157- exact source, theoretical workspace, and delivery dimensions;158- model/runtime/provider versions and `face_enhance=false`;159- luma residual bounds, chroma method, and alpha method;160- encoded dimensions, byte count, alpha counts/hash, and output hash;161- white, black, gray, light/dark checker, inverted-RGB, and raw-alpha audits;162- real browser verification on every consuming route at desktop and mobile.163164The delivery size and byte budget are quality targets, not permission to165damage the approved art. Report misses honestly. A delivery must still be a166smaller modern-format browser asset than its retained source PNG.167168## State gates169170- **Zero:** seated zen, closed eyes, normal gravity, one katana, no wings and171 absolutely no shards.172- **Heaven:** unique falling pose, both diamond eyes open, one katana, ordered173 saturated cyan-blue glass-shard wings.174- **Hell:** generate a complete Heaven-palette source with both eyes naturally175 closed and one continuous tear from the eyelid down the full face, then apply176 one exact full-foreground RGB inversion. The source tear must be the cyan177 complement that becomes the final vivid red tear. Use one katana and178 fragmented shards. Never patch eyelids or recolor the tear after inversion;179 all Hell-related derivatives descend from the untouched inverted master.180- **Ultra:** unique decisive falling pose, one gold diamond eye open, the other181 closed with a red tear, two matching katanas, gold shards, never inverted.182183All states retain shoulder-length silver-white hair, dark sailor uniform,184prismatic ribbon, barefoot anatomy, real steel katana construction, and glass185shards with no feathers or membranes.186187## One-pass self-review checklist188189- [ ] Same canonical Lucy, proportions, uniform, hair length, ribbon, bare feet.190- [ ] Assigned pose, gravity, eye state, tear, weapon count, and shard language.191- [ ] No text, labels, signature, watermark, frame, or accidental UI.192- [ ] Full silhouette and required effects are not clipped.193- [ ] Transparent deliverables have real alpha and no matte/halo.194- [ ] Head, face, hair, torso, limbs, wings, and weapons have nonzero alpha in195 their declared semantic regions.196- [ ] White, black, gray, normal-checker, dark-checker, and inverted previews197 preserve hair, skin, glass, and steel edges.198- [ ] Exterior partial-alpha edges contain no strong green or magenta pixels.199- [ ] The two-pixel interior foreground boundary contains no strong green key200 spill. This includes opaque hair/glass edge pixels: exact Hell inversion201 would turn missed green spill into a magenta rim.202- [ ] For Hell, enforce that green-boundary rule on the pre-inversion source.203 The final exact-inverted Hell may use the guard's explicit204 `--exact-inverted-hell` mode only after the source report passes and the205 inversion report proves full-foreground RGB inversion plus byte-identical206 alpha. This avoids misclassifying legitimate green produced by inverting207 canonical source magenta.208- [ ] Hell inversion receipts must verify the source tear contains vivid cyan209 pixels in the declared face-core, the exact inversion contains the same210 number of vivid-red pixels, and the red pixels span at least 35 percent211 of the face-core height. Human composite review still decides eyelid212 contact and unbroken eyelid-to-jaw continuity.213- [ ] Output dimensions and file paths match the production plan.214- [ ] Production WebP re-opens successfully and stays within its target size.215- [ ] Raw PNG was backed up as-is.216- [ ] Receipt records pass/fail honestly; failed gates are not silently hidden.
Run npx skillmds@latest add gaia-research/lucy-image-production in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
One-shot Lucy asset generation and deterministic export for Skill Heaven. It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
gaia-research (@gaia-research) published this skill. Their other Agent Skills are listed on their SkillMD profile.