@bitmagic/cli 0.1.65-dev.1 → 0.1.65-dev.10

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.
@@ -11,7 +11,17 @@
11
11
  * `project-files.test.ts` enforces the frontmatter (name == directory) and that AGENTS.md names
12
12
  * every shipped skill. The same template-literal rule applies: the markdown is full of backticks,
13
13
  * so every one inside is escaped as \` and the test checks the rendered output.
14
+ *
15
+ * One renderer here breaks the template-literal rule on purpose: `renderTrailerCraftReference`
16
+ * reads `assets/skills/trailer-craft.md`, because that file is the SOURCE OF TRUTH for trailer
17
+ * craft in two places at once — the skill scaffolded into a creator's project, and the monorepo's
18
+ * own `make-trailer` skill, which symlinks to the same file. Craft is the half of trailer guidance
19
+ * that is not about commands, so both readers need all of it and neither owns it; a second copy
20
+ * would drift the moment either was edited, and the drift is silent (both files still look like
21
+ * guidance). A shipped asset is the only shape that lets a symlink do the sharing.
14
22
  */
23
+ import fs from 'node:fs';
24
+ import { fileURLToPath } from 'node:url';
15
25
  import { describeSkillsDir } from './agent-targets.js';
16
26
  /**
17
27
  * `.kiro/steering/bitmagic.md` — Kiro's startup instructions, and the only per-agent extra file
@@ -105,11 +115,14 @@ in \`AGENTS.md\` — both are left alone.
105
115
  * `<skills dir>/making-a-trailer/SKILL.md` — the whole trailer flow, and the craft that makes a
106
116
  * cut watchable.
107
117
  *
108
- * Two kinds of knowledge live here on purpose. The FLOW (record → make → look → publish) is plain
109
- * command routing an agent could read off \`--help\`. The CRAFT — ordering, pacing, the five variety
110
- * axes, the selection rules the repo's own trailer reviews paid for — is not derivable from any
111
- * command, and without it the agent's "tuning" is random. The tuning table at the end is the part
112
- * the creator actually experiences: a prompt in, a shots.json edit out, one command to see it.
118
+ * Two kinds of knowledge live here on purpose, and they are split across two files. The FLOW
119
+ * (record → make → look → publish) is plain command routing an agent could read off \`--help\`,
120
+ * and it is what SKILL.md carries. The CRAFT — ordering, pacing, the five variety axes, the
121
+ * selection rules earlier trailer reviews paid for — is not derivable from any command, and
122
+ * without it the agent's "tuning" is random; it lives in \`references/trailer-craft.md\`
123
+ * (\`renderTrailerCraftReference\`) because it is longer than the flow and read once per trailer
124
+ * rather than once per command. The tuning table at the end is the part the creator actually
125
+ * experiences: a prompt in, a shots.json edit out, one command to see it.
113
126
  */
114
127
  export function renderTrailerSkill() {
115
128
  return `---
@@ -128,19 +141,43 @@ and running one command again.
128
141
 
