learn-style
Style pack from a rotoscoped clip: measure its traces and drawings into knob values and statistic bands, prove the bands against adversarial controls, and check new scenes against the pack. Use when: 'learn this style', 'make a style pack', 'extract the style from this clip', 'does my film match the style', 'check this scene against the woodcut pack', 'which statistics separate styles'. Needs a rotoscope work dir; not for copying a clip one to one.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- metadata
- { "summary": "Measure a traced clip into a style pack and check new scenes against it", "workflow-stage": "implement" }
- description
- Style pack from a rotoscoped clip: measure its traces and drawings into knob values and statistic bands, prove the bands against adversarial controls, and check new scenes against the pack. Use when: 'learn this style', 'make a style pack', 'extract the style from this clip', 'does my film match the style', 'check this scene against the woodcut pack', 'which statistics separate styles'. Needs a rotoscope work dir; not for copying a clip one to one.
- argument-hint
- <rotoscope work dir> <pack dir> [--cuts T,T,..] [--credit TEXT] [--negative SUMMARY.json ...]
- user-invocable
- true
- disable-model-invocation
- false
02 资源文件 3
- 参考文档reference/statistics.md22.4 KB
- 脚本scripts/controls.py11.7 KB
- 脚本scripts/learn.py14.0 KB
03 SKILL.md 正文
Learn style
Turn a rotoscoped clip into a style pack: the numbers that make the style what it is, and a check
that tells whether a new film shares them. The pack holds statistics only; never copy traced
geometry, source frames or the clip into it. Read
reference/statistics.md first: what each statistic measures, how a
band is set, which statistics separate the woodcut style from a filtered near miss and from other
styles, and what the check still cannot separate.
Run each script as python3 ${CLAUDE_PLUGIN_ROOT}/scripts/pydeps.py run --data-dir "${CLAUDE_PLUGIN_DATA}" -- <script> ..., alone as its own Bash call: no cd, no --help run first, and no other command chained to it; this page gives each script's arguments.
Never probe the host Python, numpy or cv2, never run pydeps.py install, and never list, create or read anything under ${CLAUDE_PLUGIN_DATA} yourself: pydeps.py run finds the packages, and when it exits 2 it prints the repair line, which you report (/animation:setup checks the requirements). Input is a
rotoscope work directory (d/dNNN.json traces and src/dNNN.png drawings). The scripts are
${CLAUDE_PLUGIN_ROOT}/skills/learn-style/scripts/learn.py,
${CLAUDE_PLUGIN_ROOT}/skills/learn-style/scripts/controls.py and the shared
${CLAUDE_PLUGIN_ROOT}/scripts/inkstats.py.
Pack format
styles/<name>/ in the plugin, tool-neutral:
| File | Written by | Holds |
|---|---|---|
style.json |
learn.py, then you |
palette (ink, paper, tone ramp), knobs (the seven-knob schema), stats (p10/p50/p90), timing, ref (the source's values), bands, check, measured_only, heldout (how each band was set and how it tested), brush, credit, rotoscope_fits |
STYLE.md |
you | the style in words for a reader: credit, knob table with each value marked measured or judgment and pointing at its style.json key, how to author in it, the validation result |
learn.py measures everything but credit, brush and the movement, camera and
backgrounds knobs, which it keeps from an existing style.json; fill those knobs from viewing
the source and mark them "basis": "judgment". check is learn.py's CHECK, the statistics
shown to separate, less any content-class row the source defines in fewer than two parts;
measured_only lists the subject-sensitive statistics the check prints but never judges. The
numbers live in style.json only; STYLE.md and other docs point at its keys. Read a pack's style.json with the Read tool by absolute path, never with python3 -c, cat, jq or ls in a shell.
Loop
- Controls:
controls.py measure <out> --near <a near-miss film> --other <films in other styles> --source <the clip> --replica <rotoscope work dir>measures a filtered family of the near miss (blur, noise, stripes, dry brush, contour warp), synthetic flat polygons, the other styles, and the same-style positives, alternating the controls between a calibration and an evaluation half. - Learn:
learn.py <work> <pack dir> --cuts <the clip's shot starts> --credit "<who made the source, its URL, date>" --negative <out>/calibration/*.json. Bands come from film-sized excerpts of the source, split by shot, with half the splits held out; the calibration controls cap each band's widening so they keep failing. - Prove the check:
controls.py check <out> <pack dir>must show every control failing (margin above 0) and the source and replica passing, with the evaluation half held out. Thencontrols.py selftest <pack dir> --near <the near-miss film>(the pack argument is required) must exit 0. Put the table inreference/statistics.md. A control that passes goes under "what the check cannot say"; never narrow a band until it fails. - Describe: fill the judgment knobs in
style.jsonand writeSTYLE.md. - Validate: author a scene of at least a third of the source's length (bands are learned from
excerpts that long) on a different subject,
from ink.js and the scene elements, with geometry you write, never traced; pass the pack's
palette.inkas every ink.js call'scolor(the engine'sINKdefault is not the pack's). Render it at the source's size with${CLAUDE_PLUGIN_ROOT}/scripts/render.py <scene.js> <frames dir> --fps <the pack's knobs.frame_rate.base_fps> --encode mp4 --playwright-core '${user_config.playwright_core}'(it serves the scene's folder andscripts/), and runinkstats.py <frames dir>.mp4 --cuts <shot starts> --pack <pack dir>. A produce production passes itsshots.jsonas--cuts. It exits 0 only when every checked row and the palette pass. Each row prints its distance to source (0 is the source value, 1 the band edge on either side); the film's distance ranks passing scenes and its margin names the row nearest failing. - Review: measure each prop with
--region X,Y,W,H --t T0-T1next to source prop boxes, then read every drawing at 1:1 (tile frames so no image is over the long-edge limit${CLAUDE_PLUGIN_ROOT}/skills/rotoscope/reference/method.md, Reviewing images, records; never downscale, never a GIF) beside source crops. A pass on the numbers with a crop that does not read as the style is a fail; say which mark is wrong. - Record: put the parameters that passed into the pack's
brushand the result intoSTYLE.md, including where the scene still falls short.
Repeat 5-7 until the check passes and the crops read as the style. Tune the scene against the
check, never the check against the scene. inkstats.py with no pack (--json for the full
summary) measures any film, which is how to compare two films.
Next
/animation:produce <production dir>
It takes a style pack this skill wrote and makes the film: boards for approval, then shots, render, and review.
Gotchas
- A post filter must not be what passes the check. Blur, noise, stripes and dry-brush overlays move
edge softness and the amount of gray inside the ink, so those rows are measured but not checked.
grainandperiodare measured only: on the woodcut source they follow codec residue and the pixel grid, and a flat black through h264 lands ingrain's band.flatrejects texture laid over all the black, androughandoffstepdo not move under blur, noise, stripes or dry brush.controls.py selftest <pack dir> [--near <film>]exits 1 if the review's blur-and-stripes filter (and, with--near, the warped, retimedATTACK) gets a synthetic or near-miss film through; rerun it with--nearafter changing a statistic. straightandsliverfollow the subject, so they are checked only inside the content classesborderandcaption(straight_border,sliver_caption, ...) and printed as measured only over the whole frame.boilis measured on the border and caption. A scene without a frame line or a caption panel in the top quarter leaves those rows n/a; draw both, as the source does.- Bands are learned per excerpt of the whole source, not per shot, so a very short film is judged against bands that may not fit it; there is no per-shot row.
w50andpw50come from a distance transform and move in 2 px steps; every woodcut source excerpt haspw508, so neither is checked.- A strictly regular timing fails
offstep: hold a few drawings for 2 or 4 frames. softneeds a soften pass after drawing, since a two-tone canvas render has almost no edge ramp. Chromium'sctx.filter = 'blur()'does nothing below a floor (${CLAUDE_PLUGIN_ROOT}/skills/rotoscope/reference/method.md, Rendering, holds the dated record); soften in JS instead.
04 同仓库更多 Skills
track
Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.
reviewer-media
Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
principles
Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.
write
Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').