@milenyumai/film-kit 2.3.1 → 2.3.3
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/README.md +25 -5
- package/build/cli.js +2 -1
- package/build/lib/cli.js +5 -1
- package/build/lib/configure.js +494 -17
- package/build/lib/defaults.js +3 -1
- package/build/lib/storyboard-reference/adapters/seedance20.js +11 -1
- package/build/lib/storyboard-reference/index.d.ts +1 -1
- package/build/lib/storyboard-reference/index.js +1 -1
- package/build/lib/storyboard-reference/output-writer.js +36 -0
- package/build/lib/storyboard-reference/prompt-bundle-builder.js +45 -5
- package/build/lib/storyboard-reference/types.d.ts +3 -0
- package/build/lib/storyboard-reference/validators.d.ts +4 -2
- package/build/lib/storyboard-reference/validators.js +92 -20
- package/build/lib/storyboard-reference/visual-world-builder.js +1 -1
- package/build/lib/templates.js +144 -36
- package/content/workflows/generate-storyboard.md +16 -0
- package/package.json +2 -1
- package/packages/studio/build/lib/configure.js +4 -4
package/build/lib/templates.js
CHANGED
|
@@ -8,7 +8,37 @@ 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
|
|
11
|
+
function isStoryboardReference(config) {
|
|
12
|
+
return config.referenceMode === "storyboard-reference" && Boolean(config.storyboardReferenceMode?.enabled);
|
|
13
|
+
}
|
|
14
|
+
function buildReferenceModeSummary(config) {
|
|
15
|
+
const referenceMode = config.referenceMode ?? "start-end";
|
|
16
|
+
if (!isStoryboardReference(config)) {
|
|
17
|
+
return `- Reference mode: \`${referenceMode}\`
|
|
18
|
+
- Start/end frame generation: enabled
|
|
19
|
+
- Active workflow: \`generate\``;
|
|
20
|
+
}
|
|
21
|
+
return `- Reference mode: \`storyboard-reference\`
|
|
22
|
+
- Storyboard reference mode: enabled
|
|
23
|
+
- Max storyboard phases per shot: ${config.storyboardReferenceMode?.maxStoryboardPhases ?? 4}
|
|
24
|
+
- Start/end frame generation: disabled
|
|
25
|
+
- Active workflow: \`generate-storyboard\`
|
|
26
|
+
- \`ILK FRAME\` / \`İLK FRAME\` / \`SON FRAME\` sections are forbidden in storyboard-reference mode`;
|
|
27
|
+
}
|
|
28
|
+
function buildStoryboardPlatformGuard(config) {
|
|
29
|
+
if (!isStoryboardReference(config)) {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
return `
|
|
33
|
+
## Storyboard-Reference Mode Guard
|
|
34
|
+
- Reference mode is \`storyboard-reference\`; \`/generate\` must follow \`.agent/workflows/generate.md\`, which is rendered as the storyboard workflow for this project.
|
|
35
|
+
- Do not generate main-shot \`ILK FRAME\`, \`İLK FRAME\`, or \`SON FRAME\` sections.
|
|
36
|
+
- Do not use exact first-frame reuse instructions, \`SHOTNN_START\`, \`SHOTNN_END\`, or mandatory Start+End transition fields.
|
|
37
|
+
- If no character reference is available through the user, an in-context image, \`--character-ref\`, or \`refs/character.png\`, stop and request one.
|
|
38
|
+
- Required storyboard outputs: \`${config.outputDir}/storyboard-reference-plan.json\`, \`${config.outputDir}/reference-prep/\`, \`${config.outputDir}/storyboard-prompts/\`, \`${config.outputDir}/prompt-bundles/\`, \`${config.outputDir}/shots/SHOTNN.md\`, and \`${config.outputDir}/reports/STORYBOARD-REFERENCE-QA.md\`.
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
function buildSeedanceProfile(active, storyboardReferenceActive = false, maxStoryboardPhases = 4) {
|
|
12
42
|
return `## Seedance 2.0 Rules${active ? " (ACTIVE)" : " (Reference)"}
|
|
13
43
|
|
|
14
44
|
### Capability Mindset
|
|
@@ -40,6 +70,10 @@ Seedance 2.0 is strongest when prompting treats the model as a **multimodal shot
|
|
|
40
70
|
- Storyboard phase budget: 4-6s uses 1-2 phases, 7-10s uses 2-3 phases, 11-15s uses at most 4 phases; split 5+ meaningful phases into separate SHOTNN.md files
|
|
41
71
|
- Storyboard role separation: \`@Image1\` / \`@image1\` locks identity, face, body proportions, wardrobe, accessories, and visible props; \`@Image2\` / \`@image2\` controls composition, blocking, camera direction, timing, and action rhythm only
|
|
42
72
|
- Storyboard text, panel borders, watermark, logo, and alternate character designs are never identity sources
|
|
73
|
+
${storyboardReferenceActive
|
|
74
|
+
? `- Storyboard-reference project gate is active: generate GPT Image 2 character sheets and per-shot storyboards first; do not ask for main-shot start/end frame sections
|
|
75
|
+
- Cap per-shot storyboard phases at ${maxStoryboardPhases}; split 5+ meaningful phases into separate SHOTNN.md files`
|
|
76
|
+
: ""}
|
|
43
77
|
|
|
44
78
|
### Video Extension Rules
|
|
45
79
|
- Extension syntax should start from the existing clip: \`Extend @video1 by 5s\`
|
|
@@ -116,10 +150,12 @@ model_reasoning_effort = "high"
|
|
|
116
150
|
developer_instructions = ${tomlString(developerInstructions)}
|
|
117
151
|
`;
|
|
118
152
|
}
|
|
119
|
-
function buildCodexImageSkill(workflowFile,
|
|
153
|
+
function buildCodexImageSkill(workflowFile, config) {
|
|
154
|
+
const outputDir = config.outputDir;
|
|
155
|
+
const storyboardReferenceActive = isStoryboardReference(config);
|
|
120
156
|
return `---
|
|
121
157
|
name: film-kit-codex-images
|
|
122
|
-
description: Optional Codex-native still
|
|
158
|
+
description: Optional Codex-native still phase for Film-Kit. Use after successful prompt generation when the user wants ${storyboardReferenceActive ? "optional character sheet or storyboard still prep" : "to create or iteratively edit accepted ILK FRAME and SON FRAME images"} inside Codex. Never auto-start; offer it after /generate and wait for user confirmation.
|
|
123
159
|
---
|
|
124
160
|
|
|
125
161
|
# Film-Kit Codex Images
|
|
@@ -141,20 +177,28 @@ This skill is for **Codex only**. It adds a still-image phase after Film-Kit pro
|
|
|
141
177
|
## Core Behavior
|
|
142
178
|
- Use Codex's built-in image generation/editing flow.
|
|
143
179
|
- If a local image file must be edited, first bring it into the conversation context, then edit it.
|
|
144
|
-
|
|
180
|
+
${storyboardReferenceActive
|
|
181
|
+
? `- Storyboard-reference mode does not require \`ILK FRAME\` / \`SON FRAME\` assets.
|
|
182
|
+
- 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.
|
|
183
|
+
- Preserve role separation: character sheets lock identity; shot storyboard images guide staging only.
|
|
184
|
+
- Do not convert storyboard-reference shots back into start/end frame chaining.`
|
|
185
|
+
: `- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
|
|
145
186
|
- Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
146
|
-
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start
|
|
187
|
+
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.`}
|
|
147
188
|
- After every image, ask the user to accept it or request a targeted edit.
|
|
148
189
|
|
|
149
190
|
## Output Contract
|
|
150
191
|
- Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
|
|
151
|
-
|
|
152
|
-
-
|
|
192
|
+
${storyboardReferenceActive
|
|
193
|
+
? "- Canonical files are optional role-specific references such as `character-sheet.png` and `shot-storyboard.png` when requested"
|
|
194
|
+
: "- 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`"}
|
|
153
195
|
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
154
196
|
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
155
197
|
`;
|
|
156
198
|
}
|
|
157
|
-
function buildCodexImagesWorkflow(
|
|
199
|
+
function buildCodexImagesWorkflow(config) {
|
|
200
|
+
const outputDir = config.outputDir;
|
|
201
|
+
const storyboardReferenceActive = isStoryboardReference(config);
|
|
158
202
|
return `---
|
|
159
203
|
description: Optional Codex-native still image phase for Film-Kit single-agent output
|
|
160
204
|
---
|
|
@@ -175,30 +219,37 @@ description: Optional Codex-native still image phase for Film-Kit single-agent o
|
|
|
175
219
|
\`\`\`text
|
|
176
220
|
${outputDir}/codex-images/
|
|
177
221
|
├── SHOTNN/
|
|
178
|
-
|
|
222
|
+
${storyboardReferenceActive
|
|
223
|
+
? "│ ├── character-sheet.png\n│ └── shot-storyboard.png"
|
|
224
|
+
: `│ ├── ilk-frame.png
|
|
179
225
|
│ ├── ilk-frame-v2.png
|
|
180
226
|
│ ├── son-frame.png
|
|
181
|
-
│ └── son-frame-v3.png
|
|
227
|
+
│ └── son-frame-v3.png`}
|
|
182
228
|
├── manifest.json
|
|
183
229
|
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
184
230
|
\`\`\`
|
|
185
231
|
|
|
186
232
|
## Flow
|
|
187
233
|
1. Ask which shot range to process. Default to sequential order.
|
|
188
|
-
|
|
234
|
+
${storyboardReferenceActive
|
|
235
|
+
? `2. For storyboard-reference projects, do not require start/end frame stills.
|
|
236
|
+
3. If the user requests still prep, create or edit character identity references and storyboard planning references.
|
|
237
|
+
4. Preserve \`Storyboard Plan\` role separation: identity stills cannot inherit storyboard character design, and storyboard stills cannot override identity/wardrobe/props.
|
|
238
|
+
5. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted reference.`
|
|
239
|
+
: `2. For a fresh shot, generate \`ILK FRAME\` from the accepted prompt plus references.
|
|
189
240
|
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
190
241
|
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
191
242
|
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
192
243
|
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
193
244
|
7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
|
|
194
245
|
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.
|
|
195
|
-
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image
|
|
246
|
+
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.`}
|
|
196
247
|
|
|
197
248
|
## Hard Rules
|
|
198
249
|
- Never auto-start this workflow.
|
|
199
|
-
- V1 covers only main-shot
|
|
250
|
+
- ${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`."}
|
|
200
251
|
- Do not generate coverage stills or video here.
|
|
201
|
-
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
252
|
+
- Preserve ${storyboardReferenceActive ? "storyboard handoff continuity" : "chain continuity"} unless the user explicitly requests a reset.
|
|
202
253
|
`;
|
|
203
254
|
}
|
|
204
255
|
export function buildProjectFiles(config) {
|
|
@@ -232,12 +283,14 @@ export function buildProjectFiles(config) {
|
|
|
232
283
|
files[".codex/config.toml"] = buildCodexConfig();
|
|
233
284
|
files[".codex/agents/prompt-engineer.toml"] = buildCodexAgentToml("prompt_engineer", "Film-Kit prompt engineer for single-agent cinematic shot generation, repair, and delivery QA.", `Read AGENTS.md first, then .agent/model-profile.md, .agent/MASTER.md, .agent/VOICE-DESIGN.md, .agent/agents/prompt-engineer.md, and the requested .agent/workflows/*.md file before acting.
|
|
234
285
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
235
|
-
|
|
286
|
+
${isStoryboardReference(config)
|
|
287
|
+
? "When /generate is requested, treat it as storyboard-reference generation: require a character reference, follow .agent/workflows/generate.md, and do not create ILK FRAME / SON FRAME sections. Offer /codex-images only as optional reference still prep after QA passes."
|
|
288
|
+
: "When /generate finishes successfully inside Codex, always offer /codex-images as an optional still-image phase. Never auto-start it."}
|
|
236
289
|
When /generate-storyboard is requested, use .agent/workflows/generate-storyboard.md and .agent/skills/storyboard-reference/SKILL.md; do not require start/end frames.
|
|
237
290
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
238
291
|
For worktree runs, if node_modules or build outputs are missing and package.json exists, bootstrap with npm install and npm run build before running package commands.`);
|
|
239
|
-
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images.md", config
|
|
240
|
-
files[".agent/workflows/codex-images.md"] = buildCodexImagesWorkflow(config
|
|
292
|
+
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images.md", config);
|
|
293
|
+
files[".agent/workflows/codex-images.md"] = buildCodexImagesWorkflow(config);
|
|
241
294
|
if (config.platforms.includes("antigravity")) {
|
|
242
295
|
files[".agents/skills/shotforge-generate/SKILL.md"] = buildAntigravitySkill(config);
|
|
243
296
|
}
|
|
@@ -318,8 +371,24 @@ When the user asks \`/generate-storyboard\`, use character reference + storyboar
|
|
|
318
371
|
- If there is an active/selected markdown file in editor, use that first.
|
|
319
372
|
- Target model: \`${config.model}\` (${getModelDisplayName(config.model)})
|
|
320
373
|
- Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
|
|
374
|
+
${buildReferenceModeSummary(config)}
|
|
375
|
+
${buildStoryboardPlatformGuard(config)}
|
|
321
376
|
|
|
322
377
|
## Output Contract
|
|
378
|
+
${isStoryboardReference(config)
|
|
379
|
+
? `In storyboard-reference mode, each \`SHOTNN.md\` contains storyboard prompt package sections only:
|
|
380
|
+
- Input Asset Roles
|
|
381
|
+
- Reference Asset Requirements
|
|
382
|
+
- GPT Image 2 Character Sheet Prompt
|
|
383
|
+
- GPT Image 2 SHOTNN Storyboard Prompt
|
|
384
|
+
- Storyboard Plan
|
|
385
|
+
- Audio Plan
|
|
386
|
+
- ${config.model === "seedance-2.0" ? "Seedance 2.0 Ready Video Prompt" : "Model-Ready Video Prompt"}
|
|
387
|
+
- Coverage Shots
|
|
388
|
+
- QA Verdict
|
|
389
|
+
|
|
390
|
+
Do not use the start/end frame output contract in this mode.`
|
|
391
|
+
: `
|
|
323
392
|
Each \`SHOTNN.md\` is a **single file** containing ALL shot details:
|
|
324
393
|
- 🔗 Chain status (FIRST / CHAINED / CHAIN BREAK)
|
|
325
394
|
- İLK FRAME (start frame image prompt — compact reference-first still contract)
|
|
@@ -329,12 +398,13 @@ Each \`SHOTNN.md\` is a **single file** containing ALL shot details:
|
|
|
329
398
|
- COVERAGE SHOTS (2-3 coverage shots within same file — compact stills + detailed coverage video when needed)
|
|
330
399
|
- 🇹🇷 Turkish summary for each section
|
|
331
400
|
- Avoid line on EVERY prompt
|
|
401
|
+
`}
|
|
332
402
|
|
|
333
403
|
## Critical Rules
|
|
334
404
|
- **AUTO-ANONYMOUS:** Replace ALL real person names with physical descriptions automatically
|
|
335
405
|
- **Name Policy:** Visual prompts must stay anonymous. Dialogue naming follows \`shot-plan.json\` policy.
|
|
336
406
|
- **AUTO-SAFETY:** Proactively reframe content that may trigger safety filters
|
|
337
|
-
- **
|
|
407
|
+
- **Continuity:** ${isStoryboardReference(config) ? "Storyboard handoff continuity replaces start/end frame chaining" : "Last frame of SHOT[N] = First frame of SHOT[N+1]"}
|
|
338
408
|
- **Semantic Consistency:** \`shot-plan.json.visual_world\` is canonical for perspective, named camera movement strategy, shadow vector, scale, reflection, physics, and seed strategy
|
|
339
409
|
- **Coverage Mandatory:** Every main shot includes 2-3 coverage sub-shots in same file
|
|
340
410
|
- **Voice Design:** \`shot-plan.json\` keeps top-level \`voiceCast\`; every speaking VIDEO section keeps \`Audio Plan\`
|
|
@@ -346,6 +416,8 @@ Each \`SHOTNN.md\` is a **single file** containing ALL shot details:
|
|
|
346
416
|
function buildCursorLegacyRules(config) {
|
|
347
417
|
return `# Film-Kit Rules — Hollywood Standard Cinematic Prompt Engineering
|
|
348
418
|
# ${getModelDisplayName(config.model)} | ALL GENRES SUPPORTED
|
|
419
|
+
${buildReferenceModeSummary(config)}
|
|
420
|
+
${buildStoryboardPlatformGuard(config)}
|
|
349
421
|
|
|
350
422
|
## CRITICAL: SKILL LOADING PROTOCOL
|
|
351
423
|
Before generating ANY prompts, read the appropriate skill files from .agent/skills/:
|
|
@@ -374,10 +446,10 @@ Read .agent/VOICE-DESIGN.md when dialogue, narrator VO, or reusable speaker iden
|
|
|
374
446
|
6. Music: NONE by default. User must explicitly request.
|
|
375
447
|
7. EVERY prompt must have an Avoid line. No exceptions.
|
|
376
448
|
8. Coverage shots mandatory (2-3 per main shot, included in same file; stills stay compact, coverage videos stay detailed).
|
|
377
|
-
9.
|
|
449
|
+
9. Continuity: ${isStoryboardReference(config) ? "storyboard handoff continuity; do not use start/end frame chaining." : "Last frame of SHOT[N] = First frame of SHOT[N+1]."}
|
|
378
450
|
10. Semantic consistency: \`${config.outputDir}/shot-plan.json\` must include \`visual_world\`; prompts must align camera, named movement strategy, light/shadow vector, scale, reflections, physics, anatomy risk, and contextual logic.
|
|
379
|
-
11. ILK/İLK FRAME section must contain a code block even for chained shots.
|
|
380
|
-
12. Chained ILK/İLK FRAME code blocks must contain only:
|
|
451
|
+
11. ${isStoryboardReference(config) ? "Storyboard-reference SHOTNN.md files must contain Input Asset Roles, Reference Asset Requirements, GPT Image 2 storyboard prompt, Storyboard Plan, Audio Plan, model-ready video prompt, coverage, and QA Verdict." : "ILK/İLK FRAME section must contain a code block even for chained shots."}
|
|
452
|
+
12. ${isStoryboardReference(config) ? "ILK/İLK FRAME and SON FRAME sections are forbidden in storyboard-reference mode." : "Chained ILK/İLK FRAME code blocks must contain only: `Use SHOT[prev]_END as exact first frame`; any new visual prompt is a CHAIN BREAK."}
|
|
381
453
|
13. ONE FILE PER SHOT: Each SHOTNN.md contains main shot + all coverage shots.
|
|
382
454
|
14. Keep top-level \`voiceCast\` in ${config.outputDir}/shot-plan.json and \`Audio Plan\` in every speaking VIDEO section.
|
|
383
455
|
15. Storyboard-reference mode: character ref locks identity; storyboard ref controls staging/camera/timing only; 5+ phases split.
|
|
@@ -407,6 +479,8 @@ alwaysApply: true
|
|
|
407
479
|
---
|
|
408
480
|
|
|
409
481
|
# Film-Kit — Hollywood Standard Prompt Engineering
|
|
482
|
+
${buildReferenceModeSummary(config)}
|
|
483
|
+
${buildStoryboardPlatformGuard(config)}
|
|
410
484
|
|
|
411
485
|
## Entry Point
|
|
412
486
|
Read \`.agent/MASTER.md\` for complete production ruleset.
|
|
@@ -439,13 +513,13 @@ All skills at: \`.agent/skills/[name]/SKILL.md\`
|
|
|
439
513
|
- \`shot-plan.json\` stores top-level \`visual_world\` for camera/lens/camera-movement/light/shadow/scale/reflection/physics/seed strategy
|
|
440
514
|
- Every speaking VIDEO section includes \`Audio Plan\`
|
|
441
515
|
- AUTO-SAFETY: Proactively reframe sensitive content
|
|
442
|
-
-
|
|
443
|
-
- Chained ILK/İLK FRAME code block contains only
|
|
516
|
+
- Continuity: ${isStoryboardReference(config) ? "storyboard handoff continuity; start/end frame chaining is disabled" : "Last frame SHOT[N] = First frame SHOT[N+1]"}
|
|
517
|
+
- ${isStoryboardReference(config) ? "Main-shot ILK/İLK FRAME and SON FRAME sections are forbidden in storyboard-reference mode" : "Chained ILK/İLK FRAME code block contains only `Use SHOT[prev]_END as exact first frame`; any new visual prompt requires CHAIN BREAK"}
|
|
444
518
|
- Coverage: 2-3 sub-shots per main shot (same file; compact stills, detailed coverage videos)
|
|
445
519
|
- Avoid line: MANDATORY on every prompt
|
|
446
520
|
- Music: NONE by default
|
|
447
521
|
- Duration: 8s default, slow burn pacing
|
|
448
|
-
- ILK/İLK FRAME section always contains a code block
|
|
522
|
+
- ${isStoryboardReference(config) ? "Required storyboard sections: Input Asset Roles, Reference Asset Requirements, GPT Image 2 storyboard prompt, Storyboard Plan, Audio Plan, model-ready video prompt, Coverage, QA Verdict" : "ILK/İLK FRAME section always contains a code block"}
|
|
449
523
|
- ONE FILE PER SHOT: SHOTNN.md contains everything
|
|
450
524
|
|
|
451
525
|
## Output
|
|
@@ -464,6 +538,8 @@ function buildClaudeRoot(config) {
|
|
|
464
538
|
|
|
465
539
|
## Workspace Mode
|
|
466
540
|
Single-agent shot package generation. Claude Code may use the native \`prompt-engineer\` subagent for focused drafting or repair, but planning and delivery stay in one session.
|
|
541
|
+
${buildReferenceModeSummary(config)}
|
|
542
|
+
${buildStoryboardPlatformGuard(config)}
|
|
467
543
|
|
|
468
544
|
## Mandatory Read Order
|
|
469
545
|
1. \`.agent/model-profile.md\`
|
|
@@ -512,9 +588,9 @@ Before generating ANY prompts, read skills from \`.agent/skills/\`:
|
|
|
512
588
|
7. **Avoid line:** MANDATORY on every prompt (image, video, coverage).
|
|
513
589
|
8. **Coverage:** 2-3 sub-shots within same SHOTNN.md file, min 70 words each.
|
|
514
590
|
9. **Voice Design:** keep project-level \`voiceCast\` in \`${config.outputDir}/shot-plan.json\` and per-shot \`Audio Plan\` in each VIDEO section.
|
|
515
|
-
10. **
|
|
516
|
-
11. **Chained ILK/İLK FRAME:** code block contains only
|
|
517
|
-
12. **Image Prompt Contract:** reference-anchored ILK/SON use
|
|
591
|
+
10. **Continuity:** ${isStoryboardReference(config) ? "Use storyboard handoff continuity; do not create start/end frame sections." : "Always include a fenced ILK/İLK FRAME code block, even when chained."}
|
|
592
|
+
11. **Chained ILK/İLK FRAME:** ${isStoryboardReference(config) ? "Forbidden in storyboard-reference mode." : "code block contains only `Use SHOT[prev]_END as exact first frame`; any new visual prompt requires CHAIN BREAK."}
|
|
593
|
+
12. **Image Prompt Contract:** ${isStoryboardReference(config) ? "GPT Image 2 character sheets lock identity; per-shot storyboard prompts control staging only; VIDEO >= 120; coverage video >= 70." : "reference-anchored ILK/SON use `REFERENCE LOCK` + `Keep same` + `Change only`; VIDEO >= 120; coverage video >= 70."}
|
|
518
594
|
13. **Specificity Floor:** lens/framing, lighting, and foreground/midground/background action are mandatory.
|
|
519
595
|
14. **Spatial Realism Floor:** eyeline target, plane map, shared light source, and contact/depth cues are mandatory when relational staging matters.
|
|
520
596
|
15. **Semantic Consistency Floor:** \`visual_world\`, perspective/geometry, shadow vector, scale map, reflections, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradictions, and targeted semantic avoid terms are mandatory.
|
|
@@ -541,6 +617,8 @@ function buildClaudeLocal(config) {
|
|
|
541
617
|
return `# Local Claude Project Rules — Film-Kit Core
|
|
542
618
|
|
|
543
619
|
This workspace keeps high-level policy in \`CLAUDE.md\` and operational detail in \`.claude/rules/\`.
|
|
620
|
+
${buildReferenceModeSummary(config)}
|
|
621
|
+
${buildStoryboardPlatformGuard(config)}
|
|
544
622
|
|
|
545
623
|
## Before Any Generation or Repair
|
|
546
624
|
1. Read \`.agent/model-profile.md\`
|
|
@@ -576,6 +654,8 @@ description: Generate and repair Film-Kit single-agent shot packages with strict
|
|
|
576
654
|
---
|
|
577
655
|
|
|
578
656
|
Use the Film-Kit core runtime.
|
|
657
|
+
${buildReferenceModeSummary(config)}
|
|
658
|
+
${buildStoryboardPlatformGuard(config)}
|
|
579
659
|
|
|
580
660
|
## Read First
|
|
581
661
|
1. \`.agent/model-profile.md\`
|
|
@@ -611,6 +691,8 @@ function buildClaudeRuleGenerateFlow(config) {
|
|
|
611
691
|
Read \`.agent/workflows/generate.md\` for the complete generation workflow.
|
|
612
692
|
Read \`.agent/model-profile.md\` for active model constraints.
|
|
613
693
|
If using the native Claude subagent, read \`.claude/agents/prompt-engineer.md\` and give it an explicit shot range or repair target.
|
|
694
|
+
${buildReferenceModeSummary(config)}
|
|
695
|
+
${buildStoryboardPlatformGuard(config)}
|
|
614
696
|
|
|
615
697
|
## Quick Reference
|
|
616
698
|
1. **Scenario Analysis:**
|
|
@@ -662,6 +744,8 @@ Input source: \`${config.scenarioHint}\` or active editor file.
|
|
|
662
744
|
}
|
|
663
745
|
function buildClaudeRuleOutputContract(config) {
|
|
664
746
|
return `# Output Contract — Film-Kit
|
|
747
|
+
${buildReferenceModeSummary(config)}
|
|
748
|
+
${buildStoryboardPlatformGuard(config)}
|
|
665
749
|
|
|
666
750
|
## Required Files
|
|
667
751
|
- \`${config.outputDir}/project-info.md\` — Characters, settings, emotional arc mapping, tension levels
|
|
@@ -886,6 +970,8 @@ function buildClaudeSettingsLocal() {
|
|
|
886
970
|
function buildCopilotInstructions(config) {
|
|
887
971
|
return `# Film-Kit — Copilot Instructions
|
|
888
972
|
## Hollywood Standard Cinematic Prompt Engineering for ${getModelDisplayName(config.model)}
|
|
973
|
+
${buildReferenceModeSummary(config)}
|
|
974
|
+
${buildStoryboardPlatformGuard(config)}
|
|
889
975
|
|
|
890
976
|
### System Entry Point
|
|
891
977
|
Read \`.agent/MASTER.md\` for the complete production ruleset.
|
|
@@ -926,8 +1012,8 @@ Before generating ANY prompts, read skills from \`.agent/skills/\`:
|
|
|
926
1012
|
- **AUTO-ANONYMOUS:** Replace ALL real names with physical descriptions
|
|
927
1013
|
- **Name Policy:** Dialogue naming follows \`${config.outputDir}/shot-plan.json\` policy
|
|
928
1014
|
- **AUTO-SAFETY:** Proactively reframe sensitive content
|
|
929
|
-
- **
|
|
930
|
-
- **Chain Hardening:** chained ILK/İLK FRAME code block contains only
|
|
1015
|
+
- **Continuity:** ${isStoryboardReference(config) ? "Storyboard handoff continuity replaces start/end frame chaining" : "Last frame of SHOT[N] = First frame of SHOT[N+1]"}
|
|
1016
|
+
- **Chain Hardening:** ${isStoryboardReference(config) ? "ILK/İLK FRAME and SON FRAME sections are forbidden in storyboard-reference mode" : "chained ILK/İLK FRAME code block contains only `Use SHOT[prev]_END as exact first frame`"}
|
|
931
1017
|
- **Coverage:** 2-3 sub-shots per main shot (in same file; stills compact, coverage videos detailed)
|
|
932
1018
|
- **Spatial Realism:** eyeline targets, shared light, depth scale, and anti-cutout staging must agree when subjects share frame
|
|
933
1019
|
- **Semantic Consistency:** \`visual_world\` controls perspective/geometry, shadow vector, scale map, reflections, physics, anatomy risk, background coherence, and contextual contradictions
|
|
@@ -937,7 +1023,7 @@ Before generating ANY prompts, read skills from \`.agent/skills/\`:
|
|
|
937
1023
|
- **Storyboard Reference:** character ref identity wins; storyboard ref cannot redesign wardrobe, face, props, or copy text/logos
|
|
938
1024
|
- **Duration:** 8s default, slow burn pacing
|
|
939
1025
|
- **Language:** Prompts in English, dialogue preserved
|
|
940
|
-
- **ILK/İLK FRAME
|
|
1026
|
+
- **Shot Format:** ${isStoryboardReference(config) ? "use storyboard-reference sections and QA Verdict; do not emit start/end frame sections" : "keep ILK/İLK FRAME fenced code block even when chained"}
|
|
941
1027
|
- **ONE FILE PER SHOT:** SHOTNN.md contains main shot + all coverage
|
|
942
1028
|
|
|
943
1029
|
### Other Workflows
|
|
@@ -958,6 +1044,8 @@ function buildCopilotScopedInstructions(config) {
|
|
|
958
1044
|
applyTo: "**/*.md"
|
|
959
1045
|
---
|
|
960
1046
|
# Film-Kit Scoped Instructions
|
|
1047
|
+
${buildReferenceModeSummary(config)}
|
|
1048
|
+
${buildStoryboardPlatformGuard(config)}
|
|
961
1049
|
|
|
962
1050
|
When request is /generate, follow the Film-Kit Hollywood production system:
|
|
963
1051
|
1. Read \`.agent/workflows/generate.md\` for full procedure
|
|
@@ -987,6 +1075,8 @@ This skill is part of the Film-Kit prompt engineering system.
|
|
|
987
1075
|
Read \`.agent/MASTER.md\` for the complete production ruleset (690+ rules).
|
|
988
1076
|
Read \`.agent/VOICE-DESIGN.md\` for project-level \`voiceCast\` and shot-level \`audioPlan\`.
|
|
989
1077
|
Read \`.agent/model-profile.md\` first for active model constraints.
|
|
1078
|
+
${buildReferenceModeSummary(config)}
|
|
1079
|
+
${buildStoryboardPlatformGuard(config)}
|
|
990
1080
|
|
|
991
1081
|
## Skill Loading Protocol
|
|
992
1082
|
Before generating ANY prompts, read these skills:
|
|
@@ -1031,23 +1121,27 @@ Before generating ANY prompts, read these skills:
|
|
|
1031
1121
|
1. **AUTO-ANONYMOUS:** Replace ALL real person names with physical descriptions
|
|
1032
1122
|
2. **Name Policy:** Dialogue naming follows \`${config.outputDir}/shot-plan.json\` policy
|
|
1033
1123
|
3. **AUTO-SAFETY:** Proactively reframe sensitive content
|
|
1034
|
-
4. **
|
|
1124
|
+
4. **Continuity:** ${isStoryboardReference(config) ? "Storyboard handoff continuity replaces start/end frame chaining" : "Last frame of SHOT[N] becomes first frame of SHOT[N+1]"}
|
|
1035
1125
|
5. **Coverage Mandatory:** 2-3 sub-shots per main shot (in same file; stills compact, coverage videos detailed)
|
|
1036
1126
|
6. **Avoid Line:** MANDATORY on every prompt (image + video + coverage)
|
|
1037
1127
|
7. **Voice Design:** keep \`voiceCast\` in \`${config.outputDir}/shot-plan.json\` and \`Audio Plan\` in every speaking VIDEO section
|
|
1038
1128
|
8. **Music: NONE** by default
|
|
1039
1129
|
9. **Ultra Realism** default visual mode
|
|
1040
1130
|
10. **8s duration** default, slow burn pacing
|
|
1041
|
-
11. **ILK/İLK FRAME
|
|
1042
|
-
12. **Chained ILK/İLK FRAME
|
|
1131
|
+
11. **Shot Format:** ${isStoryboardReference(config) ? "Use storyboard-reference sections; main-shot ILK/İLK FRAME and SON FRAME sections are forbidden" : "ILK/İLK FRAME always keeps a fenced code block"}
|
|
1132
|
+
12. **Chain Hardening:** ${isStoryboardReference(config) ? "Exact first-frame reuse text is forbidden in storyboard-reference mode" : "Chained ILK/İLK FRAME code block contains only `Use SHOT[prev]_END as exact first frame`; any new visual prompt is CHAIN BREAK"}
|
|
1043
1133
|
13. **ONE FILE PER SHOT:** SHOTNN.md contains main shot + all coverage
|
|
1044
1134
|
14. **Relational Realism:** preserve eyeline targets, shared light, depth scale, and anti-cutout staging when multiple subjects share frame
|
|
1045
1135
|
15. **Semantic Consistency:** preserve \`visual_world\` perspective, shadow vector, scale map, reflections, gravity/contact physics, anatomy risk, foreground/background coherence, and contextual logic
|
|
1046
1136
|
|
|
1047
1137
|
## Quality Floor (Hard Gate)
|
|
1048
1138
|
Reject and regenerate any shot that fails:
|
|
1049
|
-
|
|
1050
|
-
|
|
1139
|
+
${isStoryboardReference(config)
|
|
1140
|
+
? `- missing \`Input Asset Roles\`, \`Reference Asset Requirements\`, \`GPT Image 2 SHOTNN Storyboard Prompt\`, \`Storyboard Plan\`, \`Audio Plan\`, model-ready video prompt, coverage, or \`QA Verdict\`
|
|
1141
|
+
- missing character sheet prompt or role separation between character identity and storyboard staging
|
|
1142
|
+
- forbidden main-shot start/end frame sections appear in storyboard-reference mode`
|
|
1143
|
+
: `- reference-anchored ILK FRAME missing \`REFERENCE LOCK\`, \`Keep same\`, or \`Change only\`
|
|
1144
|
+
- SON FRAME drifts from the same visual universe or changes more than one major beat`}
|
|
1051
1145
|
- VIDEO < 120 words
|
|
1052
1146
|
- any coverage video prompt < 70 words
|
|
1053
1147
|
- reference-visible face/hair/skin/body/wardrobe/accessories/prop design drift
|
|
@@ -1077,6 +1171,7 @@ function buildModelProfile(config) {
|
|
|
1077
1171
|
- Target model: \`${config.model}\`
|
|
1078
1172
|
- Display name: ${getModelDisplayName(config.model)}
|
|
1079
1173
|
- Kling preset: \`${getKlingPresetDisplay(config.model, config.klingPreset)}\`
|
|
1174
|
+
${buildReferenceModeSummary(config)}
|
|
1080
1175
|
|
|
1081
1176
|
## Active Profile Summary
|
|
1082
1177
|
${isKling
|
|
@@ -1094,6 +1189,19 @@ ${isKling
|
|
|
1094
1189
|
- Frame chaining and coverage contracts are active
|
|
1095
1190
|
- Default pacing: 8s slow burn`}
|
|
1096
1191
|
|
|
1192
|
+
${isStoryboardReference(config)
|
|
1193
|
+
? `
|
|
1194
|
+
## Storyboard-Reference Hard Gate
|
|
1195
|
+
|
|
1196
|
+
- \`/generate\` must behave as \`/generate-storyboard\`; do not use the legacy start/end shot workflow.
|
|
1197
|
+
- A character reference is required before shot generation. If no in-context character image, \`--character-ref\`, or \`refs/character.png\` is available, stop and request one.
|
|
1198
|
+
- Required shot sections: \`Input Asset Roles\`, \`Reference Asset Requirements\`, \`GPT Image 2 Character Sheet Prompt\`, \`GPT Image 2 SHOTNN Storyboard Prompt\`, \`Storyboard Plan\`, \`Audio Plan\`, \`Seedance 2.0 Ready Video Prompt\` or model-ready equivalent, \`Coverage Shots\`, and \`QA Verdict\`.
|
|
1199
|
+
- Forbidden main-shot sections/text: \`ILK FRAME\`, \`İLK FRAME\`, \`SON FRAME\`, \`SHOTNN_START\`, \`SHOTNN_END\`, exact first-frame reuse instructions, and mandatory Start+End transition fields.
|
|
1200
|
+
- Frame chaining is replaced by storyboard handoff continuity: the final \`Storyboard Plan\` phase of SHOT[N] must hand off into the opening phase of SHOT[N+1].
|
|
1201
|
+
- Safety and semantic reports must use \`storyboard_reference_status\` and \`storyboard_handoff_status\`, not start/end contract fields.
|
|
1202
|
+
`
|
|
1203
|
+
: ""}
|
|
1204
|
+
|
|
1097
1205
|
---
|
|
1098
1206
|
|
|
1099
1207
|
## Veo 3.1 Rules${config.model === "veo31" ? " (ACTIVE)" : " (Reference)"}
|
|
@@ -1126,7 +1234,7 @@ When generating video from a reference image:
|
|
|
1126
1234
|
|
|
1127
1235
|
---
|
|
1128
1236
|
|
|
1129
|
-
${buildSeedanceProfile(isSeedance)}
|
|
1237
|
+
${buildSeedanceProfile(isSeedance, isStoryboardReference(config), config.storyboardReferenceMode?.maxStoryboardPhases ?? 4)}
|
|
1130
1238
|
|
|
1131
1239
|
---
|
|
1132
1240
|
|
|
@@ -94,3 +94,19 @@ npx @milenyumai/film-kit generate-storyboard \
|
|
|
94
94
|
- Missing GPT Image 2 per-shot storyboard prompt: output is invalid.
|
|
95
95
|
- Missing `Avoid` / negative prompt: output is invalid.
|
|
96
96
|
- Kling prompt missing required block structure: output is invalid.
|
|
97
|
+
- Main-shot `ILK FRAME`, `İLK FRAME`, `SON FRAME`, `SHOTNN_START`, `SHOTNN_END`, exact first-frame reuse instructions, or mandatory Start+End transition fields: output is invalid in storyboard-reference mode.
|
|
98
|
+
|
|
99
|
+
## Required SHOTNN.md Sections
|
|
100
|
+
|
|
101
|
+
Every storyboard-reference shot file must include:
|
|
102
|
+
|
|
103
|
+
- `Model Control`
|
|
104
|
+
- `Input Asset Roles`
|
|
105
|
+
- `Reference Asset Requirements`
|
|
106
|
+
- `GPT Image 2 Character Sheet Prompt` or a link to the generated character sheet prompt
|
|
107
|
+
- `GPT Image 2 SHOTNN Storyboard Prompt`
|
|
108
|
+
- `Storyboard Plan`
|
|
109
|
+
- `Audio Plan`
|
|
110
|
+
- `Seedance 2.0 Ready Video Prompt` or model-ready equivalent
|
|
111
|
+
- `Coverage Shots`
|
|
112
|
+
- `QA Verdict`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milenyumai/film-kit",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Single-package Film-Kit distribution with preset-driven cinematic runtime setup for OpenAI Codex App, Claude Code, Cursor, Copilot, and Antigravity.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"build:presets": "npm --prefix packages/multi run build && npm --prefix packages/hybrid run build && npm --prefix packages/hybrid-smart run build && npm --prefix packages/gpt-image-smart run build && npm --prefix packages/studio run build",
|
|
45
45
|
"dev:setup": "tsx src/postinstall.ts",
|
|
46
46
|
"postinstall": "node -e \"import('./build/postinstall.js').then(m=>m.runPostinstall()).catch(()=>{})\"",
|
|
47
|
+
"release:check": "npm run typecheck && npm test && npm run build && npm publish --access public --dry-run",
|
|
47
48
|
"test": "vitest run",
|
|
48
49
|
"test:watch": "vitest",
|
|
49
50
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
@@ -67,17 +67,17 @@ function getBaseContentDirCandidates() {
|
|
|
67
67
|
return candidates;
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
|
-
* Best-effort candidates for locating
|
|
70
|
+
* Best-effort candidates for locating the internal multi preset content directory.
|
|
71
71
|
* 1) Monorepo/dev layout (packages/multi/content)
|
|
72
|
-
* 2) Installed package layout
|
|
72
|
+
* 2) Installed single-package layout (node_modules/@milenyumai/film-kit/packages/multi/content)
|
|
73
73
|
*/
|
|
74
74
|
function getMultiContentDirCandidates() {
|
|
75
75
|
const candidates = [];
|
|
76
76
|
candidates.push(join(__dirname, "..", "..", "..", "multi", "content"));
|
|
77
77
|
try {
|
|
78
78
|
const require = createRequire(import.meta.url);
|
|
79
|
-
const
|
|
80
|
-
candidates.push(join(dirname(
|
|
79
|
+
const basePkgJson = require.resolve("@milenyumai/film-kit/package.json");
|
|
80
|
+
candidates.push(join(dirname(basePkgJson), "packages", "multi", "content"));
|
|
81
81
|
}
|
|
82
82
|
catch {
|
|
83
83
|
// Dependency may be unavailable in some local contexts.
|