makaron-cli 0.17.1 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/.claude-plugin/plugin.json +2 -2
  2. package/.codex-plugin/plugin.json +5 -4
  3. package/README.md +45 -1
  4. package/bin/makaron.mjs +22 -8
  5. package/craft/manifest.json +2877 -0
  6. package/craft/prompts/agent-coding.md +220 -0
  7. package/craft/prompts/agent.md +86 -0
  8. package/craft/prompts/animate.md +448 -0
  9. package/craft/prompts/audio.md +261 -0
  10. package/craft/prompts/captions.md +220 -0
  11. package/craft/prompts/coding-submission.md +31 -0
  12. package/craft/prompts/coding-workflow.md +26 -0
  13. package/craft/prompts/creative.md +108 -0
  14. package/craft/prompts/cutout.md +81 -0
  15. package/craft/prompts/enhance.md +123 -0
  16. package/craft/prompts/generate_image_tool.md +26 -0
  17. package/craft/prompts/image.md +222 -0
  18. package/craft/prompts/legacy/agent.md +123 -0
  19. package/craft/prompts/legacy/coding-tool.md +31 -0
  20. package/craft/prompts/legacy/video-tool.md +38 -0
  21. package/craft/prompts/legacy/workspace-authoring.md +13 -0
  22. package/craft/prompts/niji.md +117 -0
  23. package/craft/prompts/pony_translate.md +42 -0
  24. package/craft/prompts/remotion-composition.md +405 -0
  25. package/craft/prompts/video-reverse.md +170 -0
  26. package/craft/prompts/video-submission.md +44 -0
  27. package/craft/prompts/video-workflow.md +42 -0
  28. package/craft/prompts/wai_translate.md +28 -0
  29. package/craft/prompts/web-search.md +1 -0
  30. package/craft/prompts/wild.md +119 -0
  31. package/craft/prompts/workspace-authoring.md +13 -0
  32. package/craft/skills/SKILL_README.md +249 -0
  33. package/craft/skills/_shared/aesthetic-lens-contract.md +68 -0
  34. package/craft/skills/_shared/native-audiovisual.md +44 -0
  35. package/craft/skills/_shared/remotion-director-contract.md +133 -0
  36. package/craft/skills/_shared/remotion-video-director/README.md +140 -0
  37. package/craft/skills/_shared/remotion-video-director/SKILL.md +391 -0
  38. package/craft/skills/_shared/remotion-video-director/references/component-library.md +608 -0
  39. package/craft/skills/_shared/remotion-video-director/references/expert-definitions.md +214 -0
  40. package/craft/skills/_shared/remotion-video-director/references/music-and-audio.md +186 -0
  41. package/craft/skills/_shared/remotion-video-director/references/remotion-patterns.md +439 -0
  42. package/craft/skills/_shared/remotion-video-director/references/video-archetypes.md +395 -0
  43. package/craft/skills/_shared/speech-clock.md +63 -0
  44. package/craft/skills/_shared/spoken-caption.md +75 -0
  45. package/craft/skills/_shared/studio-production/audio-direction.md +60 -0
  46. package/craft/skills/_shared/studio-production/production-contract.md +188 -0
  47. package/craft/skills/_shared/studio-production/reference-analysis.md +37 -0
  48. package/craft/skills/_shared/studio-production/review-contract.md +77 -0
  49. package/craft/skills/_shared/studio-production/taste-direction.md +114 -0
  50. package/craft/skills/_shared/visual-asset-bridge/SKILL.md +57 -0
  51. package/craft/skills/_shared/visual-direction/SKILL.md +98 -0
  52. package/craft/skills/_shared/voice-translation.md +55 -0
  53. package/craft/skills/aesthetic-disney-character-motion/SKILL.md +66 -0
  54. package/craft/skills/aesthetic-lottiefiles-motion/SKILL.md +78 -0
  55. package/craft/skills/aesthetic-rampstack-direction/SKILL.md +68 -0
  56. package/craft/skills/ai-video-gen/SKILL.md +48 -0
  57. package/craft/skills/animated-explainer/SKILL.md +53 -0
  58. package/craft/skills/animation/SKILL.md +53 -0
  59. package/craft/skills/avatar-spokesperson/SKILL.md +66 -0
  60. package/craft/skills/canvas-procedural-animation/SKILL.md +48 -0
  61. package/craft/skills/character-animation/SKILL.md +57 -0
  62. package/craft/skills/character-animation-qa/SKILL.md +48 -0
  63. package/craft/skills/character-rigging/SKILL.md +48 -0
  64. package/craft/skills/cinematic/SKILL.md +53 -0
  65. package/craft/skills/cinematic-video/SKILL.md +65 -0
  66. package/craft/skills/clip-factory/SKILL.md +53 -0
  67. package/craft/skills/comfyui/SKILL.md +48 -0
  68. package/craft/skills/content-repurpose/SKILL.md +54 -0
  69. package/craft/skills/create-video/SKILL.md +48 -0
  70. package/craft/skills/documentary-montage/SKILL.md +53 -0
  71. package/craft/skills/doubao-tts/SKILL.md +51 -0
  72. package/craft/skills/explainer-aesthetic-disney/SKILL.md +33 -0
  73. package/craft/skills/explainer-aesthetic-lottiefiles/SKILL.md +33 -0
  74. package/craft/skills/explainer-aesthetic-rampstack/SKILL.md +33 -0
  75. package/craft/skills/explainer-video/SKILL.md +423 -0
  76. package/craft/skills/ffmpeg/SKILL.md +48 -0
  77. package/craft/skills/grok-media/SKILL.md +47 -0
  78. package/craft/skills/hybrid/SKILL.md +53 -0
  79. package/craft/skills/localization-dub/SKILL.md +59 -0
  80. package/craft/skills/long-video-anchor/SKILL.md +111 -0
  81. package/craft/skills/long-video-director/SKILL.md +217 -0
  82. package/craft/skills/long-video-storyboard/SKILL.md +102 -0
  83. package/craft/skills/makaron-mascot/SKILL.md +83 -0
  84. package/craft/skills/makaron-mascot/assets/character-sheet.jpg +0 -0
  85. package/craft/skills/makaron-mascot/assets/makaron-spark-pixel-wizard-concepts.png +0 -0
  86. package/craft/skills/media-use/SKILL.md +47 -0
  87. package/craft/skills/motion-design-video/SKILL.md +64 -0
  88. package/craft/skills/motion-graphics/SKILL.md +48 -0
  89. package/craft/skills/multi-angle-video/SKILL.md +533 -0
  90. package/craft/skills/music/SKILL.md +47 -0
  91. package/craft/skills/music-to-video/SKILL.md +60 -0
  92. package/craft/skills/photo-to-video/SKILL.md +60 -0
  93. package/craft/skills/podcast-repurpose/SKILL.md +53 -0
  94. package/craft/skills/pose-library-design/SKILL.md +48 -0
  95. package/craft/skills/reference-video-studio/SKILL.md +55 -0
  96. package/craft/skills/remotion/SKILL.md +48 -0
  97. package/craft/skills/remotion-best-practices/SKILL.md +48 -0
  98. package/craft/skills/screen-demo/SKILL.md +61 -0
  99. package/craft/skills/seedance-2-0/SKILL.md +48 -0
  100. package/craft/skills/seedance-2-5/SKILL.md +48 -0
  101. package/craft/skills/sound-effects/SKILL.md +47 -0
  102. package/craft/skills/source-video-studio/SKILL.md +68 -0
  103. package/craft/skills/speech-to-text/SKILL.md +47 -0
  104. package/craft/skills/sticker-maker/SKILL.md +178 -0
  105. package/craft/skills/svg-character-animation/SKILL.md +48 -0
  106. package/craft/skills/synthetic-screen-recording/SKILL.md +48 -0
  107. package/craft/skills/talking-head/SKILL.md +106 -0
  108. package/craft/skills/text-to-speech/SKILL.md +50 -0
  109. package/craft/skills/threejs-animation/SKILL.md +48 -0
  110. package/craft/skills/threejs-fundamentals/SKILL.md +48 -0
  111. package/craft/skills/threejs-geometry/SKILL.md +48 -0
  112. package/craft/skills/threejs-lighting/SKILL.md +48 -0
  113. package/craft/skills/threejs-materials/SKILL.md +48 -0
  114. package/craft/skills/threejs-shaders/SKILL.md +48 -0
  115. package/craft/skills/threejs-textures/SKILL.md +48 -0
  116. package/craft/skills/tiktok-video/SKILL.md +188 -0
  117. package/craft/skills/tiktok-video/references/audio-sync.md +58 -0
  118. package/craft/skills/tiktok-video/references/caption-direction.md +36 -0
  119. package/craft/skills/tiktok-video/references/delivery-qa.md +84 -0
  120. package/craft/skills/tiktok-video/references/platform-layout.md +62 -0
  121. package/craft/skills/video-edit/SKILL.md +144 -0
  122. package/craft/skills/video-edit/references/direct-reference-route.md +141 -0
  123. package/craft/skills/video-edit/references/editing-protocol.md +79 -0
  124. package/craft/skills/video-edit/references/frame-location.md +85 -0
  125. package/craft/skills/video-edit/references/replication-protocol.md +67 -0
  126. package/craft/skills/video-edit/references/shot-blueprint.md +116 -0
  127. package/craft/skills/video-edit/references/shot-blueprint.schema.json +143 -0
  128. package/craft/skills/video-edit/references/similarity-qa.md +47 -0
  129. package/craft/skills/video-edit/scripts/extract-shot-blueprint.mjs +313 -0
  130. package/craft/skills/video-ffmpeg-lab/SKILL.md +220 -0
  131. package/craft/skills/video-mature-themes/SKILL.md +175 -0
  132. package/craft/skills/video-segment-edit/SKILL.md +16 -0
  133. package/craft/skills/video-translate/SKILL.md +148 -0
  134. package/craft/skills/video-understand/SKILL.md +48 -0
  135. package/craft/skills/visual-style/SKILL.md +47 -0
  136. package/craft/skills/wan-3-0/SKILL.md +59 -0
  137. package/craft/skills/web-design-guidelines/SKILL.md +47 -0
  138. package/craft/skills/website-to-video/SKILL.md +61 -0
  139. package/craft-source.json +7 -0
  140. package/package.json +12 -5
  141. package/runtime/adapter.mjs +615 -0
  142. package/runtime/configure.mjs +28 -0
  143. package/runtime/tool-catalog.json +807 -0
  144. package/runtime/tool-cli.mjs +98 -0
  145. package/skills/makaron-native/SKILL.md +89 -0
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: video-edit
3
+ description: Edit, transform, or faithfully recreate a supplied video. Use for source-preserving trims, repairs, captions, audio, effects, and subject/background replacement, or when a reference video's timing, camera, action, transitions, and beat structure must be reproduced with new content. Distinguishes source-edit from replication internally; use direct generation for a new video with no source authority and reference-video-studio for loose inspiration.
4
+ allowed-tools: read_file list_files inspect_retake retake_video prepare_visual_asset analyze_video transcribe_audio analyze_image generate_image generate_animation generate_audio run_code write_code_file write_file preview_frame materialize_media studio_run
5
+ metadata:
6
+ makaron:
7
+ icon: "⌁"
8
+ color: "#d946ef"
9
+ tipsEnabled: false
10
+ builtIn: true
11
+ userSelectable: false
12
+ manifestVisible: true
13
+ sourceMediaRequired: true
14
+ sourceProject: "openmontage"
15
+ sourceSkill: "video-edit"
16
+ sourceKind: "agent-skill"
17
+ supportLevel: "native"
18
+ adapterFamily: "media"
19
+ tags: [video, edit, replication, source-led, reference-to-video, ffmpeg, remotion]
20
+ ---
21
+
22
+ # Video Edit
23
+
24
+ ## Scope before execution
25
+
26
+ Whole-video character/object/outfit/background replacement, persistent removal,
27
+ and restyling remain full-source video edits. "Only change the character"
28
+ restricts what changes, not the time range. Pass the complete source plus the
29
+ supplied replacement image to generate_animation through the source-edit
30
+ protocol, preserving all unnamed attributes. Do not find character appearance
31
+ windows and force retake_video, inherit old ranges/actions, or generate endpoint
32
+ images merely because the conversation previously used local editing. Existing
33
+ images are references, not mandatory new image-generation requests. When a new
34
+ request explicitly changes the source or scope, replace the prior edit plan.
35
+ Provider duration limits select a capable model or the long-video workflow;
36
+ 15 seconds is the local selection limit, not the whole-product editing limit.
37
+
38
+ ## Bounded visual edits
39
+
40
+ This is an addition to full-source editing, not a replacement for it. For a
41
+ requested interval/scene, follow the steps here and stop before the full-source
42
+ profiles below. The tool descriptions own model limits, parameters, frame/audio
43
+ interpretation and prompt-writing guidance; do not load multi-angle or generation
44
+ guides for a bounded edit, even when its brief asks for multiple views.
45
+
46
+ 1. Resolve the requested range from explicit seconds/timecodes, first/last N
47
+ seconds, source duration or a verified scene/action. Convert clip-relative
48
+ time to original-source seconds using its source offset. GUI selection is
49
+ optional. For a known range, go straight to inspection; do not analyze the
50
+ whole video or locate a screenshot first. For an unknown scene, use
51
+ `analyze_video` / `preview_frame` to locate it. Only an unknown screenshot
52
+ location uses `skills/video-edit/references/frame-location.md`.
53
+ 2. State the source range briefly. Choose the requested model, otherwise H3 Max;
54
+ Seedance family requests default to Eco unless native/standard is explicit.
55
+ Call `inspect_retake` for that exact source/range/model. Read its actual frame
56
+ evidence and ASR together; do not retranscribe it. If visual inspection fails,
57
+ report it instead of generating blindly. If essential speech evidence is
58
+ unavailable, resolve it before submission.
59
+ 3. From the user's actual demand, independently choose `edit_mode` and
60
+ `audio_mode` using the tool contracts. Expand the demand using the observed
61
+ footage and measured output clock. Pass supplied images in their intended
62
+ roles; no compulsory image generation or standard camera sequence.
63
+ 4. Call `retake_video` with the inspection receipt and final instruction. It owns
64
+ contextual clipping, generation, selected audio handling and full-video
65
+ assembly. Do not script another pipeline or ask for a second merge approval.
66
+ Poll its root task; delivery retries must not create another paid generation.
67
+ 5. Verify the delivered selection: requested change, correct modification or
68
+ replacement policy, outer footage, joins and requested sound. Provider
69
+ completion alone is not acceptance. Report actual seconds and limitations.
70
+
71
+ A model-only comparison reuses the last explicitly edited ORIGINAL source,
72
+ range and demand, then reinspects that source for the new model. Do not use the
73
+ failed/generated result or current GUI selection as a new base unless the user
74
+ explicitly asks to revise that result. For an authorized correction, inspect the
75
+ failed selection to identify the defect, then revise from the original source.
76
+ Never weaken modification continuity just to make a failed edit look different.
77
+
78
+ If the range or source exceeds tool capabilities, use a capable full-source or
79
+ long-video workflow without silently shrinking the request. Precise cuts,
80
+ subtitles, working editable layers, standalone audio and continuation retain
81
+ their own tools. Visual demonstrations of layers and natural image/logo
82
+ integration within a scene remain local visual edits.
83
+
84
+ Use one Skill for any request in which a supplied video controls the result.
85
+ "Edit" is a user intent, not a requirement to expose a provider's typed edit
86
+ mode. First decide what authority the source has; that decision changes the
87
+ analysis depth, execution plan, and acceptance gates.
88
+
89
+ ## Choose One Profile
90
+
91
+ - **source-edit** — the supplied video's pixels remain the base. Change only the
92
+ named range/layer and preserve every unspecified part. Read
93
+ `skills/video-edit/references/editing-protocol.md`.
94
+ - **replication** — the supplied video is structural authority, while people,
95
+ objects, setting, brand, or other content is regenerated/replaced. Preserve
96
+ observable shot grammar: order, timing, framing, camera, choreography,
97
+ transitions, captions, and audio/beat structure. Read
98
+ `skills/video-edit/references/replication-protocol.md`, then its conditional
99
+ references.
100
+
101
+ If the source is only mood/style inspiration with no measurable structure lock,
102
+ use `reference-video-studio`. If there is no source authority, return to direct
103
+ generation in `prompts/animate.md`.
104
+
105
+ ## Shared Protocol
106
+
107
+ 1. Resolve the exact source and replacement inputs. Record duration/aspect/FPS,
108
+ requested sound, target output, rights, and a compact keep/change brief.
109
+ 2. Inspect only to the required depth. A clear source edit does not need
110
+ `analyze_video`; replication must understand the complete clip and lock
111
+ uncertain boundaries before paid generation.
112
+
113
+ 3. Choose the smallest capable path: deterministic FFmpeg, editable Remotion,
114
+ reference-to-video synthesis, or a hybrid. Models decide semantic intent and
115
+ visual labels; deterministic tools own measurements, timecodes, assembly,
116
+ and decode checks.
117
+ 4. For Seedance, keep the video in the reference set and express its authority
118
+ in the prompt. Use reference-to-video semantics for both profiles; do not ask
119
+ the user to choose an "edit mode" and do not set
120
+ `video_operation: "edit"`. Extension remains a distinct operation.
121
+ 5. Before paid work, state provider, current capability, billable duration/cost,
122
+ and retry ceiling. A clear existing-video edit instruction authorizes that
123
+ scoped edit without a GUI selection; ask only for genuinely missing source
124
+ or scope, or when the user requested review first. New video generation
125
+ retains its script confirmation gate.
126
+ 6. Verify the real output, not task completion: decode, streams, duration,
127
+ changed content, preserved layers, identity, continuity, structure, and audio
128
+ sync. Retry only against one or two measured failures.
129
+
130
+ ## Interrupt and Resume
131
+
132
+ Persist the source fingerprint, selected profile, change/preserve contract,
133
+ prompt or Blueprint, provider/task ID, budget, outputs, and QA status before an
134
+ async boundary. Reuse successful provider outputs and reconcile pending or
135
+ terminal tasks before any resubmission. Structured replication reuses the
136
+ existing Studio Run artifacts instead of inventing another state machine.
137
+
138
+ ## Stop Conditions
139
+
140
+ Stop when the source is ambiguous or unreadable, rights are unclear, replacement
141
+ roles conflict, the plan violates the preserve contract, structural evidence is
142
+ too uncertain, provider capability/cost cannot be confirmed, a paid retry lacks
143
+ a measurable correction, the retry ceiling is reached, or the output cannot be
144
+ decoded.
@@ -0,0 +1,141 @@
1
+ # Direct Reference Replication
2
+
3
+ Use this route for a single short clip that fits one provider call and whose
4
+ whole-clip motion, camera, timing, choreography, or background should control the
5
+ result. This is the P0 proven by the CUI experiment; it is still supervised
6
+ generation, not deterministic pixel replacement.
7
+
8
+ When no model or resolution is selected explicitly by the user or app, use Wan
9
+ 3.0 Prime at 720p for this route. Keep explicit provider, resolution, latency,
10
+ and cost requests authoritative; ordinary non-replication video generation
11
+ keeps its own default.
12
+
13
+ ## Input Checklist
14
+
15
+ Identify the reference video, each replacement image and its role, what should
16
+ stay structurally the same, and what should change. Keep this in the Agent's
17
+ working notes and final prompt; do not create another runtime object for it.
18
+
19
+ If the original video itself must remain visible underneath the change, route
20
+ to `video-edit`. If the user wants only mood/style inspiration, route to
21
+ `reference-video-studio`.
22
+
23
+ ## Compact Blueprint
24
+
25
+ Before submission, record at minimum:
26
+
27
+ - source duration/aspect/FPS and audio presence;
28
+ - shot count/order and boundary times, including uncertainty;
29
+ - for each shot: framing, camera path, subject action/choreography, screen
30
+ direction, transition, caption range, and beat/impact time;
31
+ - replacement role map and explicit preserved layers;
32
+ - top three acceptance priorities.
33
+
34
+ Use the full schema when the candidate boundary detector finds multiple shots,
35
+ confidence is low, captions/audio carry meaning, or the user requests an
36
+ editable result.
37
+
38
+ ## Prompt Contract
39
+
40
+ After understanding the complete clip, call `generate_animation` once with both
41
+ an evidence-based `story_prompt` and `replication_contract`, and explicitly set
42
+ `video_intent="replicate"`. This contract is an
43
+ internal deterministic tool input, not a second Skill, user mode, editor, or
44
+ state machine. The Agent supplies measured semantics; runtime owns the repeated
45
+ source-authority, identity, continuity, structure, and exclusion wording.
46
+
47
+ Use this intent only for exact source-led replication. Photo animation, new
48
+ videos, loose inspiration, ordinary source edits and extensions keep the default
49
+ `video_intent="generate"` and omit `replication_contract`. Never invent a source
50
+ video or fill unused contract fields with placeholders.
51
+
52
+ Populate:
53
+
54
+ - complete source video files supplied in the conversation and measured duration;
55
+ - every replaced performer, identified by stable source appearance/costume plus
56
+ an opening or distinctive action, mapped to one replacement files supplied in the conversation and
57
+ its exact identity, face, hair, body, clothing, colors, footwear, and
58
+ accessories;
59
+ - every replaced object, identified by source state/action/handler, mapped to
60
+ one replacement files supplied in the conversation and its exact shape, material, color,
61
+ construction, surface details, and distinctive features;
62
+ - replacement environment only when scenery changes; omission means preserve
63
+ the visible source environment;
64
+ - requested style and clip-specific exclusions when they matter.
65
+
66
+ A whole-person replacement includes the supplied clothing unless the user
67
+ explicitly narrows it. Never infer that an occupation or story role requires
68
+ preserving the source uniform. Never map a role only as left/right/front/back;
69
+ subjects cross, turn, overlap, fall, and reverse screen direction.
70
+
71
+ Keep `story_prompt` focused on measured content the compiler cannot infer:
72
+
73
+ 1. first line title;
74
+ 2. every shot or continuous action phase in source order, with measured or
75
+ best-evidence timing, framing/camera, opening state, preparation,
76
+ anticipation, action, impact, recoil, recovery, crossing, transition, and
77
+ ending hold;
78
+ 3. requested music, ambience, dialogue, voice, and effects tied to visible
79
+ beats; unless the user explicitly asks for silence, leave model-native audio
80
+ enabled;
81
+ 4. case-specific style or exceptions.
82
+
83
+ Do not paste generic source/identity/structure locks into `story_prompt`; the
84
+ compiler adds them deterministically. Immediately before submission, compare
85
+ the contract with `story_prompt`: no sentence may preserve or reintroduce a
86
+ source face, hair, body, garment, color, accessory, environment, or object
87
+ property controlled by replacement media. A conflict is a paid-submit blocker;
88
+ rewrite the free-form direction or correct the contract first. Do not add an
89
+ automatic audio post-processing workflow or infer exact source-track reuse.
90
+
91
+ ## Complete-Understanding Gate
92
+
93
+ Do not submit a paid replication when complete-video understanding failed. If
94
+ `analyze_video` errors or does not expose opening actions, crossings, impacts,
95
+ and the final state, call raw-video `preview_frame` once with 4-6 representative
96
+ `timestamps` and inspect the returned contact sheet. If neither source provides
97
+ those temporal facts, stop before `generate_animation` and report the blocker.
98
+
99
+ For Seedance, submit the clip and replacement references through
100
+ reference-to-video. Do not set `video_operation: "edit"`. Seedance 2.5 may use
101
+ `duration: -1` so provider-managed output follows the full reference duration;
102
+ Seedance 2.0 uses a supported explicit duration matching the source as closely
103
+ as possible.
104
+
105
+ ## Deterministic Provider-Input Repair
106
+
107
+ Before the first paid submission, inspect known reference dimensions. If a
108
+ Seedance image is below the provider minimum, resize/pad the supplied pixels
109
+ with `run_code({ runtime: "node", references: [...] })`, save each result with
110
+ `saveOutput`, then publish those workspace image outputs once with
111
+ `write_file({ fromWorkspaceOutputs: true, mediaType: "image", limit: N,
112
+ publish: true })`. Use the newly returned files supplied in the conversation items in the final script.
113
+
114
+ This is transport preparation, not creative regeneration. Never call
115
+ `generate_image` merely to increase dimensions, convert format, or add padding;
116
+ that changes identity and adds avoidable cost. Preserve aspect ratio and all
117
+ source pixels. A robust Node return shape is:
118
+
119
+ ```js
120
+ const saved = await saveOutput(out, workspacePath, 'image/png');
121
+ outputs.push({ ...saved, path: out, contentType: 'image/png', description });
122
+ return { type: 'files', outputs };
123
+ ```
124
+
125
+ If deterministic preparation cannot produce a new public URL, stop before any
126
+ video submission and report the input blocker. Do not fall back to image
127
+ generation.
128
+
129
+ ## QA and Correction
130
+
131
+ Run the shared similarity gates. For a first P0 comparison, prioritize:
132
+
133
+ 1. all replacement roles remain correct and stable;
134
+ 2. shot count/order and action sequence match;
135
+ 3. camera/framing and contact/impact timing match;
136
+ 4. requested background policy is honored;
137
+ 5. output duration, requested audio presence/sync, and decodability pass.
138
+
139
+ The correction prompt must name one or two measured failures. If one attempt
140
+ preserves characters but misses camera, and another preserves camera but misses
141
+ background, report that tradeoff; do not average it into a false success claim.
@@ -0,0 +1,79 @@
1
+ # Video Editing Protocol
2
+
3
+ Use this reference after `skills/video-edit/SKILL.md`. It separates editing
4
+ intent from provider implementation so one CUI workflow can use deterministic,
5
+ composition, and generative tools without exposing backend modes to the user.
6
+
7
+ ## 1. Change/Preserve Contract
8
+
9
+ Before tools, reduce the request to:
10
+
11
+ ```json
12
+ {
13
+ "base_video": "the supplied source",
14
+ "change": ["replace the red car with the supplied blue car"],
15
+ "preserve": ["duration", "camera", "performance", "background"],
16
+ "range": { "start_sec": 0, "end_sec": 8.2 },
17
+ "delivery": { "editable": false, "sound": "natural and synchronized" }
18
+ }
19
+ ```
20
+
21
+ Unspecified dimensions belong in `preserve`. If the user asks to change almost
22
+ everything while retaining shot grammar, return to `video-edit/SKILL.md` and
23
+ choose its `replication` profile.
24
+
25
+ ## 2. Tool Decision Table
26
+
27
+ | Edit class | Primary path | Model judgment |
28
+ | --- | --- | --- |
29
+ | trim, remove, reorder, speed, crop, resize, transcode | FFmpeg | choose ranges only when language/visual meaning matters |
30
+ | dialogue-led cut | transcript then FFmpeg/Remotion | select semantic ranges; execute timecodes deterministically |
31
+ | captions, titles, overlays, picture-in-picture | Remotion | decide layout/taste; render timing deterministically |
32
+ | subject, object, outfit, material, background, weather, VFX replacement | reference-to-video | describe change/preserve constraints and inspect visual fidelity |
33
+ | one bad moment | locate frame/range, generate patch, deterministic replace | identify fault and judge continuity |
34
+ | forward/backward continuation | provider extend | describe only the new beat; do not treat as an edit |
35
+
36
+ Do not invoke generation for an exact operation FFmpeg can complete without
37
+ inventing pixels. Do not force FFmpeg to solve semantic pixel replacement.
38
+
39
+ ## 3. Generative Source Editing
40
+
41
+ - Put the base video and every replacement reference in the same request.
42
+ - Define every reference by role before describing action. Map identity by role
43
+ and appearance, not only by left/right position.
44
+ - State the invariant sentence explicitly: preserve original camera path,
45
+ choreography, timing, framing, cuts, and background except for the named
46
+ replacement.
47
+ - Seedance source edits use reference-to-video semantics. Do not expose or set a
48
+ Seedance `edit` mode merely because the user said “编辑”; the Skill owns the
49
+ intent, while the video is a motion/camera/content reference. Seedance 2.5 may
50
+ use provider-managed duration (`duration: -1`) for full-source repainting.
51
+ - Typed `edit` may remain an internal compatibility path for another provider
52
+ only when its verified contract requires it. It is never a user-facing mode.
53
+ - Describe the requested sound naturally in the video prompt and let the model
54
+ render it with the picture. Use a provider-native source-sound switch only
55
+ when the user explicitly asks for that result and the selected route supports
56
+ it. Do not add an automatic audio restoration or post-processing path.
57
+
58
+ ## 4. Locality and Continuity
59
+
60
+ For a local repair, record `replaceStart`, `replaceEnd`, and
61
+ `replacementDuration`. Give the model at least one identity/context anchor from
62
+ both sides when available. Trim or retime the patch to the exact replacement
63
+ range before assembly. Inspect the frame before the seam, the seam, and the frame
64
+ after it; never accept a patch from its middle frame alone.
65
+
66
+ ## 5. Acceptance Gates
67
+
68
+ Always require:
69
+
70
+ - output is a decodable MP4/MOV with expected video/audio streams;
71
+ - duration is within one frame for deterministic edits, or within the agreed
72
+ provider tolerance for generative edits;
73
+ - requested change is visible for the required range;
74
+ - preserved identity/background/action/camera do not drift materially;
75
+ - requested sound is present and synchronized, unless silence was requested;
76
+ - first and last frames do not morph into a different subject;
77
+ - local-edit seams do not jump in pose, lighting, scale, or sound.
78
+
79
+ One provider success is evidence of completion, not evidence of acceptance.
@@ -0,0 +1,85 @@
1
+ # Locate an unknown screenshot moment
2
+
3
+ Read only when a supplied screenshot identifies a video repair but its timestamp
4
+ is unknown. A creative image is not a screenshot locator. If the user supplies a
5
+ clear time/range, return directly to video-edit inspection without this workflow.
6
+
7
+ ## Locate the screenshot in the video
8
+
9
+ Primary locator: call `analyze_video` with `mode: "locate_frame"`.
10
+
11
+ Examples:
12
+
13
+ For an uploaded screenshot URL:
14
+
15
+ `analyze_video({ source: { path: "inputs/source.jpg" }, mode: "locate_frame", image_url, question })`
16
+
17
+ For a frame captured by `preview_frame`:
18
+
19
+ `analyze_video({ source: { path: "inputs/source.jpg" }, mode: "locate_frame", workspace_path, question })`
20
+
21
+ Interpret the result:
22
+
23
+ - `located` with confidence >= 0.65: proceed only if `verification.verdict` is
24
+ `match` and `verification.confidence >= 0.72`.
25
+ - `multiple_candidates`: use the strongest timestamp/window, then verify with
26
+ `preview_frame`.
27
+ - `uncertain`, confidence < 0.65, missing verification, or failed verification:
28
+ use the FFmpeg fallback below. Do not proceed to regeneration from an
29
+ unverified timestamp.
30
+ - `not_found`: ask for a clearer screenshot or confirm the source video.
31
+
32
+ High confidence is not enough when several moments look broadly similar. If the
33
+ evidence sounds generic, if the returned timestamp is near 0s for a later-looking
34
+ frame, or if the video reuses similar layouts across time, run the local visual
35
+ cross-check below.
36
+
37
+ Verification is a hard gate. If the candidate frame extracted at the located
38
+ timestamp does not visually match the user's screenshot, say the frame could not
39
+ be located confidently and ask for a clearer screenshot or timestamp. Do not
40
+ continue just because the broad scene or skyline looks similar.
41
+
42
+ ## Verify the candidate visually
43
+
44
+ Use this when `analyze_video(mode:"locate_frame")` is weak, ambiguous, or
45
+ overconfident on visually similar moments.
46
+
47
+ Read `skills/video-ffmpeg-lab/SKILL.md` before the first `run_code` call.
48
+
49
+ Use `run_code({ runtime: "node", references: [{ path: "inputs/reference.mp4", role: "reference" }] })` to:
50
+
51
+ - probe the video,
52
+ - extract candidate frames every 0.5s, or every 0.25s around a likely window,
53
+ - compare the screenshot against candidate frames when it is an exact or near
54
+ exact frame capture,
55
+ - optionally build a contact sheet,
56
+ - save the contact sheet or candidate frames to workspace outputs.
57
+
58
+ Decision rule:
59
+
60
+ - Before choosing a timestamp, compare the user's screenshot with at least one
61
+ candidate frame image. The selected timestamp must be visually defensible as
62
+ the same underlying frame or moment.
63
+ - If the screenshot is a real frame capture and the best visual match is strong,
64
+ isolated in time, and disagrees with `analyze_video`, prefer that timestamp
65
+ even when `analyze_video` returned high confidence.
66
+ - A low visual distance is not enough by itself. If many near-identical matches
67
+ span several seconds or more, treat the visual match as ambiguous; use it only
68
+ as support evidence and ask for confirmation or keep the AI/user timestamp.
69
+ - If the screenshot includes player controls or UI chrome, crop/ignore the UI
70
+ before comparing when possible. If not, use the visual search only as support
71
+ evidence and rely on `preview_frame` for final confirmation.
72
+ - If the best visual match strongly disagrees with `analyze_video`, use the
73
+ visual match timestamp and verify it with `preview_frame`.
74
+
75
+ Then compare the screenshot with the best candidates visually, or call
76
+ `analyze_video(mode:"locate_frame")` again on a smaller candidate segment.
77
+
78
+ Do not spend many turns on perfect matching. If two candidates are plausible,
79
+ ask the user which one is the frame they meant.
80
+
81
+
82
+ After a verified match, resolve the smallest bounded scene/window containing the
83
+ requested correction, inside the visible source range. A timestamp repair does
84
+ not mean editing everything after it. Return to the Bounded visual edits steps
85
+ in `skills/video-edit/SKILL.md`; do not generate/assemble a separate patch here.
@@ -0,0 +1,67 @@
1
+ # Replication Profile
2
+
3
+ Use this profile when the reference video is the structural authority and the
4
+ user wants its content replaced. The goal is observable shot-grammar fidelity,
5
+ not pixel identity or a vague "similar feeling".
6
+
7
+ ## Required References
8
+
9
+ 1. `skills/video-edit/references/shot-blueprint.md`
10
+ 2. `skills/video-edit/references/direct-reference-route.md`
11
+ 3. `skills/video-edit/references/similarity-qa.md`
12
+ 4. `skills/video-ffmpeg-lab/SKILL.md` for deterministic inspection and files
13
+ 5. Shared Studio production and Remotion contracts only for structured/editable
14
+ execution
15
+
16
+ ## Protocol
17
+
18
+ 1. **Resolve scope and rights.** Identify one exact reference, replacement role
19
+ map, preserve/change layers, delivery duration/aspect/resolution, captions,
20
+ and requested sound. Probe the exact file. Get permission before sending
21
+ private references to third-party models; otherwise stay local.
22
+ 2. **Understand the complete clip.** Extract deterministic file truth, candidate
23
+ boundaries, frames, audio envelope, and beat candidates. Transcribe only when
24
+ speech timing matters. Use a multimodal model to label composition,
25
+ choreography, camera, text/style, and uncertain boundaries. If
26
+ `analyze_video` fails or lacks opening/action/impact/ending evidence, call
27
+ raw-video `preview_frame` once with 4-6 representative timestamps. If both
28
+ routes fail to reveal the temporal evidence, stop before paid generation. Do
29
+ not confuse a prose summary with measured evidence.
30
+ 3. **Lock Video DNA.** Write a Shot Blueprint with source ranges, confidence,
31
+ evidence, preserve/replace fields, and acceptance priorities. A short
32
+ continuous clip may use a compact Blueprint; multi-shot, low-confidence, or
33
+ editable work uses the full schema and Studio artifacts.
34
+ 4. **Choose one execution route.** Use direct reference replication for one
35
+ provider-sized clip when whole-clip motion/camera/choreography should transfer
36
+ in one call. When neither the user nor the app selector chooses a model,
37
+ direct replication defaults to Wan 3.0 Prime at 720p;
38
+ this exception does not change the default for ordinary video generation.
39
+ Preserve an explicit provider or cost/resolution request. Otherwise choose A
40
+ = deterministic re-edit of supplied replacements, B = per-shot generation,
41
+ or C = hybrid; prefer A, then C, then B. Kling Motion Control is only for
42
+ supported single-person continuous action, not a general multi-person or
43
+ multi-shot route.
44
+ 5. **Gate generation.** For structured work, prove one representative 4-5
45
+ second shot before a batch. For a direct short clip, one complete attempt is
46
+ the representative proof. Allow one evidence-driven correction; more paid
47
+ work needs approval.
48
+ 6. **Generate or map content.** For direct structural replication, explicitly
49
+ set `video_intent="replicate"` and pass the
50
+ measured identity/object/environment mappings in
51
+ `generate_animation.replication_contract`; put timed shots/actions and
52
+ natural sound direction in `story_prompt`. Runtime deterministically expands
53
+ the fragile invariant wording. This is an internal tool contract under the
54
+ same Skill, not a second product workflow. Seedance uses reference-to-video,
55
+ never typed edit.
56
+ 7. **Assemble only when needed.** A direct reference result may remain one
57
+ provider output after QA. Structured routes put pixels into one editable
58
+ Remotion composition; the Blueprint stays the master clock. Do not add a
59
+ separate audio post-production path unless the user explicitly requests one.
60
+ 8. **Measure and repair.** Compare boundaries/order/durations, framing, camera
61
+ and subject motion, transitions, captions, beat alignment, color/style, role
62
+ identity, and final decodability. Repair the smallest failing layer; never
63
+ regenerate working layers by default.
64
+
65
+ Do not promise perfect replication. Models may drift on exact trajectories,
66
+ occluded identity, fine contact physics, typography, and stochastic pixels; the
67
+ QA report must expose those residuals rather than average them into success.
@@ -0,0 +1,116 @@
1
+ # Shot Blueprint / Video DNA Contract
2
+
3
+ `shot-blueprint.json` is the P0 machine-readable skeleton between analysis,
4
+ asset mapping/generation, Remotion construction, and QA. It is evidence, not a
5
+ creative brief. Keep seconds as decimals in reference time; convert to frames
6
+ only after the output FPS is locked.
7
+
8
+ The companion JSON Schema is
9
+ `skills/video-edit/references/shot-blueprint.schema.json`.
10
+ The offline prototype also rejects inconsistent shot/boundary counts, order,
11
+ non-contiguous coverage, duration math, duration-curve length, and an uncovered
12
+ ending. Composition/camera/text/audio/style fields are still a P0 skeleton: keep
13
+ them `null` until a typed extractor or model review supplies evidence.
14
+
15
+ ## Required P0 Shape
16
+
17
+ ```json
18
+ {
19
+ "schema_version": "0.1.0",
20
+ "reference": {
21
+ "source_name": "reference.mp4",
22
+ "duration_sec": 15,
23
+ "width": 1080,
24
+ "height": 1920,
25
+ "fps": 30,
26
+ "video_codec": "h264",
27
+ "audio": { "present": false, "codec": null, "sample_rate": null }
28
+ },
29
+ "analysis": {
30
+ "boundary_method": "adaptive_scene_plus_black",
31
+ "asr_status": "not_run",
32
+ "beat_status": "not_run",
33
+ "model_review_status": "required",
34
+ "unresolved_boundary_candidates": [],
35
+ "warnings": []
36
+ },
37
+ "global_dna": {
38
+ "aspect_ratio": "9:16",
39
+ "shot_duration_curve_sec": [5.02, 5.5, 4.48],
40
+ "cut_rate_per_min": 8,
41
+ "style": null,
42
+ "audio_arc": null
43
+ },
44
+ "boundaries": [
45
+ {
46
+ "time_sec": 5.02,
47
+ "kind": "fade_or_black",
48
+ "confidence": 0.7,
49
+ "evidence": [{ "method": "blackdetect", "time_sec": 5.02 }]
50
+ }
51
+ ],
52
+ "shots": [
53
+ {
54
+ "id": "shot-001",
55
+ "order": 1,
56
+ "source_range": { "start_sec": 0, "end_sec": 5.02 },
57
+ "duration_sec": 5.02,
58
+ "narrative_role": null,
59
+ "subject_action": null,
60
+ "composition": null,
61
+ "camera_motion": null,
62
+ "transition_in": null,
63
+ "transition_out": null,
64
+ "text_layers": [],
65
+ "audio": null,
66
+ "style": null,
67
+ "preserve": ["duration", "order"],
68
+ "replace": ["subject", "brand", "copy"],
69
+ "confidence": 0.5,
70
+ "needs_model_review": true
71
+ }
72
+ ],
73
+ "route": null,
74
+ "qa_targets": null
75
+ }
76
+ ```
77
+
78
+ ## Evidence Ownership
79
+
80
+ Deterministic tools own numeric/file facts: stream metadata, source ranges,
81
+ candidate cut/fade timestamps, decoded frames, ASR word times, waveform/onset
82
+ times, output duration, and MP4 decode. A model may correct a boundary only by
83
+ adding its frame/time evidence; it must not silently replace measured data.
84
+
85
+ The multimodal model owns semantic labels: narrative role, subject/action,
86
+ shot size, camera intent, composition anchors, transition interpretation,
87
+ visible text/style, and which grammar is transferable. Mark unknown fields
88
+ `null`; do not fabricate them to satisfy the schema.
89
+
90
+ ## Route Contract
91
+
92
+ The Studio Run Proposal owns the route decision. If `route` is populated in the
93
+ Blueprint, treat it as a read-only projection with the Proposal artifact path,
94
+ not a second source of truth. Proposal contains:
95
+
96
+ - `strategy`: `A`, `B`, or `C`.
97
+ - `shot_routes`: one entry per shot with `source_recut`, `generated`, or
98
+ `hybrid_overlay`, plus the exact source/generation artifact.
99
+ - `provider_contract`: model/version, operation, duration/reference limits,
100
+ resolution, audio behavior, and the date checked.
101
+ - `cost_gate`: currency, estimated total, approved cap, attempt count, and
102
+ whether more approval is required.
103
+
104
+ The editable composition must use the Blueprint's source ranges and one locked
105
+ FPS. Keep provider task IDs and workspace artifact paths in the Studio Run
106
+ Assets artifact so the Blueprint remains portable and comparable.
107
+
108
+ ## Resume State
109
+
110
+ Use the existing `${projectId}/studio-runs/${studioRunId}/run.json` and its eight
111
+ stages as the only resume state. Brief points to this supplemental Blueprint;
112
+ Proposal owns route/budget; Storyboard owns confirmed shots; Assets own the map
113
+ and provider task IDs; Composition owns the design path and pre-materialization
114
+ QA. A resumed run validates reference metadata, Blueprint version, assets, and
115
+ task IDs, then follows Studio Run approval/invalidation. Do not create a second
116
+ stage machine.