zilmate 1.9.9 → 1.10.2

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 (287) hide show
  1. package/.agents/skills/ad-creative/SKILL.md +362 -0
  2. package/.agents/skills/ad-creative/evals/evals.json +90 -0
  3. package/.agents/skills/ad-creative/references/generative-tools.md +637 -0
  4. package/.agents/skills/ad-creative/references/platform-specs.md +213 -0
  5. package/.agents/skills/ai-seo/SKILL.md +489 -0
  6. package/.agents/skills/ai-seo/evals/evals.json +90 -0
  7. package/.agents/skills/ai-seo/references/content-patterns.md +285 -0
  8. package/.agents/skills/ai-seo/references/content-types.md +71 -0
  9. package/.agents/skills/ai-seo/references/okf.md +104 -0
  10. package/.agents/skills/ai-seo/references/platform-ranking-factors.md +154 -0
  11. package/.agents/skills/clerk-backend-api/SKILL.md +426 -0
  12. package/.agents/skills/clerk-backend-api/evals/evals.json +87 -0
  13. package/.agents/skills/clerk-backend-api/scripts/api-specs-context.sh +30 -0
  14. package/.agents/skills/clerk-backend-api/scripts/execute-request.sh +88 -0
  15. package/.agents/skills/clerk-backend-api/scripts/extract-endpoint-detail.sh +165 -0
  16. package/.agents/skills/clerk-backend-api/scripts/extract-tag-endpoints.sh +208 -0
  17. package/.agents/skills/clerk-backend-api/scripts/extract-tags.js +14 -0
  18. package/.agents/skills/copy-editing/SKILL.md +457 -0
  19. package/.agents/skills/copy-editing/evals/evals.json +89 -0
  20. package/.agents/skills/copy-editing/references/checklist.md +66 -0
  21. package/.agents/skills/copy-editing/references/content-refresh.md +38 -0
  22. package/.agents/skills/copy-editing/references/plain-english-alternatives.md +394 -0
  23. package/.agents/skills/hyperframes/SKILL.md +163 -0
  24. package/.agents/skills/hyperframes-cli/SKILL.md +109 -0
  25. package/.agents/skills/hyperframes-cli/references/doctor-browser.md +45 -0
  26. package/.agents/skills/hyperframes-cli/references/init-and-scaffold.md +51 -0
  27. package/.agents/skills/hyperframes-cli/references/lambda.md +132 -0
  28. package/.agents/skills/hyperframes-cli/references/lint-validate-inspect.md +121 -0
  29. package/.agents/skills/hyperframes-cli/references/preview-render.md +109 -0
  30. package/.agents/skills/hyperframes-cli/references/upgrade-info-misc.md +75 -0
  31. package/.agents/skills/hyperframes-media/SKILL.md +97 -0
  32. package/.agents/skills/hyperframes-media/assets/sfx/CREDITS.md +35 -0
  33. package/.agents/skills/hyperframes-media/assets/sfx/manifest.json +97 -0
  34. package/.agents/skills/hyperframes-media/references/bgm.md +72 -0
  35. package/.agents/skills/hyperframes-media/references/captions/authoring.md +159 -0
  36. package/.agents/skills/hyperframes-media/references/captions/motion.md +87 -0
  37. package/.agents/skills/hyperframes-media/references/captions/transcript-handling.md +97 -0
  38. package/.agents/skills/hyperframes-media/references/remove-background.md +143 -0
  39. package/.agents/skills/hyperframes-media/references/requirements.md +29 -0
  40. package/.agents/skills/hyperframes-media/references/sfx.md +42 -0
  41. package/.agents/skills/hyperframes-media/references/transcribe.md +52 -0
  42. package/.agents/skills/hyperframes-media/references/tts-to-captions.md +24 -0
  43. package/.agents/skills/hyperframes-media/references/tts.md +135 -0
  44. package/.agents/skills/hyperframes-media/scripts/audio.mjs +282 -0
  45. package/.agents/skills/hyperframes-media/scripts/heygen-tts.mjs +121 -0
  46. package/.agents/skills/hyperframes-media/scripts/lib/bgm.mjs +235 -0
  47. package/.agents/skills/hyperframes-media/scripts/lib/heygen.mjs +131 -0
  48. package/.agents/skills/hyperframes-media/scripts/lib/sfx.mjs +128 -0
  49. package/.agents/skills/hyperframes-media/scripts/lib/tts.mjs +220 -0
  50. package/.agents/skills/hyperframes-media/scripts/lyria-recipe.py +128 -0
  51. package/.agents/skills/hyperframes-media/scripts/wait-bgm.mjs +167 -0
  52. package/.agents/skills/hyperframes-registry/SKILL.md +101 -0
  53. package/.agents/skills/hyperframes-registry/examples/add-block.md +51 -0
  54. package/.agents/skills/hyperframes-registry/examples/add-component.md +73 -0
  55. package/.agents/skills/hyperframes-registry/references/contributing.md +166 -0
  56. package/.agents/skills/hyperframes-registry/references/demo-html-pattern.md +54 -0
  57. package/.agents/skills/hyperframes-registry/references/discovery.md +215 -0
  58. package/.agents/skills/hyperframes-registry/references/install-locations.md +45 -0
  59. package/.agents/skills/hyperframes-registry/references/templates.md +417 -0
  60. package/.agents/skills/hyperframes-registry/references/wiring-blocks.md +61 -0
  61. package/.agents/skills/hyperframes-registry/references/wiring-components.md +39 -0
  62. package/.agents/skills/marketing-psychology/SKILL.md +455 -0
  63. package/.agents/skills/marketing-psychology/evals/evals.json +88 -0
  64. package/.agents/skills/mintlify/SKILL.md +328 -0
  65. package/.agents/skills/product-launch-video/SKILL.md +206 -0
  66. package/.agents/skills/product-launch-video/references/cut-catalog.md +220 -0
  67. package/.agents/skills/product-launch-video/references/motion-language.md +156 -0
  68. package/.agents/skills/product-launch-video/references/story-design.md +373 -0
  69. package/.agents/skills/product-launch-video/references/visual-design.md +126 -0
  70. package/.agents/skills/product-launch-video/scripts/assemble-index.mjs +570 -0
  71. package/.agents/skills/product-launch-video/scripts/audio.mjs +253 -0
  72. package/.agents/skills/product-launch-video/scripts/build-frame.mjs +536 -0
  73. package/.agents/skills/product-launch-video/scripts/captions.mjs +508 -0
  74. package/.agents/skills/product-launch-video/scripts/lib/assets.mjs +55 -0
  75. package/.agents/skills/product-launch-video/scripts/lib/dimensions.mjs +45 -0
  76. package/.agents/skills/product-launch-video/scripts/lib/storyboard.mjs +249 -0
  77. package/.agents/skills/product-launch-video/scripts/lib/tokens.mjs +204 -0
  78. package/.agents/skills/product-launch-video/scripts/lib/transition-registry.mjs +38 -0
  79. package/.agents/skills/product-launch-video/scripts/lib/transitions.json +71 -0
  80. package/.agents/skills/product-launch-video/scripts/stage-assets.mjs +39 -0
  81. package/.agents/skills/product-launch-video/scripts/transitions.mjs +320 -0
  82. package/.agents/skills/product-launch-video/sub-agents/frame-worker.md +74 -0
  83. package/.agents/skills/prompt-engineering-patterns/SKILL.md +144 -0
  84. package/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
  85. package/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
  86. package/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
  87. package/.agents/skills/prompt-engineering-patterns/references/details.md +338 -0
  88. package/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
  89. package/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
  90. package/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
  91. package/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
  92. package/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
  93. package/.agents/skills/remotion-to-hyperframes/SKILL.md +127 -0
  94. package/.agents/skills/remotion-to-hyperframes/assets/.gitkeep +0 -0
  95. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/run.sh +249 -0
  96. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/README.md +41 -0
  97. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +26 -0
  98. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +61 -0
  99. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/package.json +14 -0
  100. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/remotion.config.ts +13 -0
  101. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/Root.tsx +13 -0
  102. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/TitleCard.tsx +34 -0
  103. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/index.ts +4 -0
  104. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/tsconfig.json +15 -0
  105. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +54 -0
  106. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +29 -0
  107. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +118 -0
  108. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/package.json +14 -0
  109. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/remotion.config.ts +13 -0
  110. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/MultiScene.tsx +105 -0
  111. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/Root.tsx +13 -0
  112. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/index.ts +4 -0
  113. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/tsconfig.json +15 -0
  114. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/setup.sh +34 -0
  115. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/README.md +85 -0
  116. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +41 -0
  117. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +269 -0
  118. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/package.json +15 -0
  119. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/remotion.config.ts +13 -0
  120. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Root.tsx +27 -0
  121. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Stargazed.tsx +37 -0
  122. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/AnimatedNumber.tsx +23 -0
  123. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/StatCard.tsx +59 -0
  124. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/UnderlinedText.tsx +47 -0
  125. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/index.ts +4 -0
  126. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/OutroScene.tsx +18 -0
  127. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/StatsScene.tsx +34 -0
  128. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/TitleScene.tsx +55 -0
  129. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/tsconfig.json +15 -0
  130. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/README.md +51 -0
  131. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/01-use-state.tsx +29 -0
  132. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/02-use-effect-deps.tsx +29 -0
  133. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/03-async-metadata.tsx +39 -0
  134. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/04-third-party-react.tsx +30 -0
  135. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/05-lambda-config.tsx +38 -0
  136. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/06-warnings-only.tsx +36 -0
  137. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/07-custom-hook.tsx +28 -0
  138. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/08-mixed.tsx +41 -0
  139. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/expected.json +85 -0
  140. package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/validate.sh +110 -0
  141. package/.agents/skills/remotion-to-hyperframes/references/api-map.md +142 -0
  142. package/.agents/skills/remotion-to-hyperframes/references/escape-hatch.md +115 -0
  143. package/.agents/skills/remotion-to-hyperframes/references/eval.md +140 -0
  144. package/.agents/skills/remotion-to-hyperframes/references/fonts.md +112 -0
  145. package/.agents/skills/remotion-to-hyperframes/references/limitations.md +136 -0
  146. package/.agents/skills/remotion-to-hyperframes/references/lottie.md +121 -0
  147. package/.agents/skills/remotion-to-hyperframes/references/media.md +149 -0
  148. package/.agents/skills/remotion-to-hyperframes/references/parameters.md +167 -0
  149. package/.agents/skills/remotion-to-hyperframes/references/sequencing.md +195 -0
  150. package/.agents/skills/remotion-to-hyperframes/references/timing.md +165 -0
  151. package/.agents/skills/remotion-to-hyperframes/references/transitions.md +114 -0
  152. package/.agents/skills/remotion-to-hyperframes/scripts/.gitkeep +0 -0
  153. package/.agents/skills/remotion-to-hyperframes/scripts/frame_strip.sh +107 -0
  154. package/.agents/skills/remotion-to-hyperframes/scripts/lint_source.py +358 -0
  155. package/.agents/skills/remotion-to-hyperframes/scripts/render_diff.sh +103 -0
  156. package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/blocker.tsx +50 -0
  157. package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/clean.tsx +46 -0
  158. package/.agents/skills/remotion-to-hyperframes/scripts/tests/smoke.sh +90 -0
  159. package/.agents/skills/seo-audit/SKILL.md +497 -0
  160. package/.agents/skills/seo-audit/evals/evals.json +136 -0
  161. package/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
  162. package/.agents/skills/seo-audit/references/international-seo.md +230 -0
  163. package/README.md +4 -2
  164. package/SDK.md +64 -1
  165. package/dist/agents/coding.agent.d.ts +558 -0
  166. package/dist/agents/coding.agent.d.ts.map +1 -1
  167. package/dist/agents/coding.agent.js +8 -0
  168. package/dist/agents/coding.agent.js.map +1 -1
  169. package/dist/agents/developer-helper.agent.d.ts +712 -0
  170. package/dist/agents/developer-helper.agent.d.ts.map +1 -1
  171. package/dist/agents/developer-helper.agent.js +6 -0
  172. package/dist/agents/developer-helper.agent.js.map +1 -1
  173. package/dist/agents/docs-research.agent.d.ts +8 -0
  174. package/dist/agents/docs-research.agent.d.ts.map +1 -1
  175. package/dist/agents/finance.agent.d.ts +8 -0
  176. package/dist/agents/finance.agent.d.ts.map +1 -1
  177. package/dist/agents/manager.d.ts +837 -2
  178. package/dist/agents/manager.d.ts.map +1 -1
  179. package/dist/agents/manager.js +28 -0
  180. package/dist/agents/manager.js.map +1 -1
  181. package/dist/agents/security.agent.d.ts +165 -3
  182. package/dist/agents/security.agent.d.ts.map +1 -1
  183. package/dist/agents/security.agent.js +3 -0
  184. package/dist/agents/security.agent.js.map +1 -1
  185. package/dist/agents/swarm/main.js +1 -1
  186. package/dist/agents/swarm/main.js.map +1 -1
  187. package/dist/agents/swarm/registry.d.ts.map +1 -1
  188. package/dist/agents/swarm/registry.js +232 -26
  189. package/dist/agents/swarm/registry.js.map +1 -1
  190. package/dist/cli/doctor.d.ts +14 -0
  191. package/dist/cli/doctor.d.ts.map +1 -1
  192. package/dist/cli/doctor.js +91 -0
  193. package/dist/cli/doctor.js.map +1 -1
  194. package/dist/cli/menu.d.ts.map +1 -1
  195. package/dist/cli/menu.js +102 -0
  196. package/dist/cli/menu.js.map +1 -1
  197. package/dist/cli/setup.d.ts +10 -0
  198. package/dist/cli/setup.d.ts.map +1 -1
  199. package/dist/cli/setup.js +178 -0
  200. package/dist/cli/setup.js.map +1 -1
  201. package/dist/cli/swarm.d.ts +1 -0
  202. package/dist/cli/swarm.d.ts.map +1 -1
  203. package/dist/cli/swarm.js +47 -8
  204. package/dist/cli/swarm.js.map +1 -1
  205. package/dist/cli/theme.d.ts +0 -24
  206. package/dist/cli/theme.d.ts.map +1 -1
  207. package/dist/cli/theme.js +6 -2
  208. package/dist/cli/theme.js.map +1 -1
  209. package/dist/config/env.d.ts +10 -0
  210. package/dist/config/env.d.ts.map +1 -1
  211. package/dist/config/env.js +38 -17
  212. package/dist/config/env.js.map +1 -1
  213. package/dist/index.js +96 -5
  214. package/dist/index.js.map +1 -1
  215. package/dist/jobs/trigger-orchestrator.d.ts +5 -1
  216. package/dist/jobs/trigger-orchestrator.d.ts.map +1 -1
  217. package/dist/jobs/trigger-orchestrator.js +29 -9
  218. package/dist/jobs/trigger-orchestrator.js.map +1 -1
  219. package/dist/jobs/trigger-router.d.ts.map +1 -1
  220. package/dist/jobs/trigger-router.js +3 -2
  221. package/dist/jobs/trigger-router.js.map +1 -1
  222. package/dist/memory/corporate-wiki.d.ts +15 -0
  223. package/dist/memory/corporate-wiki.d.ts.map +1 -0
  224. package/dist/memory/corporate-wiki.js +152 -0
  225. package/dist/memory/corporate-wiki.js.map +1 -0
  226. package/dist/memory/scratchpad.d.ts +2 -0
  227. package/dist/memory/scratchpad.d.ts.map +1 -1
  228. package/dist/memory/scratchpad.js +27 -0
  229. package/dist/memory/scratchpad.js.map +1 -1
  230. package/dist/observability/doctor.d.ts.map +1 -1
  231. package/dist/observability/doctor.js +12 -4
  232. package/dist/observability/doctor.js.map +1 -1
  233. package/dist/observability/traces.d.ts +72 -0
  234. package/dist/observability/traces.d.ts.map +1 -0
  235. package/dist/observability/traces.js +1134 -0
  236. package/dist/observability/traces.js.map +1 -0
  237. package/dist/runtime/swarm.d.ts +1 -1
  238. package/dist/runtime/swarm.d.ts.map +1 -1
  239. package/dist/runtime/swarm.js +54 -25
  240. package/dist/runtime/swarm.js.map +1 -1
  241. package/dist/safety/approvals.d.ts +2 -2
  242. package/dist/safety/approvals.d.ts.map +1 -1
  243. package/dist/safety/approvals.js +47 -1
  244. package/dist/safety/approvals.js.map +1 -1
  245. package/dist/safety/redaction.d.ts.map +1 -1
  246. package/dist/safety/redaction.js +10 -0
  247. package/dist/safety/redaction.js.map +1 -1
  248. package/dist/tools/cloud.tool.d.ts +394 -0
  249. package/dist/tools/cloud.tool.d.ts.map +1 -0
  250. package/dist/tools/cloud.tool.js +784 -0
  251. package/dist/tools/cloud.tool.js.map +1 -0
  252. package/dist/tools/computer-use.tool.d.ts +2 -2
  253. package/dist/tools/corporate-wiki.tool.d.ts +22 -0
  254. package/dist/tools/corporate-wiki.tool.d.ts.map +1 -0
  255. package/dist/tools/corporate-wiki.tool.js +43 -0
  256. package/dist/tools/corporate-wiki.tool.js.map +1 -0
  257. package/dist/tools/devops.tool.d.ts +162 -0
  258. package/dist/tools/devops.tool.d.ts.map +1 -0
  259. package/dist/tools/devops.tool.js +377 -0
  260. package/dist/tools/devops.tool.js.map +1 -0
  261. package/dist/tools/multimedia.tool.d.ts +126 -0
  262. package/dist/tools/multimedia.tool.d.ts.map +1 -0
  263. package/dist/tools/multimedia.tool.js +533 -0
  264. package/dist/tools/multimedia.tool.js.map +1 -0
  265. package/dist/tools/osint.tool.d.ts +6 -6
  266. package/dist/tools/sandbox-dev.tool.d.ts +15 -0
  267. package/dist/tools/sandbox-dev.tool.d.ts.map +1 -0
  268. package/dist/tools/sandbox-dev.tool.js +146 -0
  269. package/dist/tools/sandbox-dev.tool.js.map +1 -0
  270. package/dist/tools/scratchpad.tool.d.ts +8 -0
  271. package/dist/tools/scratchpad.tool.d.ts.map +1 -1
  272. package/dist/tools/scratchpad.tool.js +40 -1
  273. package/dist/tools/scratchpad.tool.js.map +1 -1
  274. package/dist/tools/setup-assistant.tool.d.ts +1 -1
  275. package/dist/tools/swarm-ops.tool.d.ts +14 -0
  276. package/dist/tools/swarm-ops.tool.d.ts.map +1 -1
  277. package/dist/tools/swarm-ops.tool.js +47 -0
  278. package/dist/tools/swarm-ops.tool.js.map +1 -1
  279. package/dist/tools/sysops.tool.d.ts +157 -0
  280. package/dist/tools/sysops.tool.d.ts.map +1 -0
  281. package/dist/tools/sysops.tool.js +643 -0
  282. package/dist/tools/sysops.tool.js.map +1 -0
  283. package/dist/voice/deepgram.d.ts.map +1 -1
  284. package/dist/voice/deepgram.js +30 -2
  285. package/dist/voice/deepgram.js.map +1 -1
  286. package/package.json +8 -1
  287. package/scripts/release-github.mjs +23 -16
