@milenyumai/film-kit 2.2.0 → 2.3.0

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.
Files changed (55) hide show
  1. package/README.md +68 -17
  2. package/build/index.d.ts +1 -1
  3. package/build/lib/cli.js +2 -2
  4. package/build/lib/film-kit.js +6 -4
  5. package/build/lib/storyboard-reference/adapters/kling30.js +3 -1
  6. package/build/lib/storyboard-reference/adapters/seedance20.d.ts +4 -0
  7. package/build/lib/storyboard-reference/adapters/seedance20.js +72 -13
  8. package/build/lib/storyboard-reference/adapters/veo31.js +3 -1
  9. package/build/lib/storyboard-reference/index.d.ts +1 -1
  10. package/build/lib/storyboard-reference/output-writer.js +84 -6
  11. package/build/lib/storyboard-reference/prompt-bundle-builder.js +295 -8
  12. package/build/lib/storyboard-reference/request-normalizer.js +8 -4
  13. package/build/lib/storyboard-reference/storyboard-interpreter.d.ts +3 -1
  14. package/build/lib/storyboard-reference/storyboard-interpreter.js +21 -1
  15. package/build/lib/storyboard-reference/types.d.ts +151 -2
  16. package/build/lib/storyboard-reference/validators.js +2 -5
  17. package/build/lib/templates.js +10 -6
  18. package/content/ARCHITECTURE.md +4 -4
  19. package/content/MASTER.md +2 -2
  20. package/content/RULES.md +4 -4
  21. package/content/agents/prompt-engineer.md +7 -7
  22. package/content/skills/prompt-structure/SKILL.md +14 -11
  23. package/content/skills/reference-locking/SKILL.md +6 -4
  24. package/content/skills/semantic-consistency/SKILL.md +1 -1
  25. package/content/skills/storyboard-reference/SKILL.md +54 -13
  26. package/content/workflows/generate-storyboard.md +37 -16
  27. package/content/workflows/generate.md +7 -7
  28. package/content/workflows/safety-check.md +2 -2
  29. package/package.json +1 -1
  30. package/packages/gpt-image-smart/content/skills/storyboard-reference/SKILL.md +104 -12
  31. package/packages/gpt-image-smart/content/workflows/generate-storyboard.md +89 -12
  32. package/packages/hybrid/content/skills/storyboard-reference/SKILL.md +104 -12
  33. package/packages/hybrid/content/workflows/generate-storyboard.md +89 -12
  34. package/packages/hybrid-smart/content/skills/storyboard-reference/SKILL.md +104 -12
  35. package/packages/hybrid-smart/content/workflows/generate-storyboard.md +89 -12
  36. package/packages/multi/build/cli.js +39 -0
  37. package/packages/multi/build/index.d.ts +1 -1
  38. package/packages/multi/build/lib/configure.js +208 -1
  39. package/packages/multi/build/lib/defaults.d.ts +3 -1
  40. package/packages/multi/build/lib/defaults.js +32 -0
  41. package/packages/multi/build/lib/templates.js +146 -60
  42. package/packages/multi/build/lib/types.d.ts +16 -0
  43. package/packages/multi/content/agents/continuity-editor.md +6 -6
  44. package/packages/multi/content/agents/delivery-editor.md +2 -2
  45. package/packages/multi/content/agents/lead-director.md +18 -10
  46. package/packages/multi/content/agents/semantic-auditor.md +4 -5
  47. package/packages/multi/content/agents/shot-generator.md +9 -27
  48. package/packages/multi/content/skills/storyboard-reference/SKILL.md +104 -12
  49. package/packages/multi/content/workflows/chain-multi.md +4 -4
  50. package/packages/multi/content/workflows/generate-multi.md +6 -6
  51. package/packages/multi/content/workflows/generate-storyboard.md +89 -12
  52. package/packages/multi/content/workflows/generate-teammate.md +8 -14
  53. package/packages/multi/content/workflows/safety-check-multi.md +7 -11
  54. package/packages/studio/content/skills/storyboard-reference/SKILL.md +104 -12
  55. package/packages/studio/content/workflows/generate-storyboard.md +89 -12
