@milenyumai/film-kit 2.0.1 → 2.1.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.
- package/README.md +4 -1
- package/build/lib/templates.js +93 -0
- package/content/agents/prompt-engineer.md +1 -0
- package/content/workflows/generate.md +5 -0
- package/package.json +2 -2
- package/packages/hybrid/README.md +1 -0
- package/packages/hybrid/build/lib/templates.js +94 -0
- package/packages/hybrid/content/workflows/generate.md +3 -0
- package/packages/hybrid-smart/README.md +1 -0
- package/packages/hybrid-smart/build/lib/templates.js +94 -0
- package/packages/hybrid-smart/content/workflows/generate.md +3 -0
- package/packages/multi/README.md +2 -0
- package/packages/multi/build/lib/configure.js +3 -1
- package/packages/multi/build/lib/templates.js +102 -1
- package/packages/multi/content/agents/lead-director.md +1 -0
- package/packages/multi/content/workflows/generate-multi.md +1 -0
- package/packages/studio/README.md +2 -0
- package/packages/studio/build/lib/configure.js +3 -1
- package/packages/studio/build/lib/templates.js +116 -1
- package/packages/studio/content/agents/render-supervisor.md +1 -0
package/README.md
CHANGED
|
@@ -51,6 +51,8 @@ npx @milenyumai/film-kit init --preset studio --model seedance-2.0 --refs-dir ./
|
|
|
51
51
|
|
|
52
52
|
After the first run, Film-Kit writes `film-kit.config.json` and uses that file as the canonical project configuration.
|
|
53
53
|
|
|
54
|
+
In Codex-enabled projects, all presets now include an optional `/codex-images` still phase after a successful `/generate`. It is always opt-in and never auto-starts.
|
|
55
|
+
|
|
54
56
|
## Presets
|
|
55
57
|
|
|
56
58
|
| Preset | Purpose | Supported video model surface | Default notes |
|
|
@@ -238,13 +240,14 @@ Film-Kit writes repo-scoped runtime files for supported editors and agents. Depe
|
|
|
238
240
|
- `.cursor/`
|
|
239
241
|
- `.github/copilot-instructions.md`
|
|
240
242
|
- `AGENTS.md`
|
|
241
|
-
- runtime workflows such as `generate`, `chain`, `safety-check`, `recover`, `finish`
|
|
243
|
+
- runtime workflows such as `generate`, `codex-images`, `chain`, `safety-check`, `recover`, `finish`
|
|
242
244
|
|
|
243
245
|
Editorial/runtime contract shared across the package:
|
|
244
246
|
|
|
245
247
|
- one file per shot: `SHOTNN.md`
|
|
246
248
|
- coverage lives inside the same shot file
|
|
247
249
|
- report files live under `reports/`
|
|
250
|
+
- optional Codex still outputs live under `codex-images/` with `manifest.json` and `reports/CODEX-IMAGE-REPORT.md`
|
|
248
251
|
- continuity and first-frame chaining are explicit
|
|
249
252
|
- voice design uses top-level `voiceCast`
|
|
250
253
|
- per-shot sound control uses `Audio Plan`
|
package/build/lib/templates.js
CHANGED
|
@@ -112,6 +112,91 @@ model_reasoning_effort = "high"
|
|
|
112
112
|
developer_instructions = ${tomlString(developerInstructions)}
|
|
113
113
|
`;
|
|
114
114
|
}
|
|
115
|
+
function buildCodexImageSkill(workflowFile, outputDir) {
|
|
116
|
+
return `---
|
|
117
|
+
name: film-kit-codex-images
|
|
118
|
+
description: Optional Codex-native still image phase for Film-Kit. 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 after /generate and wait for user confirmation.
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
# Film-Kit Codex Images
|
|
122
|
+
|
|
123
|
+
This skill is for **Codex only**. It adds a still-image phase after Film-Kit prompt generation.
|
|
124
|
+
|
|
125
|
+
## Read First
|
|
126
|
+
1. \`${workflowFile}\`
|
|
127
|
+
2. \`.agent/model-profile.md\`
|
|
128
|
+
3. the relevant shot files under \`${outputDir}/shots/\`
|
|
129
|
+
4. \`${outputDir}/shot-plan.json\`
|
|
130
|
+
5. report files under \`${outputDir}/reports/\` when the workflow requires them
|
|
131
|
+
|
|
132
|
+
## Trigger Rules
|
|
133
|
+
- Start only when the user explicitly asks for image generation/editing or accepts the \`/codex-images\` suggestion after \`/generate\`.
|
|
134
|
+
- Do not auto-start this phase.
|
|
135
|
+
- Do not use it for coverage stills or video generation in v1.
|
|
136
|
+
|
|
137
|
+
## Core Behavior
|
|
138
|
+
- Use Codex's built-in image generation/editing flow.
|
|
139
|
+
- If a local image file must be edited, first bring it into the conversation context, then edit it.
|
|
140
|
+
- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
|
|
141
|
+
- Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
142
|
+
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.
|
|
143
|
+
- After every image, ask the user to accept it or request a targeted edit.
|
|
144
|
+
|
|
145
|
+
## Output Contract
|
|
146
|
+
- Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
|
|
147
|
+
- Canonical files: \`ilk-frame.png\`, \`son-frame.png\`
|
|
148
|
+
- Iterations use sibling versioned filenames such as \`ilk-frame-v2.png\` and \`son-frame-v3.png\`
|
|
149
|
+
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
150
|
+
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
151
|
+
`;
|
|
152
|
+
}
|
|
153
|
+
function buildCodexImagesWorkflow(outputDir) {
|
|
154
|
+
return `---
|
|
155
|
+
description: Optional Codex-native still image phase for Film-Kit single-agent output
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
# /codex-images - Film-Kit Codex Still Phase
|
|
159
|
+
|
|
160
|
+
## Preconditions
|
|
161
|
+
- \`/generate\` completed successfully
|
|
162
|
+
- shot files already exist under \`${outputDir}/shots/\`
|
|
163
|
+
- this phase is opt-in; start only after the user confirms
|
|
164
|
+
|
|
165
|
+
## Reference Priority
|
|
166
|
+
1. images already present in the active Codex conversation
|
|
167
|
+
2. user-supplied local image paths
|
|
168
|
+
3. repo-local \`refs/\` folders when present
|
|
169
|
+
|
|
170
|
+
## Output Contract
|
|
171
|
+
\`\`\`text
|
|
172
|
+
${outputDir}/codex-images/
|
|
173
|
+
├── SHOTNN/
|
|
174
|
+
│ ├── ilk-frame.png
|
|
175
|
+
│ ├── ilk-frame-v2.png
|
|
176
|
+
│ ├── son-frame.png
|
|
177
|
+
│ └── son-frame-v3.png
|
|
178
|
+
├── manifest.json
|
|
179
|
+
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
180
|
+
\`\`\`
|
|
181
|
+
|
|
182
|
+
## Flow
|
|
183
|
+
1. Ask which shot range to process. Default to sequential order.
|
|
184
|
+
2. For a fresh shot, generate \`ILK FRAME\` from the accepted prompt plus references.
|
|
185
|
+
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
186
|
+
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
187
|
+
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
188
|
+
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
189
|
+
7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
|
|
190
|
+
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.
|
|
191
|
+
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.
|
|
192
|
+
|
|
193
|
+
## Hard Rules
|
|
194
|
+
- Never auto-start this workflow.
|
|
195
|
+
- V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
|
|
196
|
+
- Do not generate coverage stills or video here.
|
|
197
|
+
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
198
|
+
`;
|
|
199
|
+
}
|
|
115
200
|
export function buildProjectFiles(config) {
|
|
116
201
|
const files = {};
|
|
117
202
|
// Runtime model profile file is generated from selected model options.
|
|
@@ -143,8 +228,11 @@ export function buildProjectFiles(config) {
|
|
|
143
228
|
files[".codex/config.toml"] = buildCodexConfig();
|
|
144
229
|
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.
|
|
145
230
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
231
|
+
When /generate finishes successfully inside Codex, always offer /codex-images as an optional still-image phase. Never auto-start it.
|
|
146
232
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
147
233
|
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.`);
|
|
234
|
+
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images.md", config.outputDir);
|
|
235
|
+
files[".agent/workflows/codex-images.md"] = buildCodexImagesWorkflow(config.outputDir);
|
|
148
236
|
if (config.platforms.includes("antigravity")) {
|
|
149
237
|
files[".agents/skills/shotforge-generate/SKILL.md"] = buildAntigravitySkill(config);
|
|
150
238
|
}
|
|
@@ -190,11 +278,13 @@ All rules, skills, and workflows are located under \`.agent/\`.
|
|
|
190
278
|
| \`/safety-check\` | \`.agent/workflows/safety-check.md\` |
|
|
191
279
|
| \`/recover\` | \`.agent/workflows/recover.md\` |
|
|
192
280
|
| \`/finish\` | \`.agent/workflows/finish.md\` |
|
|
281
|
+
| \`/codex-images\` | \`.agent/workflows/codex-images.md\` |
|
|
193
282
|
|
|
194
283
|
## OpenAI Codex App
|
|
195
284
|
- Open the Git root as the Codex project root; Codex discovers \`AGENTS.md\`, \`.codex/config.toml\`, and \`.agents/skills/\` from that root.
|
|
196
285
|
- Repo-scoped Codex config lives in \`.codex/config.toml\`; Codex may ignore it until the project is trusted in the app.
|
|
197
286
|
- Codex skills live under \`.agents/skills/*/SKILL.md\`; \`.agent/skills\` remains the legacy Film-Kit runtime mirror for Claude/Cursor/Copilot/Antigravity.
|
|
287
|
+
- Codex-native still phase lives in \`.agents/skills/film-kit-codex-images/SKILL.md\` and starts with \`/codex-images\` only after user confirmation.
|
|
198
288
|
- Codex custom agents live in \`.codex/agents/*.toml\` and point back to the canonical \`.agent/agents/*.md\` role files.
|
|
199
289
|
- Full-auto Codex profile: \`approval_policy = "never"\`, \`sandbox_mode = "danger-full-access"\`, \`[agents] max_threads = 6\`, \`max_depth = 1\`.
|
|
200
290
|
- Worktree bootstrap: if \`node_modules\` or build output is missing, run \`npm install\` and \`npm run build\` before package commands.
|
|
@@ -208,6 +298,7 @@ When the user asks \`/generate\`, convert the scenario into:
|
|
|
208
298
|
- \`${config.outputDir}/reports/SEMANTIC-REPORT.md\` — Semantic consistency gate result
|
|
209
299
|
- \`${config.outputDir}/reports/DELIVERY-REPORT.md\` — Delivery gate result
|
|
210
300
|
- \`${config.outputDir}/_index.md\` — Shot list with chain & status tracking
|
|
301
|
+
- Optional Codex still phase: \`${config.outputDir}/codex-images/manifest.json\` + \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
211
302
|
|
|
212
303
|
## Input
|
|
213
304
|
- Preferred scenario file: \`${config.scenarioHint}\`
|
|
@@ -420,6 +511,7 @@ Before generating ANY prompts, read skills from \`.agent/skills/\`:
|
|
|
420
511
|
| \`/safety-check\` | \`.agent/workflows/safety-check.md\` |
|
|
421
512
|
| \`/recover\` | \`.agent/workflows/recover.md\` |
|
|
422
513
|
| \`/finish\` | \`.agent/workflows/finish.md\` |
|
|
514
|
+
| \`/codex-images\` | \`.agent/workflows/codex-images.md\` |
|
|
423
515
|
|
|
424
516
|
## Claude Code Ops
|
|
425
517
|
- Use \`/memory\` to verify which CLAUDE and rule files are loaded.
|
|
@@ -888,6 +980,7 @@ Before generating ANY prompts, read these skills:
|
|
|
888
980
|
| /safety-check | \`.agent/workflows/safety-check.md\` — Validate before delivery |
|
|
889
981
|
| /recover | \`.agent/workflows/recover.md\` — Recover failed gates |
|
|
890
982
|
| /finish | \`.agent/workflows/finish.md\` — Complete project, create summary |
|
|
983
|
+
| /codex-images | \`.agent/workflows/codex-images.md\` — Optional Codex-native still phase |
|
|
891
984
|
|
|
892
985
|
## Input
|
|
893
986
|
- Scenario source: \`${config.scenarioHint}\` (or selected file in editor)
|
|
@@ -46,6 +46,7 @@ You are a senior Technical Prompt Engineer specialized in model-aware cinematic
|
|
|
46
46
|
16. **Hard specificity floor:** Her promptta lens/framing, lighting ve FG/MG/BG action detayları zorunlu
|
|
47
47
|
17. **Spatial realism floor:** eyeline target, plane map, shared light source, contact/weight cues ve tam ölçek derinlik mantığı gerektiğinde zorunlu
|
|
48
48
|
18. **Semantic consistency floor:** `shot-plan.json.visual_world` kanonik olmalı; perspective/geometry, shadow vector, scale map, reflection handling, gravity/contact physics, anatomy risk, foreground/background coherence, contextual contradiction, immutable reference lock ve allowed-change budget her shot'ta geçmeli
|
|
49
|
+
19. **Codex still phase rule:** `/generate` başarıyla bittiyse ve çalışma Codex içindeyse `/codex-images` opsiyonunu öner; asla otomatik başlatma
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
@@ -40,6 +40,8 @@ $OUTPUT_DIR/
|
|
|
40
40
|
│ ├── SAFETY-REPORT.md # Safety and policy validation
|
|
41
41
|
│ ├── SEMANTIC-REPORT.md # Perspective, shadow, scale, physics validation
|
|
42
42
|
│ └── DELIVERY-REPORT.md # Final packaging validation
|
|
43
|
+
├── codex-images/ # Optional, created only after /codex-images is approved in Codex
|
|
44
|
+
│ └── SHOTNN/ # Accepted ilk/son stills + versioned edits
|
|
43
45
|
└── _index.md # Shot list with status and report gate table
|
|
44
46
|
```
|
|
45
47
|
|
|
@@ -365,8 +367,11 @@ Delivery report: $OUTPUT_DIR/reports/DELIVERY-REPORT.md
|
|
|
365
367
|
|
|
366
368
|
Devam etmek icin: 'devam et' veya '/chain'
|
|
367
369
|
Tamamlama icin: '/finish'
|
|
370
|
+
Codex'te opsiyonel still fazi icin: '/codex-images' (yalnizca kullanici onaylarsa)
|
|
368
371
|
```
|
|
369
372
|
|
|
373
|
+
If generation succeeds inside Codex, offer `/codex-images` as an optional still-image phase. Never auto-start it.
|
|
374
|
+
|
|
370
375
|
---
|
|
371
376
|
|
|
372
377
|
## Reject Weak Prompt Style
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milenyumai/film-kit",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
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",
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"film-kit": "
|
|
9
|
+
"film-kit": "build/cli.js"
|
|
10
10
|
},
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
@@ -30,6 +30,7 @@ npx @milenyumai/film-kit init --preset hybrid --aspect 16:9 --nano-size 4K
|
|
|
30
30
|
- OpenAI Codex App / Cursor / Copilot / Antigravity surfaces
|
|
31
31
|
- `.codex/config.toml` + `.codex/agents/prompt-engineer.toml`
|
|
32
32
|
- `.agents/skills/*/SKILL.md` Codex skill mirror with the hybrid prompt-structure override
|
|
33
|
+
- optional Codex still phase via `.agents/skills/film-kit-codex-images/SKILL.md` and `/codex-images`
|
|
33
34
|
- hybrid overrides and prompt-structure overrides
|
|
34
35
|
|
|
35
36
|
## Contracts
|
|
@@ -20,6 +20,92 @@ model_reasoning_effort = "high"
|
|
|
20
20
|
developer_instructions = ${tomlString(developerInstructions)}
|
|
21
21
|
`;
|
|
22
22
|
}
|
|
23
|
+
function buildCodexImageSkill(workflowFile, outputDir) {
|
|
24
|
+
return `---
|
|
25
|
+
name: film-kit-codex-images
|
|
26
|
+
description: Optional Codex-native still image phase for Film-Kit Hybrid. 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 after /generate and wait for user confirmation.
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Film-Kit Codex Images
|
|
30
|
+
|
|
31
|
+
This skill is for **Codex only**. It adds a still-image phase after Film-Kit prompt generation.
|
|
32
|
+
|
|
33
|
+
## Read First
|
|
34
|
+
1. \`${workflowFile}\`
|
|
35
|
+
2. \`.agent/model-profile.md\`
|
|
36
|
+
3. \`${outputDir}/shot-plan.json\`
|
|
37
|
+
4. the relevant shot files under \`${outputDir}/shots/\`
|
|
38
|
+
5. report files under \`${outputDir}/reports/\`
|
|
39
|
+
|
|
40
|
+
## Trigger Rules
|
|
41
|
+
- Start only when the user explicitly asks for image generation/editing or accepts the \`/codex-images\` suggestion after \`/generate\`.
|
|
42
|
+
- Do not auto-start this phase.
|
|
43
|
+
- Do not use it for coverage stills or video generation in v1.
|
|
44
|
+
|
|
45
|
+
## Core Behavior
|
|
46
|
+
- Use Codex's built-in image generation/editing flow.
|
|
47
|
+
- If a local image file must be edited, first bring it into the conversation context, then edit it.
|
|
48
|
+
- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
|
|
49
|
+
- Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
50
|
+
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.
|
|
51
|
+
- After every image, ask the user to accept it or request a targeted edit.
|
|
52
|
+
|
|
53
|
+
## Output Contract
|
|
54
|
+
- Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
|
|
55
|
+
- Canonical files: \`ilk-frame.png\`, \`son-frame.png\`
|
|
56
|
+
- Iterations use sibling versioned filenames such as \`ilk-frame-v2.png\` and \`son-frame-v3.png\`
|
|
57
|
+
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
58
|
+
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
function buildCodexImagesWorkflow(outputDir) {
|
|
62
|
+
return `---
|
|
63
|
+
description: Optional Codex-native still image phase for Film-Kit Hybrid output
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# /codex-images - Film-Kit Hybrid Codex Still Phase
|
|
67
|
+
|
|
68
|
+
## Preconditions
|
|
69
|
+
- \`/generate\` completed successfully
|
|
70
|
+
- shot files already exist under \`${outputDir}/shots/\`
|
|
71
|
+
- \`${outputDir}/shot-plan.json\` exists
|
|
72
|
+
- this phase is opt-in; start only after the user confirms
|
|
73
|
+
|
|
74
|
+
## Reference Priority
|
|
75
|
+
1. images already present in the active Codex conversation
|
|
76
|
+
2. user-supplied local image paths
|
|
77
|
+
3. repo-local \`refs/\` folders when present
|
|
78
|
+
|
|
79
|
+
## Output Contract
|
|
80
|
+
\`\`\`text
|
|
81
|
+
${outputDir}/codex-images/
|
|
82
|
+
├── SHOTNN/
|
|
83
|
+
│ ├── ilk-frame.png
|
|
84
|
+
│ ├── ilk-frame-v2.png
|
|
85
|
+
│ ├── son-frame.png
|
|
86
|
+
│ └── son-frame-v3.png
|
|
87
|
+
├── manifest.json
|
|
88
|
+
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
## Flow
|
|
92
|
+
1. Ask which shot range to process. Default to sequential order.
|
|
93
|
+
2. For a fresh shot, generate \`ILK FRAME\` from the accepted still prompt plus references.
|
|
94
|
+
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
95
|
+
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
96
|
+
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
97
|
+
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
98
|
+
7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
|
|
99
|
+
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.
|
|
100
|
+
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.
|
|
101
|
+
|
|
102
|
+
## Hard Rules
|
|
103
|
+
- Never auto-start this workflow.
|
|
104
|
+
- V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
|
|
105
|
+
- Do not generate coverage stills or video here.
|
|
106
|
+
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
23
109
|
export function buildHybridProjectFiles(config) {
|
|
24
110
|
const files = {};
|
|
25
111
|
files[".agent/model-profile.md"] = buildModelProfile(config);
|
|
@@ -51,8 +137,11 @@ export function buildHybridProjectFiles(config) {
|
|
|
51
137
|
files[".codex/agents/prompt-engineer.toml"] = buildCodexAgentToml("prompt_engineer", "Film-Kit hybrid prompt engineer for Nano Banana start/end frames and Kling 3.0 video prompts.", `Read AGENTS.md first, then .agent/model-profile.md, .agent/MASTER.md, .agent/VOICE-DESIGN.md, .agent/HYBRID-OVERRIDES.md, .agent/agents/prompt-engineer.md, and the requested .agent/workflows/*.md file before acting.
|
|
52
138
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
53
139
|
Use the hybrid .agents/skills/prompt-structure/SKILL.md override for Kling 3.0 VIDEO grammar.
|
|
140
|
+
When /generate finishes successfully inside Codex, always offer /codex-images as an optional still-image phase. Never auto-start it.
|
|
54
141
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
55
142
|
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.`);
|
|
143
|
+
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images-hybrid.md", config.outputDir);
|
|
144
|
+
files[".agent/workflows/codex-images-hybrid.md"] = buildCodexImagesWorkflow(config.outputDir);
|
|
56
145
|
if (config.platforms.includes("antigravity")) {
|
|
57
146
|
files[".agents/skills/shotforge-generate/SKILL.md"] = buildAntigravitySkill(config);
|
|
58
147
|
}
|
|
@@ -81,6 +170,7 @@ Hybrid image/video prompt generation.
|
|
|
81
170
|
- Open the Git root as the Codex project root; Codex discovers \`AGENTS.md\`, \`.codex/config.toml\`, and \`.agents/skills/\` from that root.
|
|
82
171
|
- Repo-scoped Codex config lives in \`.codex/config.toml\`; Codex may ignore it until the project is trusted in the app.
|
|
83
172
|
- Codex skills live under \`.agents/skills/*/SKILL.md\`; \`.agent/skills\` remains the legacy Film-Kit runtime mirror for Claude/Cursor/Copilot/Antigravity.
|
|
173
|
+
- Codex-native still phase lives in \`.agents/skills/film-kit-codex-images/SKILL.md\` and starts with \`/codex-images\` only after user confirmation.
|
|
84
174
|
- Codex custom agents live in \`.codex/agents/*.toml\` and point back to the canonical \`.agent/agents/*.md\` role files.
|
|
85
175
|
- Full-auto Codex profile: \`approval_policy = "never"\`, \`sandbox_mode = "danger-full-access"\`, \`[agents] max_threads = 6\`, \`max_depth = 1\`.
|
|
86
176
|
- Worktree bootstrap: if \`node_modules\` or build output is missing, run \`npm install\` and \`npm run build\` before package commands.
|
|
@@ -101,6 +191,7 @@ Hybrid image/video prompt generation.
|
|
|
101
191
|
- ONE FILE PER SHOT: \`SHOTNN.md\` includes main shot + coverage
|
|
102
192
|
- \`${config.outputDir}/shot-plan.json\` carries top-level \`voiceCast\`
|
|
103
193
|
- \`${config.outputDir}/shot-plan.json\` carries top-level \`visual_world\`
|
|
194
|
+
- Optional Codex still phase: \`${config.outputDir}/codex-images/manifest.json\` + \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
104
195
|
- Image sections (ILK/SON + still coverage prompts) are written for ${config.imageModelDisplay}
|
|
105
196
|
- Video sections are written for ${config.videoModelDisplay}
|
|
106
197
|
- Speaking \`VIDEO\` sections include machine-readable \`AUDIO PLAN\`
|
|
@@ -115,6 +206,7 @@ Hybrid image/video prompt generation.
|
|
|
115
206
|
- Default aspect ratio: \`${config.defaultAspectRatio}\`
|
|
116
207
|
- Nano Banana target size: \`${config.nanoBananaImageSize}\`
|
|
117
208
|
- Kling preset: \`${config.klingPreset}\`
|
|
209
|
+
- Codex still workflow: \`.agent/workflows/codex-images-hybrid.md\`
|
|
118
210
|
`;
|
|
119
211
|
}
|
|
120
212
|
function buildCursorLegacyRules(config) {
|
|
@@ -231,6 +323,7 @@ function buildClaudeRoot(config) {
|
|
|
231
323
|
|
|
232
324
|
## Workflows
|
|
233
325
|
- /generate -> \`.agent/workflows/generate.md\`
|
|
326
|
+
- /codex-images -> \`.agent/workflows/codex-images-hybrid.md\`
|
|
234
327
|
- /chain -> \`.agent/workflows/chain.md\`
|
|
235
328
|
- /safety-check -> \`.agent/workflows/safety-check.md\`
|
|
236
329
|
- /recover -> \`.agent/workflows/recover.md\`
|
|
@@ -247,6 +340,7 @@ This workspace uses a split model workflow.
|
|
|
247
340
|
Always read \`.agent/model-profile.md\`, \`.agent/HYBRID-OVERRIDES.md\`, and \`.claude/rules/*\` before /generate.
|
|
248
341
|
Read \`.agent/VOICE-DESIGN.md\` whenever dialogue, narrator VO, or reusable speaker identity exists.
|
|
249
342
|
Use \`.claude/agents/prompt-engineer.md\` for shot drafting or repair when delegation helps.
|
|
343
|
+
If Codex completed \`/generate\`, offer \`/codex-images\` as an opt-in still phase instead of auto-starting it.
|
|
250
344
|
Apply \`.agent/skills/spatial-blocking/SKILL.md\` whenever gaze, compositing, or depth realism is critical.
|
|
251
345
|
Write shot files to \`${config.outputDir}/shots/SHOTNN.md\`.
|
|
252
346
|
`;
|
|
@@ -103,6 +103,9 @@ For each `SHOTNN.md`:
|
|
|
103
103
|
10. Reject outputs with disconnected eyelines, pasted-cutout compositing, or toy-scale depth caused by missing plane/light integration.
|
|
104
104
|
11. Reject outputs that violate `visual_world`, shadow vector, scale/depth, reflection/physics/anatomy, contextual logic, targeted semantic avoid terms, reference drift, allowed-change budget, or chained ILK exact-reuse rules.
|
|
105
105
|
|
|
106
|
+
### 4. Codex Follow-up
|
|
107
|
+
If this workflow is running inside Codex and generation succeeds, offer `/codex-images` as an optional still-image phase. Never auto-start it.
|
|
108
|
+
|
|
106
109
|
## Non-Negotiables
|
|
107
110
|
- ONE FILE PER SHOT (`SHOTNN.md` includes coverage)
|
|
108
111
|
- Avoid line on every prompt
|
|
@@ -32,6 +32,7 @@ npx @milenyumai/film-kit init --preset hybrid-smart --kling-preset balanced
|
|
|
32
32
|
- OpenAI Codex App / Cursor / Copilot / Antigravity surfaces
|
|
33
33
|
- `.codex/config.toml` + `.codex/agents/prompt-engineer.toml`
|
|
34
34
|
- `.agents/skills/*/SKILL.md` Codex skill mirror with the smart hybrid prompt-structure override
|
|
35
|
+
- optional Codex still phase via `.agents/skills/film-kit-codex-images/SKILL.md` and `/codex-images`
|
|
35
36
|
- smart hybrid overrides and route-aware prompt-structure overrides
|
|
36
37
|
|
|
37
38
|
## Contracts
|
|
@@ -20,6 +20,92 @@ model_reasoning_effort = "high"
|
|
|
20
20
|
developer_instructions = ${tomlString(developerInstructions)}
|
|
21
21
|
`;
|
|
22
22
|
}
|
|
23
|
+
function buildCodexImageSkill(workflowFile, outputDir) {
|
|
24
|
+
return `---
|
|
25
|
+
name: film-kit-codex-images
|
|
26
|
+
description: Optional Codex-native still image phase for Film-Kit Hybrid Smart. 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 after /generate and wait for user confirmation.
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Film-Kit Codex Images
|
|
30
|
+
|
|
31
|
+
This skill is for **Codex only**. It adds a still-image phase after Film-Kit prompt generation.
|
|
32
|
+
|
|
33
|
+
## Read First
|
|
34
|
+
1. \`${workflowFile}\`
|
|
35
|
+
2. \`.agent/model-profile.md\`
|
|
36
|
+
3. \`${outputDir}/shot-plan.json\`
|
|
37
|
+
4. the relevant shot files under \`${outputDir}/shots/\`
|
|
38
|
+
5. report files under \`${outputDir}/reports/\`
|
|
39
|
+
|
|
40
|
+
## Trigger Rules
|
|
41
|
+
- Start only when the user explicitly asks for image generation/editing or accepts the \`/codex-images\` suggestion after \`/generate\`.
|
|
42
|
+
- Do not auto-start this phase.
|
|
43
|
+
- Do not use it for coverage stills or video generation in v1.
|
|
44
|
+
|
|
45
|
+
## Core Behavior
|
|
46
|
+
- Use Codex's built-in image generation/editing flow.
|
|
47
|
+
- If a local image file must be edited, first bring it into the conversation context, then edit it.
|
|
48
|
+
- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
|
|
49
|
+
- Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
50
|
+
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.
|
|
51
|
+
- After every image, ask the user to accept it or request a targeted edit.
|
|
52
|
+
|
|
53
|
+
## Output Contract
|
|
54
|
+
- Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
|
|
55
|
+
- Canonical files: \`ilk-frame.png\`, \`son-frame.png\`
|
|
56
|
+
- Iterations use sibling versioned filenames such as \`ilk-frame-v2.png\` and \`son-frame-v3.png\`
|
|
57
|
+
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
58
|
+
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
59
|
+
`;
|
|
60
|
+
}
|
|
61
|
+
function buildCodexImagesWorkflow(outputDir) {
|
|
62
|
+
return `---
|
|
63
|
+
description: Optional Codex-native still image phase for Film-Kit Hybrid Smart output
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
# /codex-images - Film-Kit Hybrid Smart Codex Still Phase
|
|
67
|
+
|
|
68
|
+
## Preconditions
|
|
69
|
+
- \`/generate\` completed successfully
|
|
70
|
+
- shot files already exist under \`${outputDir}/shots/\`
|
|
71
|
+
- \`${outputDir}/shot-plan.json\` exists
|
|
72
|
+
- this phase is opt-in; start only after the user confirms
|
|
73
|
+
|
|
74
|
+
## Reference Priority
|
|
75
|
+
1. images already present in the active Codex conversation
|
|
76
|
+
2. user-supplied local image paths
|
|
77
|
+
3. repo-local \`refs/\` folders when present
|
|
78
|
+
|
|
79
|
+
## Output Contract
|
|
80
|
+
\`\`\`text
|
|
81
|
+
${outputDir}/codex-images/
|
|
82
|
+
├── SHOTNN/
|
|
83
|
+
│ ├── ilk-frame.png
|
|
84
|
+
│ ├── ilk-frame-v2.png
|
|
85
|
+
│ ├── son-frame.png
|
|
86
|
+
│ └── son-frame-v3.png
|
|
87
|
+
├── manifest.json
|
|
88
|
+
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
89
|
+
\`\`\`
|
|
90
|
+
|
|
91
|
+
## Flow
|
|
92
|
+
1. Ask which shot range to process. Default to sequential order.
|
|
93
|
+
2. For a fresh shot, generate \`ILK FRAME\` from the accepted still prompt plus references.
|
|
94
|
+
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
95
|
+
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
96
|
+
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
97
|
+
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
98
|
+
7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
|
|
99
|
+
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.
|
|
100
|
+
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.
|
|
101
|
+
|
|
102
|
+
## Hard Rules
|
|
103
|
+
- Never auto-start this workflow.
|
|
104
|
+
- V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
|
|
105
|
+
- Do not generate coverage stills or video here.
|
|
106
|
+
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
23
109
|
export function buildSmartHybridProjectFiles(config) {
|
|
24
110
|
const files = {};
|
|
25
111
|
files[".agent/model-profile.md"] = buildModelProfile(config);
|
|
@@ -51,8 +137,11 @@ export function buildSmartHybridProjectFiles(config) {
|
|
|
51
137
|
files[".codex/agents/prompt-engineer.toml"] = buildCodexAgentToml("prompt_engineer", "Film-Kit smart hybrid prompt engineer for Nano Banana stills and dialogue-aware Veo/Kling routing.", `Read AGENTS.md first, then .agent/model-profile.md, .agent/MASTER.md, .agent/VOICE-DESIGN.md, .agent/SMART-HYBRID-OVERRIDES.md, .agent/agents/prompt-engineer.md, and the requested .agent/workflows/*.md file before acting.
|
|
52
138
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
53
139
|
Use the smart hybrid .agents/skills/prompt-structure/SKILL.md override for Veo dialogue routes and Kling no-dialogue routes.
|
|
140
|
+
When /generate finishes successfully inside Codex, always offer /codex-images as an optional still-image phase. Never auto-start it.
|
|
54
141
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
55
142
|
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.`);
|
|
143
|
+
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images-hybrid-smart.md", config.outputDir);
|
|
144
|
+
files[".agent/workflows/codex-images-hybrid-smart.md"] = buildCodexImagesWorkflow(config.outputDir);
|
|
56
145
|
if (config.platforms.includes("antigravity")) {
|
|
57
146
|
files[".agents/skills/shotforge-generate/SKILL.md"] = buildAntigravitySkill(config);
|
|
58
147
|
}
|
|
@@ -82,6 +171,7 @@ Smart hybrid image/video prompt generation.
|
|
|
82
171
|
- Open the Git root as the Codex project root; Codex discovers \`AGENTS.md\`, \`.codex/config.toml\`, and \`.agents/skills/\` from that root.
|
|
83
172
|
- Repo-scoped Codex config lives in \`.codex/config.toml\`; Codex may ignore it until the project is trusted in the app.
|
|
84
173
|
- Codex skills live under \`.agents/skills/*/SKILL.md\`; \`.agent/skills\` remains the legacy Film-Kit runtime mirror for Claude/Cursor/Copilot/Antigravity.
|
|
174
|
+
- Codex-native still phase lives in \`.agents/skills/film-kit-codex-images/SKILL.md\` and starts with \`/codex-images\` only after user confirmation.
|
|
85
175
|
- Codex custom agents live in \`.codex/agents/*.toml\` and point back to the canonical \`.agent/agents/*.md\` role files.
|
|
86
176
|
- Full-auto Codex profile: \`approval_policy = "never"\`, \`sandbox_mode = "danger-full-access"\`, \`[agents] max_threads = 6\`, \`max_depth = 1\`.
|
|
87
177
|
- Worktree bootstrap: if \`node_modules\` or build output is missing, run \`npm install\` and \`npm run build\` before package commands.
|
|
@@ -102,6 +192,7 @@ Smart hybrid image/video prompt generation.
|
|
|
102
192
|
- ONE FILE PER SHOT: \`SHOTNN.md\` includes main shot + coverage
|
|
103
193
|
- \`${config.outputDir}/shot-plan.json\` carries top-level \`voiceCast\`
|
|
104
194
|
- \`${config.outputDir}/shot-plan.json\` carries top-level \`visual_world\`
|
|
195
|
+
- Optional Codex still phase: \`${config.outputDir}/codex-images/manifest.json\` + \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
105
196
|
- Image sections (ILK/SON + still coverage prompts) are written for ${config.imageModelDisplay}
|
|
106
197
|
- Video sections are routed by dialogue presence (dialogue->${config.veoVideoModelId}, no-dialogue->${config.klingVideoModelId})
|
|
107
198
|
- Speaking video sections include machine-readable \`AUDIO PLAN\`
|
|
@@ -117,6 +208,7 @@ Smart hybrid image/video prompt generation.
|
|
|
117
208
|
- Nano Banana target size: \`${config.nanoBananaImageSize}\`
|
|
118
209
|
- Kling preset: \`${config.klingPreset}\`
|
|
119
210
|
- Kling custom shot max (app.kling): \`${config.maxKlingCustomShots}\`
|
|
211
|
+
- Codex still workflow: \`.agent/workflows/codex-images-hybrid-smart.md\`
|
|
120
212
|
`;
|
|
121
213
|
}
|
|
122
214
|
function buildCursorLegacyRules(config) {
|
|
@@ -233,6 +325,7 @@ function buildClaudeRoot(config) {
|
|
|
233
325
|
|
|
234
326
|
## Workflows
|
|
235
327
|
- /generate -> \`.agent/workflows/generate.md\`
|
|
328
|
+
- /codex-images -> \`.agent/workflows/codex-images-hybrid-smart.md\`
|
|
236
329
|
- /chain -> \`.agent/workflows/chain.md\`
|
|
237
330
|
- /safety-check -> \`.agent/workflows/safety-check.md\`
|
|
238
331
|
- /recover -> \`.agent/workflows/recover.md\`
|
|
@@ -249,6 +342,7 @@ This workspace uses a split model workflow.
|
|
|
249
342
|
Always read \`.agent/model-profile.md\`, \`.agent/SMART-HYBRID-OVERRIDES.md\`, and \`.claude/rules/*\` before /generate.
|
|
250
343
|
Read \`.agent/VOICE-DESIGN.md\` whenever dialogue, narrator VO, or reusable speaker identity exists.
|
|
251
344
|
Use \`.claude/agents/prompt-engineer.md\` for shot drafting or repair when delegation helps.
|
|
345
|
+
If Codex completed \`/generate\`, offer \`/codex-images\` as an opt-in still phase instead of auto-starting it.
|
|
252
346
|
Apply \`.agent/skills/spatial-blocking/SKILL.md\` whenever gaze, compositing, or depth realism is critical.
|
|
253
347
|
Write shot files to \`${config.outputDir}/shots/SHOTNN.md\`.
|
|
254
348
|
`;
|
|
@@ -115,6 +115,9 @@ For each `SHOTNN.md`:
|
|
|
115
115
|
12. Reject outputs with disconnected eyelines, pasted-cutout compositing, or toy-scale depth caused by missing plane/light integration.
|
|
116
116
|
13. Reject outputs that violate `visual_world`, shadow vector, scale/depth, reflection/physics/anatomy, contextual logic, targeted semantic avoid terms, reference drift, allowed-change budget, or chained ILK exact-reuse rules.
|
|
117
117
|
|
|
118
|
+
### 4. Codex Follow-up
|
|
119
|
+
If this workflow is running inside Codex and generation succeeds, offer `/codex-images` as an optional still-image phase. Never auto-start it.
|
|
120
|
+
|
|
118
121
|
## Non-Negotiables
|
|
119
122
|
- ONE FILE PER SHOT (`SHOTNN.md` includes coverage)
|
|
120
123
|
- Avoid line on every prompt
|
package/packages/multi/README.md
CHANGED
|
@@ -33,6 +33,7 @@ npx @milenyumai/film-kit init --preset multi --model seedance-2.0
|
|
|
33
33
|
- OpenAI Codex App config under `.codex/config.toml`
|
|
34
34
|
- OpenAI Codex custom agents under `.codex/agents/*.toml`
|
|
35
35
|
- Codex skill mirror under `.agents/skills/*/SKILL.md`
|
|
36
|
+
- optional Codex still phase via `.agents/skills/film-kit-codex-images/SKILL.md` and `/codex-images`
|
|
36
37
|
- multi rules under `.claude/rules/`
|
|
37
38
|
- Antigravity skills:
|
|
38
39
|
- `.agent/skills/shotforge-generate/SKILL.md`
|
|
@@ -69,6 +70,7 @@ Specialists run in three phases after all shot batches complete:
|
|
|
69
70
|
## Workflow
|
|
70
71
|
|
|
71
72
|
- `/generate` -> lead planning + teammate spawning + 3-phase specialist validation
|
|
73
|
+
- `/codex-images` -> optional Codex-native still phase after all reports pass
|
|
72
74
|
- `/chain` -> chained continuation
|
|
73
75
|
- `/safety-check` -> specialist validation
|
|
74
76
|
- `/recover` -> deterministic recovery with impacted range definition
|
|
@@ -242,7 +242,9 @@ export async function configureMultiAgents(options = {}) {
|
|
|
242
242
|
|| relativePath === ".agent/skills/shotforge-generate-multi/SKILL.md";
|
|
243
243
|
const isCodexConfig = relativePath.startsWith(".codex/")
|
|
244
244
|
|| relativePath === ".agents/skills/shotforge-generate/SKILL.md"
|
|
245
|
-
|| relativePath === ".agents/skills/shotforge-generate-multi/SKILL.md"
|
|
245
|
+
|| relativePath === ".agents/skills/shotforge-generate-multi/SKILL.md"
|
|
246
|
+
|| relativePath === ".agents/skills/film-kit-codex-images/SKILL.md"
|
|
247
|
+
|| relativePath === ".agent/workflows/codex-images-multi.md";
|
|
246
248
|
const isRuntimeModelFile = relativePath === ".agent/model-profile.md";
|
|
247
249
|
if (fileExists && !isClaudeConfig && !isAntigravityConfig && !isCodexConfig && !isRuntimeModelFile && !resolved.overwrite) {
|
|
248
250
|
skipped.push(relativePath);
|
|
@@ -126,12 +126,104 @@ const MULTI_CODEX_AGENTS = [
|
|
|
126
126
|
["delivery-editor", "delivery_editor", "Audit final package completeness, report dependencies, and delivery readiness."]
|
|
127
127
|
];
|
|
128
128
|
function buildMultiCodexAgent(roleFile, name, description, config) {
|
|
129
|
+
const leadDirectorNote = roleFile === "lead-director"
|
|
130
|
+
? "\nWhen /generate finishes successfully inside Codex and every required specialist report passes, offer /codex-images as an optional still-image phase. Never auto-start it."
|
|
131
|
+
: "";
|
|
129
132
|
return buildCodexAgentToml(name, description, `Read AGENTS.md first, then .agent/model-profile.md, .agent/MASTER.md, .agent/VOICE-DESIGN.md, .agent/agents/${roleFile}.md, and the relevant .agent/workflows/*.md file before acting.
|
|
130
133
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
131
134
|
Respect file ownership from AGENTS.md: shot teammates write only assigned SHOTNN.md files, specialists write only their report files, and the Lead owns plan/index/final summary files.
|
|
135
|
+
${leadDirectorNote}
|
|
132
136
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
133
137
|
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.`);
|
|
134
138
|
}
|
|
139
|
+
function buildCodexImageSkill(workflowFile, outputDir) {
|
|
140
|
+
return `---
|
|
141
|
+
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.
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
# Film-Kit Codex Images
|
|
146
|
+
|
|
147
|
+
This skill is for **Codex only**. It adds a still-image phase after Film-Kit prompt generation and specialist validation.
|
|
148
|
+
|
|
149
|
+
## Read First
|
|
150
|
+
1. \`${workflowFile}\`
|
|
151
|
+
2. \`.agent/model-profile.md\`
|
|
152
|
+
3. \`${outputDir}/team-plan.json\`
|
|
153
|
+
4. the relevant shot files under \`${outputDir}/shots/\`
|
|
154
|
+
5. all required report files under \`${outputDir}/reports/\`
|
|
155
|
+
|
|
156
|
+
## Trigger Rules
|
|
157
|
+
- Start only when the user explicitly asks for image generation/editing or accepts the \`/codex-images\` suggestion after \`/generate\`.
|
|
158
|
+
- Do not auto-start this phase.
|
|
159
|
+
- Only offer it after all mandatory specialist reports pass.
|
|
160
|
+
- Do not use it for coverage stills or video generation in v1.
|
|
161
|
+
|
|
162
|
+
## Core Behavior
|
|
163
|
+
- Use Codex's built-in image generation/editing flow.
|
|
164
|
+
- 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.
|
|
166
|
+
- 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.
|
|
168
|
+
- After every image, ask the user to accept it or request a targeted edit.
|
|
169
|
+
|
|
170
|
+
## Output Contract
|
|
171
|
+
- 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\`
|
|
174
|
+
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
175
|
+
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
function buildCodexImagesWorkflow(outputDir) {
|
|
179
|
+
return `---
|
|
180
|
+
description: Optional Codex-native still image phase for Film-Kit Multi output
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
# /codex-images - Film-Kit Multi Codex Still Phase
|
|
184
|
+
|
|
185
|
+
## Preconditions
|
|
186
|
+
- \`/generate\` completed successfully
|
|
187
|
+
- shot files already exist under \`${outputDir}/shots/\`
|
|
188
|
+
- \`${outputDir}/team-plan.json\` exists
|
|
189
|
+
- every mandatory specialist report under \`${outputDir}/reports/\` passed
|
|
190
|
+
- this phase is opt-in; start only after the user confirms
|
|
191
|
+
|
|
192
|
+
## Reference Priority
|
|
193
|
+
1. images already present in the active Codex conversation
|
|
194
|
+
2. user-supplied local image paths
|
|
195
|
+
3. repo-local \`refs/\` folders when present
|
|
196
|
+
|
|
197
|
+
## Output Contract
|
|
198
|
+
\`\`\`text
|
|
199
|
+
${outputDir}/codex-images/
|
|
200
|
+
├── SHOTNN/
|
|
201
|
+
│ ├── ilk-frame.png
|
|
202
|
+
│ ├── ilk-frame-v2.png
|
|
203
|
+
│ ├── son-frame.png
|
|
204
|
+
│ └── son-frame-v3.png
|
|
205
|
+
├── manifest.json
|
|
206
|
+
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
## Flow
|
|
210
|
+
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.
|
|
212
|
+
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
213
|
+
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
214
|
+
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
215
|
+
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
216
|
+
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.
|
|
219
|
+
|
|
220
|
+
## Hard Rules
|
|
221
|
+
- Never auto-start this workflow.
|
|
222
|
+
- V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
|
|
223
|
+
- Do not generate coverage stills or video here.
|
|
224
|
+
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
225
|
+
`;
|
|
226
|
+
}
|
|
135
227
|
/**
|
|
136
228
|
* Build project files for multi-agent mode.
|
|
137
229
|
* Generates Claude Code configs plus Antigravity multi orchestration skills.
|
|
@@ -471,6 +563,8 @@ Use this playbook when a teammate fails or a quality gate fails.
|
|
|
471
563
|
for (const [roleFile, name, description] of MULTI_CODEX_AGENTS) {
|
|
472
564
|
files[`.codex/agents/${roleFile}.toml`] = buildMultiCodexAgent(roleFile, name, description, config);
|
|
473
565
|
}
|
|
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);
|
|
474
568
|
if (config.includeAgentsMd) {
|
|
475
569
|
files["AGENTS.md"] = `# Film-Kit Multi - Agent Teams Contract
|
|
476
570
|
|
|
@@ -497,6 +591,7 @@ Multi-agent parallel generation with shot teammates and specialist validators.
|
|
|
497
591
|
- Team plan is stored in \`${config.outputDir}/team-plan.json\`
|
|
498
592
|
- \`${config.outputDir}/team-plan.json\` is also the authoritative top-level \`voiceCast\` package
|
|
499
593
|
- \`${config.outputDir}/team-plan.json\` is also the authoritative top-level \`visual_world\` package
|
|
594
|
+
- Optional Codex still phase: \`${config.outputDir}/codex-images/manifest.json\` + \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
500
595
|
- Batch reports are stored in \`${config.outputDir}/reports/\`
|
|
501
596
|
- Specialist reports are mandatory before completion:
|
|
502
597
|
- \`${config.outputDir}/reports/CONTINUITY-REPORT.md\`
|
|
@@ -511,6 +606,7 @@ Multi-agent parallel generation with shot teammates and specialist validators.
|
|
|
511
606
|
|
|
512
607
|
## Workflows
|
|
513
608
|
- \`/generate\` -> \`.agent/workflows/generate-multi.md\`
|
|
609
|
+
- \`/codex-images\` -> \`.agent/workflows/codex-images-multi.md\`
|
|
514
610
|
- \`/chain\` -> \`.agent/workflows/chain-multi.md\`
|
|
515
611
|
- \`/safety-check\` -> \`.agent/workflows/safety-check-multi.md\`
|
|
516
612
|
- \`/recover\` -> \`.agent/workflows/recover-multi.md\`
|
|
@@ -520,6 +616,7 @@ Multi-agent parallel generation with shot teammates and specialist validators.
|
|
|
520
616
|
- Open the Git root as the Codex project root; Codex discovers \`AGENTS.md\`, \`.codex/config.toml\`, and \`.agents/skills/\` from that root.
|
|
521
617
|
- Repo-scoped Codex config lives in \`.codex/config.toml\`; Codex may ignore it until the project is trusted in the app.
|
|
522
618
|
- Codex skills live under \`.agents/skills/*/SKILL.md\`; \`.agent/skills\` remains the legacy Film-Kit runtime mirror for Claude/Cursor/Copilot/Antigravity.
|
|
619
|
+
- Codex-native still phase lives in \`.agents/skills/film-kit-codex-images/SKILL.md\` and starts with \`/codex-images\` only after user confirmation.
|
|
523
620
|
- Codex custom agents live in \`.codex/agents/*.toml\` and point back to the canonical \`.agent/agents/*.md\` role files.
|
|
524
621
|
- Full-auto Codex profile: \`approval_policy = "never"\`, \`sandbox_mode = "danger-full-access"\`, \`[agents] max_threads = 6\`, \`max_depth = 1\`.
|
|
525
622
|
- Worktree bootstrap: if \`node_modules\` or build output is missing, run \`npm install\` and \`npm run build\` before package commands.
|
|
@@ -602,6 +699,7 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
|
|
|
602
699
|
7. Wait for all batch reports before specialist validation
|
|
603
700
|
8. Run continuity, safety, stability, dialogue, character-consistency, color-continuity, semantic, pacing, and delivery specialists
|
|
604
701
|
9. Finalize only after every required report passes
|
|
702
|
+
10. In Codex, after all required reports pass, offer \`/codex-images\` as an optional still-image phase and wait for explicit user confirmation
|
|
605
703
|
|
|
606
704
|
## Critical Rules
|
|
607
705
|
- AUTO-ANONYMOUS: Replace ALL real names with physical descriptions
|
|
@@ -624,6 +722,7 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
|
|
|
624
722
|
|
|
625
723
|
## Workflows
|
|
626
724
|
- \`/generate\` -> \`.agent/workflows/generate-multi.md\`
|
|
725
|
+
- \`/codex-images\` -> \`.agent/workflows/codex-images-multi.md\`
|
|
627
726
|
- \`/chain\` -> \`.agent/workflows/chain-multi.md\`
|
|
628
727
|
- \`/safety-check\` -> \`.agent/workflows/safety-check-multi.md\`
|
|
629
728
|
- \`/recover\` -> \`.agent/workflows/recover-multi.md\`
|
|
@@ -662,6 +761,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
|
|
|
662
761
|
- Lead Director owns \`${config.outputDir}/project-info.md\`, \`${config.outputDir}/_index.md\`, \`${config.outputDir}/team-plan.json\`, \`${config.outputDir}/FINAL-SUMMARY.md\`
|
|
663
762
|
- Shot Generators own only assigned \`${config.outputDir}/shots/SHOTNN.md\`
|
|
664
763
|
- Specialists own only files inside \`${config.outputDir}/reports/\`
|
|
764
|
+
- Codex still phase writes only to \`${config.outputDir}/codex-images/\` and \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
665
765
|
- Keep top-level \`voiceCast\` in \`${config.outputDir}/team-plan.json\`
|
|
666
766
|
- Keep top-level \`visual_world\` in \`${config.outputDir}/team-plan.json\`
|
|
667
767
|
- Keep \`Audio Plan\` blocks aligned to \`voiceCast\`
|
|
@@ -672,6 +772,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
|
|
|
672
772
|
|
|
673
773
|
## Debugging
|
|
674
774
|
- Use \`/memory\` to confirm this file and \`.claude/rules/*\` are loaded
|
|
775
|
+
- In Codex, never auto-start \`/codex-images\`; offer it only after successful \`/generate\` completion and passing reports
|
|
675
776
|
- If delegation gets confused, restate task-specific context explicitly in the spawn prompt
|
|
676
777
|
`;
|
|
677
778
|
}
|
|
@@ -708,7 +809,7 @@ Own only:
|
|
|
708
809
|
- \`${config.outputDir}/team-plan.json\`
|
|
709
810
|
- \`${config.outputDir}/FINAL-SUMMARY.md\`
|
|
710
811
|
|
|
711
|
-
Never write shot prompts directly. Do not finalize until every required report exists and passes. 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.`);
|
|
812
|
+
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.`);
|
|
712
813
|
}
|
|
713
814
|
function buildClaudeShotGeneratorSubagent(config) {
|
|
714
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\`.
|
|
@@ -301,6 +301,7 @@ Do not close project until all are true:
|
|
|
301
301
|
- `$OUTPUT_DIR/reports/DELIVERY-REPORT.md` exists and is pass
|
|
302
302
|
- `$OUTPUT_DIR/_index.md` is complete and lists all report statuses
|
|
303
303
|
- `$OUTPUT_DIR/FINAL-SUMMARY.md` is written
|
|
304
|
+
- If running inside Codex, `/codex-images` is offered only after all required reports pass and only if the user explicitly opts in
|
|
304
305
|
|
|
305
306
|
## Recovery Policy
|
|
306
307
|
|
|
@@ -132,3 +132,4 @@ If any report is missing or fail: run `.agent/workflows/recover-multi.md`.
|
|
|
132
132
|
1. Update `$OUTPUT_DIR/_index.md` (all final statuses + report table)
|
|
133
133
|
2. Write `$OUTPUT_DIR/FINAL-SUMMARY.md`
|
|
134
134
|
3. Include team size, batch map, recovery actions, and final gate results
|
|
135
|
+
4. If running inside Codex, offer `/codex-images` as an optional still-image phase only after every required report passes. Never auto-start it.
|
|
@@ -21,6 +21,7 @@ npx @milenyumai/film-kit init --preset studio --model seedance-2.0 --refs-dir ./
|
|
|
21
21
|
- Everything film-kit-multi does (lead-directed multi-agent production with 8 specialists)
|
|
22
22
|
- PLUS actual image and video rendering via fal.ai MCP integration
|
|
23
23
|
- OpenAI Codex App repo-scoped config, custom agents, skill mirror, and fal.ai MCP setup
|
|
24
|
+
- optional Codex still phase via `.agents/skills/film-kit-codex-images/SKILL.md` and `/codex-images`
|
|
24
25
|
- Generates real still frames using Nano Banana 2
|
|
25
26
|
- Generates real videos using Kling 3.0 Pro
|
|
26
27
|
- Supports reference images for character/location consistency
|
|
@@ -62,6 +63,7 @@ The render supervisor automatically maps characters and locations from shot prom
|
|
|
62
63
|
## Workflows
|
|
63
64
|
|
|
64
65
|
- `/generate` → multi-agent shot prompt generation (inherited from film-kit-multi)
|
|
66
|
+
- `/codex-images` → optional Codex-native still phase for accepted ILK/SON frame iteration
|
|
65
67
|
- `/render` → fal.ai rendering pipeline (NEW)
|
|
66
68
|
- `/chain`, `/safety-check`, `/recover`, `/finish` → inherited from film-kit-multi
|
|
67
69
|
|
|
@@ -319,7 +319,9 @@ export async function configureStudioAgents(options = {}) {
|
|
|
319
319
|
|| relativePath === ".agent/skills/shotforge-generate-multi/SKILL.md";
|
|
320
320
|
const isCodexConfig = relativePath.startsWith(".codex/")
|
|
321
321
|
|| relativePath === ".agents/skills/shotforge-generate/SKILL.md"
|
|
322
|
-
|| relativePath === ".agents/skills/shotforge-generate-multi/SKILL.md"
|
|
322
|
+
|| relativePath === ".agents/skills/shotforge-generate-multi/SKILL.md"
|
|
323
|
+
|| relativePath === ".agents/skills/film-kit-codex-images/SKILL.md"
|
|
324
|
+
|| relativePath === ".agent/workflows/codex-images-studio.md";
|
|
323
325
|
const isRuntimeModelFile = relativePath === ".agent/model-profile.md";
|
|
324
326
|
if (fileExists && !isClaudeConfig && !isAntigravityConfig && !isCodexConfig && !isRuntimeModelFile && !resolved.overwrite) {
|
|
325
327
|
skipped.push(relativePath);
|
|
@@ -141,13 +141,115 @@ const STUDIO_CODEX_AGENTS = [
|
|
|
141
141
|
["render-supervisor", "render_supervisor", "Orchestrate fal.ai rendering, frame chaining, render reports, and semantic render QA."]
|
|
142
142
|
];
|
|
143
143
|
function buildStudioCodexAgent(roleFile, name, description, config) {
|
|
144
|
+
const leadDirectorNote = roleFile === "lead-director"
|
|
145
|
+
? "\nWhen /generate finishes successfully inside Codex and every mandatory specialist report passes, offer /codex-images as an optional still-image phase. Never auto-start it. Keep /render as the separate fal.ai render pipeline."
|
|
146
|
+
: "";
|
|
144
147
|
return buildCodexAgentToml(name, description, `Read AGENTS.md first, then .agent/model-profile.md, .agent/MASTER.md, .agent/VOICE-DESIGN.md, .agent/agents/${roleFile}.md, and the relevant .agent/workflows/*.md file before acting.
|
|
145
148
|
Use .agents/skills for Codex App skill discovery; .agent remains the Film-Kit legacy runtime source.
|
|
146
149
|
Respect file ownership from AGENTS.md: shot teammates write only assigned SHOTNN.md files, specialists write only their report files, the Lead owns plan/index/final summary files, and the Render Supervisor owns renders plus render reports.
|
|
147
150
|
Use the fal-ai MCP server from .codex/config.toml for render work when FAL_KEY is available; if FAL_KEY is missing, report the blocker instead of failing init.
|
|
151
|
+
${leadDirectorNote}
|
|
148
152
|
Keep outputs under ${config.outputDir} unless the user explicitly changes the output contract.
|
|
149
153
|
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.`);
|
|
150
154
|
}
|
|
155
|
+
function buildCodexImageSkill(workflowFile, outputDir, refsDir) {
|
|
156
|
+
return `---
|
|
157
|
+
name: film-kit-codex-images
|
|
158
|
+
description: Optional Codex-native still image phase for Film-Kit Studio. 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 mandatory reports pass and keep /render separate.
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
# Film-Kit Codex Images
|
|
162
|
+
|
|
163
|
+
This skill is for **Codex only**. It adds a still-image phase after Film-Kit prompt generation and specialist validation.
|
|
164
|
+
|
|
165
|
+
## Read First
|
|
166
|
+
1. \`${workflowFile}\`
|
|
167
|
+
2. \`.agent/model-profile.md\`
|
|
168
|
+
3. \`${outputDir}/team-plan.json\`
|
|
169
|
+
4. the relevant shot files under \`${outputDir}/shots/\`
|
|
170
|
+
5. all required report files under \`${outputDir}/reports/\`
|
|
171
|
+
|
|
172
|
+
## Trigger Rules
|
|
173
|
+
- Start only when the user explicitly asks for image generation/editing or accepts the \`/codex-images\` suggestion after \`/generate\`.
|
|
174
|
+
- Do not auto-start this phase.
|
|
175
|
+
- Only offer it after all mandatory specialist reports pass.
|
|
176
|
+
- Keep \`/render\` as the separate fal.ai render/video workflow.
|
|
177
|
+
- Do not use this phase for coverage stills or video generation in v1.
|
|
178
|
+
|
|
179
|
+
## Reference Priority
|
|
180
|
+
1. images already present in the active Codex conversation
|
|
181
|
+
2. user-supplied local image paths
|
|
182
|
+
3. repo-local \`refs/\` folders when present
|
|
183
|
+
4. studio \`${refsDir}/\`
|
|
184
|
+
|
|
185
|
+
## Core Behavior
|
|
186
|
+
- Use Codex's built-in image generation/editing flow.
|
|
187
|
+
- If a local image file must be edited, first bring it into the conversation context, then edit it.
|
|
188
|
+
- Generate \`ILK FRAME\` from the accepted shot prompt plus references.
|
|
189
|
+
- Generate \`SON FRAME\` by iterating from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
190
|
+
- For chained shots, default the next shot's \`ILK FRAME\` to the previously accepted \`SON FRAME\` unless the user explicitly requests a fresh start.
|
|
191
|
+
- After every image, ask the user to accept it or request a targeted edit.
|
|
192
|
+
|
|
193
|
+
## Output Contract
|
|
194
|
+
- Save accepted stills under \`${outputDir}/codex-images/SHOTNN/\`
|
|
195
|
+
- Canonical files: \`ilk-frame.png\`, \`son-frame.png\`
|
|
196
|
+
- Iterations use sibling versioned filenames such as \`ilk-frame-v2.png\` and \`son-frame-v3.png\`
|
|
197
|
+
- Keep \`${outputDir}/codex-images/manifest.json\` updated
|
|
198
|
+
- Keep \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` updated
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
function buildCodexImagesWorkflow(outputDir, refsDir) {
|
|
202
|
+
return `---
|
|
203
|
+
description: Optional Codex-native still image phase for Film-Kit Studio output
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
# /codex-images - Film-Kit Studio Codex Still Phase
|
|
207
|
+
|
|
208
|
+
## Preconditions
|
|
209
|
+
- \`/generate\` completed successfully
|
|
210
|
+
- shot files already exist under \`${outputDir}/shots/\`
|
|
211
|
+
- \`${outputDir}/team-plan.json\` exists
|
|
212
|
+
- every mandatory specialist report under \`${outputDir}/reports/\` passed
|
|
213
|
+
- this phase is opt-in; start only after the user confirms
|
|
214
|
+
- \`/render\` remains separate and is not replaced by this workflow
|
|
215
|
+
|
|
216
|
+
## Reference Priority
|
|
217
|
+
1. images already present in the active Codex conversation
|
|
218
|
+
2. user-supplied local image paths
|
|
219
|
+
3. repo-local \`refs/\` folders when present
|
|
220
|
+
4. studio \`${refsDir}/\`
|
|
221
|
+
|
|
222
|
+
## Output Contract
|
|
223
|
+
\`\`\`text
|
|
224
|
+
${outputDir}/codex-images/
|
|
225
|
+
├── SHOTNN/
|
|
226
|
+
│ ├── ilk-frame.png
|
|
227
|
+
│ ├── ilk-frame-v2.png
|
|
228
|
+
│ ├── son-frame.png
|
|
229
|
+
│ └── son-frame-v3.png
|
|
230
|
+
├── manifest.json
|
|
231
|
+
└── ../reports/CODEX-IMAGE-REPORT.md
|
|
232
|
+
\`\`\`
|
|
233
|
+
|
|
234
|
+
## Flow
|
|
235
|
+
1. Process shots sequentially unless the user explicitly requests a different order.
|
|
236
|
+
2. For a fresh shot, generate \`ILK FRAME\` from the accepted still prompt plus references.
|
|
237
|
+
3. Show the result and ask the user to accept it or request a targeted edit.
|
|
238
|
+
4. Save the accepted start image as \`ilk-frame.png\`; keep previous attempts as versioned siblings.
|
|
239
|
+
5. Generate \`SON FRAME\` by editing from the accepted \`ILK FRAME\` while preserving \`REFERENCE LOCK\`, \`Keep same\`, and \`Change only\`.
|
|
240
|
+
6. Show the result and ask the user to accept it or request a targeted edit.
|
|
241
|
+
7. Save the accepted end image as \`son-frame.png\`; keep previous attempts as versioned siblings.
|
|
242
|
+
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.
|
|
243
|
+
9. Update \`${outputDir}/codex-images/manifest.json\` and \`${outputDir}/reports/CODEX-IMAGE-REPORT.md\` after each accepted image.
|
|
244
|
+
|
|
245
|
+
## Hard Rules
|
|
246
|
+
- Never auto-start this workflow.
|
|
247
|
+
- V1 covers only main-shot \`ILK FRAME\` and \`SON FRAME\`.
|
|
248
|
+
- Do not generate coverage stills or video here.
|
|
249
|
+
- Preserve chain continuity unless the user explicitly requests a reset.
|
|
250
|
+
- Keep \`/render\` available as the separate fal.ai render/video pipeline.
|
|
251
|
+
`;
|
|
252
|
+
}
|
|
151
253
|
/**
|
|
152
254
|
* Build project files for studio mode.
|
|
153
255
|
* Superset of multi-agent mode: all multi files + fal.ai render pipeline.
|
|
@@ -191,6 +293,8 @@ export function buildStudioProjectFiles(config) {
|
|
|
191
293
|
for (const [roleFile, name, description] of STUDIO_CODEX_AGENTS) {
|
|
192
294
|
files[`.codex/agents/${roleFile}.toml`] = buildStudioCodexAgent(roleFile, name, description, config);
|
|
193
295
|
}
|
|
296
|
+
files[".agents/skills/film-kit-codex-images/SKILL.md"] = buildCodexImageSkill(".agent/workflows/codex-images-studio.md", config.outputDir, config.refsDir);
|
|
297
|
+
files[".agent/workflows/codex-images-studio.md"] = buildCodexImagesWorkflow(config.outputDir, config.refsDir);
|
|
194
298
|
// ── AGENTS.md ───────────────────────────────────────────────────────
|
|
195
299
|
if (config.includeAgentsMd) {
|
|
196
300
|
files["AGENTS.md"] = buildAgentsMd(config);
|
|
@@ -251,9 +355,11 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
|
|
|
251
355
|
6. Wait for all batch reports before specialist validation
|
|
252
356
|
7. Run continuity, safety, stability, dialogue, character-consistency, color-continuity, semantic, pacing, and delivery specialists
|
|
253
357
|
8. Finalize only after every required report passes
|
|
358
|
+
9. In Codex, after all mandatory specialist reports pass, offer \`/codex-images\` as an optional still-image phase and wait for explicit user confirmation
|
|
254
359
|
|
|
255
360
|
## Render Pipeline
|
|
256
361
|
- \`/render\` workflow runs after \`/generate\` completes and all specialist reports pass
|
|
362
|
+
- \`/codex-images\` is a separate manual Codex-native still phase and does not replace \`/render\`
|
|
257
363
|
- Shots render SEQUENTIALLY — frame chaining requires previous shot's output
|
|
258
364
|
- Frame chain: SHOT[N] SON FRAME → reused as SHOT[N+1] ILK FRAME (no re-generation)
|
|
259
365
|
- SON FRAME uses its own ILK FRAME as reference for intra-shot consistency
|
|
@@ -286,6 +392,7 @@ Before ANY work, read ALL skills from \`.agent/skills/\`:
|
|
|
286
392
|
|
|
287
393
|
## Workflows
|
|
288
394
|
- \`/generate\` -> \`.agent/workflows/generate-multi.md\`
|
|
395
|
+
- \`/codex-images\` -> \`.agent/workflows/codex-images-studio.md\`
|
|
289
396
|
- \`/chain\` -> \`.agent/workflows/chain-multi.md\`
|
|
290
397
|
- \`/safety-check\` -> \`.agent/workflows/safety-check-multi.md\`
|
|
291
398
|
- \`/recover\` -> \`.agent/workflows/recover-multi.md\`
|
|
@@ -332,6 +439,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
|
|
|
332
439
|
- Shot Generators own only assigned \`${config.outputDir}/shots/SHOTNN.md\`
|
|
333
440
|
- Specialists own only files inside \`${config.outputDir}/reports/\`
|
|
334
441
|
- Render Supervisor owns \`${config.outputDir}/renders/\`, \`${config.outputDir}/reports/RENDER-REPORT.md\`, and \`${config.outputDir}/reports/SEMANTIC-RENDER-REPORT.md\`
|
|
442
|
+
- Codex still phase writes only to \`${config.outputDir}/codex-images/\` and \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
335
443
|
- Image prompt contract, specificity floor, and semantic floor are hard gates, not suggestions
|
|
336
444
|
- Semantic consistency floor is a hard gate, including exact chained ILK reuse and \`visual_world\` alignment
|
|
337
445
|
- Do not let teammates create extra SHOT files beyond the locked batch ranges
|
|
@@ -339,6 +447,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
|
|
|
339
447
|
|
|
340
448
|
## Render Pipeline Rules
|
|
341
449
|
- \`/render\` runs only after \`/generate\` completes and all specialist reports pass
|
|
450
|
+
- \`/codex-images\` is manual, still-only, and separate from the fal.ai pipeline
|
|
342
451
|
- Shots render SEQUENTIALLY — frame chaining requires previous shot's output
|
|
343
452
|
- SHOT[N] SON FRAME → reused as SHOT[N+1] ILK FRAME (chained, no re-generation)
|
|
344
453
|
- SON FRAME uses its own ILK FRAME as image reference for intra-shot consistency
|
|
@@ -349,6 +458,7 @@ This workspace keeps high-level policy in \`CLAUDE.md\` and execution detail in
|
|
|
349
458
|
|
|
350
459
|
## Debugging
|
|
351
460
|
- Use \`/memory\` to confirm this file and \`.claude/rules/*\` are loaded
|
|
461
|
+
- In Codex, never auto-start \`/codex-images\`; offer it only after successful \`/generate\` completion and passing reports
|
|
352
462
|
- If delegation gets confused, restate task-specific context explicitly in the spawn prompt
|
|
353
463
|
- Verify fal-ai MCP is connected via \`.claude/settings.json\`
|
|
354
464
|
`;
|
|
@@ -389,7 +499,7 @@ Own only:
|
|
|
389
499
|
- \`${config.outputDir}/team-plan.json\`
|
|
390
500
|
- \`${config.outputDir}/FINAL-SUMMARY.md\`
|
|
391
501
|
|
|
392
|
-
Never write shot prompts directly. Do not finalize until every required report exists and passes. Lock director-grade shot count before teammate sizing, then enforce spatial contracts in teammate assignments.`);
|
|
502
|
+
Never write shot prompts directly. Do not finalize until every required report exists and passes. In Codex, once all mandatory specialist reports pass, offer \`/codex-images\` as an optional still-image phase and wait for explicit user confirmation. Keep \`/render\` as the separate fal.ai pipeline. Lock director-grade shot count before teammate sizing, then enforce spatial contracts in teammate assignments.`);
|
|
393
503
|
}
|
|
394
504
|
function buildClaudeShotGeneratorSubagent(config) {
|
|
395
505
|
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/agents/shot-generator.md\`, and \`.agent/workflows/generate-teammate.md\`.
|
|
@@ -1014,6 +1124,7 @@ Multi-agent parallel generation with shot teammates, specialist validators, and
|
|
|
1014
1124
|
- Active model rules: \`.agent/model-profile.md\`
|
|
1015
1125
|
- Team plan is stored in \`${config.outputDir}/team-plan.json\`
|
|
1016
1126
|
- \`${config.outputDir}/team-plan.json\` carries top-level \`visual_world\`
|
|
1127
|
+
- Optional Codex still phase: \`${config.outputDir}/codex-images/manifest.json\` + \`${config.outputDir}/reports/CODEX-IMAGE-REPORT.md\`
|
|
1017
1128
|
- Batch reports are stored in \`${config.outputDir}/reports/\`
|
|
1018
1129
|
- Specialist reports are mandatory before completion:
|
|
1019
1130
|
- \`${config.outputDir}/reports/CONTINUITY-REPORT.md\`
|
|
@@ -1031,6 +1142,7 @@ Multi-agent parallel generation with shot teammates, specialist validators, and
|
|
|
1031
1142
|
|
|
1032
1143
|
## Workflows
|
|
1033
1144
|
- \`/generate\` -> \`.agent/workflows/generate-multi.md\`
|
|
1145
|
+
- \`/codex-images\` -> \`.agent/workflows/codex-images-studio.md\`
|
|
1034
1146
|
- \`/chain\` -> \`.agent/workflows/chain-multi.md\`
|
|
1035
1147
|
- \`/safety-check\` -> \`.agent/workflows/safety-check-multi.md\`
|
|
1036
1148
|
- \`/recover\` -> \`.agent/workflows/recover-multi.md\`
|
|
@@ -1041,9 +1153,11 @@ Multi-agent parallel generation with shot teammates, specialist validators, and
|
|
|
1041
1153
|
- Open the Git root as the Codex project root; Codex discovers \`AGENTS.md\`, \`.codex/config.toml\`, and \`.agents/skills/\` from that root.
|
|
1042
1154
|
- Repo-scoped Codex config lives in \`.codex/config.toml\`; Codex may ignore it until the project is trusted in the app.
|
|
1043
1155
|
- Codex skills live under \`.agents/skills/*/SKILL.md\`; \`.agent/skills\` remains the legacy Film-Kit runtime mirror for Claude/Cursor/Copilot/Antigravity.
|
|
1156
|
+
- Codex-native still phase lives in \`.agents/skills/film-kit-codex-images/SKILL.md\` and starts with \`/codex-images\` only after user confirmation.
|
|
1044
1157
|
- Codex custom agents live in \`.codex/agents/*.toml\` and point back to the canonical \`.agent/agents/*.md\` role files.
|
|
1045
1158
|
- Full-auto Codex profile: \`approval_policy = "never"\`, \`sandbox_mode = "danger-full-access"\`, \`[agents] max_threads = 6\`, \`max_depth = 1\`.
|
|
1046
1159
|
- fal.ai MCP config is project-scoped in \`.codex/config.toml\` with \`required = false\`; if \`FAL_KEY\` is missing, report the render blocker instead of failing init.
|
|
1160
|
+
- \`/render\` remains the fal.ai pipeline; \`/codex-images\` is the manual Codex-native still collaboration surface.
|
|
1047
1161
|
- Worktree bootstrap: if \`node_modules\` or build output is missing, run \`npm install\` and \`npm run build\` before package commands.
|
|
1048
1162
|
|
|
1049
1163
|
## Skills (shared by all agents)
|
|
@@ -1067,6 +1181,7 @@ Multi-agent parallel generation with shot teammates, specialist validators, and
|
|
|
1067
1181
|
- Video model: \`${config.falVideoModel}\`
|
|
1068
1182
|
- Reference images: \`${config.refsDir}/\`
|
|
1069
1183
|
- Render output: \`${config.outputDir}/renders/SHOTNN/\`
|
|
1184
|
+
- Codex still workflow: \`.agent/workflows/codex-images-studio.md\`
|
|
1070
1185
|
- Frame chaining: SHOT[N] SON FRAME → reused as SHOT[N+1] ILK FRAME
|
|
1071
1186
|
- SON FRAME references its own ILK FRAME for intra-shot consistency
|
|
1072
1187
|
- Scene boundaries break the chain; ILK FRAME generated fresh
|
|
@@ -153,6 +153,7 @@ Write `$OUTPUT_DIR/reports/RENDER-REPORT.md` with this strict structure:
|
|
|
153
153
|
## Rules
|
|
154
154
|
|
|
155
155
|
- Do not start rendering until all specialist reports pass
|
|
156
|
+
- `/codex-images` is a separate manual Codex still workflow; do not write into `$OUTPUT_DIR/codex-images/` and do not replace `/render`
|
|
156
157
|
- Always check cost before rendering; alert user if cost exceeds $10
|
|
157
158
|
- Render shots SEQUENTIALLY — chaining requires previous shot's output
|
|
158
159
|
- Use `submit_job` for video generation (never `run_model` — too slow)
|