129
142
  1. **Have \`bitmagic dev\` running** (it is the sink the recorder streams frames to, and the HUD
130
143
  replay for \`--ui\`). ffmpeg and Google Chrome must be installed; the commands say so if not.
131
- 2. **Record.** \`bitmagic trailer record --seconds 60\` opens Chrome on the dev view, waits for the
132
- creator to press Play, starts the recorder for them, stops after 60 s (or when they press F9),
133
- and prints the recording directory. Ask the creator to PLAY WELL — the trailer is only as good
134
- as the footage: overtakes, jumps, kills, close calls, a finish. \`--seconds\` is wall-clock; the
135
- recording counts FRAMES at 60 fps, and the game runs as fast as the machine encodes them — on a
136
- machine capturing at 30 fps, 60 s of play becomes 30 s of footage (the command reports both).
137
- After stop the frames are extracted from the capture; the command waits for that. Aim for
138
- footage of about 3x the trailer length: a 30 s trailer wants
139
- 90 s of footage, so \`--seconds 120\` or two sittings. Two sittings?
140
- \`bitmagic trailer merge <dirA> <dirB> --out <dir>\`.
141
- No human available: author \`trailer/flythrough.json\` (below) and
142
- \`bitmagic trailer record --flythrough trailer/flythrough.json\` records a camera path with
143
- nobody playing — scenery trailers, world reveals.
144
+ 2. **Record — played footage, a fly-through, or both.** Decide this BEFORE you ask anyone to play:
145
+
146
+ \`\`\`
147
+ bitmagic trailer record --seconds 60 # they play
148
+ bitmagic trailer record --flythrough trailer/flythrough.json # nobody plays
149
+ \`\`\`
150
+
151
+ **Played footage** is the bulk of any trailer — it is the only thing that shows what the game
152
+ does. \`record\` opens Chrome on the dev view, waits for the creator to press Play, starts the
153
+ recorder for them, stops after 60 s (or when they press F9), and prints the recording directory.
154
+ Ask them to PLAY WELL — the trailer is only as good as the footage: overtakes, jumps, kills,
155
+ close calls, a finish. \`--seconds\` is wall-clock; the recording counts FRAMES at 60 fps, and the
156
+ game runs as fast as the machine encodes them — on a machine capturing at 30 fps, 60 s of play
157
+ becomes 30 s of footage (the command reports both). After stop the frames are extracted from the
158
+ capture; the command waits for that. Aim for about 3x the trailer length: a 30 s trailer wants
159
+ 90 s of footage, so \`--seconds 120\` or two sittings.
160
+
161
+ **A fly-through needs nobody.** \`--flythrough\` clicks through the menu and Play itself, then
162
+ glides the camera along an authored path WHILE THE GAME RUNS — traffic drives, animations play,
163
+ physics ticks — and stops at the last marker. It is the whole trailer flow with no human in it,
164
+ so reach for it when the creator is not around, when you are working on your own, or when they
165
+ would rather not be filmed playing badly.
166
+
167
+ **Offer it even when there IS gameplay.** A chase camera almost never gives you the two shots
168
+ the craft doc asks for by name — a composed cold open and one calm wide breath before the end —
169
+ and a fly-through costs the creator nothing. Record a short one as well and join the two:
170
+
171
+ \`\`\`
172
+ bitmagic trailer merge <gameplay-dir> <flythrough-dir> --out <dir>
173
+ \`\`\`
174
+
175
+ \`merge\` is how two sittings become one cuttable recording, and it does not care how the
176
+ footage was made — only that the runs share a resolution and post-processing state. So the cut
177
+ can pull an establishing shot from the fly-through and everything else from play.
178
+ Tell the creator the offer in one line ("I can also fly a camera through the level for the
179
+ opening shot — you don't have to do anything"), and write the path yourself from the level you
180
+ built: \`world.json\` has the coordinates.
144
181
  3. **Make.** \`bitmagic trailer make --music-prompt "<style that fits the game>" --title "<name>"\`
145
182
  analyzes the recording, generates a music bed (sparks — say so to the creator; \`--music <file>\`
146
183
  uses their own track, \`--no-music\` skips it), writes a first cut to \`trailer/shots.json\`,
@@ -163,7 +200,7 @@ cut before delivering.
163
200
  | File | What it is |
164
201
  |---|---|
165
202
  | \`trailer/shots.json\` | **The cut.** Committed. Your edits live here; \`make\` re-cuts from it every run. |
166
- | \`trailer/flythrough.json\` | Optional camera path for a no-human recording. |
203
+ | \`trailer/flythrough.json\` | A camera path you author. Committed. Records with nobody playing — the whole trailer, or just the opening shot. |
167
204
  | \`.bitmagic/trailer/recordings/<name>/\` | A recording: \`<name>_%06d.png\` at 60 fps + \`timeline.json\` (events, sounds, HUD). |
168
205
  | \`.bitmagic/trailer/<name>/analysis.json\` | Scored highlight windows: \`startFrame\`, \`endFrame\`, \`score\`, event digests (\`"f3121 explosion i0.9"\`), \`sheet\`. |
169
206
  | \`.bitmagic/trailer/<name>/sheets/\` | Contact sheets, one per window — read these. |
@@ -200,46 +237,26 @@ seconds or \`"last-clip"\` for the end card. \`bitmagic trailer cut\` turns this
200
237
 
201
238
  Positions are world units (\`engine/agent-docs/coordinate-system.md\`); \`timestamp\` is seconds,
202
239
  ascending from 0; \`lookAt\` (or an Euler \`rotation\`) per marker. The camera glides through the
203
- markers and the recording stops at the last one.
204
-
205
- ## Craft — read before touching the cut
206
-
207
- **Order: Genre → Hook → Anchors → Content.** The first 1–2 shots must say what kind of game this
208
- is. The hook — the thing only this game has — lands inside the first third. The middle holds the
209
- anchors people expect from the genre; breadth (levels, modes) comes last.
210
-
211
- **Skeleton first, footage last.** Cold open → introduction → escalation → climax → one breath →
212
- end card. Reserve the end card (2–3 s, one card) before anything else, then find the ONE clip
213
- that proves each beat — not "fifteen great clips", which drifts toward sameness.
214
-
215
- **Pacing.** Shots run 1.5–3 s for arcade action, with a few longer holds where one continuous
216
- action is the payoff. Vary lengths (2, 3, 4, 6 beats); do not cut on every beat — let a musical
217
- hit land on an in-clip impact sometimes. Build to a peak, then a calmer wider shot, then build
218
- again. 30–45 s total. More cutting is not better editing: if one take shows the whole stunt,
219
- keep the take.
220
-
221
- **Variety, five axes** — audit the labels in shots.json top to bottom, repetition shows in text
222
- before you ever re-watch: content (different actions, escalate rather than repeat), composition
223
- (camera distance and framing), energy (intense vs quiet), pacing (section tempo), shot length.
224
- **Rule of three**: never more than three similar things in a row, and max three of any shot
225
- type in the whole cut.
226
-
227
- **Text.** End card only, unless the footage cannot say it. ≤ 6 words, evocative verbs, sounds
228
- like this game and no other. Banned: quantities ("5 unique levels"), genre stacks, verb lists
229
- ("Race! Drift! Win!"), stock phrases ("Get ready…", "…like never before"). Cards get their own
230
- beat — never over action.
231
-
232
- ## Selection rules this project already paid for
233
-
234
- - **Never slow motion.** On gameplay footage it reads as a low framerate. \`speed\` is 1.0.
235
- - **Numbers are not interest.** A high \`impactSpeed\` is often a car dead against a wall — the
236
- worst clip. A crash earns its slot only if things visibly break and motion continues.
237
- - **Low speed can BE the drama.** Wheelspin recoveries, plowing back onto the track, being
238
- overtaken while struggling — often the best clips, and they score near zero.
239
- - **"Some shots of X" means a few.** One standing start is an opener; five is a broken trailer.
240
- - **Menu and selection screens need \`"ui": false\`** — the HUD replay paints the race HUD over them.
241
- - **Verify on pixels.** Sheets and stills, every candidate. Then render — iterating is minutes and
242
- revisions are kept, so render rather than debate.
240
+ markers and the recording stops at the last one (600 s is the ceiling).
241
+
242
+ You write this file — take the coordinates from the level you built, in \`world.json\`. Aim the
243
+ first marker at whatever makes the game recognisable, keep the camera moving slowly and in one
244
+ direction per leg (a drifting push or a slow arc reads as deliberate; a whip-pan reads as a
245
+ mistake), and give each leg several seconds. Six markers over 20 s is plenty for the two or three
246
+ shots a cut will actually use — you are recording candidate footage, not the trailer.
247
+
248
+ ## Craft — read \`references/trailer-craft.md\` before touching the cut
249
+
250
+ Everything about WHICH moments and in what order lives in
251
+ \`references/trailer-craft.md\`, next to this file: the Genre → Hook → Anchors → Content ordering,
252
+ laying the timeline out as a skeleton before hunting footage, pacing and shot length, the five
253
+ variety axes, the rules for on-screen text, a section-by-section structure template, and the
254
+ selection rules earlier trailers already paid for (never slow motion; a high \`impactSpeed\` is
255
+ usually a car dead against a wall; low speed can BE the drama; menus need \`"ui": false\`).
256
+
257
+ Read it in full the first time you cut a trailer for this game. The tool finds candidate windows
258
+ and snaps cuts to the beat — it has no opinion about any of the above, so without that file your
259
+ "tuning" is random.
243
260
 
244
261
  ## Tuning from prompts
245
262
 
@@ -254,6 +271,8 @@ The creator talks; you edit \`trailer/shots.json\`, run \`bitmagic trailer make\
254
271
  | "show the menu / the map / the start" | add ONE shot from the recording's opening with \`"ui": false\` |
255
272
  | "put the title at the end" / "change the tagline" | \`titles: [{ "at": "last-clip", "text": "…", "sub": "…", "style": "card" }]\` |
256
273
  | "add a title at the start" | a \`title\`-style cue at \`at: 0\` for ~2.5 s, and make the first shot calm enough to read over |
274
+ | "show more of the world / the level", "a wider shot", "an establishing shot" | record a fly-through, \`merge\` it with the gameplay recording, and take the cold open (and the breath) from it |
275
+ | "I can't play right now", "you do it", nobody available | \`record --flythrough\` — it clicks Play itself and needs no one |
257
276
  | "different music", "more epic / chill" | \`--music-prompt\` with the new direction (spends sparks), or \`--music <file>\`; shots keep their beat counts and re-snap |
258
277
  | "no HUD" / "show the HUD" | drop or add \`--ui\` (per shot: \`"ui": false\`) |
259
278
  | "the HUD stutters" / "smoother HUD" | raise \`--ui-keyframe-rate\` on \`make\` or \`render\` (default 30/s; 0 = every change) |
@@ -265,6 +284,25 @@ Then: **quota check** the labels (rule of three, one standing start), render, ex
265
284
  from the changed region, compare with the previous \`-rN\`, deliver the URL.
266
285
  `;