@@ -8,7 +8,24 @@ function getModelDisplayName(model) {
8
8
  function getKlingPresetDisplay(model, klingPreset) {
9
9
  return model === "kling-3.0" ? klingPreset : "n/a (Kling-only)";
10
10
  }
11
- function buildSeedanceProfile(active) {
11
+ function isSeedanceStoryboardReference(config) {
12
+ return config.model === "seedance-2.0"
13
+ && config.referenceMode === "storyboard-reference"
14
+ && config.storyboardReferenceMode.enabled;
15
+ }
16
+ function buildReferenceModeSummary(config) {
17
+ if (!isSeedanceStoryboardReference(config)) {
18
+ return `- Reference mode: \`${config.referenceMode}\`
19
+ - Start/end frame chaining contract: active`;
20
+ }
21
+ return `- Reference mode: \`storyboard-reference\`
22
+ - Storyboard reference mode: enabled
23
+ - Max storyboard phases per shot: ${config.storyboardReferenceMode.maxStoryboardPhases}
24
+ - Recommended phase budget: 4-6s = 1-2, 7-10s = 2-3, 11-15s = 3-4; split 5+ phases
25
+ - Provider reference tokens: generated character sheet tokens first, generated shot storyboard token next
26
+ - Start/end frame chaining contract: disabled for Seedance storyboard-reference`;
27
+ }
28
+ function buildSeedanceProfile(active, storyboardReferenceActive, maxStoryboardPhases) {
12
29
  return `## Seedance 2.0 Rules${active ? " (ACTIVE)" : " (Reference)"}
13
30
 
14
31
  ### Capability Mindset
@@ -17,12 +34,13 @@ Seedance 2.0 responds best when you assign **explicit multimodal control roles**
17
34
  - videos lock motion grammar, body action, or vocal tone
18
35
  - audio references guide music or ambience behavior
19
36
  - text explains only the evolution and interaction between those materials
37
+ - provider image tokens use \`@Image1\`, \`@Image2\`, ...; legacy lowercase \`@image1\`, \`@image2\`, ... remain accepted aliases in Film-Kit text
20
38
 
21
39
  ### Core Prompt Grammar
22
- - Name the role of each asset directly with \`@image1\`, \`@video1\`, and \`@audio1\`
40
+ - Name the role of each asset directly with \`@Image1\`, \`@video1\`, and \`@audio1\`
23
41
  - For long clips, use timeline segmentation: \`0-3s: ... / 3-6s: ... / 6-10s: ...\`
24
42
  - Replace abstract emotion labels with visible acting cues: eyes, breath, shoulders, hands, mouth
25
- - If the clip must stay unbroken, close with: \`No scene cuts throughout, one continuous shot.\`
43
+ - If the clip must stay unbroken, close with: \`No scene cuts throughout, one continuous shot.\`; do not apply this to planned storyboard phase transitions
26
44
  - For extensions, specify only the newly generated seconds and begin from the exact last-frame state
27
45
 
28
46
  ### Reference Binding Strategy
@@ -37,6 +55,14 @@ Seedance 2.0 responds best when you assign **explicit multimodal control roles**
37
55
  - Use continuous-shot language for location traversals instead of hidden cut logic
38
56
  - Escalate speed and intensity explicitly; do not compress several beats into one vague sentence
39
57
  - For complex clips, prefer timeline segments over overloaded paragraphs
58
+ ${storyboardReferenceActive
59
+ ? `- Storyboard-reference mode is active: generate one 16:9 GPT Image 2 character sheet prompt per character first; those sheet images lock identity/wardrobe/props
60
+ - Each SHOTNN.md includes a GPT IMAGE 2 STORYBOARD PROMPT plus a per-shot STORYBOARD PLAN; the generated storyboard token controls only composition, blocking, camera direction, timing, and action progression
61
+ - Duration budget: 4-6s = 1-2 phases, 7-10s = 2-3 phases, 11-15s = 3-4 phases; split 5+ phases into separate SHOTNN.md files
62
+ - Storyboard text, panel borders, watermark, logo, and alternate character design are never identity sources
63
+ - Do not require ILK FRAME / SON FRAME sections or exact first-frame reuse text in Seedance storyboard-reference mode
64
+ - Use "No scene cuts throughout, one continuous shot." only when the shot's storyboard plan is actually one uninterrupted camera move`
65
+ : ""}
40
66
 
41
67
  ### Video Extension Rules
42
68
  - Use extension syntax like \`Extend @video1 by 5s\`
@@ -51,7 +77,7 @@ Seedance 2.0 responds best when you assign **explicit multimodal control roles**
51
77
 
52
78
  ### Failure Recovery
53
79
  - Camera motion mismatch: say \`completely reference all camera movement effects from @video1\`
54
- - Character drift: say \`maintain character appearance exactly consistent with @image1\` and add more angles
80
+ - Character drift: say \`maintain character appearance exactly consistent with @Image1\` and add more angles
55
81
  - Extension seam feels off: describe the original last frame before the new action begins
56
82
  - Flat acting: replace general mood words with visible facial/body behavior
57
83
 
@@ -68,7 +94,7 @@ Seedance 2.0 responds best when you assign **explicit multimodal control roles**
68
94
 
69
95
  **Template A — Multimodal Continuous Shot**
70
96
  \`\`\`
71
- Use @image1 as the first frame. Reference camera movement from @video1 and atmosphere from @audio1.
97
+ Use @Image1 as the first frame. Reference camera movement from @video1 and atmosphere from @audio1.
72
98
  One continuous tracking shot from location A through location B into location C.
73
99
  0-3s: establish subject, scale, and path.
74
100
  3-6s: introduce one major action or environmental shift.
@@ -78,7 +104,7 @@ No scene cuts throughout, one continuous shot.
78
104
 
79
105
  **Template B — Performance Beat**
80
106
  \`\`\`
81
- Maintain character appearance exactly consistent with @image1.
107
+ Maintain character appearance exactly consistent with @Image1.
82
108
  0-2s: eyes shift, breath shortens, fingers tighten around the prop.
83
109
  2-4s: camera pushes closer as the line is delivered in a restrained voice.
84
110
  4-6s: expression softens, shoulders lower, and the scene returns to calm.
@@ -121,7 +147,7 @@ const MULTI_CODEX_AGENTS = [
121
147
  ["dialogue-auditor", "dialogue_auditor", "Audit dialogue tone, voiceCast binding, SFX accuracy, and audio direction completeness."],
122
148
  ["character-consistency-auditor", "character_consistency_auditor", "Audit character description consistency and anonymous identity stability."],
123
149
  ["color-continuity-auditor", "color_continuity_auditor", "Audit lighting direction and color temperature consistency across same-scene shots."],
124
- ["semantic-auditor", "semantic_auditor", "Audit visual_world, perspective, shadows, scale, reflections, physics, anatomy, context, and chained ILK reuse."],
150
+ ["semantic-auditor", "semantic_auditor", "Audit visual_world, perspective, shadows, scale, reflections, physics, anatomy, context, and continuity contracts."],
125
151
  ["pacing-auditor", "pacing_auditor", "Audit shot sequence rhythm, tempo variety, and dramatic arc alignment."],
126
152
  ["delivery-editor", "delivery_editor", "Audit final package completeness, report dependencies, and delivery readiness."]
127
153
  ];
@@ -136,10 +162,12 @@ ${leadDirectorNote}
136
162
  Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
137
163
  For worktree runs, if node_modules or build outputs are missing and package.json exists, bootstrap with npm install and npm run build before package commands.`);
138
164
  }
139
- function buildCodexImageSkill(workflowFile, outputDir) {
165
+ function buildCodexImageSkill(workflowFile, config) {
166
+ const outputDir = config.outputDir;
167
+ const storyboardReferenceActive = isSeedanceStoryboardReference(config);
140
168
  return `---
141
169
  name: film-kit-codex-images
142
- description: Optional Codex-native still image phase for Film-Kit Multi. Use after successful prompt generation when the user wants to create or iteratively edit accepted ILK FRAME and SON FRAME images inside Codex. Never auto-start; offer it only after all required reports pass and the user confirms.
170
+ description: Optional Codex-native still image phase for Film-Kit Multi. Use after successful prompt generation when the user wants ${storyboardReferenceActive ? "optional character sheet or generated storyboard still prep" : "to create or iteratively edit accepted ILK FRAME and SON FRAME images"} inside Codex. Never auto-start; offer it only after all required reports pass and the user confirms.
143
171
  ---
144
172
 
145
173
  # Film-Kit Codex Images
@@ -162,20 +190,27 @@ This skill is for **Codex only**. It adds a still-image phase after Film-Kit pro
162
190
  ## Core Behavior
163
191
  - Use Codex's built-in image generation/editing flow.
164
192
  - If a local image file must be edited, first bring it into the conversation context, then edit it.
165
- - Generate \`ILK FRAME\` from the accepted shot prompt plus references.
193
+ ${storyboardReferenceActive
194
+ ? `- Storyboard-reference mode does not require \`ILK FRAME\` / \`SON FRAME\` assets.
195
+ - If the user asks for still prep, create or edit character sheet images and generated shot storyboard images from the accepted GPT Image 2 prompts while preserving the shot \`STORYBOARD PLAN\`.
196
+ - Keep generated still metadata under \`${outputDir}/codex-images/manifest.json\` and do not convert storyboard-reference shots back into start/end frame chaining.`
197
+ : `- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
166
198
  - Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
167
- - For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.
199
+ - For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.`}
168
200
  - After every image, ask the user to accept it or request a targeted edit.
169
201
 
170
202
  ## Output Contract
171
203
  - Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
172
- - Canonical files: \`ilk-frame.png\`, \`son-frame.png\`
173
- - Iterations use sibling versioned filenames such as \`ilk-frame-v2.png\` and \`son-frame-v3.png\`
204
+ ${storyboardReferenceActive
205
+ ? "- Canonical files are optional role-specific references such as `character-sheet.png` and `shot-storyboard.png` when requested"
206
+ : "- Canonical files: `ilk-frame.png`, `son-frame.png`\n- Iterations use sibling versioned filenames such as `ilk-frame-v2.png` and `son-frame-v3.png`"}
174
207
  - Keep \`${outputDir}/codex-images/manifest.json\` updated
175
208
  - Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
176
209
  `;
177
210
  }
