@anvpx/motion 0.1.0 → 0.1.2
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.
- package/CATALOG.md +2 -2
- package/README.md +10 -8
- package/music/ambient-calm.wav +0 -0
- package/music/catalog.json +68 -0
- package/music/cinematic-deep.wav +0 -0
- package/music/documentary-reflective.wav +0 -0
- package/music/playful-light.wav +0 -0
- package/music/tech-pulse.wav +0 -0
- package/music/warm-human.wav +0 -0
- package/package.json +10 -9
- package/plugins/motion-kit/.claude-plugin/plugin.json +1 -1
- package/plugins/motion-kit/README.md +14 -6
- package/plugins/motion-kit/commands/mk-draft.md +2 -2
- package/plugins/motion-kit/commands/mk-new.md +4 -4
- package/plugins/motion-kit/commands/mk-render.md +2 -2
- package/plugins/motion-kit/skills/motion-kit/SKILL.md +44 -34
- package/plugins/motion-kit/skills/motion-kit/references/authoring-scene.md +15 -4
- package/plugins/motion-kit/skills/motion-kit/references/authoring-style.md +6 -4
- package/plugins/motion-kit/skills/motion-kit/references/common-mistakes.md +18 -15
- package/plugins/motion-kit/skills/motion-kit/references/content-pack.md +61 -73
- package/plugins/motion-kit/skills/motion-kit/references/craft-color.md +50 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-composition.md +52 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-critique.md +68 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-motion.md +55 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-narrative.md +54 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-sound.md +53 -0
- package/plugins/motion-kit/skills/motion-kit/references/craft-type.md +54 -0
- package/plugins/motion-kit/skills/motion-kit/references/critique-repair.md +46 -0
- package/plugins/motion-kit/skills/motion-kit/references/decision-packet.md +59 -0
- package/plugins/motion-kit/skills/motion-kit/references/direction.md +84 -0
- package/plugins/motion-kit/skills/motion-kit/references/free-storyboard.md +3 -3
- package/plugins/motion-kit/skills/motion-kit/references/intake.md +38 -12
- package/plugins/motion-kit/skills/motion-kit/references/knowledge-routing.md +58 -32
- package/plugins/motion-kit/skills/motion-kit/references/longform.md +65 -0
- package/plugins/motion-kit/skills/motion-kit/references/outline.md +27 -17
- package/plugins/motion-kit/skills/motion-kit/references/patterns.md +19 -19
- package/plugins/motion-kit/skills/motion-kit/references/quality-bar.md +30 -21
- package/plugins/motion-kit/skills/motion-kit/references/slop.md +13 -11
- package/plugins/motion-kit/skills/motion-kit/references/themes.md +15 -0
- package/plugins/motion-kit/skills/motion-kit/references/voice.md +41 -4
- package/plugins/motion-kit/skills/motion-kit/references/worked-decisions.md +178 -0
- package/skills/motion-kit/SKILL.md +44 -34
- package/skills/motion-kit/references/authoring-scene.md +15 -4
- package/skills/motion-kit/references/authoring-style.md +6 -4
- package/skills/motion-kit/references/common-mistakes.md +18 -15
- package/skills/motion-kit/references/content-pack.md +61 -73
- package/skills/motion-kit/references/craft-color.md +50 -0
- package/skills/motion-kit/references/craft-composition.md +52 -0
- package/skills/motion-kit/references/craft-critique.md +68 -0
- package/skills/motion-kit/references/craft-motion.md +55 -0
- package/skills/motion-kit/references/craft-narrative.md +54 -0
- package/skills/motion-kit/references/craft-sound.md +53 -0
- package/skills/motion-kit/references/craft-type.md +54 -0
- package/skills/motion-kit/references/critique-repair.md +46 -0
- package/skills/motion-kit/references/decision-packet.md +59 -0
- package/skills/motion-kit/references/direction.md +84 -0
- package/skills/motion-kit/references/free-storyboard.md +3 -3
- package/skills/motion-kit/references/intake.md +38 -12
- package/skills/motion-kit/references/knowledge-routing.md +58 -32
- package/skills/motion-kit/references/longform.md +65 -0
- package/skills/motion-kit/references/outline.md +27 -17
- package/skills/motion-kit/references/patterns.md +19 -19
- package/skills/motion-kit/references/quality-bar.md +30 -21
- package/skills/motion-kit/references/slop.md +13 -11
- package/skills/motion-kit/references/themes.md +15 -0
- package/skills/motion-kit/references/voice.md +41 -4
- package/skills/motion-kit/references/worked-decisions.md +178 -0
package/CATALOG.md
CHANGED
|
@@ -31,7 +31,7 @@ code | base | Code or terminal text typed or revealed line by line, with highlig
|
|
|
31
31
|
kpi-grid | base | 2-6 headline numbers side by side, each with label, unit, change and trend arrow (good=down when a fall is good); values count up. | items
|
|
32
32
|
chart | base | Animated bar, line or donut chart for ranking, trend or share, with values shown and an optional highlight. | kind
|
|
33
33
|
table | base | Small data table or ranked list (2-5 columns, 2-8 rows) with row-by-row reveal and one optional highlighted row. | columns,rows
|
|
34
|
-
scene3d | base | WebGL diorama (vendored three.js): post, light, material, environment presets; flat 2D canvas fallback without WebGL. 3D output is machine+GPU stable, not portable. | -
|
|
34
|
+
scene3d | base | WebGL diorama (vendored three.js): post, light, material, environment presets; model presets knot|gem|sphere|torus; flat 2D canvas fallback without WebGL. 3D output is machine+GPU stable, not portable. | -
|
|
35
35
|
sticker | base | Pop-comic sticker slam: 1-5 short phrases slam in with outline type, tilt and a starburst; for hooks, myth-vs-fact and punchy shorts. | words
|
|
36
36
|
waveform | base | Audio waveform from precomputed peaks: bars rise as the playhead sweeps; for voice agents, podcasts and narrated reports. Peaks are storyboard data, never decoded audio. | peaks
|
|
37
37
|
Detail: `mk catalog <type>`. Props are strict; unlisted keys are rejected.
|
|
@@ -275,7 +275,7 @@ props: {"title":"Top regions","columns":["Region","Revenue"],"rows":[["North","$
|
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
```
|
|
278
|
-
scene3d (base): WebGL diorama (vendored three.js): post, light, material, environment presets; flat 2D canvas fallback without WebGL. 3D output is machine+GPU stable, not portable.
|
|
278
|
+
scene3d (base): WebGL diorama (vendored three.js): post, light, material, environment presets; model presets knot|gem|sphere|torus; flat 2D canvas fallback without WebGL. 3D output is machine+GPU stable, not portable.
|
|
279
279
|
title text<=60
|
|
280
280
|
caption text<=140
|
|
281
281
|
model text
|
package/README.md
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
**Storyboard JSON in, animated video out.** motion-kit turns a small, validated document into an explainer, infographic or social clip and renders it locally with HyperFrames. Free and open source: no metering, no watermark, no account, no cloud.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
brief ──► storyboard.json ──► validate ──► preview ──► approve ──► render --gated
|
|
7
|
-
(small, diffable) (schema+lint) (contact sheet, stills, clip)
|
|
6
|
+
brief ──► direction ──► storyboard.json ──► validate ──► preview ──► approve ──► render --gated
|
|
7
|
+
(design) (small, diffable) (schema+lint) (contact sheet, stills, clip)
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
## Why it is different
|
|
11
11
|
|
|
12
|
-
- **
|
|
12
|
+
- **A small production document with room for original design.** Storyboards are diffable, reviewable and patchable JSON. Use catalog components where they fit, or author deterministic HTML/CSS/JS scenes for original compositions through the same build and approval path.
|
|
13
13
|
- **Deterministic by construction.** Every scene is a pure function of time (`seek(t)`): no frame-rate clock, no unseeded randomness. Same-machine drafts are byte-identical.
|
|
14
14
|
- **A real approval gate.** `mk preview` writes a review pack, `mk approve` records the user's yes, and `mk render --gated` refuses with exit 4 until the recorded approval matches the current inputs. Any edit re-arms it.
|
|
15
15
|
- **Local and offline.** Rendering, linting, contact sheets and voice run on your machine. Confidential decks stay on disk.
|
|
@@ -25,12 +25,13 @@ Optional voice needs Python 3.12 plus Kokoro/faster-whisper; `mk doctor` tells y
|
|
|
25
25
|
## Quickstart
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
npx -y @anvpx/motion@0.1.
|
|
28
|
+
npx -y @anvpx/motion@0.1.2 doctor
|
|
29
29
|
|
|
30
30
|
# Optional: make the rest shorter
|
|
31
|
-
alias mk="npx -y @anvpx/motion@0.1.
|
|
32
|
-
function mk { npx -y @anvpx/motion@0.1.
|
|
31
|
+
alias mk="npx -y @anvpx/motion@0.1.2" # bash/zsh
|
|
32
|
+
function mk { npx -y @anvpx/motion@0.1.2 @args } # PowerShell
|
|
33
33
|
|
|
34
|
+
# Optional template-assisted example, after deciding the visual direction:
|
|
34
35
|
mk template list --for "how our pricing works"
|
|
35
36
|
mk new explain/architecture --demo --out storyboard.json # --demo = example copy; --set k=v for yours
|
|
36
37
|
mk validate storyboard.json
|
|
@@ -56,7 +57,7 @@ mk render storyboard.json --gated --verify
|
|
|
56
57
|
|
|
57
58
|
## How authoring works
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
The agent first develops a visual argument in an authoring-only `direction.md`: concept, composition, typography, color, motion, sound and intended divergence from relevant prior work. It loads focused craft guidance for unresolved decisions, then chooses template-assisted, direct or authored realization by fit. Templates help repeat a brand system; authored scenes can carry the whole film when the brief calls for it. There is no template-exhaustion requirement or custom-scene quota. The protocol lives in the skill (`skills/motion-kit/SKILL.md`) and in `docs/AGENT-WORKFLOW.md`. Users never write storyboards; the agent designs, shows a preview, and renders only after an explicit yes.
|
|
60
61
|
|
|
61
62
|
Claude Code users can install the bundled plugin with `mk plugin install`.
|
|
62
63
|
|
|
@@ -81,7 +82,8 @@ mk preview → user reviews contact.png / stills / clip → mk approve →
|
|
|
81
82
|
|
|
82
83
|
```sh
|
|
83
84
|
pnpm install
|
|
84
|
-
pnpm build # tsc -b
|
|
85
|
+
pnpm build # tsc -b, runtime assets, generated package payloads
|
|
86
|
+
pnpm scaffold:check # fail if a generated copy drifted from its source
|
|
85
87
|
pnpm check # typecheck + lint
|
|
86
88
|
pnpm test # unit tests
|
|
87
89
|
pnpm test:integration # needs Chrome
|
|
Binary file
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"licence": "CC0-1.0",
|
|
4
|
+
"note": "Synthesized for motion-kit from oscillators and noise; no sampled recording.",
|
|
5
|
+
"loopSec": 32.0,
|
|
6
|
+
"beds": [
|
|
7
|
+
{
|
|
8
|
+
"id": "ambient-calm",
|
|
9
|
+
"file": "ambient-calm.wav",
|
|
10
|
+
"mood": "calm",
|
|
11
|
+
"energy": "low",
|
|
12
|
+
"bpm": 60,
|
|
13
|
+
"key": "D major",
|
|
14
|
+
"loopSec": 32.0,
|
|
15
|
+
"useWhen": "Reflective, human, quiet explanations; leave room for narration."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "cinematic-deep",
|
|
19
|
+
"file": "cinematic-deep.wav",
|
|
20
|
+
"mood": "cinematic",
|
|
21
|
+
"energy": "medium",
|
|
22
|
+
"bpm": 60,
|
|
23
|
+
"key": "D minor",
|
|
24
|
+
"loopSec": 32.0,
|
|
25
|
+
"useWhen": "A serious opening, product reveal or documentary turn."
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "warm-human",
|
|
29
|
+
"file": "warm-human.wav",
|
|
30
|
+
"mood": "warm",
|
|
31
|
+
"energy": "low-medium",
|
|
32
|
+
"bpm": 60,
|
|
33
|
+
"key": "C major",
|
|
34
|
+
"loopSec": 32.0,
|
|
35
|
+
"useWhen": "Brand stories, human services, invitations and warm explainers."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"id": "tech-pulse",
|
|
39
|
+
"file": "tech-pulse.wav",
|
|
40
|
+
"mood": "tech",
|
|
41
|
+
"energy": "high",
|
|
42
|
+
"bpm": 120,
|
|
43
|
+
"key": "A minor",
|
|
44
|
+
"loopSec": 32.0,
|
|
45
|
+
"useWhen": "Data, product, engineering and fast technical stories."
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "playful-light",
|
|
49
|
+
"file": "playful-light.wav",
|
|
50
|
+
"mood": "playful",
|
|
51
|
+
"energy": "medium-high",
|
|
52
|
+
"bpm": 120,
|
|
53
|
+
"key": "F major",
|
|
54
|
+
"loopSec": 32.0,
|
|
55
|
+
"useWhen": "Friendly social clips, workshops and practical community stories."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "documentary-reflective",
|
|
59
|
+
"file": "documentary-reflective.wav",
|
|
60
|
+
"mood": "reflective",
|
|
61
|
+
"energy": "low",
|
|
62
|
+
"bpm": 60,
|
|
63
|
+
"key": "G major",
|
|
64
|
+
"loopSec": 32.0,
|
|
65
|
+
"useWhen": "Long-form documentary, history, science and considered editorial."
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anvpx/motion",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Storyboard JSON to animated video, rendered locally with HyperFrames: the mk CLI plus the full pipeline.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "anvpx",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"luts/*.cube",
|
|
40
40
|
"luts/LICENSE-CC0.txt",
|
|
41
41
|
"music/*.wav",
|
|
42
|
+
"music/catalog.json",
|
|
42
43
|
"music/LICENSE-CC0.txt",
|
|
43
44
|
"packs/**/*",
|
|
44
45
|
"assets.json",
|
|
@@ -55,14 +56,14 @@
|
|
|
55
56
|
"@fontsource/jetbrains-mono": "5.3.0",
|
|
56
57
|
"@fontsource/source-serif-4": "5.3.1",
|
|
57
58
|
"@fontsource/space-grotesk": "5.3.0",
|
|
58
|
-
"@anvpx/motion-assets": "0.1.
|
|
59
|
-
"@anvpx/motion-audio": "0.1.
|
|
60
|
-
"@anvpx/motion-build": "0.1.
|
|
61
|
-
"@anvpx/motion-cli": "0.1.
|
|
62
|
-
"@anvpx/motion-scenes": "0.1.
|
|
63
|
-
"@anvpx/motion-schema": "0.1.
|
|
64
|
-
"@anvpx/motion-templates": "0.1.
|
|
65
|
-
"@anvpx/motion-themes": "0.1.
|
|
59
|
+
"@anvpx/motion-assets": "0.1.2",
|
|
60
|
+
"@anvpx/motion-audio": "0.1.2",
|
|
61
|
+
"@anvpx/motion-build": "0.1.2",
|
|
62
|
+
"@anvpx/motion-cli": "0.1.2",
|
|
63
|
+
"@anvpx/motion-scenes": "0.1.2",
|
|
64
|
+
"@anvpx/motion-schema": "0.1.2",
|
|
65
|
+
"@anvpx/motion-templates": "0.1.2",
|
|
66
|
+
"@anvpx/motion-themes": "0.1.2",
|
|
66
67
|
"hyperframes": "0.8.212",
|
|
67
68
|
"postprocessing": "6.39.5",
|
|
68
69
|
"three": "0.186.0",
|
|
@@ -2,23 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Plugin root: `plugins/motion-kit/` (chosen over a top-level `motion-kit-plugin/`
|
|
4
4
|
folder name used by the plugin packaging convention;
|
|
5
|
-
`npx -y @anvpx/motion@0.1.
|
|
5
|
+
`npx -y @anvpx/motion@0.1.2 plugin install` copies this exact folder).
|
|
6
6
|
|
|
7
7
|
## Layout
|
|
8
8
|
|
|
9
9
|
- `.claude-plugin/plugin.json` — manifest (`name`, `version`, `description` only;
|
|
10
10
|
version tracks `@anvpx/motion`).
|
|
11
11
|
- `commands/mk-new.md`, `mk-draft.md`, `mk-render.md` — thin wrappers. Every step
|
|
12
|
-
calls `npx -y @anvpx/motion@0.1.
|
|
12
|
+
calls `npx -y @anvpx/motion@0.1.2` (pinned; never unpinned `npx`).
|
|
13
13
|
Surface as `/motion-kit:mk-new`, `/motion-kit:mk-draft`, `/motion-kit:mk-render`.
|
|
14
|
-
- `skills/motion-kit/SKILL.md` —
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
- `skills/motion-kit/SKILL.md` — generated from the canonical skill by the
|
|
15
|
+
scaffold; do not edit it here.
|
|
16
|
+
- `skills/motion-kit/references/` — generated from the canonical reference set,
|
|
17
|
+
so every `references/*.md` link resolves after install.
|
|
18
|
+
|
|
19
|
+
## Source ownership
|
|
20
|
+
|
|
21
|
+
The plugin's `.claude-plugin/`, `commands/` and this README are hand-maintained.
|
|
22
|
+
The `skills/motion-kit/` tree is generated. Edit the canonical skill and run
|
|
23
|
+
`pnpm scaffold`; `pnpm scaffold:check` fails on drift. The same scaffold
|
|
24
|
+
generates the core package's `skills/` and `plugins/` trees.
|
|
17
25
|
|
|
18
26
|
## Install
|
|
19
27
|
|
|
20
28
|
```bash
|
|
21
|
-
npx -y @anvpx/motion@0.1.
|
|
29
|
+
npx -y @anvpx/motion@0.1.2 plugin install --out ./motion-kit-plugin
|
|
22
30
|
```
|
|
23
31
|
|
|
24
32
|
Verifies `skills/motion-kit/SKILL.md` sha256 matches after copy.
|
|
@@ -5,8 +5,8 @@ description: Preview a motion-kit storyboard (stills, contact sheet, draft clip)
|
|
|
5
5
|
Run the pinned CLI for every step; never use an unpinned invocation.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @anvpx/motion@0.1.
|
|
9
|
-
npx -y @anvpx/motion@0.1.
|
|
8
|
+
npx -y @anvpx/motion@0.1.2 preview storyboard.json
|
|
9
|
+
npx -y @anvpx/motion@0.1.2 approve storyboard.json --note "<user words>"
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Follow `skills/motion-kit/SKILL.md` stages 7-8 (preview, show + approve).
|
|
@@ -5,10 +5,10 @@ description: Start a motion-kit video (intake, brief, template pick, storyboard)
|
|
|
5
5
|
Run the pinned CLI for every step; never use an unpinned invocation.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @anvpx/motion@0.1.
|
|
9
|
-
npx -y @anvpx/motion@0.1.
|
|
10
|
-
npx -y @anvpx/motion@0.1.
|
|
11
|
-
npx -y @anvpx/motion@0.1.
|
|
8
|
+
npx -y @anvpx/motion@0.1.2 template list --for "<one-line brief>"
|
|
9
|
+
npx -y @anvpx/motion@0.1.2 template show <template>/<blueprint>
|
|
10
|
+
npx -y @anvpx/motion@0.1.2 new <template>/<blueprint> --set k=v ... --out storyboard.json
|
|
11
|
+
npx -y @anvpx/motion@0.1.2 validate storyboard.json
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
Follow `skills/motion-kit/SKILL.md` stages 1-6 (intake, brief, pick template,
|
|
@@ -5,8 +5,8 @@ description: Gated render of an approved motion-kit storyboard with verify
|
|
|
5
5
|
Run the pinned CLI for every step; never use an unpinned invocation.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npx -y @anvpx/motion@0.1.
|
|
9
|
-
npx -y @anvpx/motion@0.1.
|
|
8
|
+
npx -y @anvpx/motion@0.1.2 render storyboard.json --gated --verify
|
|
9
|
+
npx -y @anvpx/motion@0.1.2 verify out/final.mp4 --storyboard storyboard.json
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
Follow `skills/motion-kit/SKILL.md` stages 9-10 (patch, render). Exit 4 means
|
|
@@ -6,32 +6,37 @@ allowed-tools: Bash(mk:*) Bash(npx:*) Read Write
|
|
|
6
6
|
|
|
7
7
|
# motion-kit: brief -> preview -> approved video
|
|
8
8
|
|
|
9
|
-
`mk` = `npx -y @anvpx/motion@0.1.
|
|
9
|
+
`mk` = `npx -y @anvpx/motion@0.1.2`; alias it once per shell, or use the npx prefix in its place. The user describes the outcome; you author one storyboard JSON, show a short preview, and render only after an explicit yes.
|
|
10
10
|
|
|
11
11
|
## Start here
|
|
12
12
|
|
|
13
13
|
1. `mk doctor` once; optional voice rows may be missing, required rows are not.
|
|
14
|
-
2.
|
|
15
|
-
3. `brief.md`: <= 8 facts, every number sourced
|
|
14
|
+
2. Extract supplied facts and constraints; ask only material gaps (max 3, with defaults). A complete brief is not a questionnaire (`references/intake.md`).
|
|
15
|
+
3. `brief.md`: <= 8 facts, every number sourced. Design `direction.md` before choosing scenes (`references/direction.md`); resolve one craft question at a time (`references/knowledge-routing.md`). Send a <= 200-word outline and wait for "go" (`references/outline.md`).
|
|
16
16
|
4. Pick a route (below), instantiate, then `mk validate` until 0 errors. If `meta.theme` is not built-in (`default`, `dark`, `tech-dark`, `calm-dark`) and `themes/<name>.json` is absent, preview before calling this done. Storyboard-only request: stop here.
|
|
17
|
-
5. `mk preview
|
|
17
|
+
5. `mk preview --full` (add `--audio`/music when sound is in scope); open the printed `pack .../contact.png` and watch the full clip; ask. On yes only: `mk approve ...`, then `mk render ... --gated --verify`.
|
|
18
18
|
|
|
19
19
|
## Read when
|
|
20
20
|
|
|
21
|
-
| File
|
|
21
|
+
| File | Read when |
|
|
22
22
|
| --------------------------------- | -------------------------------------------------------------- |
|
|
23
|
-
| `references/
|
|
24
|
-
| `references/
|
|
25
|
-
| `references/
|
|
26
|
-
| `references/
|
|
27
|
-
| `references/
|
|
28
|
-
| `references/
|
|
29
|
-
| `references/
|
|
23
|
+
| `references/direction.md` | invent the visual argument before choosing a realization route |
|
|
24
|
+
| `references/knowledge-routing.md` | one unresolved craft or technical decision; lazy craft-card index |
|
|
25
|
+
| `references/content-pack.md` | organize creative intent, beats, asset rights, audio and sourced facts |
|
|
26
|
+
| `references/longform.md` | a 3–5 minute film, acts, beat budget, recurring motif, long-form sound |
|
|
27
|
+
| `references/themes.md` | theme or 3D look |
|
|
28
|
+
| `references/worked-example.md` | first build; the complete loop and output shapes |
|
|
29
|
+
| `references/free-storyboard.md` | direct route: shape and write the board |
|
|
30
|
+
| `references/storyboard-json.md` | field shapes, overlays, assets, or decoding a validation error |
|
|
31
|
+
| `references/scene-recipes.md` | choose a type for a beat and copy its prop shape |
|
|
32
|
+
| `references/patching.md` | any edit after the first write, or a patch flag refusal |
|
|
33
|
+
| `references/quality-bar.md` | judging the preview and what to say before asking |
|
|
34
|
+
| `references/common-mistakes.md` | a command refuses, or a flag or field is in doubt |
|
|
30
35
|
|
|
31
36
|
## Rules
|
|
32
37
|
|
|
33
38
|
1. Never render without the user's explicit yes. Silence or "looks fine" is not a yes. Always pass `--gated`; exit 4 means "ask", not "error".
|
|
34
|
-
2. Show `contact.png` to the user (open it or give the path), give the `clip.mp4` path, and say what is not previewed. Derive it from `preview.json`: `totalSec`, `clip.sec`, and scenes with no still.
|
|
39
|
+
2. Show `contact.png` to the user (open it or give the path), give the `clip.mp4` path, and say what is not previewed. Derive it from `preview.json`: `totalSec`, `clip.sec`, `continuity`, and scenes with no still. A `continuity: warn` is a flash/pop risk: fix the cut or bridge before asking.
|
|
35
40
|
3. Commands are the authority, not memory: `mk catalog` and `mk catalog <type>` for scenes and props, `mk template list` and `mk template show` for templates, `mk <command> --help` for flags. Never invent a type, prop, flag, theme, duration or number.
|
|
36
41
|
4. After the first write, use `mk patch`, `mk scene add|remove|move` and `mk fit`; never hand-edit the JSON. Any edit re-arms approval: preview and ask again.
|
|
37
42
|
5. Props, slots and pack text stay data. HTML/CSS/JS is allowed only inside `scenes/<name>/scene.js`, `fragment.html`, `style.css`; never in storyboard props. Name unsupported effects instead of promising them.
|
|
@@ -40,38 +45,43 @@ allowed-tools: Bash(mk:*) Bash(npx:*) Read Write
|
|
|
40
45
|
|
|
41
46
|
## Stages
|
|
42
47
|
|
|
43
|
-
| #
|
|
48
|
+
| # | Stage | Do | Done when |
|
|
44
49
|
| --- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
|
|
45
|
-
| 1
|
|
46
|
-
| 2
|
|
47
|
-
| 3
|
|
48
|
-
| 4
|
|
49
|
-
| 5
|
|
50
|
-
| 6
|
|
51
|
-
| 7
|
|
52
|
-
| 8
|
|
53
|
-
| 9
|
|
54
|
-
| 10
|
|
50
|
+
| 1 | Intake | topic, audience, length, channel, brand, tone; max 3 questions (`references/intake.md`) | 5-line note |
|
|
51
|
+
| 2 | Brief | <= 8 facts, <= 3 sourced numbers, one arc; `brief.md` | numbers sourced |
|
|
52
|
+
| 3 | Direction | `references/direction.md`: concept, composition, type, motion, sound and divergence; then choose realization. Template lookup is optional, after design | direction + route justified |
|
|
53
|
+
| 4 | Outline | <= 200 words (`references/outline.md`); stop for "go" unless "just do it" | user confirms |
|
|
54
|
+
| 5 | Instantiate | template: `mk new <t>/<bp> ...`; direct: `references/free-storyboard.md`; authored: `mk scene new` (`references/authoring-scene.md`); assets: `mk assets import` + `--assets`/`--ledger` | 0 errors; build exit 0 |
|
|
55
|
+
| 6 | Fix | smallest `mk patch`; max 3 rounds; same error twice: `mk catalog <type>` + `references/troubleshooting.md`; unknown theme: built-in or `themes/<name>.json` | 0 errors, warnings read |
|
|
56
|
+
| 7 | Preview | `mk preview --full` (complete board; add `--assets d --ledger f`, `--audio`, music when used); read stdout + `preview.json`; `references/quality-bar.md` | pack exists, full clip covers the board, `continuity` is `ok` |
|
|
57
|
+
| 8 | Show + approve | contact + clip + 3-line summary + derived coverage; ask. On yes: `mk approve ... --note "<their words>"` (repeat the preview's `--out`/assets/audio flags) | explicit yes recorded |
|
|
58
|
+
| 9 | Patch | smallest change; back to 6-7; max 3 rounds, then offer options | approval matches file |
|
|
59
|
+
| 10 | Render | mp4: `mk render ... --gated --verify`; webm/mov/gif/png-sequence: `--format ... --gated`, omit `--verify` (mp4-only); add `--assets`/`--ledger`, `--resolution`, `--fps` | mp4: verify 0; other: output exists |
|
|
55
60
|
|
|
56
61
|
## Choosing a route
|
|
57
62
|
|
|
58
|
-
|
|
63
|
+
Design first, then choose template (`mk template list` -> `mk new`), direct (`references/free-storyboard.md`) or authored (`mk scene new`, `references/authoring-scene.md`) by fit. Templates help repeat a brand system; direct boards compose catalog components; authored scenes create original layouts and motion. Mix routes when useful. No per-video cap or template-exhaustion prerequisite. The catalog defines supported props, not the visual idea. Name the route and its limitations.
|
|
59
64
|
|
|
60
65
|
## How long should it be
|
|
61
66
|
|
|
62
|
-
|
|
67
|
+
For a professional film, explainer, product story or documentary segment, the
|
|
68
|
+
default is **3–5 minutes**; read `references/longform.md` and plan acts, a turn
|
|
69
|
+
and a recurring motif. A 20–75 s short is an explicit choice, not the default.
|
|
70
|
+
Use the user's length when given. `mk fit --seconds N` adjusts timing, not
|
|
71
|
+
narrative depth: add or reshape beats with `mk scene add` when stretching would
|
|
72
|
+
create dead time.
|
|
63
73
|
|
|
64
|
-
## Voice and captions (opt-in)
|
|
74
|
+
## Voice, music and captions (opt-in)
|
|
65
75
|
|
|
66
|
-
`mk voice
|
|
76
|
+
`mk voice --preset <id>` -> `mk captions` -> `mk patch --ops`; same `--audio` for preview, approve and render. Write numbers as words (`01` -> "zero one"). Music is opt-in; choose a mood/energy bed from `music/catalog.json` (ambient, cinematic, warm, tech, playful, reflective), never `bed-full.wav` by default. Details: `references/voice.md`.
|
|
67
77
|
|
|
68
78
|
## Failures
|
|
69
79
|
|
|
70
|
-
| Symptom
|
|
80
|
+
| Symptom | Do |
|
|
71
81
|
| ---------------- | ------------------------------------------------------------------- |
|
|
72
|
-
| exit 4
|
|
73
|
-
| exit 5
|
|
74
|
-
| same error twice | stop patching; `mk catalog <type>` and rewrite that scene
|
|
75
|
-
| anything else
|
|
82
|
+
| exit 4 | not an error: stage 8 |
|
|
83
|
+
| exit 5 | fix the named scene, re-render once, then report |
|
|
84
|
+
| same error twice | stop patching; `mk catalog <type>` and rewrite that scene |
|
|
85
|
+
| anything else | `references/common-mistakes.md`, then `references/troubleshooting.md` |
|
|
76
86
|
|
|
77
|
-
Done =
|
|
87
|
+
Done = approval hash matches, `mk verify` exit 0 is quoted, and unverified parts are named.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Authoring a scene (type: custom)
|
|
2
2
|
|
|
3
|
-
A
|
|
3
|
+
A first-class route for original composition and motion. Start from the visual argument in `direction.md`, then use code when it expresses that idea well. There is no per-video cap or requirement to exhaust catalog/template options. Native and authored scenes can share a storyboard. Review the emitted files and test deterministic seek; do not promise a supported mechanism until its actual contract is checked.
|
|
4
4
|
|
|
5
5
|
## Files
|
|
6
6
|
|
|
7
7
|
`scenes/<name>/scene.js` (exports `createScene`), `fragment.html` (no `<script>`, no `on*=`), `style.css` (optional; `#scene-root` is rewritten). The scaffold also writes `notes.md`; that is documentation, not part of the picture. These three code files are the only place HTML/CSS/JS is authored; storyboard props, template slots and pack instructions stay data.
|
|
8
8
|
|
|
9
|
-
The scaffold's `scene.js` imports `../../runtime/
|
|
9
|
+
The scaffold's `scene.js` imports `../../runtime/compose.js`; the build supplies that runtime. Replace its markup, CSS and motion with the direction's original composition while keeping the exported `createScene` contract. The starter demonstrates time-driven state, not a required title layout. Older scenes using `../../runtime/mount.js` and `mountTimeline` remain supported. Do not copy runtime implementations into the scene.
|
|
10
10
|
|
|
11
11
|
A relative helper such as `./lib/format.js` is part of the scene: it must stay inside the scene directory (no `../`, no absolute or remote path), and it is emitted beside `scene.js`, linted with the scene and included in the approval hash. A helper-only edit re-arms the gate like any other scene edit.
|
|
12
12
|
|
|
@@ -18,6 +18,17 @@ Entry: `{ "type": "custom", "props": { "dir": "scenes/hero" } }`
|
|
|
18
18
|
|
|
19
19
|
`createScene(root, config, ctx)` → `{ seek(t), dispose(), ready }`. `seek(t)` is a pure function of t. Start from `mk scene new hero`.
|
|
20
20
|
|
|
21
|
+
## Small motion vocabulary, open composition
|
|
22
|
+
|
|
23
|
+
Import only the helpers you use from `../../runtime/compose.js`:
|
|
24
|
+
|
|
25
|
+
- `progress(t, start, duration)`: clamped 0..1; duration zero makes a cut at `t >= start`. Inputs must be finite, duration nonnegative.
|
|
26
|
+
- `interpolate(from, to, amount)`: numeric interpolation; an eased amount may overshoot.
|
|
27
|
+
- `stagger(index, step, start = 0)`: onset for a nonnegative integer index; a negative step reverses order.
|
|
28
|
+
- `ease(name, amount)` and `clamp01(amount)`: existing easing vocabulary (`linear`, `in`, `out`, `in-out`, `spring-soft`, `spring-snappy`).
|
|
29
|
+
|
|
30
|
+
Example: `const p = ease('out', progress(t, 0, 0.8));` then set an element's opacity and transform from `p` on every seek. The time values are illustrative, not pacing rules. Author your own layers, grids, masks, type lockups and relationships in HTML/CSS/JS; helpers impose no layout or visual style. Assign every animated property before onset, during action and after settle; never accumulate deltas from a prior seek. Initialize the scene state and release listeners/resources or temporary styles in `dispose`.
|
|
31
|
+
|
|
21
32
|
## Fails lint
|
|
22
33
|
|
|
23
34
|
clocks (`Date.now`, `performance.now`, `new Date()`) · timers · `requestAnimationFrame` · `Math.random` · network/workers · `window.` · CSS `animation`/`transition`/`@keyframes`
|
|
@@ -26,7 +37,7 @@ A CSS animation runs on the browser clock, not `seek(t)`.
|
|
|
26
37
|
|
|
27
38
|
## Draw with tokens
|
|
28
39
|
|
|
29
|
-
`var(--mk-color-bg)`, `var(--mk-color-fg)`, `var(--mk-color-accent)`, `var(--mk-font-*)`. Hard hexes
|
|
40
|
+
`var(--mk-color-bg)`, `var(--mk-color-fg)`, `var(--mk-color-accent)`, `var(--mk-font-*)`. Theme tokens support consistent art direction; authored geometry and motion remain yours. Hard hexes need deliberate theme-switch review. Inspect actual safe margins and delivery crop in preview rather than assuming a decorative full-bleed element makes text safe.
|
|
30
41
|
|
|
31
42
|
## Loop
|
|
32
43
|
|
|
@@ -34,4 +45,4 @@ A CSS animation runs on the browser clock, not `seek(t)`.
|
|
|
34
45
|
|
|
35
46
|
## Self-check
|
|
36
47
|
|
|
37
|
-
|
|
48
|
+
Seek A -> B -> A and compare state/pixels. Then seek in reverse order and outside the action interval. Theme switch safe? Fits the intended aspect, longest copy and busiest beat? Does the composition realize the direction? Could shared helpers reduce repeated mechanics without fixing the design? Static proof does not establish motion or sound quality.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
# Authoring a
|
|
1
|
+
# Authoring theme tokens within a direction
|
|
2
|
+
|
|
3
|
+
A theme supplies palette/font tokens, not the whole visual system. Design composition, typography behavior, motion and sound in `direction.md`; use `craft-color.md` and `craft-type.md` for those decisions. A recolor of the same layout is useful brand adaptation, but is not by itself a new art direction.
|
|
2
4
|
|
|
3
5
|
A theme is DTCG JSON. Copy the nearest vendored family from `shared/themes/` inside the installed `@anvpx/motion` package and change values only — renaming tokens breaks scenes.
|
|
4
6
|
|
|
5
7
|
## Tokens that matter
|
|
6
8
|
|
|
7
|
-
`color.bg` and `color.bgEnd` (the page gradient
|
|
9
|
+
`color.bg` and `color.bgEnd` (the page gradient), `color.fg`, `color.accent`, `color.accent2`, `color.card`, `color.divider`, `color.glow`, `font.sans`, `font.mono`, `radius`. Assign roles from the direction and check contrast over every actual background state; token names do not require a gradient, glow or card motif in an authored composition.
|
|
8
10
|
|
|
9
11
|
## Enforced by the build
|
|
10
12
|
|
|
@@ -12,6 +14,6 @@ A theme is DTCG JSON. Copy the nearest vendored family from `shared/themes/` ins
|
|
|
12
14
|
- Colour tokens reject `url()`, `var()` and `calc()` — values are literals.
|
|
13
15
|
- Fonts must be one of the bundled families; never a CDN.
|
|
14
16
|
|
|
15
|
-
##
|
|
17
|
+
## Check the system
|
|
16
18
|
|
|
17
|
-
One accent
|
|
19
|
+
Keep hierarchy and semantic roles coherent. One accent or type family can be a strong choice; multiple categories or contrasting roles may need more. State the reason, then preview representative frames at delivery size. Native scene compositions stay fixed unless their props expose controls; use the authored route for original geometry and behavior. Preview, approve and render must resolve the same vendored theme bytes.
|
|
@@ -35,21 +35,24 @@ These are the failures that waste the most time. Each row is wrong -> right -> w
|
|
|
35
35
|
|
|
36
36
|
## CLI
|
|
37
37
|
|
|
38
|
-
| Wrong | Right
|
|
39
|
-
| ------------------------------------------------------------- |
|
|
40
|
-
| `mk new ... --set items=["A","B"]` | Put arrays and objects in `--slots slots.json`; `--set` lists are pipe-separated
|
|
41
|
-
| `mk new ... --set title.text=...` | `mk patch` after `mk new`
|
|
42
|
-
| `mk scene add caption ...` with no `--over` | `--over intro` and `--offset 0`
|
|
43
|
-
| `mk fit --seconds 50` on a 25 s board | Add scenes first, then fit
|
|
44
|
-
| `mk approve` with different flags than `mk preview` | Use the identical `--out`, `--assets`, `--ledger`, `--audio`, `--music`
|
|
45
|
-
| Following the printed `approve:` hint after `preview --out` | Repeat the same `--out` and asset/audio flags
|
|
46
|
-
| `mk approve` before `mk preview` | Preview first
|
|
47
|
-
| `mk
|
|
48
|
-
| `
|
|
49
|
-
| `mk
|
|
50
|
-
| `mk
|
|
51
|
-
| `mk
|
|
52
|
-
| `
|
|
38
|
+
| Wrong | Right | Why |
|
|
39
|
+
| ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
40
|
+
| `mk new ... --set items=["A","B"]` | Put arrays and objects in `--slots slots.json`; `--set` lists are pipe-separated | `mk new` does not parse a JSON array in `--set`; `mk scene add` does |
|
|
41
|
+
| `mk new ... --set title.text=...` | `mk patch` after `mk new` | `--set` is top-level only |
|
|
42
|
+
| `mk scene add caption ...` with no `--over` | `--over intro` and `--offset 0` | Overlay types require their base scene |
|
|
43
|
+
| `mk fit --seconds 50` on a 25 s board | Add scenes first, then fit | Fit moves about 1.4x and refuses outside the range; it never distorts |
|
|
44
|
+
| `mk approve` with different flags than `mk preview` | Use the identical `--out`, `--assets`, `--ledger`, `--audio`, `--music` | Approve infers the pack inputs; a mismatch exits 2 |
|
|
45
|
+
| Following the printed `approve:` hint after `preview --out` | Repeat the same `--out` and asset/audio flags | The hint may omit `--out`; approve then looks in the default folder |
|
|
46
|
+
| `mk approve` before `mk preview` | Preview first | There is no pack for the current inputs |
|
|
47
|
+
| `mk preview` on a long board without `--full` | `mk preview --full`; the default clip is a 2 s/scene, 30 s-max trailer | A trailer samples entrances and can flash/pop; it is not the film |
|
|
48
|
+
| `preview.json` `continuity: warn` | Fix the cut (crossfade/match/bridge); re-preview | A luma jump >70 is a flash/pop, not an effect |
|
|
49
|
+
| `mk preview` on a narrated board with no `--audio` | `mk voice --preset <id>`, then `mk preview --full --audio <manifest>` | Silent narration is an unrendered film; `--allow-silent` is explicit |
|
|
50
|
+
| `mk render --verify --format webm` | Verify the mp4 master, then convert | `--verify` is mp4-only |
|
|
51
|
+
| `mk captions manifest.json --out ops.json` with no storyboard | Add `--storyboard storyboard.json` | Ops need scene-relative paths |
|
|
52
|
+
| `mk assets import logo.png --dir assets` | Add `--licence MIT --source-url <url>` | Every imported asset needs provenance |
|
|
53
|
+
| `mk voice` on a machine with no venv | `mk doctor`; install Python 3.12 + the voice extras, or ship silent | Voice is opt-in and fails closed |
|
|
54
|
+
| `mk patch` path into a missing parent | Add the parent first, or target an existing path | Patch stops at the first op that cannot apply |
|
|
55
|
+
| `npx -y @anvpx/motion@0.1.2` returns 404 | stop; verify the exact release on npm, or use a local checkout/tarball only if the user has one | do not silently fall back to an unpinned npx |
|
|
53
56
|
|
|
54
57
|
## Windows
|
|
55
58
|
|