reframe-video 0.6.19 → 0.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,6 +74,11 @@ flagship scenes — reuse the technique, vary the content:
74
74
 
75
75
  ### 4. Verify objectively (don't argue about "more dynamic")
76
76
 
77
+ Mind the tiers so you're not full-rendering to check small things: `compile`
78
+ (validate eDSL → IR, ~1s) and `labels` are cheap, no render; `frame --t <sec>`
79
+ is the cheap visual look (one PNG, ~1s); `motion`/`trace` below need a finished
80
+ render or reference video, so they're end-stage measurement, not the per-edit loop.
81
+
77
82
  - `reframe labels scene.ts` — every label → exact seconds. The timing source for audio + a
78
83
  sanity check that beats land when you think.
79
84
  - `reframe motion out.mp4` — speeds, static fraction, oscillation rhythm, spikes. A vague
@@ -97,5 +102,6 @@ addresses), so the human's polish isn't lost when you redo the base.
97
102
  matching with `diff` before adding motion.
98
103
  - Keep `id`s/labels stable across rewrites (see `reframe guide --regen`) so the user's
99
104
  overlay edits survive.
100
- - It's still iterative. The tools cut the rounds; they don't remove the loop. Render, look,
101
- adjust the agent should render frames and read them, not guess.
105
+ - It's still iterative. The tools cut the rounds; they don't remove the loop. `compile` to
106
+ validate (~1s), `frame --t <sec>` to look at a held moment (~1s), adjust — the agent should
107
+ read frames, not guess. Full `render` is the last step, not the per-edit check.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reframe-video",
3
- "version": "0.6.19",
3
+ "version": "0.6.21",
4
4
  "description": "Declarative motion graphics that AI can write and humans can tweak — human edits survive AI regeneration. Deterministic mp4 renders from a plain-data scene format.",
5
5
  "keywords": [
6
6
  "motion-graphics",
@@ -43,7 +43,9 @@
43
43
  "dist",
44
44
  "assets",
45
45
  "guides",
46
- "preview"
46
+ "preview",
47
+ ".claude-plugin",
48
+ "skills"
47
49
  ],