178
- function buildCodexImagesWorkflow(outputDir) {
211
+ function buildCodexImagesWorkflow(config) {
212
+ const outputDir = config.outputDir;
213
+ const storyboardReferenceActive = isSeedanceStoryboardReference(config);
179
214
  return `---
180
215
  description: Optional Codex-native still image phase for Film-Kit Multi output
181
216
  ---
@@ -198,30 +233,37 @@ description: Optional Codex-native still image phase for Film-Kit Multi output
198
233
  \`\`\`text
199
234
  ${outputDir}/codex-images/
200
235
  ├── SHOTNN/
201
- │ ├── ilk-frame.png
236
+ ${storyboardReferenceActive
237
+ ? "│ ├── character-reference.png\n│ └── storyboard-reference.png"
238
+ : `│ ├── ilk-frame.png
202
239
  │ ├── ilk-frame-v2.png
203
240
  │ ├── son-frame.png
204
- │ └── son-frame-v3.png
241
+ │ └── son-frame-v3.png`}
205
242
  ├── manifest.json
206
243
  └── ../reports/CODEX-IMAGE-REPORT.md
207
244
  \`\`\`
208
245
 
209
246
  ## Flow
210
247
  1. Process shots sequentially unless the user explicitly requests a different order.
211
- 2. For a fresh shot, generate \`ILK FRAME\` from the accepted still prompt plus references.
248
+ ${storyboardReferenceActive
249
+ ? `2. For storyboard-reference projects, do not require start/end frame stills.
250
+ 3. If the user requests still prep, create or edit character identity references and storyboard planning references.
251
+ 4. Preserve \`STORYBOARD PLAN\` role separation: identity stills cannot inherit storyboard character design, and storyboard stills cannot override identity/wardrobe/props.
252
+ 5. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted reference.`
253
+ : `2. For a fresh shot, generate \`ILK FRAME\` from the accepted still prompt plus references.
212
254
  3. Show the result and ask the user to accept it or request a targeted edit.
213
255
  4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
214
256
  5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
215
257
  6. Show the result and ask the user to accept it or request a targeted edit.
216
258
  7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
217
- 8. If the next shot is chained, default its \`ILK FRAME\` to the accepted previous \`SON FRAME\` unless the user explicitly asks for a fresh start.
218
- 9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.
259
+ 8. If the next shot is chained, default its \`ILK FRAME\` to the accepted previous \`SON FRAME\` unless the user explicitly asks for a fresh start.`}
260
+ ${storyboardReferenceActive ? "" : `9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.`}
219
261
 
220
262
  ## Hard Rules
221
263
  - Never auto-start this workflow.
222
- - V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
264
+ - ${storyboardReferenceActive ? "Storyboard-reference mode covers optional reference still prep only; it does not introduce ILK/SON requirements." : "V1 covers only main-shot `ILK FRAME` and `SON FRAME`."}
223
265
  - Do not generate coverage stills or video here.
224
- - Preserve chain continuity unless the user explicitly requests a reset.
266
+ - Preserve ${storyboardReferenceActive ? "storyboard handoff continuity" : "chain continuity"} unless the user explicitly requests a reset.
225
267
  `;
226
268
  }
227
269
  /**
@@ -230,6 +272,7 @@ ${outputDir}/codex-images/
230
272
  */
231
273
  export function buildMultiProjectFiles(config) {
232
274
  const files = {};
275
+ const storyboardReferenceActive = isSeedanceStoryboardReference(config);
233
276
  // Runtime model profile file is generated from selected model options.
234
277
  files[".agent/model-profile.md"] = buildModelProfile(config);
235
278
  files["CLAUDE.md"] = buildClaudeRoot(config);
@@ -266,6 +309,15 @@ export function buildMultiProjectFiles(config) {
266
309
  2. Create \`${config.outputDir}/_index.md\`
267
310
  3. Create \`${config.outputDir}/team-plan.json\` with:
268
311
  - model target and preset
312
+ - \`project.reference_mode\`: \`${storyboardReferenceActive ? "storyboard-reference" : config.referenceMode}\`
313
+ - \`storyboard_reference.enabled\`: ${storyboardReferenceActive ? "true" : "false"}
314
+ - \`storyboard_reference.max_storyboard_phases\`: ${config.storyboardReferenceMode.maxStoryboardPhases}
315
+ - \`storyboard_reference.character_reference_sheets\`: ${storyboardReferenceActive ? "GPT Image 2, 16:9, generated once per character" : "n/a"}
316
+ - \`storyboard_reference.storyboard_prompt_policy\`: ${storyboardReferenceActive ? "GPT Image 2, 16:9, generated per shot, 160-240 words" : "n/a"}
317
+ - \`storyboard_reference.recommended_phase_budget\`: ${storyboardReferenceActive ? "`4-6s: 1-2`, `7-10s: 2-3`, `11-15s: 3-4`, split 5+ phases" : "n/a"}
318
+ - \`storyboard_reference.provider_reference_tokens\`: ${storyboardReferenceActive ? "generated character sheet tokens first; generated shot storyboard token next" : "n/a"}
319
+ - \`storyboard_reference.continuity_mode\`: ${storyboardReferenceActive ? "`continuous-shot` or `multi-shot-storyboard`" : "n/a"}
320
+ - \`storyboard_reference.provider_file_limits\`: ${storyboardReferenceActive ? "9 images, 3 videos, 3 audio, 12 total files, 4-15s duration" : "n/a"}
269
321
  - \`project.estimated_runtime_seconds\`
270
322
  - \`shot_sizing.method\` and global rationale
271
323
  - \`shot_sizing.min_functional_shots\`
@@ -277,7 +329,7 @@ export function buildMultiProjectFiles(config) {
277
329
  - voice defaults (\`voice_design.single_active_speaker_required\`, \`music_default\`, \`subtitles_default\`)
278
330
  - shot-level speaker binding map under \`shots\`
279
331
  - shot count and batch map
280
- - chain bridges per batch boundary
332
+ - ${storyboardReferenceActive ? "storyboard handoff notes per shot and per batch boundary" : "chain bridges per batch boundary"}
281
333
  - teammate assignments
282
334
  - validation gates
283
335
  - recovery policy
@@ -296,11 +348,12 @@ BATCH ID: B[NN]
296
348
  BATCH RANGE: SHOT[X] through SHOT[Y]
297
349
  OUTPUT DIR: ${config.outputDir}/shots/
298
350
  REPORT FILE: ${config.outputDir}/reports/BATCH-REPORT-B[NN].md
299
- CHAIN ENTRY FRAME: [exact frame description]
351
+ ${storyboardReferenceActive ? "STORYBOARD ENTRY HANDOFF: [visual_world-aligned opening state and prior-shot action handoff]" : "CHAIN ENTRY FRAME: [exact frame description]"}
300
352
  SPATIAL PRIORITY: [who looks at what, which plane dominates, shared light source]
301
353
  SEMANTIC WORLD: [camera height, lens family, horizon/vanishing logic, camera movement strategy, light source, shadow direction, scale map, reflection risk, physics constraints]
302
354
  RESPECT LOCKED SHOT COUNT: Do not create any shot outside SHOT[X]-SHOT[Y]
303
355
  KLING DEFAULT: single-transition first; custom storyboard only for 2-4 meaningful phases, max 4
356
+ ${storyboardReferenceActive ? `SEEDANCE STORYBOARD-REFERENCE: Each SHOTNN.md includes INPUT ASSET ROLES, REFERENCE ASSET REQUIREMENTS, GPT IMAGE 2 STORYBOARD PROMPT, STORYBOARD PLAN, AUDIO PLAN, SEEDANCE VIDEO PROMPT, and coverage. Do not require ILK FRAME / SON FRAME. Max storyboard phases per shot: ${config.storyboardReferenceMode.maxStoryboardPhases}. Character sheet tokens lock identity; generated shot storyboard token controls staging only.` : ""}
304
357
  ONE FILE PER SHOT: Each SHOTNN.md contains main shot + all coverage.
305
358
  FILE OWNERSHIP: Write only your assigned SHOT files and your own batch report.
306
359
  VOICE CONTRACT: Reuse ${config.outputDir}/team-plan.json -> \`voiceCast\` and keep one active speaker per shot.
@@ -330,7 +383,7 @@ VOICE CONTRACT: Reuse ${config.outputDir}/team-plan.json -> \`voiceCast\` and ke
330
383
  - dialogue-auditor for dialogue tone, \`voiceCast\` binding, SFX scene match, and audio direction checks
331
384
  - character-consistency-auditor for character description drift and anonymous identity checks
332
385
  - color-continuity-auditor for lighting direction and color temperature consistency checks
333
- - semantic-auditor for visual_world, perspective/geometry, shadow vector, scale, reflections, physics/anatomy, foreground/background coherence, contextual contradiction, targeted avoid terms, and chained ILK exact reuse
386
+ - semantic-auditor for visual_world, perspective/geometry, shadow vector, scale, reflections, physics/anatomy, foreground/background coherence, contextual contradiction, targeted avoid terms, and ${storyboardReferenceActive ? "storyboard-reference handoff continuity" : "chained ILK exact reuse"}
334
387
  - pacing-auditor for shot sequence rhythm, tempo variety, and dramatic arc alignment checks
335
388
  **Phase C — Delivery gate (must run last, depends on all other reports):**
336
389
  - delivery-editor for final package audit
@@ -357,14 +410,24 @@ VOICE CONTRACT: Reuse ${config.outputDir}/team-plan.json -> \`voiceCast\` and ke
357
410
  - Model: \`${config.model}\`
358
411
  - Model display: ${getModelDisplayName(config.model)}
359
412
  - Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
413
+ - Reference mode: \`${storyboardReferenceActive ? "storyboard-reference" : config.referenceMode}\`
360
414
  - Kling transition mode: Start+End (when model is kling-3.0)
361
415
  - Kling professional blocks: \`[CHARACTER / SUBJECT CONSISTENCY]\` through \`[NEGATIVE PROMPT]\` (when model is kling-3.0)
362
416
  - Kling multi-shot mode: single-transition by default; custom storyboard only for 2-4 meaningful phases, max 4 custom shots (when model is kling-3.0)
417
+ ${storyboardReferenceActive ? `- Seedance storyboard-reference mode: \`INPUT ASSET ROLES\`, \`REFERENCE ASSET REQUIREMENTS\`, \`GPT IMAGE 2 STORYBOARD PROMPT\`, \`STORYBOARD PLAN\`, and timeline phases are mandatory; \`ILK FRAME\` / \`SON FRAME\` are not required` : ""}
363
418
 
