cue-ai 0.9.2 → 0.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/CHANGELOG.md +4 -3
  2. package/README.md +148 -170
  3. package/bin/cue-learnings +30 -4
  4. package/bin/cue-review-progress +0 -0
  5. package/bin/cue-review-watch +0 -0
  6. package/dist/cue.js +4328 -3108
  7. package/package.json +1 -1
  8. package/plugins/cue/commands/cue-switch.md +1 -1
  9. package/plugins/cue/commands/cue.md +1 -1
  10. package/profiles/backend/profile.yaml +4 -0
  11. package/profiles/browser/profile.yaml +4 -0
  12. package/profiles/career/profile.yaml +2 -13
  13. package/profiles/commerce/profile.yaml +0 -2
  14. package/profiles/coolify/profile.yaml +0 -1
  15. package/profiles/core/profile.yaml +78 -11
  16. package/profiles/dash-merge-test/profile.yaml +6 -1
  17. package/profiles/designer/profile.yaml +9 -1
  18. package/profiles/dropshipping/profile.yaml +69 -0
  19. package/profiles/frontend/profile.yaml +4 -0
  20. package/profiles/google-ads/profile.yaml +34 -0
  21. package/profiles/google-analytics/profile.yaml +34 -0
  22. package/profiles/google-drive/profile.yaml +34 -0
  23. package/profiles/gstack/profile.yaml +117 -29
  24. package/profiles/marketing/profile.yaml +0 -1
  25. package/profiles/media/README.md +70 -0
  26. package/profiles/media/profile.yaml +104 -0
  27. package/profiles/nano-banana/profile.yaml +52 -0
  28. package/profiles/ops/profile.yaml +1 -2
  29. package/profiles/secops/profile.yaml +3 -0
  30. package/profiles/skill-writer/profile.yaml +15 -0
  31. package/profiles/video/profile.yaml +3 -0
  32. package/profiles/web-frontend-base/profile.yaml +6 -0
  33. package/profiles/webshop/profile.yaml +0 -1
  34. package/profiles/webshop-google/profile.yaml +1 -0
  35. package/profiles/x-growth-bot/profile.yaml +2 -0
  36. package/resources/icons/generate-icons.py +2 -128
  37. package/resources/mcps/configs/claude.sanitized.json +88 -20
  38. package/resources/mcps/configs/claude_runtime.sanitized.json +40 -1
  39. package/resources/mcps/configs/codex.sanitized.json +29 -0
  40. package/resources/skills/skills/career/job-hunter/LICENSE +21 -0
  41. package/resources/skills/skills/career/job-hunter/README.md +323 -0
  42. package/resources/skills/skills/career/job-hunter/SKILL.md +91 -0
  43. package/resources/skills/skills/career/job-hunter/agents/README.md +96 -0
  44. package/resources/skills/skills/career/job-hunter/agents/apply-assessment-prep.md +195 -0
  45. package/resources/skills/skills/career/job-hunter/agents/apply-ats-scan.md +155 -0
  46. package/resources/skills/skills/career/job-hunter/agents/apply-bias-audit.md +224 -0
  47. package/resources/skills/skills/career/job-hunter/agents/apply-cover-letter.md +69 -0
  48. package/resources/skills/skills/career/job-hunter/agents/apply-decode-jd.md +117 -0
  49. package/resources/skills/skills/career/job-hunter/agents/apply-fit-score.md +183 -0
  50. package/resources/skills/skills/career/job-hunter/agents/apply-linkedin-audit.md +74 -0
  51. package/resources/skills/skills/career/job-hunter/agents/apply-linkedin-scrape.md +255 -0
  52. package/resources/skills/skills/career/job-hunter/agents/apply-portfolio-brief.md +123 -0
  53. package/resources/skills/skills/career/job-hunter/agents/apply-reality-check.md +164 -0
  54. package/resources/skills/skills/career/job-hunter/agents/apply-reference-prep.md +150 -0
  55. package/resources/skills/skills/career/job-hunter/agents/apply-rejection-analysis.md +172 -0
  56. package/resources/skills/skills/career/job-hunter/agents/apply-resume.md +70 -0
  57. package/resources/skills/skills/career/job-hunter/agents/apply-skills-gap-filler.md +109 -0
  58. package/resources/skills/skills/career/job-hunter/agents/career-internal.md +94 -0
  59. package/resources/skills/skills/career/job-hunter/agents/career-linkedin-content.md +173 -0
  60. package/resources/skills/skills/career/job-hunter/agents/career-linkedin-scanner.md +262 -0
  61. package/resources/skills/skills/career/job-hunter/agents/career-network-message.md +108 -0
  62. package/resources/skills/skills/career/job-hunter/agents/career-promote.md +102 -0
  63. package/resources/skills/skills/career/job-hunter/agents/career-review.md +71 -0
  64. package/resources/skills/skills/career/job-hunter/agents/interview-debrief.md +117 -0
  65. package/resources/skills/skills/career/job-hunter/agents/interview-mock.md +171 -0
  66. package/resources/skills/skills/career/job-hunter/agents/interview-panel-decoder.md +152 -0
  67. package/resources/skills/skills/career/job-hunter/agents/interview-prep.md +184 -0
  68. package/resources/skills/skills/career/job-hunter/agents/interview-question-bank.md +133 -0
  69. package/resources/skills/skills/career/job-hunter/agents/interview-research.md +148 -0
  70. package/resources/skills/skills/career/job-hunter/agents/offer-compare.md +117 -0
  71. package/resources/skills/skills/career/job-hunter/agents/offer-counteroffer.md +144 -0
  72. package/resources/skills/skills/career/job-hunter/agents/offer-deadline-manager.md +148 -0
  73. package/resources/skills/skills/career/job-hunter/agents/offer-negotiate.md +126 -0
  74. package/resources/skills/skills/career/job-hunter/agents/offer-schedule.md +99 -0
  75. package/resources/skills/skills/career/job-hunter/agents/offer-thankyou.md +80 -0
  76. package/resources/skills/skills/career/job-hunter/agents/search-company-research.md +146 -0
  77. package/resources/skills/skills/career/job-hunter/agents/search-follow-up.md +129 -0
  78. package/resources/skills/skills/career/job-hunter/agents/search-ghost-job-detector.md +152 -0
  79. package/resources/skills/skills/career/job-hunter/agents/search-inbox-scan.md +193 -0
  80. package/resources/skills/skills/career/job-hunter/agents/search-interview-scorecard.md +164 -0
  81. package/resources/skills/skills/career/job-hunter/agents/search-jobs.md +149 -0
  82. package/resources/skills/skills/career/job-hunter/agents/search-momentum-check.md +194 -0
  83. package/resources/skills/skills/career/job-hunter/agents/search-outreach.md +85 -0
  84. package/resources/skills/skills/career/job-hunter/agents/search-referral-finder.md +124 -0
  85. package/resources/skills/skills/career/job-hunter/agents/search-salary.md +96 -0
  86. package/resources/skills/skills/career/job-hunter/agents/search-send-email.md +109 -0
  87. package/resources/skills/skills/career/job-hunter/agents/search-tracker-update.md +127 -0
  88. package/resources/skills/skills/career/job-hunter/inputs/README.md +26 -0
  89. package/resources/skills/skills/career/job-hunter/inputs/apply-linkedin-url.txt +8 -0
  90. package/resources/skills/skills/career/job-hunter/inputs/interview-context.md +24 -0
  91. package/resources/skills/skills/career/job-hunter/inputs/job-description.md +20 -0
  92. package/resources/skills/skills/career/job-hunter/inputs/job-search-criteria.md +36 -0
  93. package/resources/skills/skills/career/job-hunter/inputs/my-linkedin.md +24 -0
  94. package/resources/skills/skills/career/job-hunter/inputs/my-resume.md +28 -0
  95. package/resources/skills/skills/career/job-hunter/inputs/search-outreach-target.md +24 -0
  96. package/resources/skills/skills/career/job-hunter/rules/README.md +37 -0
  97. package/resources/skills/skills/career/job-hunter/rules/writing-rules.md +81 -0
  98. package/resources/skills/skills/design/banana/SKILL.md +375 -0
  99. package/resources/skills/skills/design/banana/references/cost-tracking.md +47 -0
  100. package/resources/skills/skills/design/banana/references/gemini-models.md +236 -0
  101. package/resources/skills/skills/design/banana/references/mcp-tools.md +145 -0
  102. package/resources/skills/skills/design/banana/references/post-processing.md +192 -0
  103. package/resources/skills/skills/design/banana/references/presets.md +69 -0
  104. package/resources/skills/skills/design/banana/references/prompt-engineering.md +481 -0
  105. package/resources/skills/skills/design/banana/scripts/batch.py +97 -0
  106. package/resources/skills/skills/design/banana/scripts/cost_tracker.py +191 -0
  107. package/resources/skills/skills/design/banana/scripts/edit.py +159 -0
  108. package/resources/skills/skills/design/banana/scripts/generate.py +168 -0
  109. package/resources/skills/skills/design/banana/scripts/presets.py +154 -0
  110. package/resources/skills/skills/design/banana/scripts/setup_mcp.py +151 -0
  111. package/resources/skills/skills/design/banana/scripts/validate_setup.py +133 -0
  112. package/resources/skills/skills/gstack/ship/SKILL.md +13 -0
  113. package/resources/skills/skills/media/3d-logo-animation/SKILL.md +59 -0
  114. package/resources/skills/skills/media/action-figure-generator/SKILL.md +48 -0
  115. package/resources/skills/skills/media/ad-creative/SKILL.md +79 -0
  116. package/resources/skills/skills/media/ai-clipping/SKILL.md +194 -0
  117. package/resources/skills/skills/media/ai-clipping/scripts/run-ai-clipping.sh +200 -0
  118. package/resources/skills/skills/media/ai-fight-scene/SKILL.md +132 -0
  119. package/resources/skills/skills/media/amazon-product-listing/SKILL.md +68 -0
  120. package/resources/skills/skills/media/animal-video-generator/SKILL.md +59 -0
  121. package/resources/skills/skills/media/award-ceremony-video/SKILL.md +87 -0
  122. package/resources/skills/skills/media/blog-header/SKILL.md +61 -0
  123. package/resources/skills/skills/media/brand-kit/SKILL.md +72 -0
  124. package/resources/skills/skills/media/brochures/SKILL.md +65 -0
  125. package/resources/skills/skills/media/cartoon-dance-animation/SKILL.md +62 -0
  126. package/resources/skills/skills/media/character-story-video/SKILL.md +84 -0
  127. package/resources/skills/skills/media/chibi-collage-effect/SKILL.md +63 -0
  128. package/resources/skills/skills/media/cinema-director/SKILL.md +93 -0
  129. package/resources/skills/skills/media/cinema-director/scripts/generate-film.sh +78 -0
  130. package/resources/skills/skills/media/color-analysis-board/SKILL.md +71 -0
  131. package/resources/skills/skills/media/core-edit/SKILL.md +48 -0
  132. package/resources/skills/skills/media/core-edit/edit-image.sh +54 -0
  133. package/resources/skills/skills/media/core-edit/enhance-image.sh +191 -0
  134. package/resources/skills/skills/media/core-edit/lipsync.sh +144 -0
  135. package/resources/skills/skills/media/core-edit/video-effects.sh +193 -0
  136. package/resources/skills/skills/media/core-media/SKILL.md +49 -0
  137. package/resources/skills/skills/media/core-media/create-music.sh +169 -0
  138. package/resources/skills/skills/media/core-media/generate-image.sh +161 -0
  139. package/resources/skills/skills/media/core-media/generate-video.sh +137 -0
  140. package/resources/skills/skills/media/core-media/image-to-video.sh +228 -0
  141. package/resources/skills/skills/media/core-media/schema_data.json +18708 -0
  142. package/resources/skills/skills/media/core-media/upload.sh +41 -0
  143. package/resources/skills/skills/media/core-platform/SKILL.md +41 -0
  144. package/resources/skills/skills/media/core-platform/check-result.sh +37 -0
  145. package/resources/skills/skills/media/core-platform/setup.sh +31 -0
  146. package/resources/skills/skills/media/couple-grid-creator/SKILL.md +47 -0
  147. package/resources/skills/skills/media/design-guide/SKILL.md +73 -0
  148. package/resources/skills/skills/media/drone-style-video/SKILL.md +61 -0
  149. package/resources/skills/skills/media/fashion-try-on/SKILL.md +61 -0
  150. package/resources/skills/skills/media/floor-plan-rendering/SKILL.md +56 -0
  151. package/resources/skills/skills/media/freeze-effect-video/SKILL.md +100 -0
  152. package/resources/skills/skills/media/giant-product-showcase/SKILL.md +61 -0
  153. package/resources/skills/skills/media/instagram-post/SKILL.md +58 -0
  154. package/resources/skills/skills/media/interior-design/SKILL.md +61 -0
  155. package/resources/skills/skills/media/interior-design-visualizer/SKILL.md +57 -0
  156. package/resources/skills/skills/media/jewelry-product-video/SKILL.md +61 -0
  157. package/resources/skills/skills/media/kdenlive/SKILL.md +106 -0
  158. package/resources/skills/skills/media/kdenlive/scripts/assemble.sh +57 -0
  159. package/resources/skills/skills/media/kdenlive/scripts/common.sh +30 -0
  160. package/resources/skills/skills/media/kdenlive/scripts/inspect.sh +19 -0
  161. package/resources/skills/skills/media/kdenlive/scripts/reframe.sh +22 -0
  162. package/resources/skills/skills/media/kdenlive/scripts/render.sh +16 -0
  163. package/resources/skills/skills/media/kdenlive/scripts/title-card.sh +25 -0
  164. package/resources/skills/skills/media/keyboard-art-maker/SKILL.md +44 -0
  165. package/resources/skills/skills/media/logo-branding/SKILL.md +70 -0
  166. package/resources/skills/skills/media/logo-creator/SKILL.md +80 -0
  167. package/resources/skills/skills/media/logo-creator/scripts/create-logo.sh +38 -0
  168. package/resources/skills/skills/media/logo-generator/SKILL.md +56 -0
  169. package/resources/skills/skills/media/multi-angle-reshoot/SKILL.md +70 -0
  170. package/resources/skills/skills/media/multi-angle-shots/SKILL.md +73 -0
  171. package/resources/skills/skills/media/music-video/SKILL.md +61 -0
  172. package/resources/skills/skills/media/nano-banana/SKILL.md +80 -0
  173. package/resources/skills/skills/media/nano-banana/scripts/generate-nano-art.sh +54 -0
  174. package/resources/skills/skills/media/one-shot-video/SKILL.md +56 -0
  175. package/resources/skills/skills/media/photo-pack-generator/SKILL.md +205 -0
  176. package/resources/skills/skills/media/photo-pack-generator/scripts/generate-pack.sh +241 -0
  177. package/resources/skills/skills/media/product-ad-cinematic/SKILL.md +78 -0
  178. package/resources/skills/skills/media/product-campaign/SKILL.md +76 -0
  179. package/resources/skills/skills/media/product-showcase-video/SKILL.md +60 -0
  180. package/resources/skills/skills/media/product-video-ad-maker/SKILL.md +59 -0
  181. package/resources/skills/skills/media/rednote-cover/SKILL.md +57 -0
  182. package/resources/skills/skills/media/seedance-2/SKILL.md +632 -0
  183. package/resources/skills/skills/media/seedance-2/scripts/generate-seedance.sh +701 -0
  184. package/resources/skills/skills/media/selfie-with-celebrities/SKILL.md +64 -0
  185. package/resources/skills/skills/media/social-media-video/SKILL.md +277 -0
  186. package/resources/skills/skills/media/social-media-video/scripts/run-social-video.sh +316 -0
  187. package/resources/skills/skills/media/social-pack/SKILL.md +58 -0
  188. package/resources/skills/skills/media/storyboard/SKILL.md +57 -0
  189. package/resources/skills/skills/media/storyboard-to-cooking-video/SKILL.md +143 -0
  190. package/resources/skills/skills/media/talking-baby-video/SKILL.md +57 -0
  191. package/resources/skills/skills/media/ugc-ads-workflow/SKILL.md +70 -0
  192. package/resources/skills/skills/media/ugc-lifestyle-try-on/SKILL.md +65 -0
  193. package/resources/skills/skills/media/ugc-video-factory/SKILL.md +134 -0
  194. package/resources/skills/skills/media/ui-design/SKILL.md +81 -0
  195. package/resources/skills/skills/media/ui-design/scripts/generate-mockup.sh +49 -0
  196. package/resources/skills/skills/media/url-to-design/SKILL.md +61 -0
  197. package/resources/skills/skills/media/workflow/SKILL.md +197 -0
  198. package/resources/skills/skills/media/workflow/scripts/discover-workflow.sh +18 -0
  199. package/resources/skills/skills/media/workflow/scripts/generate-workflow.sh +33 -0
  200. package/resources/skills/skills/media/workflow/scripts/interactive-run.sh +16 -0
  201. package/resources/skills/skills/media/workflow/scripts/list-workflows.sh +20 -0
  202. package/resources/skills/skills/media/workflow/scripts/run-workflow.sh +34 -0
  203. package/resources/skills/skills/media/youtube-shorts/SKILL.md +173 -0
  204. package/resources/skills/skills/media/youtube-shorts/scripts/run-youtube-shorts.sh +141 -0
  205. package/resources/skills/skills/media/youtube-thumbnail/SKILL.md +66 -0
  206. package/resources/skills/skills/meta/cue-developer/references/architecture.md +2 -2
  207. package/resources/skills/skills/meta/cue-usage/SKILL.md +1 -1
  208. package/resources/skills/skills/meta/profile-fit-monitor/SKILL.md +2 -2
  209. package/resources/skills/skills/meta/profile-optimizer/SKILL.md +1 -1
  210. package/resources/skills/skills/meta/profile-suggest/SKILL.md +7 -7
  211. package/resources/skills/skills/meta/profile-summon/SKILL.md +159 -0
  212. package/resources/skills/skills/meta/profile-summon/evals/evals.json +53 -0
  213. package/resources/skills/skills/meta/save-profile/SKILL.md +1 -1
  214. package/resources/skills/skills/meta/skill-reviewer/SKILL.md +3 -0
  215. package/resources/skills/skills/meta/skill-reviewer/references/tdd-for-skills.md +55 -0
  216. package/resources/skills/skills/research/find-skills/SKILL.md +1 -1
  217. package/resources/skills/skills/review/code-review-deep/SKILL.md +20 -0
  218. package/resources/skills/skills/security/trivy-scan/SKILL.md +139 -0
  219. package/resources/skills/skills/security/trivy-scan/scripts/ensure-trivy.sh +21 -0
  220. package/resources/skills/skills/tools/ccusage/SKILL.md +142 -0
  221. package/src/commands/_index.ts +8 -0
  222. package/src/commands/ai.ts +2 -2
  223. package/src/commands/auto-detect.test.ts +74 -0
  224. package/src/commands/auto-detect.ts +9 -7
  225. package/src/commands/cli.test.ts +20 -4
  226. package/src/commands/cli.ts +36 -20
  227. package/src/commands/create-profile.ts +2 -2
  228. package/src/commands/debug.ts +2 -2
  229. package/src/commands/discover.ts +14 -4
  230. package/src/commands/export-docker.ts +1 -1
  231. package/src/commands/features-batch1.test.ts +1 -1
  232. package/src/commands/gates.ts +1 -1
  233. package/src/commands/import-profile.ts +1 -1
  234. package/src/commands/init.ts +15 -11
  235. package/src/commands/install.test.ts +192 -0
  236. package/src/commands/install.ts +610 -0
  237. package/src/commands/launch-handoff.e2e.test.ts +33 -1
  238. package/src/commands/launch.e2e.test.ts +15 -10
  239. package/src/commands/launch.ts +73 -116
  240. package/src/commands/materialize.ts +2 -2
  241. package/src/commands/prune.ts +1 -1
  242. package/src/commands/security-audit.ts +1 -1
  243. package/src/commands/shell.ts +7 -7
  244. package/src/commands/skill-report.ts +1 -1
  245. package/src/commands/skills.ts +3 -3
  246. package/src/commands/snapshot.ts +2 -2
  247. package/src/commands/summon.test.ts +116 -0
  248. package/src/commands/summon.ts +338 -0
  249. package/src/commands/trigger-gaps.ts +1 -1
  250. package/src/commands/use.ts +47 -3
  251. package/src/commands/watch-live.ts +5 -5
  252. package/src/commands/watch.ts +8 -8
  253. package/src/index.ts +2 -0
  254. package/src/lib/active-sessions.test.ts +3 -3
  255. package/src/lib/active-sessions.ts +4 -4
  256. package/src/lib/auto-detect.test.ts +172 -8
  257. package/src/lib/auto-detect.ts +191 -136
  258. package/src/lib/codex-persona-parity.test.ts +58 -0
  259. package/src/lib/companion-detect.test.ts +43 -1
  260. package/src/lib/companion-detect.ts +35 -0
  261. package/src/lib/credentials-sync.test.ts +121 -1
  262. package/src/lib/credentials-sync.ts +95 -1
  263. package/src/lib/cwd-resolver.test.ts +8 -8
  264. package/src/lib/cwd-resolver.ts +2 -2
  265. package/src/lib/dashboard-merge.test.ts +9 -4
  266. package/src/lib/dashboard-server.ts +1 -1
  267. package/src/lib/picker.test.ts +1 -1
  268. package/src/lib/picker.ts +5 -5
  269. package/src/lib/profile-merge.test.ts +8 -0
  270. package/src/lib/profile-names.test.ts +3 -3
  271. package/src/lib/runtime-install.ts +166 -0
  272. package/src/lib/runtime-materializer.test.ts +137 -0
  273. package/src/lib/runtime-materializer.ts +105 -2
  274. package/src/lib/skill-router.test.ts +38 -0
  275. package/src/lib/skill-router.ts +65 -4
  276. package/profiles/eu-tender-research/README.md +0 -48
  277. package/profiles/eu-tender-research/logo.png +0 -0
  278. package/profiles/eu-tender-research/profile.yaml +0 -108