@@ -0,0 +1,320 @@
1
+ #!/usr/bin/env node
2
+ // transitions.mjs — inter-frame transition injector + verifier for product-launch.
3
+ //
4
+ // inject — read STORYBOARD frame order + each frame's transition_in, overlap
5
+ // the frame clip wrappers in index.html, and stamp the GSAP template.
6
+ // verify — deterministic gate over the injector's output.
7
+ //
8
+ // transition_in (written by story-design on the INCOMING frame) names a registry
9
+ // type directly: crossfade | blur-crossfade | push-slide | zoom-through | squeeze,
10
+ // optionally "<type> <DIR>" / "<type> <N>s" (e.g. "push-slide LEFT", "crossfade
11
+ // 0.4s"). `cut` / `none` / empty ⇒ hard cut (no overlap, no stamp).
12
+ //
13
+ // Mechanics — EXTEND-OUTGOING-ONLY (keeps voice/SFX/captions synced; their timing
14
+ // is keyed to the original frame start). At boundary i→i+1 (type = the incoming
15
+ // frame's transition_in): extend ONLY the outgoing wrapper's data-duration by
16
+ // `dur` so it holds its final frame across the window; do NOT move any data-start;
17
+ // the incoming — already present from the cut on a higher track — fades/pushes in
18
+ // over it. Then 0/1-ping-pong ALL frame clips' data-track-index (adjacent
19
+ // overlapping wrappers never share a track — lint timeline_track_too_dense) and
20
+ // stamp the token-substituted GSAP template into __timelines["main"] at T =
21
+ // incoming start. captions(2)/voice(10)/bgm(11)/sfx(20+) are never touched.
22
+ //
23
+ // node transitions.mjs inject --storyboard ./STORYBOARD.md --hyperframes .
24
+ // node transitions.mjs verify --storyboard ./STORYBOARD.md --index ./index.html
25
+
26
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
27
+ import { join, resolve } from "node:path";
28
+ import { parseStoryboard } from "./lib/storyboard.mjs";
29
+ import { parseFormat } from "./lib/dimensions.mjs";
30
+ import { loadTransitionRegistry, transitionsByName } from "./lib/transition-registry.mjs";
31
+
32
+ const flag = (argv, name, def) => {
33
+ const i = argv.indexOf(`--${name}`);
34
+ return i >= 0 && i + 1 < argv.length ? argv[i + 1] : def;
35
+ };
36
+ const NO_TRANSITION = new Set(["cut", "none", ""]);
37
+ const r3 = (x) => Number(x.toFixed(3));
38
+
39
+ // transition_in → { type, direction?, dur? } | null (hard cut).
40
+ function parseTransitionIn(raw) {
41
+ const s = (raw ?? "").trim();
42
+ if (NO_TRANSITION.has(s.toLowerCase())) return null;
43
+ const parts = s.split(/\s+/);
44
+ const spec = { type: parts[0].toLowerCase() };
45
+ for (const p of parts.slice(1)) {
46
+ const m = p.match(/^(\d+(?:\.\d+)?)s?$/);
47
+ if (m) spec.dur = Number(m[1]);
48
+ else spec.direction = p.toUpperCase();
49
+ }
50
+ return spec;
51
+ }
52
+
53
+ // Mounted STORYBOARD frames present in index.html, in document order: { id, frame }.
54
+ function mountedFramesInOrder(manifest, html) {
55
+ const out = [];
56
+ for (const f of manifest.frames) {
57
+ if (!f.src) continue;
58
+ const id = f.src
59
+ .split("/")
60
+ .pop()
61
+ .replace(/\.html?$/i, "");
62
+ if (html.includes(`id="el-${id}"`)) out.push({ id, frame: f });
63
+ }
64
+ return out;
65
+ }
66
+
67
+ // Frame clip wrappers parsed out of index.html (ids carry hyphens; excludes
68
+ // el-captions and audio by keying off the known frame-id set). The id is matched
69
+ // from anywhere in the tag's attribute list — never assume it is the first attribute
70
+ // (the index assembler emits data-hf-id before id, so an id-first regex finds nothing
71
+ // and inject crashes on the empty clip map).
72
+ function parseFrameClips(html, frameIds) {
73
+ const clipRe = /<div\b([^>]*)><\/div>/g;
74
+ const clips = new Map();
75
+ let m;
76
+ while ((m = clipRe.exec(html)) !== null) {
77
+ const attrs = m[1];
78
+ const idm = attrs.match(/\bid="el-([A-Za-z0-9_-]+)"/);
79
+ if (!idm || !frameIds.has(idm[1])) continue;
80
+ const num = (re) => {
81
+ const x = attrs.match(re);
82
+ return x ? Number(x[1]) : null;
83
+ };
84
+ clips.set(idm[1], {
85
+ id: idm[1],
86
+ block: m[0],
87
+ start: num(/data-start="([\d.]+)"/),
88
+ duration: num(/data-duration="([\d.]+)"/),
89
+ track: num(/data-track-index="(\d+)"/) ?? 0,
90
+ });
91
+ }
92
+ return clips;
93
+ }
94
+
95
+ // Resolve a transition_in spec to a registry record (calm default on unknown).
96
+ function resolveRecord(spec, byName, reg, warn) {
97
+ let rec = byName.get(spec.type);
98
+ if (!rec) {
99
+ rec = byName.get(reg.default_calm);
100
+ warn(`transition_in "${spec.type}" not in registry — using ${reg.default_calm}`);
101
+ }
102
+ return rec;
103
+ }
104
+ function resolveDur(spec, rec, reg) {
105
+ let dur = spec.dur ?? rec.default_duration_s ?? 0.5;
106
+ return Math.min(dur, reg.max_duration_s ?? 2.0);
107
+ }
108
+
109
+ // GSAP lines for one transition record (token substitution).
110
+ function buildGsap(rec, fromId, toId, dur, T, direction, canvasW, canvasH, die) {
111
+ const subs = {
112
+ __OLD__: `"#el-${fromId}"`,
113
+ __NEW__: `"#el-${toId}"`,
114
+ __T__: String(T),
115
+ __DUR__: String(dur),
116
+ };
117
+ let template;
118
+ if (rec.directions && rec.directions.length > 0) {
119
+ const dir = (direction || rec.default_direction || rec.directions[0]).toUpperCase();
120
+ const vertical = dir === "UP" || dir === "DOWN";
121
+ template = vertical ? rec.gsap_template_vertical : rec.gsap_template_horizontal;
122
+ if (!template)
123
+ die(`transition ${rec.name}: missing ${vertical ? "vertical" : "horizontal"} template`);
124
+ if (vertical) {
125
+ const dy = dir === "UP" ? -canvasH : canvasH;
126
+ subs.__DY__ = String(dy);
127
+ subs.__DYIN__ = String(-dy);
128
+ } else {
129
+ const dx = dir === "LEFT" ? -canvasW : canvasW;
130
+ subs.__DX__ = String(dx);
131
+ subs.__DXIN__ = String(-dx);
132
+ }
133
+ } else {
134
+ template = rec.gsap_template;
135
+ if (!template) die(`transition ${rec.name}: missing gsap_template`);
136
+ }
137
+ return template.map((line) => {
138
+ let out = line;
139
+ for (const [k, v] of Object.entries(subs)) out = out.split(k).join(v);
140
+ return out;
141
+ });
142
+ }
143
+
144
+ function runInject(argv) {
145
+ const hyperframesDir = resolve(flag(argv, "hyperframes", "."));
146
+ const storyboardPath = resolve(flag(argv, "storyboard", join(hyperframesDir, "STORYBOARD.md")));
147
+ const indexPath = join(hyperframesDir, "index.html");
148
+ const die = (msg) => {
149
+ console.error(`✗ transitions inject: ${msg}`);
150
+ process.exit(1);
151
+ };
152
+
153
+ if (!existsSync(storyboardPath)) die(`STORYBOARD.md not found at ${storyboardPath}`);
154
+
155
+ const manifest = parseStoryboard(readFileSync(storyboardPath, "utf8"));
156
+ const { width: CW, height: CH } = parseFormat(manifest.globals.format);
157
+ const reg = loadTransitionRegistry();
158
+ const byName = transitionsByName();
159
+
160
+ // Read directly and handle ENOENT here, rather than an existsSync precheck —
161
+ // the check→write pair (write-back below) is a TOCTOU race CodeQL flags.
162
+ let html = "";
163
+ try {
164
+ html = readFileSync(indexPath, "utf8");
165
+ } catch {
166
+ die(`index.html not found at ${indexPath} — run assemble-index.mjs first`);
167
+ }
168
+ const order = mountedFramesInOrder(manifest, html);
169
+ if (order.length === 0) die("no frame clips found in index.html");
170
+ const frameIds = new Set(order.map((x) => x.id));
171
+ const clips = parseFrameClips(html, frameIds);
172
+
173
+ const gsapLines = [];
174
+ const applied = [];
175
+ for (let i = 1; i < order.length; i++) {
176
+ const spec = parseTransitionIn(order[i].frame.transitionIn);
177
+ if (!spec) continue; // hard cut
178
+ const incoming = clips.get(order[i].id);
179
+ const outgoing = clips.get(order[i - 1].id);
180
+ const rec = resolveRecord(spec, byName, reg, (m) =>
181
+ console.error(` ! frame ${order[i].id}: ${m}`),
182
+ );
183
+ const dur = resolveDur(spec, rec, reg);
184
+ const T = r3(incoming.start); // cut = incoming start (frames tile)
185
+ outgoing.duration = r3(outgoing.duration + dur); // extend outgoing only
186
+ gsapLines.push(
187
+ ...buildGsap(rec, outgoing.id, incoming.id, dur, T, spec.direction, CW, CH, die),
188
+ );
189
+ applied.push({ from: outgoing.id, to: incoming.id, type: rec.name, dur, T });
190
+ }
191
+
192
+ if (applied.length === 0) {
193
+ console.log(`✓ transitions inject: 0 transitions (all cuts) — index.html unchanged`);
194
+ return;
195
+ }
196
+
197
+ // 0/1 ping-pong all frame clips in play order.
198
+ const ordered = [...clips.values()].sort((a, b) => a.start - b.start || a.id.localeCompare(b.id));
199
+ ordered.forEach((c, i) => {
200
+ c.track = i % 2;
201
+ });
202
+
203
+ // rewrite each clip block: start unchanged; duration possibly extended; track ping-ponged.
204
+ for (const c of clips.values()) {
205
+ const nb = c.block
206
+ .replace(/data-duration="[\d.]+"/, `data-duration="${c.duration}"`)
207
+ .replace(/data-track-index="\d+"/, `data-track-index="${c.track}"`);
208
+ html = html.replace(c.block, nb);
209
+ }
210
+
211
+ // stamp the GSAP after the master timeline anchor.
212
+ const anchor = 'window.__timelines["main"] = gsap.timeline({ paused: true });';
213
+ if (!html.includes(anchor)) die("master timeline anchor not found in index.html");
214
+ // The transition tweens alone leave window.__timelines["main"] spanning only the
215
+ // last transition (e.g. 24.7s), shorter than the real composition. The Studio
216
+ // reads main.duration() as its master duration and parses clips against it, so a
217
+ // short master collapses its timeline (clips dropped, duration wrong, blank stage)
218
+ // — the render engine is unaffected (it trusts the root data-duration attr). Stamp
219
+ // a full-span anchor so main.duration() == composition total. Mirrors the
220
+ // `tl.to({}, { duration })` anchor captions.html already uses.
221
+ const rootDurMatch = html.match(/data-composition-id="main"[^>]*?data-duration="([\d.]+)"/);
222
+ const totalDur = rootDurMatch ? Number(rootDurMatch[1]) : null;
223
+ const block = [
224
+ anchor,
225
+ " // ── frame transitions (injected by transitions.mjs) ──",
226
+ ' (function () { var tl = window.__timelines["main"];',
227
+ ...gsapLines.map((l) => " " + l),
228
+ ...(totalDur
229
+ ? [
230
+ ` tl.to({}, { duration: ${totalDur} }, 0); // full-span anchor — main.duration() == composition total (Studio master duration)`,
231
+ ]
232
+ : []),
233
+ " })();",
234
+ ].join("\n");
235
+ html = html.replace(anchor, block);
236
+
237
+ writeFileSync(indexPath, html);
238
+ console.log(`✓ transitions inject: ${applied.length} transition(s) stamped into index.html`);
239
+ for (const a of applied) console.log(` ${a.from}→${a.to}: ${a.type} ${a.dur}s @ T=${a.T}s`);
240
+ const tracks = ordered
241
+ .map((c) => `${c.id}[t${c.track} ${c.start}→${r3(c.start + c.duration)}]`)
242
+ .join(" ");
243
+ console.log(` tracks: ${tracks}`);
244
+ }
245
+
246
+ function runVerify(argv) {
247
+ const hyperframesDir = resolve(flag(argv, "hyperframes", "."));
248
+ const storyboardPath = resolve(flag(argv, "storyboard", join(hyperframesDir, "STORYBOARD.md")));
249
+ const indexPath = resolve(flag(argv, "index", join(hyperframesDir, "index.html")));
250
+ const bail = (msg) => {
251
+ console.error(`✗ transitions verify: ${msg}`);
252
+ process.exit(1);
253
+ };
254
+
255
+ if (!existsSync(storyboardPath)) bail("STORYBOARD.md not found");
256
+ if (!existsSync(indexPath)) bail("index.html not found");
257
+
258
+ const manifest = parseStoryboard(readFileSync(storyboardPath, "utf8"));
259
+ const html = readFileSync(indexPath, "utf8");
260
+ const order = mountedFramesInOrder(manifest, html);
261
+ const frameIds = new Set(order.map((x) => x.id));
262
+ const clips = parseFrameClips(html, frameIds);
263
+
264
+ const EPS = 0.011;
265
+ const overlaps = (a, b) =>
266
+ a.start < b.start + b.duration - EPS && b.start < a.start + a.duration - EPS;
267
+ const fail = [];
268
+
269
+ // (4) global no same-track overlap (the lint invariant).
270
+ const all = [...clips.values()];
271
+ for (let i = 0; i < all.length; i++)
272
+ for (let j = i + 1; j < all.length; j++) {
273
+ const a = all[i];
274
+ const b = all[j];
275
+ if (a.track === b.track && overlaps(a, b))
276
+ fail.push(`same-track overlap: ${a.id}[t${a.track}] & ${b.id}[t${b.track}]`);
277
+ }
278
+
279
+ const bm = html.match(/frame transitions \(injected[\s\S]*?\}\)\(\);/);
280
+ const txBlock = bm ? bm[0] : "";
281
+
282
+ let expected = 0;
283
+ for (let i = 1; i < order.length; i++) {
284
+ const spec = parseTransitionIn(order[i].frame.transitionIn);
285
+ if (!spec) continue;
286
+ expected++;
287
+ const to = clips.get(order[i].id);
288
+ const from = clips.get(order[i - 1].id);
289
+ if (!to || !from) {
290
+ fail.push(`boundary ${order[i - 1].id}→${order[i].id}: wrapper missing`);
291
+ continue;
292
+ }
293
+ if (!txBlock.includes(`"#el-${from.id}"`) || !txBlock.includes(`"#el-${to.id}"`))
294
+ fail.push(`boundary ${from.id}→${to.id}: injected block does not reference both ids`);
295
+ const overlapAmt = r3(from.start + from.duration - to.start);
296
+ if (overlapAmt <= 0) fail.push(`boundary ${from.id}→${to.id}: no overlap (${overlapAmt}s)`);
297
+ if (from.track === to.track)
298
+ fail.push(`boundary ${from.id}→${to.id}: both on track ${from.track}`);
299
+ }
300
+ if (expected > 0 && !txBlock)
301
+ fail.push(`${expected} transition(s) expected but no injected block found`);
302
+
303
+ if (fail.length) {
304
+ console.error(`✗ transitions verify: ${fail.length} failure(s):`);
305
+ for (const f of fail) console.error(` - ${f}`);
306
+ process.exit(1);
307
+ }
308
+ console.log(
309
+ `✓ transitions verify: ${expected} transition(s) verified (cross-track, overlap>0, both ids referenced, no same-track overlap)`,
310
+ );
311
+ }
312
+
313
+ const sub = process.argv[2];
314
+ const rest = process.argv.slice(3);
315
+ if (sub === "inject") runInject(rest);
316
+ else if (sub === "verify") runVerify(rest);
317
+ else {
318
+ console.error("usage: node transitions.mjs <inject|verify> [args...]");
319
+ process.exit(2);
320
+ }
@@ -0,0 +1,74 @@
1
+ # Frame worker — product-launch per-frame composition author
2
+
3
+ > You build **one** frame's composition HTML and nothing else. You run N-up, one frame each — siblings build the others. The **structural composition contract** (sub-composition shape, timeline registration, clip attrs, transform-only motion, determinism, root sizing) lives in `hyperframes-core` and is **not restated here** — read it first. This file carries only what's specific to a product-launch frame. Tempted to add a generic GSAP / timeline rule here? Wrong home — it belongs in `hyperframes-core`.
4
+
5
+ **INPUT** — your dispatch context provides:
6
+
7
+ - `PROJECT_DIR` — the project root; all paths are relative to it.
8
+ - `frame_id` — e.g. `03-feature`. Use it **verbatim** as the composition id, the `window.__timelines` key, and the file name (`compositions/frames/03-feature.html`) — that path **is** the frame's `src` in `STORYBOARD.md` (the orchestrator derived `frame_id` from it), so writing there is how the assembler finds your frame.
9
+ - Your **`## Frame N` block** in `STORYBOARD.md` (read it; never write to that file — see below):
10
+ - `scene` — a one-line contact-sheet caption. **Design intent, never visible DOM text.**
11
+ - `voiceover` — the narration line. **Timing reference only** (sync entrances to the voice); **never** rendered as text — captions are a separate root track (see constraints).
12
+ - `duration` — your render length in seconds. **Fixed upstream; never change it or tween to fill a different length.**
13
+ - `transition_in` — informational. The injector stamps it at the root; **you do not author transitions.**
14
+ - the **time-coded shot sequence** — your build spec. A sequence of Scene lines (`Scene 1 (0.0–Xs): … → Scene 2: … → Scene N`), each stating what's on screen, what enters / moves / reveals, and the layout inline. Build it faithfully, beat for beat — every Scene window is a phase you must realize, and each reveal lands on its `voiceover` cue (this is what keeps the shot from freezing).
15
+ - `blueprint:` — an id (or the literal `compose`). The id points to `../hyperframes-animation/blueprints/<id>.md`: the **product-agnostic shot template** this frame instantiates — the overall shape + its signature move. Read it for the shape; `compose` means there's no template, sequence the shot from the Scene lines directly.
16
+ - `focal:` — which candidate is the hero.
17
+ - `roles:` — each candidate's role: `cutout` foreground / `background` full-bleed / supporting — plus the real media available (each `public/<basename> — description`; a **`[video]`** tag marks a `.mp4` motion clip).
18
+ - `sfx:` — the orchestrator's; you mount no audio.
19
+ - `frame.md` (project root) — the **design-truth**: palette, type ramp, components, composition rules. The LOOK. Pull every visual token from here.
20
+ - `RULES_DIR` — absolute path to this skill's local `../hyperframes-animation/rules/`. The **named motion verbs in the Scene lines** (and the moves the blueprint cites) resolve to rule recipes here: `RULES_DIR/<id>.md` is the mechanics for a motion. (A few rules link an optional runnable demo in the shared `../hyperframes-animation/examples/<id>.html` — open it only when a recipe is unclear.)
21
+ - `../references/cut-catalog.md` — the **cut catalog** (zoom-through / inverse / cut-the-curve / waterfall). When a Scene seam is a within-scene swap, a scene-to-scene cut, or a text-to-text line change, build it INSIDE your composition per this catalog (Z-scale + blur + opacity, or per-word x-staggers). You never author the between-frame transition — story's `transition_in` + the injector own that.
22
+ - Canvas `<width>×<height>` and `Captions: <enabled | disabled>` (+ the keep-out cutoff when enabled).
23
+
24
+ **Retry** — if your context carries lint / validate feedback from a prior pass, read it first and re-author so none of those findings recur; treat each as a hard constraint.
25
+
26
+ **OUTPUT** — `compositions/frames/<frame_id>.html`, one self-contained sub-composition. Writing it (past the self-check below) is your **terminal action** — you do not edit `STORYBOARD.md`, mint audio, assemble the index, run the CLI, or report back. The orchestrator picks up the file and marks the frame's `status`.
27
+
28
+ ## You do NOT decide
29
+
30
+ These belong to other steps — touching them collides with a sibling or breaks an upstream contract:
31
+
32
+ - **What is SAID** — narration is locked in `SCRIPT.md` / the `voiceover` line. You only show; you never write or restate narration text.
33
+ - **Duration** — fixed from real voice timing. Build your entrance to land within it; don't stretch or trim it.
34
+ - **Transitions between frames** — the injector stamps them onto the root timeline. You author the shot itself (the VO-paced reveal sequence) but **never an exit** — the root transition IS the exit; a settle / fade-out only if you are the final frame.
35
+ - **Audio** (narration / BGM / SFX) — assembled at the root by the orchestrator. **No `<audio>` element in your composition.**
36
+ - **Design tokens** — palette / fonts / components come from `frame.md`. Don't invent them, and **never lift a word, label, or wordmark out of `frame.md` as your copy** — it is a style spec, not the product's content. Brand text comes from your frame's `scene` / narrative.
37
+ - **Which motions / assets exist** — named upstream in your block (the shot sequence's motion verbs + `blueprint:`, the candidate media in `roles:` / `focal:`). Implement them; don't fetch or invent new ones (you have no asset-fetch tool — never fabricate an image URL).
38
+ - **The shared `STORYBOARD.md`** — read your block, never write it. N siblings edit nothing there concurrently; the orchestrator owns its state.
39
+
40
+ ## Frame constraints
41
+
42
+ Generic seek-safety + structure live in `hyperframes-core` (read it; not restated). These are the **product-launch deltas**, each load-bearing:
43
+
44
+ - **Caption keep-out — all content in the top ~83%.** A karaoke caption pill owns the bottom ~17% of the canvas. Keep every element (headline, cards, CTA, stats, brand mark) above `y ≈ 0.83 × height` — compute the pixel cutoff from your canvas (e.g. `≤ 900` on a 1080-tall frame, `≤ 1600` on a 1920-tall portrait). Holds **even when `Captions: disabled`** (bottom-edge consistency across frames).
45
+ - **Fill the content area — especially portrait.** Compose the whole top-83% region; don't float one small cluster mid-frame. Anchor the hero high (~0.2–0.35 × height), flow supporting elements down with rhythm, scale hero type toward full-bleed. (Landscape's region is short, so vertical centering near 0.42 × height is fine.)
46
+ - **Visible text is short motion-graphics copy** — headline / stat / one-word emphasis (`"$83K"`, `"INSTANT"`), never a sentence from the narration. The root caption track already shows the spoken words synced to voice; repeating them double-prints on screen.
47
+ - **Build the whole shot — reveal across the full `duration`, never front-load.** Dumping the whole canvas in the first ~25% then holding it is exactly what reads as a PowerPoint slide. Instead reveal each piece — a line, a card, a stat, an icon — **as the `voiceover` reaches it**, sequencing reveals across the shot and especially the back ~50%, with the macro camera move running underneath. **Only EXITS are banned** — a non-final frame unmounts mid-frame, so an exit tween truncates and reads as a glitch (the root transition IS the exit); mid-shot reveals are free and seek-safe. The lone exception is a note marked as a deliberate hold / stillness frame: there, an entrance + a quiet settle is right (a held read beats bad motion).
48
+ - **Implement the shot sequence faithfully — every Scene is a timeline phase.** The Scene lines ARE the build: map each Scene onto a phase of the one timeline, each piece revealing as the `voiceover` reaches it. For each **named motion** in a Scene, open its rule recipe under `RULES_DIR/<id>.md` and reproduce its mechanics — **never name-guess** (a guess loses the signature move). The **`blueprint:` template** (`../hyperframes-animation/blueprints/<id>.md`) gives the overall shape; read it and keep its **signature move** recognizable, then instantiate it with this frame's content / assets / timing. `compose` → no template; sequence the shot straight from the Scene lines. Whichever, never front-load the whole sequence at `t=0` — pace the reveals to the voiceover.
49
+ - **Place each candidate by its `roles`** (the `focal` is the hero): a `cutout` is a foreground subject — respect the 83% keep-out, lay text around it, not over its face; a `background` is full-bleed and dimmed ~30–50% so foreground content stays legible. **A `[video]` candidate (`.mp4`) is a real motion clip — usually the strongest hero for a motion/demo product.** Render it as a **muted** `<video class="clip">` (`data-start` / `data-duration` / `data-track-index` per the core clip contract), a **direct child of the frame root** — never nested in another timed element, or the renderer freezes it. Keep it muted (the root owns all audio); a `[video-still]` or untagged image → `<img>`.
50
+
51
+ ## Workflow
52
+
53
+ 1. **Read** — `hyperframes-core`'s composition contract (the structural law), then `frame.md` (the look) and your `## Frame N` block (the shot sequence + `blueprint:` / `focal:` / `roles:` / assets). **Then read the blueprint template** `../hyperframes-animation/blueprints/<id>.md` (skip if `compose`) for the shot's shape and signature move, and **open the rule recipe `RULES_DIR/<id>.md` for every named motion** in the Scene lines (plus the shared `../hyperframes-animation/examples/<id>.html` when the recipe is unclear): you reproduce these mechanics, not improvise them. Internalize the self-check codes below before you write — most lethal is **template transport**: every `<style>` + `<script>` (including the gsap load) must live INSIDE `<template>`, because the runtime only clones template contents and `lint` / `validate` / `inspect` can miss the resulting blank sub-composition.
54
+ 2. **Design** — turn the time-coded shot sequence into a timeline using `frame.md`'s components and type ramp: each Scene window becomes a phase revealed on its `voiceover` cue, each named motion built from the recipe you just read, the blueprint's signature move kept recognizable. Place the named assets, and find a visual idea that reinforces the beat, not a literal restyle of the words.
55
+ 3. **Author** — write the full sub-composition to `compositions/frames/<frame_id>.html` (rewrite to iterate; last write wins). `<template>`-wrapped root carrying `data-composition-id="<frame_id>"` and styled via `#root` (not a class on that element — see the self-check below), exactly one `gsap.timeline({ paused: true })` registered at `window.__timelines["<frame_id>"]`, built synchronously — per the core contract.
56
+ 4. **Self-check, then finish** — re-read your file against the checklist below and fix in place. Writing the file is your terminal action; you do **not** run the CLI.
57
+
58
+ ## Self-check before finishing (you do NOT run the CLI)
59
+
60
+ You **can't** meaningfully run `hyperframes lint` / `validate` / `inspect` here: they operate on the **assembled project** (the `index.html` graph / bundle), and your frame isn't wired in yet — so they report on _other_ files, not yours (a false green). The **orchestrator** runs them at **Step 6, after assembly** (the correct unit), and **re-dispatches you with the finding** if your frame fails (see **Retry** above). So get it right on write: re-read your file against this checklist before finishing — the codes in parens are `hyperframes lint`'s and what the orchestrator may cite back (the rules behind them live in `hyperframes-core`):
61
+
62
+ - `missing_template_wrapper` / `missing_composition_id` — root is `<template>`-wrapped and carries `data-composition-id="<frame_id>"`.
63
+ - **Template transport** — every `<style>` and `<script>` block, including the GSAP load, lives inside `<template>`.
64
+ - `subcomposition_root_styled_by_class` — **style the frame root via `#root`, never a class on the `data-composition-id` element**: at render a class on the root gets scoped to a descendant selector that can't match it, so the **whole scene renders unstyled** (Studio preview still looks right — trust this rule, not the preview). Descendants use plain selectors.
65
+ - `clip_missing_data_attrs` — every `class="clip"` element has `data-start` / `data-duration` / `data-track-index`.
66
+ - `timeline_not_paused` / `timeline_not_registered` — one paused timeline, registered at `window.__timelines["<frame_id>"]`.
67
+ - `css_transition_used` + repeat / yoyo / non-deterministic logic — none present (the renderer seeks frame-by-frame).
68
+ - `gsap_css_transform_conflict` — never put a CSS `transform` (e.g. `translateY(-50%)` centering) on an element you then GSAP-animate a transform prop on (`x` / `y` / `scale` / `rotation`): GSAP overwrites the whole `transform` and silently drops the CSS centering (the element jumps). Center with `margin` / `inset` (or `top`/`left` + offset), fold the offset into the tween via `xPercent` / `yPercent`, or use `fromTo` (the rule exempts it).
69
+ - **Hero visibility** — the main subject is visible by `t <= 0.5s`; entrance tweens use `fromTo` instead of CSS-hidden starting states.
70
+ - `exit_animation_on_non_final_scene` — no exit tween unless you are the final frame.
71
+ - **No front-loading (not a slide)** — the shot's pieces reveal on their `voiceover` cues across the duration, not all fired at `t=0`; a non-still frame keeps content arriving rather than holding a full canvas from ~25%.
72
+ - **Shot-sequence fidelity** — every Scene in the time-coded sequence is realized as a phase, the blueprint's signature move (unless `compose`) is present and recognizable, and the shot reveals to the voiceover (never front-loaded at `t=0`).
73
+ - `font_family_without_font_face` — every font you name has a matching `@font-face` (or `@import`) **inside this file**. **Only use fonts that ship as files** with the project: the families declared in `frame.md` (their `.woff2` live in `assets/fonts/` or `capture/assets/fonts/` — point the `@font-face` `src` at the real file you find there). **Never name a font that has no file**, including system CJK / Japanese / Devanagari families (`Hiragino Sans`, `Yu Gothic`, `Noto Sans CJK`, `Noto Sans Devanagari`, …): the render machine is a clean headless Chrome with none of them installed, so the text silently falls back to a generic font and the typography is wrong in the MP4. For non-Latin or multilingual visible text, either use a shipped font that covers the script, or romanize / transliterate it (e.g. `日本語` → `Japanese`); if neither is possible it is out of scope for this frame — do not invent a font name.
74
+ - **Keep-out + no-narration-text** (eyeball, no code) — nothing sits below the 83% cutoff; no narration sentence is rendered as visible text.
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: prompt-engineering-patterns
3
+ description: >-
4
+ This skill should be used when the user asks to "optimize a prompt", "improve prompt
5
+ performance", "design a prompt template", "write better prompts", "debug prompt issues", "use
6
+ chain-of-thought", "structured prompting", "few-shot prompting", or wants to apply advanced
7
+ prompt engineering patterns for production LLM applications.
8
+ ---
9
+
10
+ # Prompt Engineering Patterns
11
+
12
+ Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability.
13
+
14
+ ## When to Use This Skill
15
+
16
+ - Designing complex prompts for production LLM applications
17
+ - Optimizing prompt performance and consistency
18
+ - Implementing structured reasoning patterns (chain-of-thought, tree-of-thought)
19
+ - Building few-shot learning systems with dynamic example selection
20
+ - Creating reusable prompt templates with variable interpolation
21
+ - Debugging and refining prompts that produce inconsistent outputs
22
+ - Implementing system prompts for specialized AI assistants
23
+ - Using structured outputs (JSON mode) for reliable parsing
24
+
25
+ ## Core Capabilities
26
+
27
+ ### 1. Few-Shot Learning
28
+
29
+ - Example selection strategies (semantic similarity, diversity sampling)
30
+ - Balancing example count with context window constraints
31
+ - Constructing effective demonstrations with input-output pairs
32
+ - Dynamic example retrieval from knowledge bases
33
+ - Handling edge cases through strategic example selection
34
+
35
+ ### 2. Chain-of-Thought Prompting
36
+
37
+ - Step-by-step reasoning elicitation
38
+ - Zero-shot CoT with "Let's think step by step"
39
+ - Few-shot CoT with reasoning traces
40
+ - Self-consistency techniques (sampling multiple reasoning paths)
41
+ - Verification and validation steps
42
+
43
+ ### 3. Structured Outputs
44
+
45
+ - JSON mode for reliable parsing
46
+ - Pydantic schema enforcement
47
+ - Type-safe response handling
48
+ - Error handling for malformed outputs
49
+
50
+ ### 4. Prompt Optimization
51
+
52
+ - Iterative refinement workflows
53
+ - A/B testing prompt variations
54
+ - Measuring prompt performance metrics (accuracy, consistency, latency)
55
+ - Reducing token usage while maintaining quality
56
+ - Handling edge cases and failure modes
57
+
58
+ ### 5. Template Systems
59
+
60
+ - Variable interpolation and formatting
61
+ - Conditional prompt sections
62
+ - Multi-turn conversation templates
63
+ - Role-based prompt composition
64
+ - Modular prompt components
65
+
66
+ ### 6. System Prompt Design
67
+
68
+ - Setting model behavior and constraints
69
+ - Defining output formats and structure
70
+ - Establishing role and expertise
71
+ - Safety guidelines and content policies
72
+ - Context setting and background information
73
+
74
+ ## Quick Start
75
+
76
+ ```python
77
+ from langchain_anthropic import ChatAnthropic
78
+ from langchain_core.prompts import ChatPromptTemplate
79
+ from pydantic import BaseModel, Field
80
+
81
+ # Define structured output schema
82
+ class SQLQuery(BaseModel):
83
+ query: str = Field(description="The SQL query")
84
+ explanation: str = Field(description="Brief explanation of what the query does")
85
+ tables_used: list[str] = Field(description="List of tables referenced")
86
+
87
+ # Initialize model with structured output
88
+ llm = ChatAnthropic(model="claude-sonnet-4-6")
89
+ structured_llm = llm.with_structured_output(SQLQuery)
90
+
91
+ # Create prompt template
92
+ prompt = ChatPromptTemplate.from_messages([
93
+ ("system", """You are an expert SQL developer. Generate efficient, secure SQL queries.
94
+ Always use parameterized queries to prevent SQL injection.
95
+ Explain your reasoning briefly."""),
96
+ ("user", "Convert this to SQL: {query}")
97
+ ])
98
+
99
+ # Create chain
100
+ chain = prompt | structured_llm
101
+
102
+ # Use
103
+ result = await chain.ainvoke({
104
+ "query": "Find all users who registered in the last 30 days"
105
+ })
106
+ print(result.query)
107
+ print(result.explanation)
108
+ ```
109
+
110
+ ## Detailed patterns and worked examples
111
+
112
+ Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.
113
+
114
+ ## Best Practices
115
+
116
+ 1. **Be Specific**: Vague prompts produce inconsistent results
117
+ 2. **Show, Don't Tell**: Examples are more effective than descriptions
118
+ 3. **Use Structured Outputs**: Enforce schemas with Pydantic for reliability
119
+ 4. **Test Extensively**: Evaluate on diverse, representative inputs
120
+ 5. **Iterate Rapidly**: Small changes can have large impacts
121
+ 6. **Monitor Performance**: Track metrics in production
122
+ 7. **Version Control**: Treat prompts as code with proper versioning
123
+ 8. **Document Intent**: Explain why prompts are structured as they are
124
+
125
+ ## Common Pitfalls
126
+
127
+ - **Over-engineering**: Starting with complex prompts before trying simple ones
128
+ - **Example pollution**: Using examples that don't match the target task
129
+ - **Context overflow**: Exceeding token limits with excessive examples
130
+ - **Ambiguous instructions**: Leaving room for multiple interpretations
131
+ - **Ignoring edge cases**: Not testing on unusual or boundary inputs
132
+ - **No error handling**: Assuming outputs will always be well-formed
133
+ - **Hardcoded values**: Not parameterizing prompts for reuse
134
+
135
+ ## Success Metrics
136
+
137
+ Track these KPIs for your prompts:
138
+
139
+ - **Accuracy**: Correctness of outputs
140
+ - **Consistency**: Reproducibility across similar inputs
141
+ - **Latency**: Response time (P50, P95, P99)
142
+ - **Token Usage**: Average tokens per request
143
+ - **Success Rate**: Percentage of valid, parseable outputs
144
+ - **User Satisfaction**: Ratings and feedback
@@ -0,0 +1,106 @@
1
+ {
2
+ "sentiment_analysis": [
3
+ {
4
+ "input": "This product exceeded my expectations! The quality is outstanding.",
5
+ "output": "Positive"
6
+ },
7
+ {
8
+ "input": "Terrible experience. The item arrived damaged and customer service was unhelpful.",
9
+ "output": "Negative"
10
+ },
11
+ {
12
+ "input": "The product works as described. Nothing special, but does the job.",
13
+ "output": "Neutral"
14
+ }
15
+ ],
16
+ "entity_extraction": [
17
+ {
18
+ "input": "Apple CEO Tim Cook announced the new iPhone at an event in Cupertino on September 12th.",
19
+ "output": {
20
+ "persons": ["Tim Cook"],
21
+ "organizations": ["Apple"],
22
+ "products": ["iPhone"],
23
+ "locations": ["Cupertino"],
24
+ "dates": ["September 12th"]
25
+ }
26
+ },
27
+ {
28
+ "input": "Microsoft acquired GitHub for $7.5 billion in 2018.",
29
+ "output": {
30
+ "persons": [],
31
+ "organizations": ["Microsoft", "GitHub"],
32
+ "products": [],
33
+ "locations": [],
34
+ "dates": ["2018"],
35
+ "monetary_values": ["$7.5 billion"]
36
+ }
37
+ }
38
+ ],
39
+ "code_generation": [
40
+ {
41
+ "input": "Write a Python function to check if a string is a palindrome",
42
+ "output": "def is_palindrome(s: str) -> bool:\n \"\"\"Check if string is palindrome, ignoring case and spaces.\"\"\"\n # Remove spaces and convert to lowercase\n cleaned = s.replace(' ', '').lower()\n # Compare with reversed string\n return cleaned == cleaned[::-1]"
43
+ }
44
+ ],
45
+ "text_classification": [
46
+ {
47
+ "input": "How do I reset my password?",
48
+ "output": "account_management"
49
+ },
50
+ {
51
+ "input": "My order hasn't arrived yet. Where is it?",
52
+ "output": "shipping_inquiry"
53
+ },
54
+ {
55
+ "input": "I'd like to cancel my subscription.",
56
+ "output": "subscription_cancellation"
57
+ },
58
+ {
59
+ "input": "The app keeps crashing when I try to log in.",
60
+ "output": "technical_support"
61
+ }
62
+ ],
63
+ "data_transformation": [
64
+ {
65
+ "input": "John Smith, john@email.com, (555) 123-4567",
66
+ "output": {
67
+ "name": "John Smith",
68
+ "email": "john@email.com",
69
+ "phone": "(555) 123-4567"
70
+ }
71
+ },
72
+ {
73
+ "input": "Jane Doe | jane.doe@company.com | +1-555-987-6543",
74
+ "output": {
75
+ "name": "Jane Doe",
76
+ "email": "jane.doe@company.com",
77
+ "phone": "+1-555-987-6543"
78
+ }
79
+ }
80
+ ],
81
+ "question_answering": [
82
+ {
83
+ "context": "The Eiffel Tower is a wrought-iron lattice tower in Paris, France. It was constructed from 1887 to 1889 and stands 324 meters (1,063 ft) tall.",
84
+ "question": "When was the Eiffel Tower built?",
85
+ "answer": "The Eiffel Tower was constructed from 1887 to 1889."
86
+ },
87
+ {
88
+ "context": "Python 3.11 was released on October 24, 2022. It includes performance improvements and new features like exception groups and improved error messages.",
89
+ "question": "What are the new features in Python 3.11?",
90
+ "answer": "Python 3.11 includes exception groups, improved error messages, and performance improvements."
91
+ }
92
+ ],
93
+ "summarization": [
94
+ {
95
+ "input": "Climate change refers to long-term shifts in global temperatures and weather patterns. While climate change is natural, human activities have been the main driver since the 1800s, primarily due to the burning of fossil fuels like coal, oil and gas which produces heat-trapping greenhouse gases. The consequences include rising sea levels, more extreme weather events, and threats to biodiversity.",
96
+ "output": "Climate change involves long-term alterations in global temperatures and weather patterns, primarily driven by human fossil fuel consumption since the 1800s, resulting in rising sea levels, extreme weather, and biodiversity threats."
97
+ }
98
+ ],
99
+ "sql_generation": [
100
+ {
101
+ "schema": "users (id, name, email, created_at)\norders (id, user_id, total, order_date)",
102
+ "request": "Find all users who have placed orders totaling more than $1000",
103
+ "output": "SELECT u.id, u.name, u.email, SUM(o.total) as total_spent\nFROM users u\nJOIN orders o ON u.id = o.user_id\nGROUP BY u.id, u.name, u.email\nHAVING SUM(o.total) > 1000;"
104
+ }
105
+ ]
106
+ }