364
419
  ## Shot File Format (SHOTNN.md)
365
- - Main shot contains: \`ILK FRAME\` (or \`İLK FRAME\`), \`SON FRAME\`, \`AUDIO PLAN\`, \`VIDEO\` (or \`VİDEO\`)
420
+ ${storyboardReferenceActive
421
+ ? `- Main shot contains: \`MODEL CONTROL\`, \`INPUT ASSET ROLES\`, \`REFERENCE ASSET REQUIREMENTS\`, \`GPT IMAGE 2 STORYBOARD PROMPT\`, \`STORYBOARD PLAN\`, \`AUDIO PLAN\`, \`SEEDANCE VIDEO PROMPT\`, and coverage
422
+ - \`INPUT ASSET ROLES\` declares generated character sheet tokens (\`@Image1...\`, legacy \`@image1...\`) as identity/wardrobe/props
423
+ - \`INPUT ASSET ROLES\` declares generated shot storyboard token (next \`@Image\`, legacy lowercase alias such as \`@image2\` for one character) as composition/blocking/camera/timing only
424
+ - \`GPT IMAGE 2 STORYBOARD PROMPT\` is 16:9, 160-240 words, professional storyboard style, and uses character sheets as the only identity source
425
+ - \`STORYBOARD PLAN\` includes per-shot timeline phases capped at ${config.storyboardReferenceMode.maxStoryboardPhases}
426
+ - Shot storyboard plans must derive from one shared \`${config.outputDir}/team-plan.json -> visual_world\`
427
+ - Do not require \`ILK FRAME\` / \`SON FRAME\` assets or exact first-frame reuse text in this mode`
428
+ : `- Main shot contains: \`ILK FRAME\` (or \`İLK FRAME\`), \`SON FRAME\`, \`AUDIO PLAN\`, \`VIDEO\` (or \`VİDEO\`)
366
429
  - \`ILK FRAME\` section MUST include a fenced code block, even when chained
367
- - Chained shots: code block must contain only \`Use SHOT[prev]_END as exact first frame\`; any new visual prompt requires \`CHAIN BREAK\`
430
+ - Chained shots: code block must contain only \`Use SHOT[prev]_END as exact first frame\`; any new visual prompt requires \`CHAIN BREAK\``}
368
431
  - Every prompt must align to \`${config.outputDir}/team-plan.json -> visual_world\` for perspective/geometry, shadow vector, scale, reflection, physics, anatomy risk, foreground/background coherence, and contextual contradiction checks
369
432
  - Coverage section contains 2-3 sub-shots in the same file
370
433
  - Every prompt includes an Avoid line
@@ -375,7 +438,7 @@ VOICE CONTRACT: Reuse ${config.outputDir}/team-plan.json -> \`voiceCast\` and ke
375
438
  - ONE FILE PER SHOT
376
439
  - No separate coverage files
377
440
  - Coverage is standalone (not chained)
378
- - Main shots are chained: SHOT[N]_END -> SHOT[N+1]_START
441
+ - ${storyboardReferenceActive ? "Main-shot continuity uses shared visual_world plus storyboard handoff notes, character lock, camera direction, lighting, and action progression" : "Main shots are chained: SHOT[N]_END -> SHOT[N+1]_START"}
379
442
 
380
443
  ## Batch Report Contract
381
444
  Each shot teammate must write a report file:
@@ -383,8 +446,8 @@ Each shot teammate must write a report file:
383
446
  # BATCH REPORT | B[NN]
384
447
  - batch_range: SHOT[X]-SHOT[Y]
385
448
  - files_written: [SHOTXX.md, ...]
386
- - chain_entry_used: [text]
387
- - chain_exit_frame: [text]
449
+ - ${storyboardReferenceActive ? "storyboard_entry_handoff" : "chain_entry_used"}: [text]
450
+ - ${storyboardReferenceActive ? "storyboard_exit_handoff" : "chain_exit_frame"}: [text]
388
451
  - continuity_status: pass/fail
389
452
  - safety_status: pass/fail
390
453
  - voice_design_status: pass/fail
@@ -445,7 +508,7 @@ Specialist reports must use explicit non-contradictory status fields:
445
508
  - overall_status: pass/fail
446
509
  - visual_world_status: pass/fail
447
510
  - reference_drift_status: pass/fail
448
- - start_end_contract_status: pass/fail
511
+ - ${storyboardReferenceActive ? "storyboard_reference_status" : "start_end_contract_status"}: pass/fail
449
512
  - perspective_geometry_status: pass/fail
450
513
  - shadow_vector_status: pass/fail
451
514
  - scale_depth_status: pass/fail
@@ -453,7 +516,7 @@ Specialist reports must use explicit non-contradictory status fields:
453
516
  - anatomy_physics_status: pass/fail
454
517
  - foreground_background_status: pass/fail
455
518
  - contextual_contradiction_status: pass/fail
456
- - chained_ilk_frame_status: pass/fail
519
+ - ${storyboardReferenceActive ? "storyboard_handoff_status" : "chained_ilk_frame_status"}: pass/fail
457
520
  - avoid_terms_status: pass/fail
458
521
  - blockers: [none or list]
459
522
 
@@ -481,7 +544,7 @@ Specialist reports must use explicit non-contradictory status fields:
481
544
  - Include all task-specific context needed (no hidden assumptions)
482
545
  - Never rely on prior lead conversation history carrying over
483
546
  - Reference exact file paths for input/output
484
- - Include chain entry frame description (minimum 40 words)
547
+ - Include ${storyboardReferenceActive ? "storyboard entry handoff and shared visual_world summary" : "chain entry frame description (minimum 40 words)"}
485
548
  - Declare batch ID and exact shot range
486
549
  - Require report file path under \`${config.outputDir}/reports/\`
487
550
  - Pass required \`speakerKey\` / \`voiceCast\` context from \`${config.outputDir}/team-plan.json\`
@@ -489,7 +552,7 @@ Specialist reports must use explicit non-contradictory status fields:
489
552
 
490
553
  ### Teammate -> Lead Messages
491
554
  - Confirm report file path written
492
- - Include chain exit frame description
555
+ - Include ${storyboardReferenceActive ? "storyboard exit handoff description" : "chain exit frame description"}
493
556
  - Include issue list and blockers
494
557
  - Confirm safety and coverage checks
495
558
 
@@ -500,7 +563,7 @@ Specialist reports must use explicit non-contradictory status fields:
500
563
  - dialogue-auditor scans all shot files for dialogue tone consistency, \`voiceCast\` binding, SFX scene match, audio direction completeness, and single-active-speaker compliance
501
564
  - character-consistency-auditor scans all shot files for character description drift and anonymous identity stability
502
565
  - color-continuity-auditor scans all shot files for lighting direction and color temperature consistency within same-scene shots
503
- - semantic-auditor scans all shot files for visual_world, perspective/geometry, shadow vector, scale, reflections, physics/anatomy, foreground/background coherence, contextual contradiction, chained ILK exact reuse, and targeted avoid terms
566
+ - semantic-auditor scans all shot files for visual_world, perspective/geometry, shadow vector, scale, reflections, physics/anatomy, foreground/background coherence, contextual contradiction, ${storyboardReferenceActive ? "storyboard handoff continuity" : "chained ILK exact reuse"}, and targeted avoid terms
504
567
  - pacing-auditor scans all shot files for rhythm monotony, dramatic arc mismatches, and transition variety
505
568
  - delivery-editor audits completeness and final delivery gates
506
569
  - Required specialist reports: CONTINUITY-REPORT.md, SAFETY-REPORT.md, STABILITY-REPORT.md, DIALOGUE-REPORT.md, CHARACTER-REPORT.md, COLOR-REPORT.md, SEMANTIC-REPORT.md, PACING-REPORT.md, DELIVERY-REPORT.md
@@ -533,7 +596,7 @@ Use this playbook when a teammate fails or a quality gate fails.
533
596
  - Chain continuity break between batches
534
597
  - Safety failures not resolved in place
535
598
  - Broken \`voiceCast\` / \`activeSpeakerKey\` binding
536
- - Broken \`visual_world\`, semantic consistency failure, or chained ILK block with competing visual prompt
599
+ - Broken \`visual_world\`, semantic consistency failure, or ${storyboardReferenceActive ? "storyboard handoff contradiction" : "chained ILK block with competing visual prompt"}
537
600
 
538
601
  ## Impacted Range Definition
539
602
  - **Impacted range** = the failed batch + adjacent batch boundaries (one shot before, one shot after)
@@ -563,8 +626,8 @@ Use this playbook when a teammate fails or a quality gate fails.
563
626
  for (const [roleFile, name, description] of MULTI_CODEX_AGENTS) {
564
627
  files[`.codex/agents/${roleFile}.toml`] = buildMultiCodexAgent(roleFile, name, description, config);
565
628
  }
566
- files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images-multi.md", config.outputDir);
567
- files[".agent/workflows/codex-images-multi.md"] = buildCodexImagesWorkflow(config.outputDir);
629
+ files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images-multi.md", config);
630
+ files[".agent/workflows/codex-images-multi.md"] = buildCodexImagesWorkflow(config);
568
631
  if (config.includeAgentsMd) {
569
632
  files["AGENTS.md"] = `# Film-Kit Multi - Agent Teams Contract