@@ -0,0 +1,64 @@
1
+ ---
2
+ slug: muapi-selfie-with-celebrities
3
+ name: muapi-selfie-with-celebrities
4
+ version: "1.0.0"
5
+ description: Generate a realistic behind-the-scenes selfie of the user with a celebrity or main actor from a specific movie, followed by an option to generate a cinematic long-take video connecting multiple selfies.
6
+ acceptLicenseTerms: true
7
+ ---
8
+
9
+
10
+ # Selfie with Celebrities
11
+
12
+ **Generate a realistic behind-the-scenes selfie of the user with a celebrity or main actor from a specific movie, followed by an option to generate a cinematic long-take video connecting multiple selfies.**
13
+
14
+ ## Inputs
15
+
16
+ | Name | Type | Required | Default | Description |
17
+ |:---|:---|:---|:---|:---|
18
+ | `movie_name` | text | yes | — | The name of the movie featuring the celebrity you want to take a selfie with (e.g., "Harry Potter", "The Matrix"). |
19
+ | `user_image` | image_url | yes | — | A clear photo of the user to be used for the selfie. |
20
+
21
+
22
+ ## Steps
23
+
24
+ ### Phase A — Generate First Selfie Image
25
+
26
+ If the `{{user_image}}` is not provided, ask the user to upload their image first.
27
+
28
+ Once provided, submit the plan with ONE step:
29
+
30
+ 1. **Selfie Image Generation** — `muapi image edit` (model=`nano-banana-2-edit`):
31
+ - Reference Image: `{{user_image}}`
32
+ - Prompt: `POV: close up shot, A realistic photo of the person (don't change the person's original clothes) holding a black iPhone 16 to take a picture with the main actor from the movie "{{movie_name}}" on a movie set with movie scene background. Behind-the-scenes atmosphere, including film equipment, film cameras, filled with props, and busy crew members. Sharp focus on the characters. bright scene. Aspect ratio 9:16.`
33
+ - Aspect ratio: 9:16
34
+
35
+ After generating the first image:
36
+ - Present the generated selfie to the user.
37
+ - Ask the user if they would like to create a second, third, etc. image with different movies or actors.
38
+ - Also, suggest to the user that once they have multiple images, you can create a seamless cinematic video transitioning between the selfies.
39
+
40
+ ### Phase B — Generate Connecting Video (Only when requested)
41
+
42
+ If the user has generated at least two selfies and asks to create a video connecting them, submit the plan with ONE step:
43
+
44
+ 1. **Cinematic Video Generation** — Use an image-to-video model like `kling-o1-image-to-video`, `pixverse-v5.5-i2v`, or `veo3.1-image-to-video`.
45
+ - First frame image: The first generated selfie.
46
+ - Last frame image: The second generated selfie (or use multiple steps if connecting more than two).
47
+ - Prompt: `A seamless cinematic long-take. The camera follows a person as she finishes a photo with an actor, then she naturally turns and walks toward the right. The camera tracks her movement with a smooth gimbal-like motion. Her gait is consistent and confident. Upon entering a new behind-the-scenes movie set, she slows down and stops gracefully, raising her phone with a bright smile to take a selfie with two actors. The scene transition is natural and smooth, with a seamless connection.`
48
+ - Aspect ratio: 9:16
49
+
50
+ After generation:
51
+ - Present the video to the user.
52
+
53
+ ## Trigger Keywords
54
+
55
+ `selfie with celebrity`, `movie star selfie`, `celebrity photo`, `take a picture with actor`, `behind the scenes selfie`
56
+
57
+
58
+ ---
59
+
60
+ ## Notes for the Executing Agent
61
+
62
+ - This recipe is LLM-orchestrated: read each phase, gather any missing inputs from the user, then call `muapi` CLI commands. Use `muapi auth configure` first if `MUAPI_API_KEY` is unset.
63
+ - For model IDs without a CLI alias yet, fall back to the raw endpoint via `curl -X POST https://api.muapi.ai/api/v1/<endpoint> -H "x-api-key: $MUAPI_API_KEY" -H 'content-type: application/json' -d '{...}'` and poll with `muapi predict wait <request_id>`.
64
+ - Substitute `{{input_name}}` placeholders with the user's actual inputs before issuing each call.
@@ -0,0 +1,277 @@
1
+ ---
2
+ slug: muapi-social-media-video
3
+ name: muapi-social-media-video
4
+ version: "1.0.0"
5
+ description: Brand-aware social media video creator. Reads brand-identity.md, ICP.md, and messaging.md to write a post/storyboard, craft an optimized Seedance 2.0 Director prompt, generate reference frames with the best available image model, and produce platform-ready video.
6
+ acceptLicenseTerms: true
7
+ ---
8
+
9
+ # Social Media Video Creator
10
+
11
+ **End-to-end pipeline: Brand Files → Storyboard → Reference Images → Seedance 2.0 Video.**
12
+
13
+ Reads your brand identity, ICP, and messaging documents to produce on-brand social video — fully optimized for Seedance 2.0's instructional prompt grammar and your target platform.
14
+
15
+ ---
16
+
17
+ ## Agent Execution Protocol
18
+
19
+ ### Step 1 — Read Brand Files
20
+
21
+ Before writing anything, the agent MUST read all available brand files. Look for them in the working directory or any `brand/` subdirectory:
22
+
23
+ | File | What to extract |
24
+ |:---|:---|
25
+ | `brand-identity.md` | Visual style, color palette, tone, logo/product aesthetics, brand personality |
26
+ | `ICP.md` | Target audience — who they are, their pain points, what motivates them |
27
+ | `messaging.md` | Core value props, hooks, CTAs, campaign themes, taglines |
28
+
29
+ If a file is missing, proceed with what's available and note the gap.
30
+
31
+ ---
32
+
33
+ ### Step 2 — Write the Social Post + Storyboard
34
+
35
+ Use brand context to produce:
36
+
37
+ **Social Post Copy** (for caption/copy):
38
+ - Hook line (first 1–2 sentences — must stop the scroll)
39
+ - Body (3–5 sentences: problem → solution → proof → CTA)
40
+ - Hashtags (5–8 relevant tags)
41
+ - CTA (one clear action)
42
+
43
+ **Storyboard** (match duration to platform spec):
44
+ ```
45
+ 0–3s: [Opening scene — hook/visual surprise — camera move]
46
+ 3–7s: [Core message — product/subject in action — camera move]
47
+ 7–10s: [Resolution — brand moment — CTA text on screen]
48
+ 10–15s: [Logo/tagline hold — background music fade]
49
+ ```
50
+
51
+ Tone must match brand personality. If brand is playful → upbeat transitions, bright grade.
52
+ If brand is premium → slow reveals, dark luxury aesthetic, moody lighting.
53
+
54
+ ---
55
+
56
+ ### Step 3 — Craft the Seedance 2.0 Director Prompt
57
+
58
+ Transform the storyboard into a **technical Director Brief** for Seedance 2.0.
59
+
60
+ **Rules:**
61
+ 1. Never use vague descriptors ("beautiful", "amazing", "8k"). Use technical cinematography language.
62
+ 2. Always specify camera movement, lens type, and lighting physically.
63
+ 3. For 10s+ videos, use timecode segments: `0–3s: [...] 3–7s: [...] 7–10s: [...]`
64
+ 4. Integrate `@image1`, `@image2` reference tags if images are provided.
65
+ 5. Always include sound direction (even brief) — Seedance generates audio.
66
+ 6. Lead with composition, end with texture and micro-motion.
67
+
68
+ **Director Brief Template:**
69
+ ```
70
+ [SCENE] {environment, lighting, time of day}
71
+ [SUBJECT] {product/character/subject with specific detail}
72
+ [ACTION] {what happens — fluid, continuous, physically plausible}
73
+ [CAMERA] {movement + lens + framing}
74
+ [STYLE] {color grade, mood, film reference if helpful}
75
+ [SOUND] {music tone, sound effects, ambient}
76
+ 0–Xs: {if multi-beat}
77
+ ```
78
+
79
+ ---
80
+
81
+ ### Step 4 — Generate Reference Images (If Needed)
82
+
83
+ **When to generate reference images:**
84
+
85
+ | Scenario | Mode | Images Needed |
86
+ |:---|:---|:---|
87
+ | Product showcase | `i2v` | 1 product shot as first frame |
88
+ | Scene transition | `first-last` | 2 images — opening and closing frame |
89
+ | Brand character | `i2v` | 1 character reference |
90
+ | Pure concept | `t2v` | None — text only |
91
+ | Mood/style anchor | `i2v` | 1 style reference image |
92
+
93
+ **Image generation — best models by use case:**
94
+
95
+ | Use Case | Recommended Model | Why |
96
+ |:---|:---|:---|
97
+ | Photorealistic product/scene | `google-imagen4-ultra` | Highest realism, great lighting |
98
+ | Concept art / stylized | `flux-kontext-pro-t2i` | Creative fidelity, style adherence |
99
+ | Fastest turnaround | `google-imagen4-fast` | Speed with good quality |
100
+ | Highly detailed/editorial | `hidream-i1-full` | Fine detail, editorial quality |
101
+ | Character with identity | `ideogram-v3-t2i` | Strong text + character rendering |
102
+
103
+ **Reference image prompt format:**
104
+ Write a clean, technical image prompt (not a Seedance prompt). Include:
105
+ - Subject description + key product/brand visual elements
106
+ - Lighting (studio, golden hour, etc.)
107
+ - Shot framing (medium shot, product close-up, etc.)
108
+ - Mood/color palette matching brand identity
109
+ - NO motion language (this is for a still frame)
110
+
111
+ Execute image generation:
112
+ ```bash
113
+ bash core/media/generate-image.sh \
114
+ --model google-imagen4-ultra \
115
+ --prompt "your image prompt" \
116
+ --aspect-ratio 9:16 \
117
+ --view
118
+ ```
119
+
120
+ ---
121
+
122
+ ### Step 5 — Generate the Video
123
+
124
+ Choose mode, tier, and camera based on content type and available assets.
125
+
126
+ **Mode selection:**
127
+
128
+ | Situation | Mode | Command |
129
+ |:---|:---|:---|
130
+ | No reference images | `t2v` | default |
131
+ | 1 image (first frame) | `i2v` | `--mode i2v --file ref.jpg` |
132
+ | Start + end frames | `first-last` | `--mode first-last --tier global --file start.jpg --file end.jpg` |
133
+ | Multi-ref blend | `i2v` | up to 9 images |
134
+
135
+ **Invoke the script:**
136
+ ```bash
137
+ bash library/social/social-media-video/scripts/run-social-video.sh \
138
+ --prompt "your director brief here" \
139
+ --platform instagram \
140
+ --camera drone \
141
+ [--mode t2v|i2v|first-last] \
142
+ [--file ref_image.jpg] \
143
+ [--gen-ref "reference image prompt"] \
144
+ [--tier global] \
145
+ [--quality high] \
146
+ [--view]
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Platform Specs
152
+
153
+ | Platform | Format | Aspect | Duration | Notes |
154
+ |:---|:---|:---|:---|:---|
155
+ | Instagram Reels | Vertical | 9:16 | 10–15s | Hook in first 1s |
156
+ | Instagram Feed | Square | 1:1 | 10s | Static-feel works well |
157
+ | TikTok | Vertical | 9:16 | 10–15s | High energy, fast cuts |
158
+ | YouTube Shorts | Vertical | 9:16 | 15s | Max quality |
159
+ | LinkedIn | Landscape | 16:9 | 10–15s | Professional tone |
160
+ | Twitter/X | Landscape | 16:9 | 10s | Punchy, direct |
161
+ | YouTube (long) | Landscape | 16:9 | 15s | Cinematic, slow builds |
162
+ | Pinterest | Portrait | 4:3 | 10s | Lifestyle-forward |
163
+
164
+ > **Tier note:** Use `--tier global` or `--tier vip` for `1:1` and `21:9` formats. Chinese tier supports only 16:9, 9:16, 4:3, 3:4.
165
+
166
+ ---
167
+
168
+ ## Camera Language Reference
169
+
170
+ ### Standard Camera Intents (--camera / --intent flags)
171
+
172
+ | Intent | Movement | Best For |
173
+ |:---|:---|:---|
174
+ | `reveal` | Slow crane up, wide establishing | Product launches, brand reveals |
175
+ | `epic` | Dolly in + orbit, low hero angle | Brand manifesto, emotional story |
176
+ | `product` | Static macro orbit, precision reveal | E-commerce, product demo |
177
+ | `narrative` | Tracking shot, Steadicam | Testimonials, story-driven |
178
+ | `tense` | Handheld jitter, dutch angle | High-energy, urgency |
179
+ | `comedy` | Reactive handheld, punchy zooms | Lighthearted brand content |
180
+
181
+ ### Specialty Camera Intents (New)
182
+
183
+ | Intent | Description | Best For |
184
+ |:---|:---|:---|
185
+ | `fpv` | First-person subjective POV — immersive GoPro-style, continuous forward motion, peripheral detail close-ups | Action brands, travel, sports, tech demos |
186
+ | `drone` | Aerial cinematic flythrough — smooth gimbal-stabilized, sweeping laterals, descend from high altitude into scene | Real estate, luxury, outdoor brands, epic reveals |
187
+ | `flythrough` | Ground-level architectural flythrough — continuous dolly through space, seamless portal transitions | Architecture, interior design, venue showcases |
188
+
189
+ **FPV Prompt Enrichment:**
190
+ ```
191
+ Immersive first-person POV shot. Camera glides forward through [scene] at eye level.
192
+ Slight natural motion stabilization with GoPro-style wide angle.
193
+ Peripheral detail rushing past — [details]. Smooth continuous forward motion.
194
+ No cuts throughout. [Subject] visible in foreground periphery.
195
+ ```
196
+
197
+ **Drone Flythrough Prompt Enrichment:**
198
+ ```
199
+ Cinematic aerial drone shot. Camera descends from 200m altitude toward [subject/scene],
200
+ sweeping lateral arc as it descends. Gimbal-stabilized smooth motion.
201
+ Golden hour atmosphere, long shadows across [terrain/scene].
202
+ Final frame settles into medium establishing shot.
203
+ Aerial cinematography, DJI Inspire aesthetic.
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Prompt Quality Checklist
209
+
210
+ Before finalizing the Seedance prompt, verify:
211
+
212
+ - [ ] Scene environment is physically specific (not "nice background")
213
+ - [ ] Camera movement named explicitly (dolly in, orbit, drone flythrough, FPV, etc.)
214
+ - [ ] Lighting described technically (volumetric god rays, rim lighting, soft diffused, etc.)
215
+ - [ ] Subject/product described with visual specifics from brand-identity.md
216
+ - [ ] Sound direction included (even one line)
217
+ - [ ] Timecodes used for 10s+ videos
218
+ - [ ] `@image1` etc. referenced if images are provided
219
+ - [ ] Brand CTA or tagline included in final seconds
220
+ - [ ] No vague adjectives ("amazing", "beautiful", "stunning") — replaced with technical terms
221
+
222
+ ---
223
+
224
+ ## Example: Full Workflow
225
+
226
+ **User**: "Make an Instagram Reel for our cold brew coffee brand, drone shot, premium feel"
227
+
228
+ **Step 1 — Brand read**: Read `brand-identity.md` (minimalist packaging, dark roast, black + gold palette), `ICP.md` (urban professionals 25–40, values quality), `messaging.md` ("Precision Brewed. Zero Compromise.")
229
+
230
+ **Step 2 — Storyboard**:
231
+ ```
232
+ 0–2s: Drone descends over rooftop terrace at sunrise, fog below.
233
+ 2–5s: Drone swoops down toward coffee cup on white marble, steam rising.
234
+ 5–9s: Close-up orbit of bottle, specular gold highlights, ice cubes.
235
+ 9–11s: Product settles, black screen fades in: "Zero Compromise." + logo
236
+ Sound: Minimal lounge beat, coffee pour sound effect at 5s.
237
+ ```
238
+
239
+ **Step 3 — Seedance Director Prompt**:
240
+ ```
241
+ 0–2s: Cinematic aerial drone shot. Camera descends at 30° angle toward a rooftop terrace at sunrise.
242
+ Golden hour atmosphere, San Francisco bay fog below horizon. Gimbal-stabilized smooth descent.
243
+ 2–5s: Drone rapidly closes toward a glass of cold brew coffee on white marble.
244
+ Steam curling upward. Macro lens approach. Caustic light patterns on wet glass surface.
245
+ 5–9s: Slow precision orbit around cold brew bottle. Black matte label with gold embossed text catching
246
+ specular highlights. Ice cubes with subsurface light scattering. Commercial macro aesthetic.
247
+ 9–11s: Static product hero shot. Letterbox crop, deep focus, black fade in from sides.
248
+ Sound: Minimal ambient beat, single piano note, coffee liquid sound effect at 5s mark.
249
+ Maintain cinematic color grade — deep blacks, warm gold midtones throughout.
250
+ ```
251
+
252
+ **Step 4 — Generate reference**: `google-imagen4-ultra` → cold brew bottle product shot (9:16)
253
+
254
+ **Step 5 — Generate video**:
255
+ ```bash
256
+ bash library/social/social-media-video/scripts/run-social-video.sh \
257
+ --prompt "0–2s: Cinematic aerial drone shot..." \
258
+ --platform instagram \
259
+ --camera drone \
260
+ --mode i2v \
261
+ --file media_outputs/coldbrew_ref.jpg \
262
+ --duration 11 \
263
+ --tier global \
264
+ --view
265
+ ```
266
+
267
+ ---
268
+
269
+ ## Common Mistakes to Avoid
270
+
271
+ 1. **Reading brand files and ignoring them** — the storyboard must visually match the brand palette and tone.
272
+ 2. **Generic prompts** — "a nice video of a product" produces generic output. Every token must direct.
273
+ 3. **Wrong tier for aspect ratio** — 1:1 and 21:9 require `--tier global` or `--tier vip`.
274
+ 4. **Forgetting sound** — Seedance generates audio. Direct it, or you get random results.
275
+ 5. **FPV with static subject** — FPV requires continuous motion in the scene. Pair with movement-rich environments.
276
+ 6. **Drone without establishing shot** — drone works best when it resolves INTO something (a product, a scene, a subject).
277
+ 7. **Too many scene changes in 5s** — match complexity to duration. 5s = 1 beat. 15s = 3–4 beats.
@@ -0,0 +1,316 @@
1
+ #!/bin/bash
2
+ # Social Media Video Generator — Orchestrator
3
+ #
4
+ # Generates reference images (if requested) then produces a Seedance 2.0 video,
5
+ # all wired to platform-specific defaults (aspect ratio, duration, tier).
6
+ #
7
+ # Usage:
8
+ # bash run-social-video.sh --prompt "director brief" --platform instagram [options]
9
+ #
10
+ # Requires: bash 3.2+, curl, jq
11
+
12
+ set -euo pipefail
13
+
14
+ # ============================================================
15
+ # Locate skills root (works regardless of CWD when invoked)
16
+ # ============================================================
17
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
18
+ SKILLS_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
19
+ GENERATE_IMAGE="$SKILLS_ROOT/core-media/generate-image.sh"
20
+ GENERATE_SEEDANCE="$SKILLS_ROOT/seedance-2/scripts/generate-seedance.sh"
21
+
22
+ # Load .env from skills root
23
+ if [ -f "$SKILLS_ROOT/.env" ]; then
24
+ set +u; source "$SKILLS_ROOT/.env" 2>/dev/null || true; set -u
25
+ fi
26
+
27
+ # ============================================================
28
+ # Defaults
29
+ # ============================================================
30
+ PROMPT=""
31
+ PLATFORM="instagram"
32
+ CAMERA=""
33
+ MODE="t2v"
34
+ TIER="chinese"
35
+ FAST=false
36
+ ASPECT=""
37
+ DURATION=""
38
+ QUALITY="basic"
39
+ VIEW=false
40
+ ASYNC=false
41
+ IMAGE_FILES=()
42
+
43
+ # Reference image generation
44
+ GEN_REF_FIRST="" # --gen-ref "prompt" → generate first frame ref
45
+ GEN_REF_LAST="" # --gen-ref-last "prompt" → generate last frame ref
46
+ REF_MODEL="google-imagen4-ultra"
47
+
48
+ # ============================================================
49
+ # Argument parsing
50
+ # ============================================================
51
+ while [[ $# -gt 0 ]]; do
52
+ case $1 in
53
+ --prompt|-p) PROMPT="$2"; shift 2 ;;
54
+ --platform) PLATFORM="$2"; shift 2 ;;
55
+ --camera) CAMERA="$2"; shift 2 ;;
56
+ --mode) MODE="$2"; shift 2 ;;
57
+ --tier) TIER="$2"; shift 2 ;;
58
+ --fast) FAST=true; shift ;;
59
+ --aspect) ASPECT="$2"; shift 2 ;;
60
+ --duration) DURATION="$2"; shift 2 ;;
61
+ --quality|-q) QUALITY="$2"; shift 2 ;;
62
+ --view) VIEW=true; shift ;;
63
+ --async) ASYNC=true; shift ;;
64
+ --file|-f) IMAGE_FILES+=("$2"); shift 2 ;;
65
+ --gen-ref) GEN_REF_FIRST="$2"; shift 2 ;;
66
+ --gen-ref-last) GEN_REF_LAST="$2"; shift 2 ;;
67
+ --ref-model) REF_MODEL="$2"; shift 2 ;;
68
+ --help|-h)
69
+ cat <<'HELP'
70
+ Social Media Video Generator
71
+ Usage: bash run-social-video.sh --prompt "director brief" [options]
72
+
73
+ REQUIRED
74
+ --prompt, -p TEXT Seedance 2.0 Director Brief (the full cinematic prompt)
75
+
76
+ PLATFORM (sets aspect/duration defaults)
77
+ --platform NAME instagram | tiktok | linkedin | youtube | youtube-short |
78
+ twitter | pinterest | instagram-feed (default: instagram)
79
+
80
+ CAMERA STYLE (appends camera directive to prompt)
81
+ --camera TYPE fpv | drone | flythrough | reveal | epic | product |
82
+ narrative | tracking | orbit (default: from --platform)
83
+
84
+ VIDEO OPTIONS
85
+ --mode MODE t2v | i2v | first-last | omni (default: t2v)
86
+ --tier TIER chinese | global | vip (default: chinese)
87
+ Note: first-last requires global or vip
88
+ --fast Use fast-queue variant (global/vip only)
89
+ --aspect RATIO Override platform default aspect ratio
90
+ --duration N Override platform default duration (seconds)
91
+ --quality Q basic | high (Chinese tier only; default: basic)
92
+ --view Download and open output (macOS)
93
+ --async Return request_id without waiting
94
+
95
+ REFERENCE IMAGES
96
+ --file, -f PATH Provide an existing image file (repeatable, up to 9)
97
+ --gen-ref TEXT Generate a first-frame reference image from this prompt
98
+ --gen-ref-last TEXT Generate a last-frame reference image (triggers first-last mode)
99
+ --ref-model MODEL Image model for reference generation
100
+ (default: google-imagen4-ultra)
101
+ Options: flux-kontext-pro-t2i | hidream-i1-full |
102
+ google-imagen4-fast | ideogram-v3-t2i
103
+
104
+ EXAMPLES
105
+ # Instagram Reel — drone shot, auto-generate ref image, t2v
106
+ bash run-social-video.sh \
107
+ --prompt "Drone descends over rooftop at sunrise, product reveal..." \
108
+ --platform instagram --camera drone --duration 10
109
+
110
+ # TikTok — FPV, with generated first frame
111
+ bash run-social-video.sh \
112
+ --prompt "First-person rush through..." \
113
+ --platform tiktok --camera fpv \
114
+ --gen-ref "Hero product on table, soft morning light, close-up" \
115
+ --tier global --view
116
+
117
+ # LinkedIn landscape — product orbit, existing reference image
118
+ bash run-social-video.sh \
119
+ --prompt "Precision orbit around product, specular highlights..." \
120
+ --platform linkedin --camera product --mode i2v --file product.jpg \
121
+ --quality high --view
122
+
123
+ # YouTube Short — first-last frame interpolation
124
+ bash run-social-video.sh \
125
+ --prompt "Dramatic reveal from foggy landscape to clear skyline..." \
126
+ --platform youtube-short \
127
+ --gen-ref "Morning fog over mountain valley, sunrise" \
128
+ --gen-ref-last "Clear blue sky, mountain peak, golden hour" \
129
+ --tier global --view
130
+ HELP
131
+ exit 0 ;;
132
+ *)
133
+ echo "Warning: Unknown argument '$1' — skipping." >&2
134
+ shift ;;
135
+ esac
136
+ done
137
+
138
+ # ============================================================
139
+ # Validate
140
+ # ============================================================
141
+ if [ -z "$PROMPT" ]; then
142
+ echo "Error: --prompt is required. Provide the Seedance Director Brief." >&2
143
+ exit 1
144
+ fi
145
+ if [ -z "${MUAPI_KEY:-}" ]; then
146
+ echo "Error: MUAPI_KEY is not set. Export it or add to $SKILLS_ROOT/.env" >&2
147
+ exit 1
148
+ fi
149
+
150
+ # ============================================================
151
+ # Platform → aspect ratio + duration defaults
152
+ # ============================================================
153
+ case "$PLATFORM" in
154
+ instagram|tiktok|youtube-short)
155
+ DEFAULT_ASPECT="9:16"; DEFAULT_DURATION=10 ;;
156
+ instagram-feed)
157
+ DEFAULT_ASPECT="1:1"; DEFAULT_DURATION=10 ;;
158
+ linkedin|youtube|twitter)
159
+ DEFAULT_ASPECT="16:9"; DEFAULT_DURATION=10 ;;
160
+ pinterest)
161
+ DEFAULT_ASPECT="4:3"; DEFAULT_DURATION=10 ;;
162
+ *)
163
+ DEFAULT_ASPECT="16:9"; DEFAULT_DURATION=10 ;;
164
+ esac
165
+
166
+ ASPECT="${ASPECT:-$DEFAULT_ASPECT}"
167
+ DURATION="${DURATION:-$DEFAULT_DURATION}"
168
+
169
+ # Formats requiring global/vip tier
170
+ if [[ "$ASPECT" == "1:1" || "$ASPECT" == "21:9" ]] && [[ "$TIER" == "chinese" ]]; then
171
+ echo "Note: Aspect ratio $ASPECT requires global or vip tier. Switching to global." >&2
172
+ TIER="global"
173
+ fi
174
+
175
+ # ============================================================
176
+ # Camera → intent mapping (for generate-seedance.sh --intent)
177
+ # ============================================================
178
+ case "$CAMERA" in
179
+ fpv) INTENT="fpv" ;;
180
+ drone|flythrough) INTENT="drone" ;;
181
+ reveal) INTENT="reveal" ;;
182
+ epic) INTENT="epic" ;;
183
+ product) INTENT="product" ;;
184
+ narrative|tracking) INTENT="narrative" ;;
185
+ orbit) INTENT="epic" ;;
186
+ *) INTENT="cinematic" ;;
187
+ esac
188
+
189
+ # ============================================================
190
+ # Generate reference images if requested
191
+ # ============================================================
192
+ OUTPUT_DIR="${PWD}/media_outputs"
193
+ mkdir -p "$OUTPUT_DIR"
194
+
195
+ generate_ref_image() {
196
+ local REF_PROMPT="$1"
197
+ local LABEL="$2"
198
+ local OUTPUT_PATH="$OUTPUT_DIR/social_ref_${LABEL}_$(date +%s).jpg"
199
+
200
+ echo "" >&2
201
+ echo "Generating $LABEL reference image with $REF_MODEL..." >&2
202
+ echo "Prompt: $REF_PROMPT" >&2
203
+
204
+ local RESULT
205
+ RESULT=$(cd "$SKILLS_ROOT" && bash "$GENERATE_IMAGE" \
206
+ --model "$REF_MODEL" \
207
+ --prompt "$REF_PROMPT" \
208
+ --aspect-ratio "$ASPECT" \
209
+ --json)
210
+
211
+ local IMG_URL
212
+ IMG_URL=$(echo "$RESULT" | jq -r '.outputs[0] // empty')
213
+
214
+ if [ -z "$IMG_URL" ]; then
215
+ echo "Error: Failed to generate reference image. Raw response:" >&2
216
+ echo "$RESULT" >&2
217
+ exit 1
218
+ fi
219
+
220
+ echo "Downloading reference image to $OUTPUT_PATH..." >&2
221
+ curl -s -o "$OUTPUT_PATH" "$IMG_URL"
222
+
223
+ if [ "$VIEW" = true ] && [[ "$OSTYPE" == "darwin"* ]]; then
224
+ open "$OUTPUT_PATH"
225
+ fi
226
+
227
+ echo "$OUTPUT_PATH"
228
+ }
229
+
230
+ # Generate first-frame reference
231
+ if [ -n "$GEN_REF_FIRST" ]; then
232
+ FIRST_REF_PATH=$(generate_ref_image "$GEN_REF_FIRST" "first")
233
+ IMAGE_FILES=("$FIRST_REF_PATH" "${IMAGE_FILES[@]}")
234
+ echo "First-frame reference: $FIRST_REF_PATH" >&2
235
+ fi
236
+
237
+ # Generate last-frame reference
238
+ LAST_REF_PATH=""
239
+ if [ -n "$GEN_REF_LAST" ]; then
240
+ LAST_REF_PATH=$(generate_ref_image "$GEN_REF_LAST" "last")
241
+ echo "Last-frame reference: $LAST_REF_PATH" >&2
242
+ fi
243
+
244
+ # ============================================================
245
+ # Determine mode from available images
246
+ # ============================================================
247
+ # If we have a last-frame reference, use first-last mode
248
+ if [ -n "$LAST_REF_PATH" ]; then
249
+ MODE="first-last"
250
+ IMAGE_FILES+=("$LAST_REF_PATH")
251
+ if [ "$TIER" = "chinese" ]; then
252
+ echo "Note: first-last mode requires global/vip tier. Switching to global." >&2
253
+ TIER="global"
254
+ fi
255
+ fi
256
+
257
+ # If we have images and mode is still t2v, switch to i2v
258
+ if [ ${#IMAGE_FILES[@]} -gt 0 ] && [ "$MODE" = "t2v" ]; then
259
+ MODE="i2v"
260
+ fi
261
+
262
+ # ============================================================
263
+ # Build generate-seedance.sh command
264
+ # ============================================================
265
+ SEEDANCE_ARGS=(
266
+ --mode "$MODE"
267
+ --tier "$TIER"
268
+ --subject "$PROMPT"
269
+ --intent "$INTENT"
270
+ --aspect "$ASPECT"
271
+ --duration "$DURATION"
272
+ )
273
+
274
+ # Quality only applies to Chinese tier
275
+ if [ "$TIER" = "chinese" ]; then
276
+ SEEDANCE_ARGS+=(--quality "$QUALITY")
277
+ fi
278
+
279
+ # Fast flag (global/vip only)
280
+ if [ "$FAST" = true ]; then
281
+ SEEDANCE_ARGS+=(--fast)
282
+ fi
283
+
284
+ # Attach reference images
285
+ for IMG in "${IMAGE_FILES[@]}"; do
286
+ SEEDANCE_ARGS+=(--file "$IMG")
287
+ done
288
+
289
+ # Pass-through flags
290
+ [ "$VIEW" = true ] && SEEDANCE_ARGS+=(--view)
291
+ [ "$ASYNC" = true ] && SEEDANCE_ARGS+=(--async)
292
+
293
+ # ============================================================
294
+ # Summary
295
+ # ============================================================
296
+ echo "" >&2
297
+ echo "======================================" >&2
298
+ echo " Social Media Video Generator" >&2
299
+ echo "======================================" >&2
300
+ echo " Platform : $PLATFORM" >&2
301
+ echo " Aspect : $ASPECT" >&2
302
+ echo " Duration : ${DURATION}s" >&2
303
+ echo " Mode : $MODE" >&2
304
+ echo " Tier : $TIER" >&2
305
+ echo " Camera : ${CAMERA:-default}" >&2
306
+ echo " Intent : $INTENT" >&2
307
+ echo " Ref images: ${#IMAGE_FILES[@]}" >&2
308
+ echo " Ref model : $REF_MODEL" >&2
309
+ echo "======================================" >&2
310
+ echo "" >&2
311
+
312
+ # ============================================================
313
+ # Execute Seedance generation
314
+ # ============================================================
315
+ cd "$SKILLS_ROOT"
316
+ exec bash "$GENERATE_SEEDANCE" "${SEEDANCE_ARGS[@]}"