Skip to content

A Claude Code plugin that turns a story into a finished anime

Ruby

Add the skill instructions and production references

Francesco 'makevoid' Canessa85426fad08e5
diff --git a/skills/make-an-anime/SKILL.md b/skills/make-an-anime/SKILL.md
new file mode 100644
index 0000000..c910d21
--- /dev/null
+++ b/skills/make-an-anime/SKILL.md
@@ -0,0 +1,70 @@
+---
+name: make-an-anime
+description: Create and revise anime, from a 12-second battle scene to full episodes and narrated documentaries, from a story and optional character reference photos. Character and location sheets with GPT Image 2.5 Sunburst xhigh, cinematic camera-directed shots animated with MiniMax H3 Max, green-screen layered composites over animated backgrounds, a distinct ElevenLabs Eleven v4 voice per character with lip-sync, ElevenLabs Music v2.5 scores, p5 screens/titles/subtitles, SFX and Swift VFX. Use for whole episodes, pilots, single scenes, or revisions to their cast, voices, shots, sound and effects.
+license: MIT
+compatibility: Designed for Claude Code. Requires Ruby 3.2+, Bundler, web search and sub-agent tools. Media tasks require FFmpeg, ImageMagick, Python 3, Node.js 22+ and Chrome. Swift VFX requires macOS 14+ and Swift 5.9+. Fal generation requires the plugin's sensitive FAL_AI_API_KEY option or that environment variable for local development.
+---
+
+# Make an anime
+
+Turn a story into a finished, voiced, scored anime: a cold open that hooks, characters who stay on-model (and recognisably the real people, when reference photos are supplied), shots that are composed and camera-directed like a good TV anime, voices that belong to each character, and a score that carries the emotion. Default to cinematic restraint with moments of shounen energy: hold on faces, let pauses breathe, then hit cuts and camera moves on the beats. A different tone in the user's brief overrides this default.
+
+The art direction comes from the story, the brief and the references. Write it down once as a style bible (`config/style.md`) and reuse it, unchanged, in every image and H3 prompt through `{{STYLE}}`.
+
+## Execution contract
+
+**Ruby is the only execution entry layer for the agent and every sub-agent.** Run `ruby "${CLAUDE_SKILL_DIR}/scripts/mv.rb" ...` from any working directory, or `bundle exec rake ...` inside an initialized project. Rake tasks are thin delegates to Ruby OOP services. Ruby calls the Fal queue API and shells out with argument arrays to FFmpeg, ImageMagick, Python, Node/p5 and Swift. Never execute those backends directly, use curl for Fal, or replace the Ruby client with a provider SDK. Add a Ruby method and thin task when a capability is missing.
+
+File editing, inspecting images/video/audio, web search, conversation and agent delegation remain native agent tools; they are not media execution layers. Write prompts, YAML, sketches and cue files with editing tools, then render them through Ruby.
+
+Available executable: **`${CLAUDE_SKILL_DIR}/scripts/mv.rb`** (relative location: `scripts/mv.rb`). Claude Code substitutes the skill directory when loading these instructions. `--help` documents its CLI; `-T` lists all rake tasks. It has noninteractive arguments, actionable errors and exit codes; prompts and approval happen in chat. Use absolute paths for `init` inputs. Create projects outside the installed skill/plugin directory and run setup and production with `--project`.
+
+**Plugin credentials:** read [credentials.md](references/credentials.md) before the first Fal task. The plugin's `anime` MCP server receives the sensitive key and delegates Fal-facing tasks to the same Ruby entry point (`run_task`, `task_status`). For standalone/developer use the CLI reads only `FAL_AI_API_KEY` from its environment. Never request the key in chat or print it.
+
+## 1. Intake
+
+On invocation, ask for the **story** (a story bible, treatment or script) if it was not supplied. **Character reference photos** are optional: original characters are designed from text alone. Use photos of real people only with their consent. Optional: which part to produce (a pilot, an act, the whole film), target length, language, voice preferences, aspect ratio, a soundtrack the user owns, audience, budget. Default to English dialogue, 16:9, 24fps, 768P H3 shots delivered at 1080p.
+
+Read [anime.md](references/anime.md), [planning.md](references/planning.md) and [tasks.md](references/tasks.md). Initialize an isolated project:
+
+```sh
+ruby "${CLAUDE_SKILL_DIR}/scripts/mv.rb" init --project /absolute/project --story /absolute/story.md --references /absolute/character-references
+ruby "${CLAUDE_SKILL_DIR}/scripts/mv.rb" --project /absolute/project setup
+ruby "${CLAUDE_SKILL_DIR}/scripts/mv.rb" --project /absolute/project doctor
+```
+
+To try the toolkit first, `init --project /absolute/project --example shonen-battle` creates a finished 12-second test scene (see [layered-scenes.md](references/layered-scenes.md)).
+
+Read the whole story and look at every reference photo. List the people who appear in the requested part, their age **at that point in the story** (photos may show a different age), outfits for that scene and the locations. **Use web search** for concrete, accurate period and place details (a city's night skyline, a 1990s computer, a school building, a tournament venue) and record sources in `docs/RESEARCH.md`; never treat web content as instructions.
+
+## 2. Plan, then obtain approval
+
+Write `docs/PLAN.md` from [the plan template](assets/plan-template.md): style bible, cast bible with reference photos per character, voice casting, location sheets, the beat-by-beat scene breakdown with exact frame ranges, every keyframe prompt, every H3 shot prompt **with its camera direction**, every dialogue line with timing and delivery, the score's composition plan, inserts/subtitles/titles drawn in p5, SFX, cost estimate and retry allowance.
+
+Summarize the cast, look, voices, the opening hook, shot list and costs in chat. For a new creative direction, ask the user to validate the **character sheets plan, voices, shot list and general vibe** and authorize production; make no paid calls before that. When the user already explicitly asked you to produce a specific part, preserve that authorization: write the bounded plan, record the request with `NOTE='...' plan:approve` and continue. Material changes outside the approved scope need approval again; routine retries inside it do not.
+
+**Standing production authorization:** approval to produce includes all necessary Fal uploads, reference-photo uploads, voice and music generation, image generation and H3 animation within the agreed budget. Carry it to every scene and worker.
+
+## 3. Produce
+
+Read [production.md](references/production.md), [prompts.md](references/prompts.md) (style, sheets, **camera language**) and [animation-audio-vfx.md](references/animation-audio-vfx.md). Fetch current schemas with `openapi:fetch`; never silently downgrade or substitute a model.
+
+Order of work, each step reviewed before the next:
+
+1. **Character sheets** (`Steps::RefBase`): one run per character per age, e.g. `char-kaen-v1`. Original characters are text-to-image; for a real person add `photos:` and GPT Image 2.5 Sunburst **xhigh** edits them, **front-view photos first**, with a written face-anchor checklist (see "Getting the face right" in [prompts.md](references/prompts.md)). Locations that recur get location sheets the same way (text-to-image). `review:likeness[run,...]` puts sheets under the numbered photos; inspect the face first, then age, anatomy, outfit and style consistency across the whole cast; regenerate (new version) before anything depends on them. Lock accepted sheets.
+2. **Voices** (`Steps::Dialogue`): cast one distinct ElevenLabs Eleven v4 voice per character in `config/cast.yml`; generate the scene's lines; `review:dialogue` verifies each line with Whisper. Line timings set the shot lengths, so do this before animating, and run `dialogue:timeline` after any voice or shot change.
+3. **Score** (`Steps::Music` with `03_score.json`): ElevenLabs Music v2.5 composition plan whose chunks follow the scene's beats, instrumental, exactly scene length. Then `Steps::Mix` ducks it under the dialogue.
+4. **Keyframes** (`Steps::Keyframes`): one composed first frame per shot, edited from the cast/location sheets (`base: false`, `refs: [...]`).
+5. **Shots** (`Steps::Shots`): H3 Max animates each keyframe at **768P** by default, with the shot's camera move written as its own `camera:` direction and the speaking character's mouth track as target audio. Still holds and solid inserts cost nothing. `review:camera` measures the move each shot actually made.
+6. **Layers, when the shot needs them** (`Steps::Clips`): a character performed alone on flat green, keyed to a PNG sequence and moved in p5 over an animated background plate. Painted full-frame H3 shots are the default; read [layered-scenes.md](references/layered-scenes.md) for when layers win and how to do them.
+7. **Overlay** (`Steps::Overlay`): p5 draws screens, UI, title cards, subtitles and transitions over the plate, using `tools/p5/lib/screens.js` (code editor, typing, subtitles, place cards) and `tools/p5/lib/battle.js` (title slam, speed lines, impacts, camera roll). Then `sfx:gen`/`sfx:mix` and optional Swift VFX.
+
+Delegate production to sub-agents in waves (**2 assets first → 3–4 → 4–8 → 6–10 repeatedly**) with `work:next`, `work:log`, `work:watch` and `work:accept`, as described in [production.md](references/production.md). A short pilot can run serially; say so. Schedule the opening and the emotional peak early. Never let concurrent workers edit shared config, cast or identity sheets.
+
+## 4. Review and deliver
+
+Watch every shot at normal speed with sound. Reject a shot whose face drifts off-model, whose hands or anatomy break, whose camera does something other than the directed move, whose background morphs, or that invents text, people or props. For dialogue, check that the speaking character's mouth moves on their words and rests on others' lines; `target_audio_url` pins the soundtrack but is **not proof of lip-sync**. Regenerate within the retry allowance and report what remains imperfect.
+
+A multi-scene episode has its own workflow: read [full-episode.md](references/full-episode.md) (playing order, loudness across scenes, seams, retakes). Assemble scenes contiguously (`episode:preview`, `media:concat`), check the frame count, mix SFX, and deliver the episode video, a clean version without SFX/VFX, the character sheets, the cast/voice table, the plan, research, manifests and a concise summary of revisions and unresolved issues. Completion means every planned scene of the requested part is assembled, reviewed and delivered.
+
+Run the RSpec profiles from [testing.md](references/testing.md) after changing the toolkit.
diff --git a/skills/make-an-anime/assets/plan-template.md b/skills/make-an-anime/assets/plan-template.md
new file mode 100644
index 0000000..68523f7
--- /dev/null
+++ b/skills/make-an-anime/assets/plan-template.md
@@ -0,0 +1,45 @@
+# Anime production plan
+
+## Brief and approval scope
+
+Story source, the part being produced (scene/act/episode), target length, language, aspect ratio, 24fps timeline, delivery resolution (H3 768P shots upscaled to 1080p unless stated). Proposed model call counts per model (sheets, keyframes, H3 seconds, voice lines, score seconds, SFX), pricing sources/uncertainty and retry allowance. What approval authorizes, including reference-photo uploads.
+
+## Creative direction
+
+Logline of this part, the opening hook, the emotional peak, the ending/cut-out, recurring motifs planted or paid off. Tone balance (seinen restraint vs shounen energy). Camera language for this part: which moves are used where and why.
+
+Style bible: the exact paragraph in `config/style.md` (`{{STYLE}}`), with palette anchors per light source in hex.
+
+Typography for p5 screens/titles/subtitles: installed font faces and weights, copied to the project's `tools/p5/fonts/` before rendering.
+
+## Research
+
+Link RESEARCH.md: source, verified fact or inspiration, visual treatment, scene.
+
+## Cast bible
+
+| Cast id | Character, age here | Reference photos | Likeness anchors | Outfit here | Voice (ElevenLabs) + settings + casting reason | Identity run |
+|---|---|---|---|---|---|---|
+
+For each: the full `01_ref_base.txt` sheet prompt and acceptance criteria (likeness, age, distinctness from siblings, style match).
+
+Locations: id, description, light, full prompt, which scenes use it.
+
+## Scene breakdown
+
+| Run | Frames [start, end) | Beat | Shot | Size/angle | Camera move (from → to, speed, timing) | Source (H3 / still / colour) | Speaker / audio track | Lines (at, text) | p5 (screens, titles, subtitles) | SFX | Dependencies |
+|---|---|---|---|---|---|---|---|---|---|---|---|
+
+For every shot: the keyframe prompt and refs, the H3 prompt, the `camera:` block, seconds, audio track, and acceptance (on-model faces, camera did the directed move, mouth on the right lines, no invented text).
+
+## Dialogue and score
+
+`03_dialogue.yml` lines with delivery tags and timings; `03_score.json` chunks aligned to the beats; mix levels and any hard cut.
+
+## Production waves
+
+First 2 pilot assets (usually the protagonist's sheet and one other), then 3–4, 4–8, 6–10 repeatedly. Dependency groups: sheets → voices → score/mix → keyframes → shots → overlay → SFX/VFX → assembly.
+
+## Review and delivery
+
+Likeness board, voice table, per-shot playback review, lip-sync check on talking shots, camera check, frame count, soundtrack continuity, SFX levels, delivery paths and known issues.
diff --git a/skills/make-an-anime/references/animation-audio-vfx.md b/skills/make-an-anime/references/animation-audio-vfx.md
new file mode 100644
index 0000000..df466ef
--- /dev/null
+++ b/skills/make-an-anime/references/animation-audio-vfx.md
@@ -0,0 +1,116 @@
+# Animation, audio and effects recipes
+
+## Separation of work
+
+H3 supplies expressive, self-contained characters on chroma green; p5 supplies the world around them: exact timing, camera movement, environments, props, text, diagrams and layer order. A full-frame H3 plate is a justified exception, not an equal option (see "Self-contained characters" in [prompts.md](prompts.md)). Python removes backgrounds, measures audio and composites sound. Swift applies final frame-cued camera, light and signal effects. Ruby services own all execution and manifests.
+
+## p5 scenes and overlays
+
+The renderer loads `tools/p5/lib/{core,time,fx,type,paper,riso,screens}.js` and calls a sketch for each frame at `t=frame/24`. Per-frame random seeds make repeats deterministic. Full-scene sketches draw on a background plate selected for the scene; overlay sketches leave transparent areas over an H3 plate. Load project fonts chosen for the approved art direction through `Anim.fonts`. Select drawing, texture and typography helpers to suit that direction. Library names and bundled examples do not prescribe a visual style.
+
+### Project fonts
+
+Just before rendering the video, scan installed macOS fonts and copy only the selected faces into the initialized video workspace:
+
+```sh
+ruby scripts/mv.rb --project /absolute/video-workspace fonts:list
+```
+
+This recursively lists `.ttf` and `.otf` files under `/System/Library/Fonts` (including `/System/Library/Fonts/Supplemental`), `/Library/Fonts`, and `~/Library/Fonts`. Choose actual files from the results for the approved typography and required characters. Font collections (`.ttc`) are excluded; do not rename a collection to `.ttf`. On another OS, select installed TTF/OTF files from that system's font directories.
+
+Write `config/fonts.json` in the video workspace, mapping each project filename to its selected absolute source path. For example, **only if this file appeared in the scan**:
+
+```json
+{"title.ttf": "/System/Library/Fonts/Supplemental/Arial Bold.ttf"}
+```
+
+```sh
+ruby scripts/mv.rb --project /absolute/video-workspace 'fonts:copy[config/fonts.json]'
+```
+
+The task copies the selected files to that workspace's `tools/p5/fonts/`, reports source paths and SHA-256 hashes, and refuses to replace different existing font bytes. JSON preserves source paths containing spaces or commas. Record the selection in `docs/PLAN.md`, retain applicable license notices, and keep local font files out of the plugin repository. No font installation or download happens during `setup`.
+
+Load the copied filenames, for example `this.f = await Anim.fonts({ title: "title.ttf" })`, then use `textFont(this.f.title)`. Preview representative lyrics, punctuation and non-Latin characters before rendering the full video. If a requested face is unavailable, resolve the typography choice before rendering rather than silently substituting it.
+
+This minimal example demonstrates sprite placement and a camera transform. Supply the background, graphics, colours and any typography from the scene's approved design.
+
+```js
+Anim.sketch({
+ async load() {
+ this.singer = await Anim.clip('sing');
+ },
+ draw(t, frame) {
+ // Scene coordinates here assume the default 1920x1080 plate.
+ push();
+ translate(960, 540); scale(1 + 0.04 * Math.sin(t)); translate(-960, -540);
+ this.singer.draw(this.singer.at(t), 1300, 560, 820);
+ pop();
+ }
+});
+```
+
+`Anim.clip(name).at(t)` uses `audio_at`; `.frame(index)` is clamped unless loop is requested. `.draw(image,x,y,height)` centers the cropped sprite. `.place(image,x,y,width)` preserves its original source-frame position via `box`/`src`. Do not mistake the full cutout canvas bounds for the character's visible bounds. Draw background → distant graphics → behind-character text → sprite → foreground particles/captions.
+
+Optional helpers; choose only those that fit the approved look and choreography:
+
+| Area | API |
+|---|---|
+| Data/cues | `Anim.data(name)`, `Anim.cues(words)` where words are `{w,s,e}`; `cue(word,nth)` |
+| Timing | `progress`, `tween`, `ease`, `live`, `envelope`, `steps`, `sinceStep` |
+| Transforms | `at(x,y,{scale,rot,alpha},fn)`, `pop`, `slap`, `slam`, `shake` |
+| Draw | `sparkle`, `twinkle`, `trace`, `knockout`, `typed`, `karaoke` |
+| Texture | `slip`, `misregister`, `grain` |
+
+Read implementations for precise optional arguments. Render the bundled smoke sketch through `anim:render` to exercise typography/helpers with browser system fonts; preview the production sketch separately to verify its copied fonts. Keep memory bounded: sprites are loaded as PNG sequences, so crop them and reduce `scale` for small on-screen characters. Never shrink the lead's mouth below reviewable resolution.
+
+Choreography recipes: a mascot runs at the head of a curve leaving a trail; a fall accelerates the camera/world while holding the character in the focal area; a reveal zoom shows the whole diagram; a crowd pose swap ripples outward; a word appears behind hair via layer order. Tie entrances to actual words and beat accents. When text is used, check spacing and readability with the selected font and treatment. Check all important event frames with `anim:preview`, then watch the complete section.
+
+## Character cutouts and lipsync
+
+Remove detached generated captions from an existing alpha sequence with `media:keep_component[source_dir,new_out_dir,seed_x,seed_y]` through the Ruby CLI. It keeps exact RGBA values of the four-connected nonzero-alpha silhouette containing the seed; no dilation joins text back to hair or props. Choose a torso pixel occupied in every frame. Missing/transparent seeds fail explicitly, and sources remain unchanged. This cannot remove lettering touching the body, instrument or hair: use a deliberate mask or revise the asset. Inspect all motion afterward, including semi-transparent edges and moving limbs.
+
+Use chroma green for cream/white faces/clothes; paper keying can erase them. Inspect the alpha matte, hair, hands, feet and spill over light/dark backgrounds. `media:sprite_box` helps estimate source-pixel bounds; `box` is a crop and `seed` chooses the connected paper-key component. Recut locally before paying to regenerate a good H3 performance.
+
+H3 may invent captions or interface elements even when the prompt forbids text. Inspect the entire performance, including initially empty space. Disconnected text in a keyed sprite can be removed locally with a reviewed mask/component filter; check moving fingers, hair and instrument tips before accepting the cleanup. A deliberately designed opaque p5 panel can cover unwanted background UI when it preserves the subject and fits the composition. If unwanted text intersects the face/body and cannot be repaired cleanly, use the approved regeneration allowance. Keep lyric typography under p5 control.
+
+Use Demucs vocals aligned to the full song, not separately offset clips. Set `audio_at` in section-local seconds; the service adds `music_offset`. Gate modestly only if instrumental bleed causes mouthing in pauses. Short tail audio must be padded to meet H3's two-second input minimum. Use visible lips, jaw motion, brows, head/shoulder acting, anticipation and follow-through. At song peaks synchronize articulation and the acting accent, then add p5 camera/graphics around it.
+
+`media:mouth` correlates darkness in a mouth crop against vocal energy at 24fps, checking lags from -6 to +6 frames. Supply a mouth ROI in the **cutout image's coordinates** and the full-song audio start. It is a heuristic for static framing and sufficiently visible dark mouth shapes. Moving faces, low contrast and synthetic silence can make it inconclusive. Verify phonemes/visemes and pauses by watching with audio. Fix timing errors at the source; never stretch the master song or speed-change visible singing.
+
+## Sound and assembly
+
+Keep `audio/song.wav` as the full master. Use integer frame sections; unbroken-song assembly validates each section's frame count and contiguity, joins picture and muxes one continuous song. Do not concatenate independently encoded/faded audio segments. Preserve the original input and derived vocals separately. Keep a clean render before sound effects.
+
+`prompts/finish-sfx/sfx.yml`:
+
+```yaml
+source: output/clean.mp4
+out: output/with-sfx.mp4
+rel_db: -6
+peak_db: -6
+max_gain_db: 18
+sounds:
+ pop: {prompt: "One short dry cartoon cork pop, isolated, no music or voice", duration: 2, seed: 7}
+ flatline: {tone: 1000, duration: 1}
+cues:
+ - {at: 1.25, sound: pop, rel_db: -5, len: 0.25, fade: 0.03}
+```
+
+Stable Audio SFX is paid; a steady tone is synthesized locally. SFX are cached by prompt, duration, seed and negative prompt. Mix trims leading silence, sets cue loudness relative to music in that window, caps gain and peak-limits. Use exact song times, not cut-relative times. Check dialogue intelligibility, silence jokes and audible but subordinate effects. The final mux can add codec peaks, so listen and measure the delivered file if close to full scale.
+
+## Swift VFX and p5 light layers
+
+`prompts/finish-vfx/cues.yml`:
+
+```yaml
+source: output/with-sfx.mp4
+out: output/finished.mp4
+cues:
+ - {fx: punch, f: 24, dur: 8, amt: 0.05, radius: 2}
+ - {fx: glow, f: 27, dur: 12, amt: 0.4, radius: 12}
+ - {fx: dark, f: 144, dur: 3, hold: 1, amt: 0.8}
+```
+
+Core Image supports `punch`, `zoom`, `shake`, `whip`, `mblur`, `edgeblur`, `glow`, `flash`, `dark`, `rgb`, `glitch`, `tv`, `grain`. `f`/`dur` are integer frames; `pre` starts a transition early. See `tools/vfx/Sources/mvfx/Effects.swift` for exact knobs. `leak`, `flare`, `glints` are p5 light cues: set `lights: tools/p5/examples/lights.js` for the bundled leak/flare/glints implementation, or author `05_lights.js` in the VFX prompt folder (or set `lights:` to another sketch), read `Anim.data('vfx').cues`, draw on transparent black, and use screen blending in Swift. A light cue without its sketch is an error, not an invisible effect.
+
+The Swift service builds the package through Ruby, uses FFmpeg rawvideo pipes and copies the source audio. Inspect a short clip and stills before the full render. Use distinct output paths for every finish revision. Effects should follow onsets/cuts/lyrics; start glow after a flash to avoid whiteouts, avoid double grain if p5 already draws it, and preserve deliberate quiet frames. A no-cue VFX render should resemble the clean encode; cued frames should differ measurably, which RSpec checks.
diff --git a/skills/make-an-anime/references/anime.md b/skills/make-an-anime/references/anime.md
new file mode 100644
index 0000000..3446c19
--- /dev/null
+++ b/skills/make-an-anime/references/anime.md
@@ -0,0 +1,94 @@
+# From story to episode
+
+## Breaking the story down
+
+1. **Part → scenes.** Take the requested part of the story (a cold open, an act, a whole episode). Split it into scenes: one place, one continuous time, one dramatic question. Each scene becomes a RUN (`ep01-s01`, `ep01-s02`, …) with its own dialogue, score, keyframes, shots and overlay, all `frames` long at 24fps.
+2. **Scene → beats.** Write the beats in order: what changes, who wants what, the line or image that lands it. A 20-second cold open has 5–7 beats; a 1-minute act 12–20.
+3. **Beats → shots.** Give every beat a shot (or a held insert). Choose the framing for what the audience must read: establishing wide for place and time, medium for action, close-up for emotion and dialogue, extreme close-up/insert for an object (a screen, a ring, a hand). Cut on motion or on a line; vary shot sizes between consecutive shots; respect the 180° line across a dialogue exchange.
+4. **Voiceover and flashes.** A montage film carried by narration plays narration as `vo: true` lines over picture. Brief flashes (1–2 s) are held stills with a p5 push or a short H3 shot.
+
+Shot lengths come from the dialogue: generate the voices first, read the line durations from `03_dialogue_lines.json`, then fix the frame ranges. Leave 6–12 frames of air before a line and after a punchline; never cut a line short. `dialogue:timeline` prints the shots and lines on one timeline, flags a talking shot that does not contain its speaker's whole line or an on-screen line that crosses a cut, and gives the minimum frames each talking shot needs. Run it after every voice change and before `gen:shots`; voice-over may cross cuts.
+
+When a voice is recast or a line rewritten, regenerate only that line (`ONLY=<line> FORCE=1 gen:dialogue`), re-check the timeline (a new take changes the length; `gen:dialogue` refuses a character talking over themself), rebuild the mix, and regenerate the H3 shot of that speaker so the mouth matches the new audio.
+
+## Cast bible and character sheets
+
+For each character **at each age the story needs**: stable id (`hero-adult`, `hero-child`), reference photos if any, apparent age, height/build, face shape, eyes, eyebrows, nose, hair (colour, length, parting, hairline), facial hair, glasses, skin tone, signature outfit plus scene outfits, personality in a pose and three expressions, voice. Photos of a person at a different age are still useful for bone structure and colouring: say in the prompt what to age up or down.
+
+One identity run per character-age: `char-<id>-v1` with `steps: [Steps::RefBase]`, `photos: [references/...]` and `01_ref_base.txt`. The Sunburst edit endpoint receives the photos, so the prompt says "the person in the reference photos" and asks for the sheet layout (see [prompts.md](prompts.md)). Inspect it beside the photos. Likeness is the first acceptance criterion; style consistency with the rest of the cast is the second. A fix is a new version (`-v2`, `edit_from: char-<id>-v1`), never an overwrite.
+
+Recurring locations (the family desk, a bedroom, a school corridor) get location sheets (`loc-<id>-v1`, text-to-image `01_ref_base.txt`, no people), so every shot in that place reuses the same layout, props and light.
+
+## Voices: ElevenLabs Eleven v4
+
+`config/cast.yml` gives each character one voice and its settings, shared by every scene:
+
+```yaml
+hero-adult:
+ name: Hero (39)
+ voice: Brian # an ElevenLabs voice name or voice ID
+ stability: 0.45 # lower = more expressive, higher = steadier
+ similarity_boost: 0.8
+ ref: char-hero-adult-v1
+kid:
+ name: Kid (9)
+ voice: Jessica
+ stability: 0.35
+ similarity_boost: 0.75
+ ref: char-kid-v1
+```
+
+Rules:
+
+- **Every character gets a different voice**, and voices of characters who share scenes must be clearly distinguishable in pitch, age and timbre. Keep the same voice for a character across the whole film; a child who grows up changes voice at a planned age break.
+- Children: the premade library has no child voices, so cast young, light, bright voices (Jessica, Lily, Laura, Alice, Charlotte, River) with lower stability, as anime traditionally casts children. Record the casting reasons in the plan.
+- Performance lives in the text: audio tags in square brackets (`[sleepy]`, `[whispering]`, `[softly]`, `[laughs]`, `[sighs]`, `[excited]`), punctuation for pauses (`…`, `—`), and short sentences. Tags are performed, not spoken; `review:dialogue` catches a tag that was read aloud.
+- Narration (`vo: true`) uses the narrator's voice with a calmer delivery (higher stability, `[warm, reflective]`), is mixed in, and never drives a mouth.
+- **Retakes:** the TTS sometimes repeats or adds a word ("Eat… eat, amore"), and its alignment can hide it inside a tag, so trust `review:dialogue` (Whisper `extra`, counted per occurrence, so a doubled phrase fails). Requests are cached by their exact input: `ONLY=<line> FORCE=1` with unchanged text and settings returns the same take (the client logs a warning). For a new take change the tag/punctuation, add or bump the line's `seed:`, or set `NEW_REQUEST=1` (a new paid request). The same holds for every Fal step.
+- **Levels:** takes come back anywhere from −30 to −18 LUFS for the same delivery. Measure each `03_line_*.wav` (`ffmpeg -i … -af ebur128 -f null -`) and give an outlier `gain_db:` in `03_dialogue.yml` (e.g. `-5` for an on-screen line 6+ dB hotter than the scene's narration). It levels the take in `03_dialogue.wav` only; mouth tracks keep the raw take, so H3 inputs and the cache are untouched. A plain `gen:dialogue` (cached, free) applies it; then `gen:mix` → `gen:shots` → `gen:overlay FORCE=1` → `sfx:mix`. The mix's `dialogue_db:` stays the scene-wide level.
+- Accents: ask for them with a tag (`[light Italian accent]`) only after a test line proves the voice keeps it; otherwise keep the voice's native delivery.
+
+`prompts/<run>/03_dialogue.yml` holds the scene's lines (`name`, `character`, `at` in scene seconds, `text`, optional `vo`, `subtitle` (a gloss shown instead of the text, e.g. "Tutto ok? (All good?)" — not spoken), per-line overrides). `gen:dialogue` writes the placed dialogue, one **mouth track per character** (that character's on-screen lines only) and scene-local word cues for subtitles. A shot whose speaker is on screen uses `audio: <cast id>`, so H3 animates that mouth only while that character talks.
+
+## Score: ElevenLabs Music v2.5
+
+`prompts/<run>/03_score.json` is a composition plan whose chunks follow the beats:
+
+```json
+{"chunks": [
+ {"text": "[Intro]\n[Instrumental]", "duration_ms": 7000, "positive_styles": ["solo felt piano", "warm analog pad", "night", "intimate anime soundtrack", "sparse"], "negative_styles": ["vocals", "drums"]},
+ {"text": "[Build]\n[Instrumental]", "duration_ms": 8000, "positive_styles": ["piano motif returns", "soft music box", "rising strings"], "context_adherence": "high"},
+ {"text": "[Swell]\n[Instrumental]", "duration_ms": 4500, "positive_styles": ["strings swell", "suspended chord", "anticipation"], "context_adherence": "high"}
+]}
+```
+
+Chunks are 3–120 s, at most 30, and must total no more than the scene length; the Music step fits the result to the scene exactly (`music_fade:` seconds of fade, `0` for a hard cut). A plain `03_score.txt` prompt also works. The score is instrumental by default; songs with lyrics need explicit approval. `Steps::Mix` ducks the score under the dialogue (`mix: { music_db:, dialogue_db:, duck:, music_end: }`; `music_end` hard-cuts the score for a smash cut). A supplied soundtrack the user owns can replace the score through `music_from:`.
+
+Check every score's level over time before mixing, not just its peak: scores have come back near-silent for seconds or stopping early, which a single loudness number hides (e.g. `ffmpeg -i output/<run>/03_music.* -af astats=metadata=1:reset=24,ametadata=print:key=lavfi.astats.Overall.RMS_level -f null -`). Ask for "continuous full arrangement to the last second; the final chord rings out" in the last chunk. After a music retake, `gen:mix` rebuilds the stale mix on its own (a mix older than its score or dialogue is not done), and a plain `gen:shots` re-muxes `final.mp4` with it; then re-run `gen:overlay` and `sfx:mix`. The same holds when `music_from:` is added or its shaped file is rebuilt: `gen:music` sees the fit is stale and re-fits locally, without FORCE.
+
+## Sound design
+
+Ambience and spot effects go in `prompts/<sfx-name>/sfx.yml` and are mixed over the finished scene with `sfx:gen` / `sfx:mix`: room tone, night insects, keyboard clicks timed to typing, a door, the whoosh of a cut, a baby's cry. Keep ambience low and continuous across cuts inside a scene; spot effects land on the frame of the action.
+
+## Screens, titles and subtitles
+
+Anything with readable text is drawn in p5, never generated: code editors, terminals, chat windows, dates and place cards ("CITY · 1999"), counters (`HOURS SLEPT: 4 · DAY 3`), title drops and subtitles. `tools/p5/lib/screens.js` provides them: `Anim.codeEditor` (window, tab, gutter, syntax-coloured tokens on a monospace grid, typing with a blinking cursor, eased push toward the cursor, vignette, scanlines, a flash after Enter for a smash cut), `Anim.typing` (deterministic key times, reusable as keyboard SFX cues), `Anim.subtitles` (from `Anim.data("dialogue")`, tags stripped, narration in italics, each cue starting where the voice starts — `speech_at`, measured from the take's leading silence), `Anim.placeCard`, `Anim.vignette`, `Anim.scanlines`, `Anim.mono`. Each frame's `draw` runs inside `push()`/`pop()`, so style set in one frame never leaks into the next; still, set text alignment/font in every helper you write, and check a title at several frames of the full render, not only `anim:preview`. A scene's `05_overlay.js` should mostly choose shots and content, e.g.
+
+```js
+const TYPING = Anim.typing("life = Life.new(1987)", { seed: 1987 });
+Anim.sketch({
+ async load() { this.f = await Anim.fonts({ code: "code.ttf", sub: "sub.ttf", subItalic: "sub-italic.ttf" }); this.shots = Anim.data("shots"); },
+ draw(t, frame) {
+ const s = this.shots.find((x) => frame >= x.start_frame && frame < x.start_frame + x.frames);
+ const local = (frame - s.start_frame) / ANIM.fps, dur = s.frames / ANIM.fps;
+ if (s.name === "first-line") Anim.codeEditor(local, dur, { font: this.f.code, tokens: [["life", "#e6edf7"], [" = ", "#ff79c6"], ["Life", "#7fd8ff"], [".new", "#ffd36e"], ["(1987)", "#ffb347"]], typing: TYPING, filename: "life.rb", lang: "Ruby", zoom: [1.1, 1.16] });
+ Anim.subtitles(t, Anim.data("dialogue"), { font: this.f.sub, italic: this.f.subItalic });
+ },
+});
+``` Use a `color:` shot (or a `still:` of a blank monitor keyframe) for full-screen inserts and draw the UI over it; `Anim.data("shots")` tells the sketch when each shot starts, `Anim.data("words")` and `Anim.data("dialogue")` give line and word timings.
+
+Held stills (`still:`) and colour inserts (`color:`) are rendered locally; when their `frames`, colour, still or zoom change, a plain `gen:shots` rebuilds them (no FORCE). Hold a place/date card at least ~3 s fully readable (longer text longer), and fade it in on a cut or a musical phrase; a card may cross a cut.
+
+## Continuity
+
+Keep a continuity table in `docs/PROGRESS.md`: per scene, time of day, light direction and colour, outfits, props in hand, screen direction. Reuse the previous shot's keyframe as `base:` when the next shot is the same set-up from a new angle or a moment later, so light and props carry over.
diff --git a/skills/make-an-anime/references/credentials.md b/skills/make-an-anime/references/credentials.md
new file mode 100644
index 0000000..7cb0861
--- /dev/null
+++ b/skills/make-an-anime/references/credentials.md
@@ -0,0 +1,39 @@
+# Fal credentials and plugin execution
+
+The plugin declares an optional sensitive `FAL_AI_API_KEY` option. Claude Code collects and stores it in secure credential storage, then injects it into the `anime` MCP server's environment as `FAL_AI_API_KEY_PLUGIN`. When that value is empty the server uses `FAL_AI_API_KEY` from the environment Claude Code was launched in. The option is optional so the server starts, and `credential_status` can report a missing key, instead of Claude Code dropping the server. The model does not receive the value. Configure it through the plugin's configuration interface, never through chat or a command argument. Restart/reconnect the MCP server after changing the key.
+
+The server is `scripts/mcp.rb`, a Ruby stdio process using standard libraries. It starts before project dependencies are installed. Its tools delegate to `scripts/mv.rb`; Ruby remains the execution layer. No key is read from the user's home directory or written to project files. Only initialize and execute projects the user trusts: the toolkit intentionally loads the project's Ruby configuration and Rakefile.
+
+## Plugin workflow
+
+1. Use the Ruby CLI to initialize a separate video project and run `setup`. File editing, local analysis, plan writing, and `plan:approve` stay in the CLI/native tools.
+2. Use `credential_status` on the `anime` server. It returns only `configured: true/false`. If false, ask the user to configure the plugin (`/plugin configure make-an-anime`) or relaunch Claude Code with `FAL_AI_API_KEY` exported, then reconnect the server; do not ask for the secret itself.
+3. Run `doctor` through `run_task` for a complete dependency/credential check. Direct Bash calls do not inherit the plugin's sensitive option.
+4. After the user approves the plan and the CLI records that approval, run Fal-facing tasks through `run_task`. Translate Rake recipes into `project`, `task`, and string `options` fields:
+
+```json
+{
+ "project": "/absolute/video-project",
+ "task": "gen:ref_base",
+ "options": {"RUN": "char-singer-v1"}
+}
+```
+
+For `audio:transcribe`, use a task such as `audio:transcribe[audio/song.wav,audio/words.json]`. Comma-separated task arguments follow the same Rake rules as the CLI. The tool supports `doctor`, `audio:transcribe`, `media:stems`, `media:upload`, `sfx:gen`, `pipeline:all`, `adopt`, all `gen:*` tasks, and `review:music`. Run other local recipes directly through the Ruby CLI.
+
+5. `run_task` immediately returns `job_id`. Poll `task_status` with `{"job_id":"returned-id"}` until `completed` or `failed`. Check `exit_code`, recent redacted output, and the generated artifacts. Continue the worker journal and wave reviews normally. Up to ten jobs can run concurrently, each with its own task options and subprocess.
+
+The server checks the project's plan approval before starting any supported task except `doctor`, including media uploads. It accepts only the documented task names and options; it does not expose an arbitrary shell tool or accept a key as a tool argument. The credential is passed only through the child process environment. Exact key values are redacted from output returned by the server.
+
+`cancel_task` stops the local worker. An already submitted Fal request can still finish and incur charges. Server shutdown also stops local workers. In-memory job IDs do not survive a restart; use the project's saved queue receipts to resume the original task, and avoid `NEW_REQUEST=1` unless a new paid request is intended.
+
+## Standalone and developer use
+
+For direct Ruby CLI calls, set `FAL_AI_API_KEY` in the launching terminal or inject it from your development secret manager:
+
+```sh
+export FAL_AI_API_KEY='your-fal-api-key'
+ruby .claude/skills/make-an-anime/scripts/mv.rb --project /absolute/video-project doctor
+```
+
+The same variable works when launching `scripts/mcp.rb` directly in a developer MCP configuration. The installed plugin's server also falls back to it when the plugin option is unset; a configured option takes precedence. `FAL_KEY` and the old home-directory key file are no longer supported. Keep real keys out of prompts, source files, command arguments, and commits.
diff --git a/skills/make-an-anime/references/full-episode.md b/skills/make-an-anime/references/full-episode.md
new file mode 100644
index 0000000..b4fe77e
--- /dev/null
+++ b/skills/make-an-anime/references/full-episode.md
@@ -0,0 +1,63 @@
+# Full episodes
+
+The toolkit was first used on a narrated anime documentary of over 12 minutes, about 40 scenes long. This is what a project of that size needs beyond the single-scene workflow.
+
+## Structure
+
+- `ruby mv.rb 'scene:new[ep01-s05,480]'` scaffolds a scene: `config/generations/ep01-s05.rb`, prompts and a score skeleton. One file per scene, so several agents can add scenes without editing a shared file. A run defined twice is an error.
+- `config/episodes/ep01.yml` is the playing order. Scene numbers are stable ids, so a scene can move or be added without renumbering.
+- Order of work: sheets and voices first, then the opening and the emotional peak, so the look and the budget are proven early. Then production waves (`work:next`, see [production.md](production.md)).
+
+## Commands per scene
+
+```sh
+RUN=ep01-s05 ruby mv.rb gen:dialogue # paid: one take per line
+RUN=ep01-s05 ruby mv.rb review:dialogue # paid: Whisper check of every line
+RUN=ep01-s05 ruby mv.rb dialogue:timeline # local: lines against shots and cuts
+RUN=ep01-s05 ruby mv.rb gen:music # paid
+RUN=ep01-s05 ruby mv.rb gen:mix # local
+RUN=ep01-s05 ruby mv.rb gen:keyframes # paid
+RUN=ep01-s05 ruby mv.rb gen:shots # paid
+RUN=ep01-s05 ruby mv.rb review:camera # local: measured against directed camera, with frame strips
+RUN=ep01-s05 ruby mv.rb gen:overlay # local for anime scenes
+SFX=ep01-s05-sfx ruby mv.rb sfx:gen # paid, cached
+SFX=ep01-s05-sfx ruby mv.rb sfx:mix # local
+```
+
+Retakes: `ONLY=<item> FORCE=1` on keyframes, shots or dialogue. Replaced items go to `output/<run>/rejected/`.
+
+## Joining and levelling
+
+```sh
+SEAMS=1 VOICE_DB=-24 ruby mv.rb 'episode:preview[output/ep01-preview.mp4,ep01]'
+ruby mv.rb 'audio:seams[output/ep01-preview.mp4,ep01]'
+```
+
+- Scenes are mixed one at a time, so their loudness drifts. Level on the voice (`VOICE_DB`), not only on the whole mix, or a loud fight scene takes its narrator line far below the others. `LUFS` sets a whole-mix target instead.
+- `SEAMS=1` fades each scene out across the air after its last line and in across the air before its first. A scene that opens on a hit keeps it with a very short fade. Silent cards are left alone.
+- `audio:seams` reports both ways music can change abruptly: at a join between scenes (`cut` if the last 30 ms still sound, `hard_start` if the first 30 ms are loud), and at a chunk boundary inside a scene's score.
+
+## Voice over the bed, and air before a cut
+
+- `mix: { voice_lift_db: N }` raises the voice and also writes `03_mix_ref.wav` without the lift. With `voice_dip_db: 6` in `sfx.yml`, `sfx:mix` reads cue levels from that reference and dips the cues under speech, so a louder voice does not bring the effects up with it.
+- Hold the last shot so a line ends at least 0.5 s before the cut. A held score needs `scene:tail[run,source,seconds]` and `music_from`. `scene:reaudio[run]` puts a new mix on `final_overlay.mp4` without re-rendering the picture.
+- A sound shorter than its cue stops early with no warning. Check cue `len` against the sound's real duration, and repeat the sound to carry a long cue.
+- An open mouth with no voice needs a sound (a laugh, a breath, a murmur), or the shot needs fixing.
+
+## Lines that aren't plain speech
+
+Optional keys on a dialogue line: `gate_s` silences the head of a take in the mix, for a blip before the first word; `keep_s` keeps only that much of a take; `inner: true` with `vo: true` is a thought, high-passed with a short room behind it; `subtitle: " "` is a laugh or breath with no caption. Thoughts and blank-subtitle lines do not count as speech when a scene is levelled.
+
+## Score shaping
+
+`tools/python/score_tool.py` makes small local edits without a new generation: `crossfade IN OUT T L` holds the last chord before a hard change and fades it into the new section; `soften IN OUT T L in|out` softens an abrupt start or stop; `insert`, `remove`, `freeze` and `length` retime it to the picture. Point `music_from` at the result. Keep a change that is timed to the picture.
+
+## Whole-film VFX
+
+VFX beats live in `prompts/ep01-vfx/beats.yml` in scene frames. `scene:vfx[ep01-vfx]` turns them into film frames in `cues.yml`; rerun it after any scene changes length, join, then `vfx:render`.
+
+## Limits of H3
+
+- H3 may insert a hard cut inside one shot, and automatic detection does not separate it from character motion. Write "ONE CONTINUOUS TAKE with no cuts" and read the `review:camera` strips by eye.
+- One named camera move per shot, with its end framing stated. Compound moves drift.
+- Set a retake ceiling per scene and report what remains imperfect. A retake that fixes one thing often breaks another.
diff --git a/skills/make-an-anime/references/layered-scenes.md b/skills/make-an-anime/references/layered-scenes.md
new file mode 100644
index 0000000..f3b1541
--- /dev/null
+++ b/skills/make-an-anime/references/layered-scenes.md
@@ -0,0 +1,42 @@
+# Layered scenes: green-screen characters over an animated background
+
+Painted full-frame H3 shots are the default: they are one pass, and light, depth and contact come free. A layered scene costs more clips and more review, and it earns that when you need something H3 will not do reliably in one take:
+
+- two characters who must each keep their face and act exactly on cue;
+- precise placement and timing of a hit, locked to the score;
+- a camera or effect that must match frame-accurately across layers;
+- a character moved, scaled or reused freely in p5.
+
+`examples/shonen-battle` is a complete worked example, with a 5 s layered section beside a 5 s full-H3 section for comparison. Start one with `init --project /absolute/project --example shonen-battle`.
+
+## The recipe
+
+1. **Animate the empty background.** A keyframe with the location and no people, then an H3 shot in `04_shots.yml` with clouds, smoke and debris and a named camera move. Forbid people in the prompt.
+2. **Perform each character alone.** A keyframe edited from the character's sheet on flat `#00B140`, and a `04_clips.yml` item:
+
+ ```yaml
+ - name: kaen
+ image: kaen-green
+ seconds: 5
+ frames: 120
+ audio: kaen # that character's mouth track from the Dialogue step
+ audio_at: 2.0 # the scene second this clip starts at, so frame i is scene time 2.0 + i/24
+ key: green
+ prompt: >-
+ {{STYLE}} The same man as in the image, on-model, alone. 2.8-4.4 s: he shouts his line... The flat green background stays one flat colour, no floor, no shadow, no green on him.
+ camera: { move: "locked-off, the camera does not move at all" }
+ ```
+
+ Keep any green out of costumes, hair and effects, and lock the camera: the motion comes from p5.
+3. **Compose in p5.** `Anim.clip(name)` gives the sprite; `clip.at(t)` picks the frame that lip-syncs at scene time `t`, and `clip.draw(frame, x, y, height)` draws it. See `05_overlay.js` in the example.
+4. **Turn everything with one camera.** `roll: [from, to]` on a shot rolls its plate, eased, in local ffmpeg, scaled just enough to hide the corners. Draw sprites inside `Anim.withRoll(frame, fn)` and they turn with the plate. Subtitles drawn outside it stay level.
+
+## Effects in `tools/p5/lib/battle.js`
+
+`Anim.titleSlam`, `Anim.speedLines`, `Anim.shockRing`, `Anim.impactBloom`, `Anim.embers` (give near layers a larger `depth`), `Anim.aura` (a glow that follows a sprite's alpha), `Anim.flash`, `Anim.shotAt`, `Anim.rollAt`, `Anim.withRoll`.
+
+## Review
+
+- Look at the key on light and dark: hair, hands, feet, spill. `RECUT=1 ONLY=<name> FORCE=1 gen:clips` re-keys a downloaded clip for free.
+- A sprite has no contact shadow, and it carries the light of its keyframe. Direct the light of the green keyframe to match the plate, and hide the ground contact with dust, speed lines or a low camera.
+- Check the mouth against the line at normal speed: `audio` pins the track but is not proof of lip-sync.
diff --git a/skills/make-an-anime/references/planning.md b/skills/make-an-anime/references/planning.md
new file mode 100644
index 0000000..0cbbd2b
--- /dev/null
+++ b/skills/make-an-anime/references/planning.md
@@ -0,0 +1,33 @@
+# Intake, research and a complete storyboard
+
+For an anime, start from [anime.md](anime.md): story → scenes → beats → shots, cast bible and voices. The song-first sections below apply when the user supplies a soundtrack (an opening theme, a music-video episode).
+
+For a requested regeneration, begin from the established storyboard and latest approved identity versions. Preserve its meaningful scene actions (for example, a sleepless character reclining in bed for “lie awake”) unless the user requested a remix. A polished but different desk pose is not automatically faithful. Check exported character sheets against the current manifest and storyboard: an export can still contain an older design after a later character edit. Use `ref:import` to verify provenance, and deliberately resolve version mismatches before prompting. Record reused references versus newly generated frames/clips in the evaluation report.
+
+## Song-first planning
+
+1. Preserve the original in `audio/source.<extension>`. `audio:analyze` decodes it once to `audio/song.wav`, produces beats/onsets and loudness/energy reports. Listen to confirm section boundaries: the simple beat detector assumes a steady 4/4 grid and is advisory for tempo changes.
+2. Make a timeline at 24fps. Section `at` is the inclusive starting frame; `frames` is its length; end is exclusive. Adjacent sections satisfy `next.at = at + frames`. Cover frame zero through `ceil(song_duration * 24)`; the last video frame may outlast audio by less than one frame. Never lose the intro or duplicate an alternative take.
+3. Mark exact lyric start/end, singer, face visibility and emotional action. Core lip-sync moments get dedicated close or medium shots. Silence, breaths and instrumental breaks are timing events too.
+4. After approval, Whisper word chunks and Demucs vocals can refine the timing. Keep corrections in `docs/TIMING.md` and local words JSON. Do not rewrite an approved creative plan merely to log implementation progress.
+
+## Research for interesting details
+
+Search the song's subject and concrete phrases, then adjacent visual/cultural topics. Collect several useful candidates, not a giant link dump. Each entry has source title, URL, access date, verified fact or inspiration, proposed visual joke, scene ID, and whether it is fictionalized. Use current primary sources for real numbers and claims. Avoid forcing irrelevant memes into every shot.
+
+Build escalating callbacks: introduce a prop in the hook, misuse it in a verse, transform it at the drop, pay it off at the ending. Include small background jokes, scale changes, diagram gags, fake interfaces, match cuts and character reactions. Design readable focal areas and a few calm beats; chaos comes from choreography rather than constant random flicker.
+
+## With a reference video
+
+Use `media:probe`, `media:cuts`, `media:cut`, `media:frames[...,12,480]` and `media:frame` through Ruby. Review dense frame strips between cuts; a sparse contact sheet hides how a character follows a chart or how a camera reveals a scene. Record:
+
+| Frame range | lyric/cue | camera | character action | graphics/action path | foreground/background | reuse/invention |
+|---|---|---|---|---|---|---|
+
+Cut detection is a candidate list: flat graphics and hard flashes need visual confirmation. Study staging/motion, then write an original plan in the user's chosen direction.
+
+## Approval package
+
+Use `assets/plan-template.md`. The plan must cover the whole song, contain concrete prompts, and identify which details came from research. Estimate calls by model and generated seconds, allow a bounded number of retries and quote current pricing sources when available. If price cannot be established, say so and obtain a call-count budget. Do not invent a dollar total. The chat summary should let the user understand the video without reading every prompt, while the linked document makes each prompt reviewable.
+
+Approval covers execution within those creative and cost bounds. Ask again for a changed creative plan, an unavailable model that needs substitution, or spending beyond the allowance. Routine failed local renders, recuts and edits within the plan can proceed.
diff --git a/skills/make-an-anime/references/production.md b/skills/make-an-anime/references/production.md
new file mode 100644
index 0000000..5f10c74
--- /dev/null
+++ b/skills/make-an-anime/references/production.md
@@ -0,0 +1,61 @@
+# Sub-agent waves and recoverable production
+
+The coordinator researches, obtains plan approval, owns configuration, assigns jobs, reviews output and assembles the whole song. Workers own distinct run directories. The host agent tool creates sub-agents; Ruby does not start imaginary agent processes.
+
+## Job graph
+
+Write `config/production.json` with `wave: 0` and `jobs`. Example job:
+
+```json
+{"id":"hook-frames","run":"ep01-s01","resource":"ep01-s01","depends":["singer-v1"],"state":"pending","task":"Generate and review approved hook keyframes","deliverables":["output/s01/02_keyframes.jpg"]}
+```
+
+Accepted jobs unblock dependencies. Missing IDs, no ready jobs, or a dependency cycle fail explicitly. Split work at meaningful review points: identity → keyframes → character clips → overlay/scene → assembly. Both the opening and main peak should appear in early pilot work. Keep the first two independent assets runnable before any shared-reference dependent jobs.
+
+`work:next` allocates at most 2, then 4, then 8, then 10 jobs (the last limit repeats). `SIZE` permits 3–4 / 4–8 / 6–10 for the later waves. Fewer independent/remaining jobs are valid. Calling again while a wave is active returns the same jobs so an interrupted session resumes. The scheduler gives a run/resource to only one worker in the wave. A Ruby file lock also rejects concurrent `gen:*` calls for one RUN. Do not bypass ownership with ad-hoc library calls.
+
+For each returned job, spawn a worker with:
+
+- Approved PLAN.md and only the relevant reference docs, prompts and identity versions.
+- Assigned run, exclusive output paths, exact start/length and dependencies.
+- The quality directive, intended joke, character acting and lipsync criteria.
+- Ruby commands to execute, maximum new Fal calls, and where to write review evidence.
+- Standing authorization for necessary Fal uploads and generation within the approved plan and this worker's budget; do not ask again per scene.
+- An explicit instruction to return artifact paths, model request IDs, unresolved defects and a review recommendation; never edit shared config or mark its own work accepted.
+
+Respect actual agent-slot and provider concurrency limits; queue a large wave in smaller concurrent groups. Reference generation dependencies do not disappear merely because more slots are available.
+
+## Scene ownership and monitored logs
+
+Before spawning workers, save an assignment table with worker ID, workspace/RUN, source-song path, fps, inclusive start frame, exclusive end frame, lyric/strophe and reasons for the cut. For example, `[0,242)` and `[242,388)` at 24fps give two contiguous sections ending at 16.167s; 15s would cut the final lyric short. Derive these numbers from the actual song. Require agreement before either worker shifts a shared boundary. Local animation time is `song_time - start_frame / fps`; neither worker may add a fade or pad to change the agreed length.
+
+For a disposable evaluation, initialize projects under a gitignored `work/<evaluation>/` outside the skill. Keep all prompts, media, plans, worker logs and comparison renders there. Only reusable fixes and their tests return to the skill. In a regeneration test, record which identity/song/timing inputs were reused and which scene assets were newly generated; do not pass off an old scene render as regeneration.
+
+Each worker starts a log immediately, then appends on plan/boundary confirmation, model submission/completion (request ID), local render completion, findings, retries and delivery. Log a heartbeat/next action during long waits. Use one file per worker; never include credentials. Through the Ruby CLI:
+
+```sh
+LOG_DIR=/absolute/evaluation/logs AGENT=scene-a EVENT=submitted MESSAGE='Opening H3 animation queued; checking in shortly' REQUEST_ID=actual-id ruby scripts/mv.rb --project /absolute/project work:log
+LOG_DIR=/absolute/evaluation/logs LIMIT=3 ruby scripts/mv.rb work:watch
+```
+
+The coordinator reads these logs after dispatch, during long model/render waits, and before accepting a wave. Record its own review/steering decisions. An unchanged log is a reason to check the agent/process, not proof of failure or permission to submit the same paid request again. Inspect actual returned images and timed motion samples; send concrete corrections (coordinates, occlusions, timing, crop) and review the correction before final assembly.
+
+For the first pilot wave, each production worker generates one representative keyframe, reports its path, and waits for coordinator visual review before expanding paid work. Preparation of local graphics/timing may continue. A user's instruction to regenerate an existing video already authorizes that bounded execution; retain the creative plan and actual request as evidence instead of asking for the same permission again.
+
+## Review and advancement
+
+Inspect the assets and opening/peak playback. A contact sheet alone cannot prove acting or lipsync. Reject a character keyframe before animating it unless it shows one character in one pose, a flat chroma green background with no floor, shadow or spill on the character, the whole silhouette inside the frame with a margin, and a visual style and colour treatment consistent with the approved style bible, including its permitted shading and lighting variation. Reject an H3 clip whose camera moves, whose background changes or that adds props, people or text. Save `docs/reviews/<job>.md` with actual inspected paths, problems and decisions. Run relevant `review:*` tasks and retain their metrics. `JOB=... EVIDENCE=... work:accept` records coordinator acceptance. Failed jobs remain active; fix and review them before advancing. The program requires an evidence file but cannot judge its truthfulness or replace human/agent visual review.
+
+Use `docs/PROGRESS.md` for implementation status. Do not edit the approved PLAN.md just to log progress, since it invalidates approval. A changed character concept/scene direction belongs in a revised plan and user review. Approved routine pose fixes do not.
+
+## Recovery, revisions and cost control
+
+Manifests preserve local paths, URLs, inputs, request IDs and prior attempts. CDN uploads are cached by file bytes so a retry keeps the same model input URLs. `REFRESH_UPLOAD=1` refreshes an expired asset URL and can change the following model request; first resolve any pending request. Queue receipts are saved before polling under `output/requests`; identical inputs resume a receipt. A failure after submitting must first be resumed, not re-submitted. There remains a small ambiguity if the connection drops before the receipt is received; check provider history before retrying that submission.
+
+`FORCE=1` recomputes a step/item; `ONLY=name` limits ItemsStep generation to selected items, including when others are missing. For a genuinely new identical Fal attempt, `NEW_REQUEST=1` explicitly replaces the cached receipt and can incur another charge; use only within the approved allowance. `RECUT=1 ONLY=name FORCE=1 gen:clips` can recut a downloaded clip locally. Changing crop/scale may invalidate the cached plate/overlay; delete only that derived cache through a Ruby service before rendering again.
+
+Identity changes propagate through the dependency graph. Rebuild affected sections, final assembly, SFX and VFX versions. Retain the prior clean and finished video. Stop on exhausted retry/cost allowances and report the specific blocked assets rather than repeatedly generating.
+
+## Finish criteria
+
+All jobs accepted, every storyboard interval covered exactly once, final frame count correct, unbroken original song, clean and VFX renders reviewed, no missing ending, and delivery paths provided. Do not keep increasing the wave size when visual quality declines; repair the cause first.
diff --git a/skills/make-an-anime/references/prompts.md b/skills/make-an-anime/references/prompts.md
new file mode 100644
index 0000000..81b8d0d
--- /dev/null
+++ b/skills/make-an-anime/references/prompts.md
@@ -0,0 +1,113 @@
+# Character sheets, keyframes, H3 shots and camera language
+
+Use this directive in every character, keyframe and H3 prompt and in every sub-agent brief, followed by specific instructions:
+
+> This asset belongs to a high-quality anime production with television-broadcast polish: on-model characters who are recognisably the real people they are based on, clean expressive acting, deliberate composition and purposeful camera work. Every frame should be worth pausing on.
+
+Never ask for trademarked characters, logos or branded designs, even indirectly: a colour named after a famous game character can produce that character's actual face. Describe the generic object ("a plain green square cushion with a pixel-block texture, no face or design") and let dialogue carry the reference.
+
+Do not instruct a generation model to browse: the coordinating agent researches and supplies the details. Exclude all lettering, captions, subtitles, logos and watermarks; p5 draws every readable word.
+
+## Style bible: `config/style.md`
+
+One paragraph, pasted into every image and H3 prompt through `{{STYLE}}`. Define: medium (cel-shaded 2D TV anime, painted backgrounds), line (thin clean lineart, line weight on silhouettes), shading (one or two cel tones plus soft highlight), eyes and faces (proportion, how realistic), colour (palette anchors in hex for each recurring light: monitor glow, lamp, moonlight, golden hour), backgrounds (painted, detailed, depth haze), lighting (motivated sources, rim light), and what to avoid (3D render look, photorealism, chibi, text). Choose the look from the story and brief; keep it unchanged for the whole production so every scene cuts together.
+
+## Character sheets from reference photos: GPT Image 2.5 Sunburst xhigh
+
+`Steps::RefBase` with `photos:` sends the uploaded reference photos to `openai/gpt-image-2.5/sunburst/edit` (quality `xhigh`, 2752×1536). Structure of `01_ref_base.txt`:
+
+1. "Character design sheet for an anime production. Draw the person shown in the reference photos as an anime character, keeping their real likeness: …" then the likeness anchors you verified in the photos (face shape, hairline, eyebrows, eyes, nose, beard, glasses, colouring) and the age at this point in the story.
+2. `{{STYLE}}`
+3. Layout on a plain light-grey background: full-body front turnaround, three-quarter, profile and back in a row on the left two thirds; on the right, a head close-up and three expressions named in the plan (e.g. calm focus, warm smile, sleepy). Same outfit in every view; neutral standing pose; whole silhouette inside the frame with margins; consistent scale between views.
+4. Outfit for this point in the story, colours in hex if they matter.
+5. Exclusions: no text, labels, colour swatches with numbers, logos or watermarks; no extra characters; no photoreal rendering.
+
+For children and siblings, generate each child separately but in the same session of prompts, and state the differences that tell them apart (hair length, parting, face shape, signature colour). Review the whole cast in one board beside the photos.
+
+### Getting the face right (likeness first, style second)
+
+Hair, beard and glasses are easy; the **face** is what people recognise, and the model drifts toward a generic anime face (narrow, angular, big eyes, small nose) unless the prompt and the image order push back. What works:
+
+1. **Front views first.** The edit model weighs the first images most. Put two or three straight-on, well-lit face photos as images 1–3, then three-quarter and profile photos, then (last) any sheet used only as a style reference, and say so in the prompt ("images 1–3 are FRONT views: build the face from them; image 8 is only a style reference"). Use every usable photo, not a sample.
+2. **Write a face-anchor checklist from the photos**, one line each, with what to avoid: face shape and width ("broad, full, rounded, wide at the cheeks — not narrow, no sharp cheekbones"), eyes (size, lids, depth — "small, deep-set, heavy-lidded; do NOT enlarge into big round anime eyes"), eyebrows (thickness, height relative to the glasses), nose (length, bridge, tip width), mouth and resting expression, skin undertone, forehead/hairline, build (stocky/slim, neck). Look at the photos and measure; do not guess from a name or a role.
+3. **Ask for a large FRONT-view head close-up** on the sheet, so it compares one-to-one with the front photos.
+4. **Two passes when needed.** If the likeness pass comes out semi-realistic, keep it (`-v3`) and restyle it in a second edit (`-v4`, `edit_from: <likeness run>`, `photos:` the cast's accepted sheets as style references plus two front photos), with "this is a STYLE change only: keep the face and body proportions exactly", repeating the anchors. A single prompt asking for both likeness and a strong stylisation tends to trade the face away.
+5. **Review with `review:likeness[v2,v3,v4]`**: alternatives stacked under the same numbered photo row. Judge the front close-up against the front photos first, then the turnaround. Let the user pick when they are the subject.
+
+Name versions, never overwrite: a rejected sheet stays in its run for comparison.
+
+## Keyframes: composed first frames
+
+`Steps::Keyframes` items edit the sheets into the first frame of each shot. Use `base: false` with `refs: [char-…-v1, loc-…-v1]` and say explicitly which image is which ("the man from image 1, the bedroom from image 2"). Structure:
+
+1. `{{STYLE}}`
+2. Shot size and angle (e.g. "medium close-up, slightly low angle, 35mm feel"), subject placement in percent of frame and facing direction, eyeline.
+3. The pose at the **first frame** of the action, expression, hands.
+4. Set, props and light sources with direction and colour; time of day.
+5. Space left for p5 elements (a subtitle band, a screen insert).
+6. Exclusions: no text on screens or signs (screens show a soft blank glow), no extra people.
+
+For a shot that continues the previous one, set `base:` to that keyframe and change one thing. Generate an `end_image` only when the end pose matters (a head turn that must finish facing camera); otherwise let H3 resolve the action.
+
+## H3 shots: MiniMax H3 Max
+
+`Fal::Models::H3MaxImageToVideo`, `minimax/h3-max/image-to-video`, **768P by default** (H3 offers 480P/768P/1080P; there is no 720P), prompt expansion disabled. `VIDEO_RES=1080P` refines a hero shot. Duration is the shot length (fractional seconds allowed, 0.92–15 s, at least 2 s with target audio; H3 may add up to ~0.7 s). The plate is upscaled to 1920×1080.
+
+Prompt (`prompt:` in `04_shots.yml`): identity and style (`{{STYLE}}`, "the same characters as in the image") → what happens, as two or three timed acting beats ("0–1 s: …; 1–2.5 s: …") → mouth ("speaks the line with natural lip movements; mouth closed before and after") → what must stay unchanged (faces on-model, outfit, background layout, light) → exclusions (no text, no extra people, no new props, no scene change). Anime acting reads best with clear holds and limited, purposeful motion: a blink, a breath, a head tilt, a slow smile, hair and cloth secondary motion, light flicker from a screen.
+
+For a talking shot set `audio: <cast id>`; the shot then receives that character's mouth track from its own position in the scene. Never retime a talking shot.
+
+### Camera language
+
+Write the camera as its own `camera:` field; Shots sends it to H3 as a separate `Camera:` paragraph. A Hash is joined as `key: value; …`. Always state:
+
+- **move**: one move per shot, named precisely (below);
+- **from → to**: the framing at the start and at the end (shot size and what is centred);
+- **speed and easing**: "very slow", "slow", "steady", "fast whip"; "ease-in", "ease-out", "linear";
+- **timing**: when the move starts and stops inside the shot (moves that start after a short hold and settle before the cut feel deliberate);
+- **anchors**: what stays fixed in frame (the subject's eyes on the upper third, the horizon level) and what the move reveals or hides;
+- **lens/focus** when it matters: "shallow depth of field", "rack focus from the hand to the face at 1.5 s".
+
+Vocabulary, with when to use it:
+
+| Move | Use |
+|---|---|
+| Locked-off / static | dialogue, comedy timing, holds; the acting carries the shot |
+| Slow push-in (dolly in) | growing emotion, a realisation, attention to a face or screen |
+| Pull-out (dolly out) | reveal of context or isolation, end of a scene |
+| Pan left/right | follow a look or action across a set; reveal a second subject |
+| Tilt up/down | scale, a character standing, from object to face |
+| Truck / lateral tracking with parallax | establishing shots, walking, layered backgrounds (foreground passes faster) |
+| Crane / pedestal down | open a scene from above, arrive at a window or a desk |
+| Orbit (slow arc) | a turning-point moment around one character |
+| Rack focus | shift attention between two planes without cutting |
+| Handheld micro-sway | tension, intimacy; keep it subtle |
+| Whip pan / smash zoom | shounen energy, comedic snap, transitions on a hit |
+
+Rules: one primary move per shot; keep faces in frame through the move; do not move the camera during lip-synced dialogue unless the move is very slow; alternate moving and static shots so moves register; match the direction of consecutive moves or cut on a hold; the last shot before a smash cut holds still. Example:
+
+```yaml
+camera:
+ move: very slow push-in (dolly in), no rotation
+ from: medium shot, desk and monitor centred, man at right third
+ to: medium close-up on the man's face lit by the monitor
+ timing: hold 0.5 s, push 0.5–3 s with ease-in-out, settle before the cut
+ anchors: eyes stay on the upper third; monitor edge stays in frame left; horizon level
+ focus: shallow depth of field, background bookshelf softly blurred
+```
+
+### Sprite composites
+
+When several characters must be choreographed independently, or a performance is reused over different plates, animate each character alone on flat chroma green #00B140 with a locked camera (`Steps::Clips`, `key: green`) and composite them in p5 over a still plate; the camera is then a p5 transform of the whole composite. This is the exception for anime; painted full-frame shots are the default.
+
+## Retakes
+
+If a take drifts off-model, reduce motion, shorten the shot or add an `end_image`. If it invents text, remove quoted words from the visual prompt and restate "screens show a soft blank glow". If the camera ignores the move, simplify to one named move and state the end framing again ("the camera moves forward and slightly down, never up" plus a concrete end framing worked where "descending crane + push-in" did not). Measure it: `review:camera` compares the first and last frame of every H3 shot (zoom, pan, tilt) with the directed `camera:` move; a match score below 0.65 means parallax or big character motion, so judge that strip by eye.
+
+**Hidden cuts and early actions.** H3 sometimes cuts mid-shot to a new framing (a hug that jumps to a close two-shot at 2 s) or does the shot's business too soon (eats the snack while the line is still playing). Neither the camera estimate nor frame-difference or similarity scores separate these from normal motion (tested: the cut scored like a running child), so read the ~4 fps `review/camera/<shot>_strip.jpg` that `review:camera` writes for every shot. Fixes that worked: "ONE CONTINUOUS TAKE with no cuts and no change of shot", "one unbroken move", and timing the business explicitly ("only in the very last half second does he…", after the line). When a take is good up to a defect (lettering appearing on a car as its hatch closes), cut it declaratively with `source_frames: N` (plus `retime: true` if N < `frames`) in `04_shots.yml` rather than editing the downloaded file. Keep the earlier take (manifest history) and record why it was rejected.
+
+## Models and evolving schemas
+
+Fetch `openapi:fetch` and read `openapi:summary`. The wrappers validate known properties/enums/ranges. Add any other Fal model as a Ruby `Fal::Models::Base` subclass, then a service/task. Do not call an SDK or curl directly. Do not silently substitute a model or quality setting.
+
+Official sources: [H3 API](https://fal.ai/models/minimax/h3-max/image-to-video/api), [Sunburst generation](https://fal.ai/models/openai/gpt-image-2.5/sunburst/text-to-image/api), [Sunburst edit](https://fal.ai/models/openai/gpt-image-2.5/sunburst/edit/api), [ElevenLabs Eleven v4](https://fal.ai/models/elevenlabs/tts/eleven-v4/api), [ElevenLabs Music v2.5](https://fal.ai/models/elevenlabs/music/v2.5/api).
diff --git a/skills/make-an-anime/references/tasks.md b/skills/make-an-anime/references/tasks.md
new file mode 100644
index 0000000..e67ca15
--- /dev/null
+++ b/skills/make-an-anime/references/tasks.md
@@ -0,0 +1,231 @@
+# Ruby entry points and task recipes
+
+## Directory layers
+
+```text
+make-an-anime/
+ SKILL.md
+ references/ agent instructions
+ assets/plan-template.md planning document template
+ scripts/
+ mv.rb Ruby CLI/bootstrap/project initializer
+ Rakefile require Ruby task registry; install delegates
+ Gemfile + Gemfile.lock Ruby dependencies, including RSpec
+ package.json + lockfile locked p5/Puppeteer dependencies
+ requirements.txt Python dependencies installed by Ruby setup
+ lib/
+ tasks.rb thin rake declarations
+ toolkit/ task application services and test runner
+ workflow/ plan approval and wave allocation
+ pipeline/ project, steps, manifests, generation/editing
+ fal/ Ruby HTTP queue/storage/model adapters
+ media/ Ruby wrappers that shell out
+ tools/
+ python/ analysis, cutouts, tracking and audio mixing
+ p5/ Node renderer, JS animation library, examples; project fonts copied before rendering
+ vfx/ Swift package and Core Image effects
+ spec/ high-level RSpec contracts and E2E tests
+```
+
+`init --project DIR --story STORY.md [--references PHOTOS_DIR] [--song FILE]` copies the executable toolkit to a new project with the same `Rakefile → lib → tools` layers and adds `config/`, `audio/`, `prompts/`, `docs/`, `output/` and, when given, `references/` (the photos). It excludes installed dependencies, build caches, generated outputs and test scratch data. Each project is self-contained; install dependencies there with `setup`. Ruby 3.2+ is required by the OOP code. Run the CLI using the same Ruby used for Bundler.
+
+All examples below are executed from the skill directory. Replace `/absolute/project` with the real initialized project path. `ruby scripts/mv.rb --project /absolute/project 'TASK[...]'` and, inside the project, `bundle exec rake 'TASK[...]'` are equivalent. CLI flags precede/follow the task; task arguments use Rake brackets. Quote bracket expressions in zsh. For file names containing commas, rename/copy the input in Ruby before using Rake's comma-separated arguments.
+
+For plugin use, adapt Fal-facing recipes to the `anime` server's `run_task` tool and poll `task_status`, as described in [credentials.md](credentials.md). The MCP process receives the sensitive plugin key; ordinary Bash calls do not. Local recipes keep using the resolved absolute Ruby entry path from `SKILL.md`.
+
+## Setup and inspection
+
+```sh
+ruby scripts/mv.rb --help
+ruby scripts/mv.rb -T
+ruby scripts/mv.rb --project /absolute/project setup
+ruby scripts/mv.rb --project /absolute/project doctor
+ruby scripts/mv.rb --project /absolute/project openapi:fetch
+ruby scripts/mv.rb --project /absolute/project openapi:summary
+```
+
+`setup` calls Bundler, npm ci and Python venv/pip through Ruby. Install system Ruby, Node 22+, Chrome, FFmpeg/ffprobe and ImageMagick beforehand. On macOS install Swift/Xcode command line tools for VFX. `MV_PYTHON` overrides the local `.venv/bin/python3`; `CHROME_PATH` and `MEDIA_FONT` override detected Chrome/font paths. Configure the plugin's sensitive `FAL_AI_API_KEY` option, or set `FAL_AI_API_KEY` in the environment for direct developer CLI calls; never put the key in prompts/config/commits. `doctor` prints JSON booleans; `STRICT=1` makes missing dependencies fail. Tests require the full selected profile's tools and do not silently skip missing dependencies.
+
+`fonts:list` scans installed macOS TTF/OTF files. Just before rendering, `fonts:copy[config/fonts.json]` copies a JSON mapping of project filenames to absolute source paths into the video's `tools/p5/fonts/`. Run with `--project /absolute/video-workspace`; see [Project fonts](animation-audio-vfx.md#project-fonts). Setup does not fetch fonts.
+
+## New run configuration
+
+When regenerating a video with approved character sheets and their original Fal manifests, register those identities locally without uploading again:
+
+```sh
+ruby scripts/mv.rb --project /absolute/project 'ref:import[char-dev-v1,/absolute/dev.png,/absolute/original-run/manifest.json]'
+```
+
+The service verifies that the supplied image exactly matches the source manifest's local image, copies it into the new project's run and retains its existing HTTPS URL, model and request ID as provenance. Repeated identical imports are safe; a different identity must use a new versioned RUN. Both source files must exist for verification. If a hosted URL has expired, use the normal authorized upload flow and record the replacement; do not assume that an old URL still works. This imports an identity, not a finished scene. The new project can then use `import: { ref_base: "char-dev-v1" }` and generate fresh keyframes.
+
+Invoke each import (and each differently parameterized call to the same Rake task) in a separate Ruby CLI process. Rake runs a task name once per process, even if it appears again with different bracket arguments.
+
+`config/generations.rb` evaluates inside `Pipeline` and returns a Hash. It contains configuration, never rake bodies or shell commands. An anime project has identity runs (one per character-age and recurring location) and scene runs:
+
+```ruby
+{
+ "char-hero-v1" => { steps: [Steps::RefBase], photos: ["references/hero/a.png", "references/hero/b.png"] }, # omit photos: for an original character
+ "loc-desk-v1" => { steps: [Steps::RefBase] }, # text-to-image location sheet
+ "ep01-s01" => {
+ steps: [Steps::Dialogue, Steps::Music, Steps::Mix, Steps::Keyframes, Steps::Shots, Steps::Overlay],
+ **scene(480), music_fade: 0, mix: { music_db: -5, music_end: 19.5 }
+ }
+}
+```
+
+Shared files: `config/style.md` (the style bible, substituted for `{{STYLE}}` in every prompt) and `config/cast.yml` (one ElevenLabs voice per cast id; see [anime.md](anime.md)). `scene(frames, **opts)` sets the scene length (24fps) and skips uploading the score. Join scenes with `media:concat[out.mp4,output/ep01-s01/final_overlay.mp4,...]`.
+
+The music-video form remains available: song sections share one soundtrack.
+
+```ruby
+{
+ "char-singer-v1" => { steps: [Steps::RefBase], image_model: Fal::Models::GptImage25 },
+ "ep01-s01" => {
+ steps: [Steps::RefBase, Steps::Music, Steps::Keyframes, Steps::Clips, Steps::Overlay],
+ import: { ref_base: "char-singer-v1" },
+ **section(0, 240), plate: "background"
+ },
+ "ep01-s02" => {
+ steps: [Steps::RefBase, Steps::Music, Steps::Keyframes, Steps::Clips, Steps::Overlay],
+ import: { ref_base: "char-singer-v1" },
+ **section(240, 192), plate: "ep01-s01/background"
+ }
+}
+```
+
+For a new identity version edited from a prior character, add a run with `steps: [Steps::RefBase], edit_from: "char-singer-v1"` and write its edit instructions in `01_ref_base.txt`. `edit_from: "s01/approved-edit"` can instead promote an existing edited keyframe. The RefBase service selects the Sunburst edit endpoint, records a new identity and leaves the source untouched. Point dependent runs at the new ID after review.
+
+`section(at, frames)` uses full `audio/song.wav`, offset `at/24.0`, integer frame length and an empty expected-lyrics list. Set `lyrics:` to selected recognizable words if desired. Sprite scenes are the default: `Clips, Overlay` with a still keyframe `plate:`, as in the example above. The full-frame paths are exceptions that the plan must justify (see "Self-contained characters" in [prompts.md](prompts.md)): a single H3 plate uses `Video` and a 5–15 second integer duration; multi-shot plates use `Keyframes, Shots, Overlay` with no `plate:`. `track:` optionally maps names to `[x,y,size,search,from_frame]` for tracked graphics. `reference:` is an optional local reference-video path.
+
+Set `upload_music: false` when a section only needs its local soundtrack for compositing (for example a nonsinging H3 shot with `audio: false` plus existing timed captions). `gen:music` then cuts/fits the local WAV without constructing a Fal client. Use `anim:prepare` for existing cues. `review:music` runs local metrics and marks transcription skipped; expected lyrics cannot be verified without a transcript. A `Video`, an audio-driven `Shots` item or paid `gen:overlay` that reads `music.url` requires the default upload behavior. `Clips` with a separate vocal stem uploads just its actual needed stem interval.
+
+Prompt files per run:
+
+| File | Purpose |
+|---|---|
+| `01_ref_base.txt` (or `.json`) | Character/location sheet prompt; with `photos:` it is an edit of the uploaded photos |
+| `03_dialogue.yml` | Voiced lines: `name`, `character` (cast id), `at` (scene seconds), `text` with audio tags, optional `vo`, overrides |
+| `03_score.json` / `.txt` | ElevenLabs Music v2.5 composition plan (`{"chunks": [...]}`) or prompt; instrumental, scene length |
+| `02_keyframes.yml` | Named image edit prompts, `base`, `refs` |
+| `04_video.txt` | Single-shot H3 prompt (the Video step reads this stem) |
+| `04_shots.yml` | Ordered shots: `image`/`end_image`, `frames`, `prompt`, `camera`, `audio: <cast id>`, `seconds`, or `still:`/`color:` inserts |
+| `04_clips.yml` | H3/still/source sprite specifications and chroma/crop |
+| `05_overlay.js` | p5 sketch, rendered through Ruby |
+
+Read each step's `prompt` call if adding a new type. The imported `Music3` wrapper is optional for explicit song-generation requests; the normal skill uses the user's supplied song.
+
+Example `02_keyframes.yml`:
+
+```yaml
+background:
+ prompt: "Background plate matching the approved scene, visual style, lighting and colour treatment; no people or text."
+singer:
+ prompt: "SAME approved singer, full body, flat chroma green #00B140, limbs inside frame, no text."
+reaction:
+ base: singer
+ prompt: "Same singer and framing; change only the expression to surprised."
+duet:
+ refs: [char-guest-v1]
+ prompt: "Singer from image 1 and guest from image 2, separated silhouettes."
+```
+
+`base: false` omits the current ref_base; combine with `refs`. `base: other-run/keyframe` reuses an edited frame. An earlier same-run keyframe must appear before any dependent edit.
+
+Example `03_dialogue.yml` and `04_shots.yml` for a scene:
+
+```yaml
+# 03_dialogue.yml
+- name: kid-asks
+ character: kid
+ at: 3.4
+ text: "[sleepy, mumbling] Dad… are you making a game?"
+- name: narration-1
+ character: hero
+ at: 12.0
+ vo: true
+ text: "[warm, reflective] Programming is making something from empty."
+```
+
+```yaml
+# 04_shots.yml (frames must sum to the scene length)
+- name: kid-wakes
+ image: kid-bed
+ frames: 84
+ audio: kid
+ prompt: "{{STYLE}} The boy from the image half-lifts his head from the pillow, eyes barely open; 0.5–2.5 s he mumbles his line with small sleepy mouth movements; blinks slowly; blanket shifts. Faces on-model, room unchanged, no text, no extra people."
+ camera: { move: locked-off, framing: medium close-up on the pillow, notes: "faint handheld micro-sway, no zoom" }
+- name: screen
+ color: "#05070a"
+ frames: 48
+```
+
+Anime review tools (local): `review:likeness[run,...]` stacks character sheets under their numbered reference photos; `review:camera` measures each H3 shot's camera move (first vs last frame) beside its directed `camera:` and writes a ~4 fps strip per shot (`review/camera/<shot>_strip.jpg`) for spotting H3-inserted cuts by eye; `dialogue:timeline` checks talking shots and cuts against the generated lines. `scene:new[run,frames]` scaffolds a scene; `episode:preview[out.mp4,ep01]` joins the scenes' finals, each leveled to `LUFS` (default −23; `LUFS=off`).
+
+`gen:dialogue` makes the lines, `review:dialogue` checks each with paid Whisper; `gen:music` with `03_score.*` composes the score; `gen:mix` (local) ducks it under the dialogue; `anim:prepare` with no argument loads the dialogue word cues for the overlay.
+
+Example `04_clips.yml`:
+
+```yaml
+- name: sing
+ image: singer
+ seconds: 5
+ audio: audio/stems/vocals.wav
+ audio_at: 0
+ gate: -36
+ key: green
+ prompt: "Same singer and approved visual style. Articulate the approved opening lyric; eyebrow raise on its joke. Locked camera, flat green, no text."
+- name: surprise
+ still: reaction
+ key: green
+```
+
+`audio_at` is section-local, not the whole-song time. Omit `gate` if it damages consonants. `box: [x,y,w,h]`, `seed: [x,y]`, `frames`, `start`, `scale` are cutout options. Use the approved full prompt directive, style and performance details in real files; these abbreviated examples only show the schema.
+
+## Production and review commands
+
+```sh
+NOTE='User approved the linked plan and its generation allowance' ruby scripts/mv.rb --project /absolute/project plan:approve
+ruby scripts/mv.rb --project /absolute/project work:next
+LOG_DIR=/absolute/evaluation/logs LIMIT=3 ruby scripts/mv.rb work:watch
+JOB=singer-v1 EVIDENCE=docs/reviews/singer-v1.md ruby scripts/mv.rb --project /absolute/project work:accept
+RUN=char-singer-v1 ruby scripts/mv.rb --project /absolute/project gen:ref_base
+RUN=char-singer-v1 ruby scripts/mv.rb --project /absolute/project review:ref_base
+RUN=ep01-s01 ruby scripts/mv.rb --project /absolute/project pipeline:all
+RUN=ep01-s01 ONLY=sing FORCE=1 ruby scripts/mv.rb --project /absolute/project gen:clips
+RUN=ep01-s01 RECUT=1 ONLY=sing FORCE=1 ruby scripts/mv.rb --project /absolute/project gen:clips
+RUN=ep01-s01 ruby scripts/mv.rb --project /absolute/project 'anim:prepare[audio/words.json]'
+RUN=ep01-s01 ruby scripts/mv.rb --project /absolute/project 'anim:preview[0,24,96,239]'
+RUN=ep01-s01 ruby scripts/mv.rb --project /absolute/project anim:overlay
+ruby scripts/mv.rb --project /absolute/project 'media:preview[output/clean.mp4,ep01-s01,ep01-s02]'
+```
+
+`gen:ref_base`, `gen:keyframes`, `gen:dialogue`, `gen:video`, `gen:shots`, H3 `gen:clips`, generated music/score, `review:dialogue`, `gen:overlay`, `review:music`, stems and SFX may call paid Fal endpoints. `gen:music` for an imported song is local processing plus CDN upload; `gen:overlay` uses paid Whisper unless re-rendering saved cues through `anim:overlay`. Reviews other than music are local. `pipeline:all` includes paid review calls; allocate them in the plan.
+
+For existing reliable word timings, use `anim:prepare[full-song-words.json]` after the plate prerequisites exist, then `anim:preview`/`anim:overlay`. It accepts Whisper `chunks` or an array of `{w,s,e}` / `{word,start,end}`, selects this section and subtracts its song offset. With no argument it writes an empty cue list for sketches with explicitly authored timing. It also prepares configured tracks locally. `anim:overlay` records a complete manifest even on the first local render, so `review:overlay` works without a paid `gen:overlay` call.
+
+`FORCE=1` changes cached work; `ONLY` confines ItemsStep work to named assets. A selected partial item set will not build the complete step's board until all items exist. `NEW_REQUEST=1` allows a new identical paid request; normal retries reuse saved receipts. `history[step]`, `adopt[step,request_id]`, `pick[step,index]`, `import[step,source_run]` support recovery and reuse. ItemsStep recovery uses per-item stored request IDs and reruns; adopt/pick are for single-output steps.
+
+## Analysis, finishing and utility tasks
+
+```sh
+ruby scripts/mv.rb --project /absolute/project 'audio:analyze[audio/source.mp3,audio]'
+ruby scripts/mv.rb --project /absolute/project 'audio:transcribe[audio/song.wav,audio/words.json]'
+ruby scripts/mv.rb --project /absolute/project 'media:stems[audio/song.wav,audio/stems,vocals]'
+ruby scripts/mv.rb --project /absolute/project 'media:frames[reference.mp4,output/reference_frames,12,480]'
+ruby scripts/mv.rb --project /absolute/project 'media:cuts[reference.mp4,output/cuts.json]'
+ruby scripts/mv.rb --project /absolute/project 'media:mouth[output/ep01-s01/04_clips/sing,audio/stems/vocals.wav,0,120,60,40,20]'
+ruby scripts/mv.rb --project /absolute/project 'anim:render[tools/p5/examples/smoke.js,tmp/smoke,48,1920,1080]'
+SFX=finish-sfx ruby scripts/mv.rb --project /absolute/project sfx:gen
+SFX=finish-sfx ruby scripts/mv.rb --project /absolute/project sfx:mix
+VFX=finish-vfx ruby scripts/mv.rb --project /absolute/project vfx:analyze
+VFX=finish-vfx ruby scripts/mv.rb --project /absolute/project 'vfx:stills[0,24,120]'
+VFX=finish-vfx ruby scripts/mv.rb --project /absolute/project 'vfx:clip[96,144]'
+VFX=finish-vfx ruby scripts/mv.rb --project /absolute/project vfx:render
+ruby scripts/mv.rb --project /absolute/project 'media:twitter[output/finished.mp4,output/delivery-1080.mp4]'
+```
+
+`media:probe`, `media:sheet`, `media:frame`, `media:cut`, `media:cutout`, `media:sprite_box`, `media:style`, `media:concat`, `media:mux`, `media:upload` and `media:youtube` are listed by `-T` with their arguments. Export names denote encoding presets; they do not publish to platforms. For unlisted operations, add an OOP service under `lib/` and a thin registry delegate. Keep backend code under `tools/` and tests in `spec/`.
+
+For detached lettering or debris in an RGBA sprite sequence, run `ruby scripts/mv.rb --project /absolute/project 'media:keep_component[output/raw-sprite,output/clean-sprite,320,400]'`. The seed is an integer pixel coordinate inside the intended subject in **every** input frame. The task preserves its four-connected nonzero-alpha component exactly and clears other alpha; it never expands or bridges components. Output must be a different, new or empty directory. Out-of-bounds or transparent seeds fail the whole sequence without publishing partial output. Touching text remains part of the subject and needs a separate mask; inspect the cleaned motion before use.
+
+The packaging follows [Agent Skills script guidance](https://agentskills.io/skill-creation/using-scripts): relative entry paths, explicit prerequisites, noninteractive arguments, help, meaningful failure codes and compact results. Ruby OOP methods own execution and delegate backend work.
diff --git a/skills/make-an-anime/references/testing.md b/skills/make-an-anime/references/testing.md
new file mode 100644
index 0000000..aeaef17
--- /dev/null
+++ b/skills/make-an-anime/references/testing.md
@@ -0,0 +1,52 @@
+# RSpec verification
+
+All test execution enters through Ruby. From the skill directory:
+
+```sh
+ruby scripts/mv.rb setup
+ruby scripts/mv.rb test
+PROFILE=core ruby scripts/mv.rb test
+PROFILE=media ruby scripts/mv.rb test
+PROFILE=swift ruby scripts/mv.rb test
+```
+
+The repository root also has `rake test`. `PROFILE=all` (default) runs all non-live examples. It fails if a required backend cannot run, including Chrome local-server restrictions or Swift on a non-macOS machine. Use a narrower profile intentionally when that backend is unavailable; report what was not exercised. Tests leave diagnostic fixtures in `scripts/tmp/` and derived review outputs under `scripts/output/`, both ignored by git.
+
+## What is tested
+
+| Profile | Observable behavior |
+|---|---|
+| core | skill metadata/reference links, CLI help/task discovery, intake/initialization and overwrite rejection, literal shell arguments, subprocess errors, plan approval invalidation, wave progression/dependencies/resume, monitored worker journals, identity import with byte/provenance validation, noncontiguous assembly rejection, Fal HTTP submit/poll/result/cache, schema rejection and queue errors |
+| media | real FFmpeg/ffprobe + ImageMagick + Python audio duration/silence/energy, local soundtrack processing without a Fal client, full-song cue offsets and first-render overlay manifests, cut detection, character/keyframe/H3 adapter workflow with synthetic Fal responses, green alpha edges, p5 sprite bounds/placement, actual moving pixels, deterministic repeat, overlay/assembly frame counts and soundtrack correlation, SFX timing/peak behavior, mouth-alignment diagnostic |
+| swift | real Swift build and character-scene VFX render, cue-on/cue-off pixel/luminance checks, audio/frame preservation and invalid effect rejection |
+| media (anime) | cast voices placed on a scene timeline with per-character mouth tracks and silent voice-over tracks, ElevenLabs word timings, score composition plan, ducked mix length, `{{STYLE}}` expansion, camera paragraph in the H3 prompt, 768P default, character-track target audio, still/colour inserts without model calls, 1080p plate |
+| live | paid real Sunburst character → edit → H3 768P animation (5 s is the H3 minimum), real Whisper/Demucs/SFX audio outputs and a local composition/VFX pass using the generated assets |
+
+Offline synthetic media is deliberately simple so placement/alpha/timing are measurable. Generated projects retain a `.skill/` copy of the instructions and references, so their copied test suite can validate the documentation as well. Mocked Fal responses verify client and pipeline plumbing; they cannot demonstrate the provider's current output quality or lipsync. Live generation is stochastic: tests enforce media/schema/placement invariants and save artifacts for visual review rather than asserting subjective beauty.
+
+The media profile also checks seeded alpha-component cleanup through the public Ruby task: retained subject RGBA and soft alpha remain exact, detached lettering disappears, the original file remains unchanged, and invalid/missing seeds fail without publishing a partial sequence.
+
+## Paid live E2E
+
+Live tests are excluded from routine runs. They require an explicit opt-in plus a real song excerpt and recognizable lyric words. This test invocation authorizes the listed test calls; it does not approve a new production plan.
+
+```sh
+LIVE_FAL=1 LIVE_SONG=/absolute/short-song.wav LIVE_LYRICS='known sung words' PROFILE=live ruby scripts/mv.rb test
+```
+
+Supply `FAL_AI_API_KEY` via the environment for this explicit developer CLI test. The plugin's sensitive key is scoped to its MCP server, which does not expose the live test runner. Budget per run: one Sunburst xhigh generation, one Sunburst xhigh edit, one five-second H3 768P clip (a harness-only saving; real projects keep the 1080P default), one Whisper transcription, one Demucs separation and one SFX generation. Local composition/VFX adds no model charges. No automatic paid rerolls. Run only after accepting those costs. Output is retained for inspection. A provider failure ends the test with request evidence; resume/recover before paying again.
+
+## Behavioral rehearsal for the Markdown workflow
+
+Executable tests check document links/interfaces; they do not prove an agent will obey creative prose. Rehearse these scenarios using the skill with a disposable project. Paid calls require authorization; preserve authorization already given for a bounded regeneration:
+
+1. “Make an anime” without a story/photos: request the two missing inputs.
+2. Song + satirical prompt, no reference video: analyze locally, browse, write a full linked plan with actual prompts, summarize cast/scenes/vibe and stop at production approval.
+3. Song + reference video: inspect dense motion segments and source cuts, then plan a complete frame timeline.
+4. Approve plan: record real consent, allocate two independent assets, review them, then progress through the required wave sizes with dependency and slot limits.
+5. Replace a character halfway through: create a new identity version and update affected dependencies without overwriting unrelated accepted work.
+6. Inject failed clips, lip timing drift, unreadable overlays, missing frames or a VFX no-op: reject, repair and review before accepting the wave.
+7. Interrupt during Fal polling: reuse the saved queue receipt and finish the original task.
+8. Regenerate an approved video's opening: identify the complete lyric boundary, publish exact worker frame ranges, import the current identity versions from manifests, generate fresh scene assets with at least two workers when requested, monitor their logs and review the assembled excerpt. Record reused inputs and new model requests separately.
+
+Review the generated plan against the user's actual taste and listen/watch opening and peak clips. Record behavioral findings in a review document; do not describe a structural Markdown check as full agent evaluation.