570
633
 
@@ -636,6 +699,7 @@ Multi-agent parallel generation with shot teammates and specialist validators.
636
699
  | visual-modes | \`.agent/skills/visual-modes/SKILL.md\` | ALWAYS |
637
700
  | audio-design | \`.agent/skills/audio-design/SKILL.md\` | Dialogue/SFX |
638
701
  | prompt-structure | \`.agent/skills/prompt-structure/SKILL.md\` | ALWAYS |
702
+ ${storyboardReferenceActive ? "| storyboard-reference | `.agent/skills/storyboard-reference/SKILL.md` | Seedance storyboard-reference mode |\n" : ""}
639
703
 
640
704
  ## Config
641
705
  - Max shot teammates: ${config.maxTeammates}
@@ -644,6 +708,8 @@ Multi-agent parallel generation with shot teammates and specialist validators.
644
708
  - Scenario: \`${config.scenarioHint}\`
645
709
  - Model: \`${config.model}\` (${getModelDisplayName(config.model)})
646
710
  - Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
711
+ - Reference mode: \`${storyboardReferenceActive ? "storyboard-reference" : config.referenceMode}\`
712
+ ${storyboardReferenceActive ? `- Storyboard max phases: ${config.storyboardReferenceMode.maxStoryboardPhases}` : ""}
647
713
  `;
648
714
  }
649
715
  return files;
@@ -680,7 +746,7 @@ Lead-directed parallel generation with Claude Code Agent Teams. Use native proje
680
746
  Before ANY work, read ALL skills from \`.agent/skills/\`:
681
747
  1. \`safety-compliance/SKILL.md\` - ALWAYS FIRST
682
748
  2. \`reference-locking/SKILL.md\` - When reference images provided
683
- 3. \`frame-chaining/SKILL.md\` - ALWAYS (chain entry/exit planning)
749
+ 3. \`frame-chaining/SKILL.md\` - ALWAYS (${isSeedanceStoryboardReference(config) ? "start/end reference only; storyboard handoff is active" : "chain entry/exit planning"})
684
750
  4. \`director-shot-sizing/SKILL.md\` - Lead planning only; lock target shot count before batch sizing
685
751
  5. \`spatial-blocking/SKILL.md\` - When gaze / scale / compositing realism matters
686
752
  6. \`semantic-consistency/SKILL.md\` - ALWAYS (visual_world + semantic QA)
@@ -688,6 +754,7 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
688
754
  8. \`visual-modes/SKILL.md\` - ALWAYS (Ultra Realism default)
689
755
  9. \`audio-design/SKILL.md\` - When dialogue/SFX needed
690
756
  10. \`prompt-structure/SKILL.md\` - ALWAYS (prompt templates)
757
+ ${isSeedanceStoryboardReference(config) ? "11. `storyboard-reference/SKILL.md` - Seedance character-sheet + generated storyboard prompt mode" : ""}
691
758
 
692
759
  ## /generate Contract
693
760
  1. Read \`.agent/workflows/generate-multi.md\`
@@ -710,11 +777,11 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
710
777
  - Target shot count must be justified by dramatic units; never inflate or compress arbitrarily
711
778
  - ONE FILE PER SHOT: each SHOTNN.md includes main shot + coverage
712
779
  - Each teammate owns a disjoint file set; no overlapping shot or report files
713
- - Image prompt contract: reference-anchored ILK/SON use \`REFERENCE LOCK\` + \`Keep same\` + \`Change only\`; VIDEO >= 120; coverage video >= 70
780
+ - ${isSeedanceStoryboardReference(config) ? "Storyboard prompt contract: generated character sheet tokens lock identity, generated shot storyboard token controls staging only; GPT IMAGE 2 STORYBOARD PROMPT is required; SEEDANCE VIDEO PROMPT >= 120; coverage video >= 70" : "Image prompt contract: reference-anchored ILK/SON use `REFERENCE LOCK` + `Keep same` + `Change only`; VIDEO >= 120; coverage video >= 70"}
714
781
  - Specificity floor: lens/framing, lighting, and foreground/midground/background action are mandatory
715
782
  - Spatial realism floor: eyeline target, plane map, shared light source, and contact/depth cues are mandatory when relational staging matters
716
- - Semantic consistency floor: \`visual_world\`, perspective/geometry, shadow vector, scale map, reflections, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradictions, targeted semantic avoid terms, and chained ILK exact reuse are mandatory
717
- - Chained ILK/İLK FRAME code block contains only \`Use SHOT[prev]_END as exact first frame\`; any new visual prompt requires CHAIN BREAK
783
+ - ${isSeedanceStoryboardReference(config) ? "Seedance storyboard-reference contract: each SHOTNN.md contains INPUT ASSET ROLES, REFERENCE ASSET REQUIREMENTS, GPT IMAGE 2 STORYBOARD PROMPT, STORYBOARD PLAN, AUDIO PLAN, SEEDANCE VIDEO PROMPT, and coverage; ILK FRAME / SON FRAME are not required" : "Semantic consistency floor: `visual_world`, perspective/geometry, shadow vector, scale map, reflections, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradictions, targeted semantic avoid terms, and chained ILK exact reuse are mandatory"}
784
+ - ${isSeedanceStoryboardReference(config) ? `Storyboard phases derive from \`${config.outputDir}/team-plan.json -> visual_world\`; continuity uses shot-to-shot storyboard handoff notes, character/reference lock, camera direction, lighting, and action progression` : "Chained ILK/İLK FRAME code block contains only `Use SHOT[prev]_END as exact first frame`; any new visual prompt requires CHAIN BREAK"}
718
785
  - Avoid line is mandatory on every prompt