48
50
  "engines": {
49
51
  "node": ">=20"
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: reframe
3
+ description: Create and iterate motion-graphics videos (mp4) — title cards, lower thirds, kinetic typography, product teasers, data-driven video batches. Use when the user asks to make, edit, retime, personalize, or add sound to an animated video. Scenes are declarative data; renders are deterministic; human edits survive regeneration.
4
+ ---
5
+
6
+ # reframe — motion graphics as addressable data
7
+
8
+ All commands run through npx; no install or project setup is needed. The
9
+ runtime needs ffmpeg on PATH and a one-time `npx playwright install chromium`
10
+ (the render command prints an actionable hint if either is missing).
11
+
12
+ ## Creating a scene
13
+
14
+ 1. **Read the guide first** — it is the complete, current syntax (~1,700
15
+ tokens) and one read is enough to write valid scenes:
16
+ `npx -y reframe-video guide`
17
+ 2. Write a single self-contained `<name>.ts` in the user's directory
18
+ (`npx -y reframe-video new <name>` scaffolds a documented starter).
19
+ Scenes must be pure functions of time: no `Math.random()`/`Date` — use
20
+ `wiggle` with a seed. Give every node a meaningful stable `id` and label
21
+ the key timeline moments — those names are addresses for everything below.
22
+ 3. Iterate on the cheap commands; full-render once at the end:
23
+ - `npx -y reframe-video compile <name>.ts` — validate eDSL → IR in ~1s, no
24
+ browser, no ffmpeg. Fix the classified error it prints, repeat. Catch every
25
+ syntax/validation error here before launching anything heavier.
26
+ - `npx -y reframe-video frame <name>.ts --t <sec> -o frame.png` — render ONE
27
+ PNG at a key moment in ~1s (chromium only, no mp4 mux) and LOOK at it. This
28
+ is your visual check; sample a few times across the timeline.
29
+ - `npx -y reframe-video render <name>.ts` → `out/<name>.mp4` — the full mp4 is
30
+ ~10x slower; run it once the frames look right, not per edit.
31
+
32
+ ## Directing a high-end piece (cinematic / reference-faithful)
33
+
34
+ Simple jobs (a lower-third, a logo sting, a KPI card) just work from the guide.
35
+ But a CINEMATIC or REFERENCE-FAITHFUL piece (a product teaser, a UI/session
36
+ reproduction, a title sequence) needs a director's process — **read it first**:
37
+ `npx -y reframe-video guide --directing`. The short version:
38
+
39
+ 1. Get the spec from the user: concept, **references** (screenshots / a reference
40
+ video / pasted real content — save them to disk), exact brand colors, length +
41
+ aspect, and tone. Vague prompts are why these take many rounds.
42
+ 2. **Storyboard the beats** with `beat("setup"/"rising"/"climax"/…)` BEFORE animating.
43
+ 3. **Match references with the `diff` tool** instead of eyeballing:
44
+ `npx -y reframe-video diff ref.png --mode grid` (measure a screenshot),
45
+ then `... diff ref.png scene.ts --mode side|diff` (compare a render) → fix → repeat.
46
+ 4. Apply cinematic craft: camera push-in per beat (`cameraTo` in `par`), curved
47
+ entrances (`motionPath` + `easeOutBack`), fake/real depth, layered `oscillate`
48
+ idle, and label-anchored sound.
49
+ 5. **Verify objectively**: `... labels` (exact beat seconds), `... motion out.mp4`
50
+ (makes "more dynamic" measurable), `... trace ref.mp4 --apply scene.ts` (borrow a
51
+ reference VIDEO's timing), `... preview` (hand-tune → overlay that survives regen).
52
+
53
+ ## Modifying an existing scene — the contract
54
+
55
+ Before rewriting any existing scene, read the regeneration contract:
56
+ `npx -y reframe-video guide --regen`. The core rule: **never rename node ids,
57
+ state names, or timeline labels for concepts that survive the redesign** —
58
+ the user's overlay documents hold their hand edits at those addresses.
59
+
60
+ The user may keep personal edits in an overlay JSON and render with
61
+ `--overlay <file>`. Check the conversation for overlay usage. Two situations
62
+ to handle explicitly:
63
+
64
+ - After your rewrite, the render's compose report lists orphaned edits for
65
+ concepts that were genuinely removed — relay that report to the user; never
66
+ let an edit disappear silently.
67
+ - If the user asks you to change a property their overlay already overrides,
68
+ editing the scene alone will be invisible in their renders. Resolve the
69
+ mask (update the scene AND remove/update the superseded overlay entry) and
70
+ tell them why.
71
+
72
+ ## Other capabilities
73
+
74
+ - **Batch**: `npx -y reframe-video batch scene.ts data.json` — one mp4 per
75
+ data row; row keys are overlay addresses (`nodes.<id>.<prop>`,
76
+ `timeline.<label>.duration`, ...). CSV works too (headers = addresses).
77
+ - **Preview editor**: `npx -y reframe-video preview` — scrub/play/knobs for
78
+ scenes in the current directory; the user's knob edits export as an overlay
79
+ JSON they can pass to render.
80
+ - **Audio**: `scene.audio` cues anchor to timeline labels, so sound follows
81
+ retiming and regeneration. Procedural sfx (whoosh/pop/tick/rise/shimmer/
82
+ thud) plus bundled CC0 samples (mechanical keypresses, clicks). The guide's
83
+ Audio section has the schema.
84
+ - **Motion check**: `npx -y reframe-video motion out/<name>.mp4` prints a
85
+ calibrated motion profile (speeds, static fraction, discontinuities) —
86
+ useful to verify a vague request like "make it more dynamic" objectively.
87
+ - **Image sequences** (the "glyph reveal" / stop-motion format): generated
88
+ stills become `image` nodes stacked in painter's order; hard cuts are
89
+ 0.01s opacity steps every ~0.15s, a slow camera-group scale tween adds the
90
+ push-in, `wiggle` adds shake, and a label per cut anchors a tick sfx.
91
+ Keep frame ids stable (`frame-0..N`) so the user can swap any plate via
92
+ overlay or batch row (`nodes.frame-3.src`). Image `src` paths resolve
93
+ relative to the scene file.
94
+
95
+ ## Verification habits
96
+
97
+ Verify on the cheap commands, not by full-rendering. `compile` (validate, ~1s)
98
+ then `frame --t <sec>` (one PNG, ~1s) is the inner loop; `render` is for the
99
+ final mp4. Don't pull frames out of an mp4 with ffmpeg just to look — `frame`
100
+ writes the PNG directly and skips the mux. Same input renders byte-identically,
101
+ so "it changed" or "it didn't change" is always provable from a single frame.