267
286
  }
287
+ /**
288
+ * `<skills dir>/making-a-trailer/references/trailer-craft.md` — the only shipped skill file that is
289
+ * read from disk rather than written as a template literal.
290
+ *
291
+ * It is a shipped asset (`assets/skills/`, listed in package.json's `files`) because two skills
292
+ * need the same bytes: this one, and the monorepo's own `.claude/skills/make-trailer/`, whose copy
293
+ * is a SYMLINK to the asset. Trailer craft is editing knowledge — it says nothing about the CLI, so
294
+ * neither reader owns it and neither can be given an abridgement without going stale against the
295
+ * other. The same reasoning as the repo's `.agents/skills -> ../.claude/skills` link: a link is not
296
+ * a copy, so there is nothing to keep in step and no check to forget to run.
297
+ *
298
+ * Resolved from this module's own location the way `defaultTitleFont` resolves the bundled font:
299
+ * `../../assets/` is the same hop from `src/scaffold/` and from `dist/scaffold/`, so it works run
300
+ * from source and from an installed package alike.
301
+ */
302
+ export function renderTrailerCraftReference() {
303
+ const source = fileURLToPath(new URL('../../assets/skills/trailer-craft.md', import.meta.url));
304
+ return fs.readFileSync(source, 'utf-8');
305
+ }
268
306
  /**
269
307
  * `<skills dir>/publishing-a-game/SKILL.md` — the whole ship-it path, and every way it refuses.
270
308
  *
@@ -1 +1 @@
1
- {"version":3,"file":"skill-files.js","sourceRoot":"","sources":["../../src/scaffold/skill-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;CAkBR,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAE,SAAS,EAAsB;IAC7E,2FAA2F;IAC3F,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;IAC7F,6FAA6F;IAC7F,0EAA0E;IAC1E,MAAM,WAAW,GACf,QAAQ,CAAC,MAAM,KAAK,CAAC;QACnB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,8FAA8F;YAC9F,mEAAmE;YACnE,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5C,iFAAiF,CAAC;IAExF,OAAO;;sBAEa,SAAS,SAAS,iBAAiB,CAAC,SAAS,CAAC;;;EAGlE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BZ,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,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F,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,+BAA+B;IAC7C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkER,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitmagic/cli",
3
- "version": "0.1.65-dev.1",
3
+ "version": "0.1.65-dev.10",
4
4
  "description": "Build Bitmagic games from your own agent tool",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Bitmagic Oy",
@@ -25,9 +25,9 @@
25
25
  "playwright-core": "^1.59.1",
26
26
  "tar": "^7.4.3",
27
27
  "ws": "^8.21.3",
28
- "@bitmagic/animation-forger": "0.1.20-dev.1",
29
- "@bitmagic/asset-core": "0.2.20-dev.1",
30
- "@bitmagic/world-forger": "0.1.25-dev.1"
28
+ "@bitmagic/animation-forger": "0.1.20-dev.10",
29
+ "@bitmagic/asset-core": "0.2.20-dev.10",
30
+ "@bitmagic/world-forger": "0.1.25-dev.10"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@eslint/js": "^9.38.0",