719
786
  - Music is NONE by default
720
787
  - Duration is 8s default, slow pacing
@@ -732,6 +799,7 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
732
799
  - Scenario source: \`${config.scenarioHint}\`
733
800
  - Model: \`${config.model}\` (${getModelDisplayName(config.model)})
734
801
  - Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
802
+ ${buildReferenceModeSummary(config)}
735
803
 
736
804
  ## Claude Code Ops
737
805
  - Use \`/memory\` to verify which CLAUDE and rule files are loaded
@@ -753,7 +821,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
753
821
  6. Use director-shot-sizing to lock target shot count before teammate sizing
754
822
  7. Size the team from actual shot count; default to 3-5 teammates, hard cap ${config.maxTeammates}
755
823
  8. Remember teammates inherit project context (\`CLAUDE.md\`, MCP, skills) but not the lead chat history
756
- 9. Every spawn prompt must include exact shot range, chain entry, output path, report path, and ownership boundaries
824
+ 9. Every spawn prompt must include exact shot range, ${isSeedanceStoryboardReference(config) ? "storyboard entry handoff" : "chain entry"}, output path, report path, and ownership boundaries
757
825
  10. Wait for all teammate reports before specialist validation
758
826
  11. Do not close while any required report is missing or fail
759
827
 
@@ -765,8 +833,8 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
765
833
  - Keep top-level \`voiceCast\` in \`${config.outputDir}/team-plan.json\`
766
834
  - Keep top-level \`visual_world\` in \`${config.outputDir}/team-plan.json\`
767
835
  - Keep \`Audio Plan\` blocks aligned to \`voiceCast\`
768
- - Image prompt contract, specificity floor, and semantic floor are hard gates, not suggestions
769
- - Semantic consistency floor is a hard gate, including exact chained ILK reuse and \`visual_world\` alignment
836
+ - ${isSeedanceStoryboardReference(config) ? "Storyboard-reference role separation, specificity floor, and semantic floor are hard gates, not suggestions" : "Image prompt contract, specificity floor, and semantic floor are hard gates, not suggestions"}
837
+ - ${isSeedanceStoryboardReference(config) ? "Semantic consistency floor is a hard gate, including shared visual_world alignment and storyboard handoff continuity" : "Semantic consistency floor is a hard gate, including exact chained ILK reuse and `visual_world` alignment"}
770
838
  - Do not let teammates create extra SHOT files beyond the locked batch ranges
771
839
  - Spawn prompts must pass spatial and semantic contracts: gaze target, plane map, shared light, contact/depth cues, shadow vector, scale map, reflections, physics, and contextual logic
772
840
 
@@ -812,12 +880,14 @@ Own only:
812
880
  Never write shot prompts directly. Do not finalize until every required report exists and passes. In Codex, once all required reports pass, offer \`/codex-images\` as an optional still-image phase and wait for explicit user confirmation. Keep top-level \`voiceCast\` and \`visual_world\` in \`${config.outputDir}/team-plan.json\`, lock director-grade shot count before teammate sizing, then enforce spatial, semantic, and voice contracts in teammate assignments.`);
813
881
  }
814
882
  function buildClaudeShotGeneratorSubagent(config) {
815
- return buildClaudeSubagent("shot-generator", "Generate assigned Film-Kit multi batches with strict chaining, coverage, anonymity, and report output.", `Read \`.agent/model-profile.md\`, \`.agent/MASTER.md\`, \`.agent/VOICE-DESIGN.md\`, \`.agent/agents/shot-generator.md\`, and \`.agent/workflows/generate-teammate.md\`.
883
+ return buildClaudeSubagent("shot-generator", isSeedanceStoryboardReference(config)
884
+ ? "Generate assigned Seedance storyboard-reference batches with coverage, handoff continuity, anonymity, and report output."
885
+ : "Generate assigned Film-Kit multi batches with strict chaining, coverage, anonymity, and report output.", `Read \`.agent/model-profile.md\`, \`.agent/MASTER.md\`, \`.agent/VOICE-DESIGN.md\`, \`.agent/agents/shot-generator.md\`, and \`.agent/workflows/generate-teammate.md\`.
816
886
 
817
887
  Own only assigned shot files under \`${config.outputDir}/shots/\` and one batch report under \`${config.outputDir}/reports/\`.
818
888
 
819
889
  Hard gates:
820
- - reference-anchored ILK/SON use \`REFERENCE LOCK\` + \`Keep same\` + \`Change only\`
890
+ - ${isSeedanceStoryboardReference(config) ? "generated character sheet tokens lock identity, wardrobe, accessories, and visible props; generated shot storyboard token controls composition, blocking, camera direction, timing, and action progression only" : "reference-anchored ILK/SON use `REFERENCE LOCK` + `Keep same` + `Change only`"}
821
891
  - VIDEO >= 120
822
892
  - coverage video >= 70
823
893
  - every speaking VIDEO section must include \`Audio Plan\`
@@ -825,7 +895,7 @@ Hard gates:
825
895
  - lens/framing, lighting, and FG/MG/BG action must be explicit
826
896
  - eyeline target, plane map, shared light source, and contact/depth cues must be explicit when subjects interact
827
897
  - semantic consistency must match \`${config.outputDir}/team-plan.json -> visual_world\`
828
- - chained ILK/İLK FRAME code block must contain only \`Use SHOT[prev]_END as exact first frame\`
898
+ - ${isSeedanceStoryboardReference(config) ? `each SHOTNN.md includes a STORYBOARD PLAN with timeline phases capped at ${config.storyboardReferenceMode.maxStoryboardPhases} and shot-to-shot handoff notes` : "chained ILK/İLK FRAME code block must contain only `Use SHOT[prev]_END as exact first frame`"}
829
899
  - Kling default: single-transition first; custom storyboard only when 2-4 phases genuinely earn it, max 4
830
900
 
831
901
  Do not edit another teammate's files.`);
@@ -873,11 +943,13 @@ Audit all shot files for lighting and color continuity risks: light direction co
873
943
  Write only \`${config.outputDir}/reports/COLOR-REPORT.md\`. Apply only low-risk lighting/color fixes inline (align light direction language, normalize color temperature references); otherwise mark the batch for recover.`);
874
944
  }
875
945
  function buildClaudeSemanticAuditorSubagent(config) {
876
- return buildClaudeSubagent("semantic-auditor", "Audit visual_world, perspective, shadows, scale, reflections, physics, anatomy, context, and chained ILK reuse across all generated multi-shot packages.", `Read \`.agent/model-profile.md\`, \`.agent/MASTER.md\`, \`.agent/skills/semantic-consistency/SKILL.md\`, \`.agent/agents/semantic-auditor.md\`, and \`.agent/workflows/safety-check-multi.md\`.
946
+ return buildClaudeSubagent("semantic-auditor", isSeedanceStoryboardReference(config)
947
+ ? "Audit visual_world, perspective, shadows, scale, reflections, physics, anatomy, context, and storyboard handoff continuity across all generated multi-shot packages."
948
+ : "Audit visual_world, perspective, shadows, scale, reflections, physics, anatomy, context, and chained ILK reuse across all generated multi-shot packages.", `Read \`.agent/model-profile.md\`, \`.agent/MASTER.md\`, \`.agent/skills/semantic-consistency/SKILL.md\`, \`.agent/agents/semantic-auditor.md\`, and \`.agent/workflows/safety-check-multi.md\`.
877
949
 
878
- Audit all shot files against \`${config.outputDir}/team-plan.json -> visual_world\`. Verify perspective/geometry, shadow vector, scale/depth, reflection handling, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradiction handling, targeted semantic avoid terms, and exact chained ILK reuse.
950
+ Audit all shot files against \`${config.outputDir}/team-plan.json -> visual_world\`. Verify perspective/geometry, shadow vector, scale/depth, reflection handling, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradiction handling, targeted semantic avoid terms, and ${isSeedanceStoryboardReference(config) ? "storyboard-reference phase/handoff continuity" : "exact chained ILK reuse"}.
879
951
 
880
- Write only \`${config.outputDir}/reports/SEMANTIC-REPORT.md\`. Apply only low-risk textual fixes inline; if a chained ILK frame needs new visual content, mark the batch for recover instead of editing it.`);
952
+ Write only \`${config.outputDir}/reports/SEMANTIC-REPORT.md\`. Apply only low-risk textual fixes inline; ${isSeedanceStoryboardReference(config) ? "if storyboard handoff continuity needs structural replanning, mark the batch for recover instead of rewriting neighboring shots." : "if a chained ILK frame needs new visual content, mark the batch for recover instead of editing it."}`);
881
953
  }
882
954
  function buildClaudePacingAuditorSubagent(config) {
883
955
  return buildClaudeSubagent("pacing-auditor", "Audit shot sequence rhythm, tempo variety, and dramatic arc alignment across all generated multi-shot packages.", `Read \`.agent/model-profile.md\`, \`.agent/MASTER.md\`, \`.agent/agents/pacing-auditor.md\`, and \`.agent/workflows/safety-check-multi.md\`.
@@ -902,7 +974,7 @@ description: Film-Kit Multi orchestration for Antigravity Mission Control. Runs
902
974
  # Film-Kit Multi - Antigravity Mission Control Skill
903
975
 
904
976
  ## Goal
905
- Run the Film-Kit Multi pipeline with maximum throughput while preserving chain continuity and safety.
977
+ Run the Film-Kit Multi pipeline with maximum throughput while preserving ${isSeedanceStoryboardReference(config) ? "storyboard-reference continuity" : "chain continuity"} and safety.
906
978
 
907
979
  ## System Entry
908
980
  1. Read \`.agent/MASTER.md\`
@@ -928,6 +1000,16 @@ Run the Film-Kit Multi pipeline with maximum throughput while preserving chain c
928
1000
  - \`${config.outputDir}/team-plan.json\`
929
1001
  - keep top-level \`voiceCast\` in \`${config.outputDir}/team-plan.json\`
930
1002
  - keep top-level \`visual_world\` in \`${config.outputDir}/team-plan.json\`
1003
+ - set \`project.reference_mode\` to \`${isSeedanceStoryboardReference(config) ? "storyboard-reference" : config.referenceMode}\`
1004
+ - set \`storyboard_reference.enabled\` to ${isSeedanceStoryboardReference(config) ? "true" : "false"}
1005
+ ${isSeedanceStoryboardReference(config) ? ` - set \`storyboard_reference.max_storyboard_phases\` to ${config.storyboardReferenceMode.maxStoryboardPhases}
1006
+ - set \`storyboard_reference.character_reference_sheets\` to GPT Image 2, 16:9, generated once per character
1007
+ - set \`storyboard_reference.storyboard_prompt_policy\` to GPT Image 2, 16:9, generated per shot, 160-240 words
1008
+ - set \`storyboard_reference.recommended_phase_budget\` to 4-6s=1-2, 7-10s=2-3, 11-15s=3-4, split 5+
1009
+ - set \`storyboard_reference.provider_reference_tokens\` to generated character sheet tokens first and generated shot storyboard token next
1010
+ - set \`storyboard_reference.continuity_mode\` per shot as continuous-shot or multi-shot-storyboard
1011
+ - set \`storyboard_reference.provider_file_limits\` to 9 images, 3 videos, 3 audio, 12 total files, 4-15s duration
1012
+ - include shot-level handoff notes in \`shots[].storyboard_continuity_note\`` : ""}
931
1013
  - determine minimum functional shots, maximum tasteful shots, and selected target shot count before batch mapping
932
1014
  - lead never writes SHOT files directly
933
1015
  2. **Shot Generator tasks (parallel):**
@@ -959,7 +1041,7 @@ Create:
959
1041
  - ${config.outputDir}/_index.md
960
1042
  - ${config.outputDir}/team-plan.json
961
1043
  Use director-shot-sizing to determine minimum functional shots, maximum tasteful shots, and the final target shot count before teammate assignments.
962
- Then produce teammate assignments only (BATCH ID + SHOT RANGE + CHAIN ENTRY + REPORT PATH).
1044
+ Then produce teammate assignments only (BATCH ID + SHOT RANGE + ${isSeedanceStoryboardReference(config) ? "STORYBOARD ENTRY HANDOFF" : "CHAIN ENTRY"} + REPORT PATH).
963
1045
  Include who looks at what, plane dominance, shared light source, shadow direction, scale map, reflection risk, and physics constraints for difficult interaction shots.
964
1046
  Do not write SHOT files directly.
965
1047
  \`\`\`
@@ -975,11 +1057,12 @@ READ FIRST:
975
1057
 
976
1058
  BATCH ID: B[NN]
977
1059
  BATCH RANGE: SHOT[X]-SHOT[Y]
978
- CHAIN ENTRY FRAME: [exact text from Lead]
1060
+ ${isSeedanceStoryboardReference(config) ? "STORYBOARD ENTRY HANDOFF: [visual_world-aligned opening state and prior-shot action handoff]" : "CHAIN ENTRY FRAME: [exact text from Lead]"}
979
1061
  OUTPUT DIR: ${config.outputDir}/shots/
980
1062
  REPORT FILE: ${config.outputDir}/reports/BATCH-REPORT-B[NN].md
981
1063
  SPATIAL PRIORITY: [who looks at what, which plane dominates, shared light source]
982
1064
  SEMANTIC WORLD: [camera height, lens family, horizon/vanishing logic, camera movement strategy, light source, shadow direction, scale map, reflection risk, physics constraints]
1065
+ ${isSeedanceStoryboardReference(config) ? `SEEDANCE STORYBOARD-REFERENCE: Declare generated character sheet tokens (@Image1..., legacy @image1...) for identity and the generated shot storyboard token (next @Image, legacy lowercase alias such as @image2 for one character) for staging only. Include GPT IMAGE 2 STORYBOARD PROMPT and per-shot STORYBOARD PLAN phases, max ${config.storyboardReferenceMode.maxStoryboardPhases}. Do not require ILK FRAME / SON FRAME.` : ""}
983
1066
  RESPECT LOCKED SHOT COUNT: do not create extra shots outside the assigned range
984
1067
 
985
1068
  Generate only assigned SHOT files.
@@ -998,6 +1081,7 @@ If any blocker exists, list exact file and reason.
998
1081
  - Scenario source: \`${config.scenarioHint}\` (or active file in Antigravity editor)
999
1082
  - Model: \`${config.model}\` (${getModelDisplayName(config.model)})
1000
1083
  - Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
1084
+ ${buildReferenceModeSummary(config)}
1001
1085
 
1002
1086
  ## Output Contract
1003
1087
  - Shot files: \`${config.outputDir}/shots/SHOTNN.md\` (main + coverage in one file)
@@ -1012,20 +1096,20 @@ If any blocker exists, list exact file and reason.
1012
1096
  5. Keep top-level \`visual_world\` in \`${config.outputDir}/team-plan.json\`
1013
1097
  6. Every speaking VIDEO section includes machine-readable \`Audio Plan\`
1014
1098
  7. Keep one active speaker per shot
1015
- 8. Main shots are chained (SHOT[N]_END -> SHOT[N+1]_START)
1016
- 9. Chained ILK/İLK FRAME code block contains only \`Use SHOT[prev]_END as exact first frame\`
1099
+ 8. ${isSeedanceStoryboardReference(config) ? "Main-shot continuity uses shared visual_world plus storyboard handoff notes, character lock, camera direction, lighting, and action progression" : "Main shots are chained (SHOT[N]_END -> SHOT[N+1]_START)"}
1100
+ 9. ${isSeedanceStoryboardReference(config) ? "SHOTNN.md includes INPUT ASSET ROLES, STORYBOARD PLAN, AUDIO PLAN, SEEDANCE VIDEO PROMPT, and coverage" : "Chained ILK/İLK FRAME code block contains only `Use SHOT[prev]_END as exact first frame`"}
1017
1101
  10. Every prompt includes an Avoid line
1018
1102
  11. Video prompts include full audio direction
1019
1103
  12. Music default is NONE
1020
- 13. ILK/İLK FRAME section always contains fenced code block
1104
+ 13. ${isSeedanceStoryboardReference(config) ? "ILK/İLK FRAME and SON FRAME sections are not required in Seedance storyboard-reference mode" : "ILK/İLK FRAME section always contains fenced code block"}
1021
1105
  14. Multi-subject shots must define gaze target, plane map, shared light source, and contact/depth cues
1022
1106
  15. Semantic consistency must define perspective/geometry, shadow vector, scale map, reflections, gravity/contact physics, anatomy risk, foreground/background coherence, and contextual logic
1023
1107
  16. Final shot count must come from director-shot-sizing; do not inflate shot volume for fake pace
1024
1108
 
1025
1109
  ## Quality Floor (Hard Gate)
1026
1110
  Reject and regenerate any shot that fails any item:
1027
- - reference-anchored ILK FRAME missing \`REFERENCE LOCK\`, \`Keep same\`, or \`Change only\`
1028
- - SON FRAME drifts from the same visual universe or changes more than one major beat
1111
+ - ${isSeedanceStoryboardReference(config) ? "generated character sheet token and generated shot storyboard token roles are missing or conflated" : "reference-anchored ILK FRAME missing `REFERENCE LOCK`, `Keep same`, or `Change only`"}
1112
+ - ${isSeedanceStoryboardReference(config) ? `STORYBOARD PLAN missing timeline phases or exceeding ${config.storyboardReferenceMode.maxStoryboardPhases} phases` : "SON FRAME drifts from the same visual universe or changes more than one major beat"}
1029
1113
  - VIDEO < 120 words
1030
1114
  - any coverage video prompt < 70 words
1031
1115
  - reference-visible face/hair/skin/body/wardrobe/accessories/prop design drift
@@ -1057,6 +1141,7 @@ function buildModelProfile(config) {
1057
1141
  - Target model: \`${config.model}\`
1058
1142
  - Display name: ${getModelDisplayName(config.model)}
1059
1143
  - Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
1144
+ ${buildReferenceModeSummary(config)}
1060
1145
 
1061
1146
  ## Active Profile Summary
1062
1147
  ${isKling
@@ -1068,7 +1153,8 @@ ${isKling
1068
1153
  ? `This project is configured for **Seedance 2.0**.
1069
1154
  - Multimodal prompt grammar is active: image + video + audio + text references
1070
1155
  - Timeline segmentation is recommended for 10s+ clips
1071
- - One continuous shot and video-extension syntax are available`
1156
+ - One continuous shot and video-extension syntax are available
1157
+ ${isSeedanceStoryboardReference(config) ? "- Storyboard-reference mode is active: per-shot STORYBOARD PLAN sections replace start/end frame chaining" : ""}`
1072
1158
  : `This project is configured for **Google Flow + Veo 3.1**.
1073
1159
  - Prompt Flow order is mandatory
1074
1160
  - Frame chaining and coverage contracts are active
@@ -1106,7 +1192,7 @@ When generating video from a reference image:
1106
1192
 
1107
1193
  ---
1108
1194
 
1109
- ${buildSeedanceProfile(isSeedance)}
1195
+ ${buildSeedanceProfile(isSeedance, isSeedanceStoryboardReference(config), config.storyboardReferenceMode.maxStoryboardPhases)}
1110
1196
 
1111
1197
  ---
1112
1198
 
@@ -1,5 +1,15 @@
1
1
  export type SupportedModel = "veo31" | "kling-3.0" | "seedance-2.0";
2
2
  export type KlingPreset = "ultra-realism" | "balanced" | "custom";
3
+ export type ReferenceMode = "start-end" | "storyboard-reference" | "hybrid";
4
+ export interface StoryboardReferenceConfig {
5
+ enabled: boolean;
6
+ maxStoryboardPhases: number;
7
+ defaultCharacterRefRole: "character_identity";
8
+ defaultStoryboardRefRole: "storyboard_plan";
9
+ generateAllModelPrompts: boolean;
10
+ strictReferenceLock: boolean;
11
+ splitStoryboardOverload: boolean;
12
+ }
3
13
  export interface MultiAgentConfigOptions {
4
14
  /** Root directory of the project. Defaults to process.cwd() */
5
15
  rootDir?: string;
@@ -21,6 +31,10 @@ export interface MultiAgentConfigOptions {
21
31
  model?: SupportedModel;
22
32
  /** Kling quality preset. Defaults to ultra-realism for kling-3.0. */
23
33
  klingPreset?: KlingPreset;
34
+ /** Reference strategy. Defaults to start-end. */
35
+ referenceMode?: ReferenceMode;
36
+ /** Storyboard-reference behavior when referenceMode is storyboard-reference. */
37
+ storyboardReferenceMode?: Partial<StoryboardReferenceConfig>;
24
38
  }
25
39
  export interface ResolvedMultiConfig {
26
40
  rootDir: string;
@@ -33,6 +47,8 @@ export interface ResolvedMultiConfig {
33
47
  batchSize: number;
34
48
  model: SupportedModel;
35
49
  klingPreset: KlingPreset;
50
+ referenceMode: ReferenceMode;
51
+ storyboardReferenceMode: StoryboardReferenceConfig;
36
52
  warnings: string[];
37
53
  }
38
54
  export interface MultiConfigureResult {