@kolbo/kolbo-code-linux-arm64-musl 0.0.0-dev-202604161628

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 (282) hide show
  1. package/bin/kolbo +0 -0
  2. package/package.json +14 -0
  3. package/skills/brainstorming/SKILL.md +164 -0
  4. package/skills/brainstorming/scripts/frame-template.html +214 -0
  5. package/skills/brainstorming/scripts/helper.js +88 -0
  6. package/skills/brainstorming/scripts/server.cjs +354 -0
  7. package/skills/brainstorming/scripts/start-server.sh +148 -0
  8. package/skills/brainstorming/scripts/stop-server.sh +56 -0
  9. package/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  10. package/skills/brainstorming/visual-companion.md +287 -0
  11. package/skills/color-grading/SKILL.md +152 -0
  12. package/skills/dispatching-parallel-agents/SKILL.md +182 -0
  13. package/skills/docx/.skillfish.json +10 -0
  14. package/skills/docx/SKILL.md +196 -0
  15. package/skills/docx/docx-js.md +350 -0
  16. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  17. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  18. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  19. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  20. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  21. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  22. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  23. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  24. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  25. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  26. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  27. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  28. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  29. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  30. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  31. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  32. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  33. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  34. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  35. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  36. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  37. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  38. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  39. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  40. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  41. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  42. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  43. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  44. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  45. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  46. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  47. package/skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
  48. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  49. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  50. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  51. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  52. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  53. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  54. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  55. package/skills/docx/ooxml/scripts/pack.py +159 -0
  56. package/skills/docx/ooxml/scripts/unpack.py +29 -0
  57. package/skills/docx/ooxml/scripts/validate.py +69 -0
  58. package/skills/docx/ooxml/scripts/validation/__init__.py +15 -0
  59. package/skills/docx/ooxml/scripts/validation/base.py +951 -0
  60. package/skills/docx/ooxml/scripts/validation/docx.py +274 -0
  61. package/skills/docx/ooxml/scripts/validation/pptx.py +315 -0
  62. package/skills/docx/ooxml/scripts/validation/redlining.py +279 -0
  63. package/skills/docx/ooxml.md +599 -0
  64. package/skills/docx/scripts/__init__.py +1 -0
  65. package/skills/docx/scripts/document.py +1272 -0
  66. package/skills/docx/scripts/templates/comments.xml +3 -0
  67. package/skills/docx/scripts/templates/commentsExtended.xml +3 -0
  68. package/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
  69. package/skills/docx/scripts/templates/commentsIds.xml +3 -0
  70. package/skills/docx/scripts/templates/people.xml +3 -0
  71. package/skills/docx/scripts/utilities.py +374 -0
  72. package/skills/executing-plans/SKILL.md +70 -0
  73. package/skills/ffmpeg-patterns/SKILL.md +240 -0
  74. package/skills/finishing-a-development-branch/SKILL.md +200 -0
  75. package/skills/frontend-design/SKILL.md +42 -0
  76. package/skills/fullstack-app/SKILL.md +621 -0
  77. package/skills/image-prompting-guide/SKILL.md +143 -0
  78. package/skills/kolbo/SKILL.md +610 -0
  79. package/skills/music-prompting/SKILL.md +146 -0
  80. package/skills/pdf/.skillfish.json +10 -0
  81. package/skills/pdf/FORMS.md +205 -0
  82. package/skills/pdf/REFERENCE.md +612 -0
  83. package/skills/pdf/SKILL.md +293 -0
  84. package/skills/pdf/scripts/check_bounding_boxes.py +70 -0
  85. package/skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
  86. package/skills/pdf/scripts/check_fillable_fields.py +12 -0
  87. package/skills/pdf/scripts/convert_pdf_to_images.py +35 -0
  88. package/skills/pdf/scripts/create_validation_image.py +41 -0
  89. package/skills/pdf/scripts/extract_form_field_info.py +152 -0
  90. package/skills/pdf/scripts/fill_fillable_fields.py +114 -0
  91. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
  92. package/skills/photo-studio/SKILL.md +130 -0
  93. package/skills/pptx/.skillfish.json +10 -0
  94. package/skills/pptx/SKILL.md +483 -0
  95. package/skills/pptx/html2pptx.md +626 -0
  96. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
  97. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
  98. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
  99. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
  100. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
  101. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
  102. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
  103. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
  104. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
  105. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
  106. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
  107. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
  108. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
  109. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
  110. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
  111. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
  112. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
  113. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
  114. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
  115. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
  116. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
  117. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
  118. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
  119. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
  120. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
  121. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
  122. package/skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
  123. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
  124. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
  125. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
  126. package/skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
  127. package/skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
  128. package/skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
  129. package/skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
  130. package/skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
  131. package/skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
  132. package/skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
  133. package/skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
  134. package/skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
  135. package/skills/pptx/ooxml/scripts/pack.py +159 -0
  136. package/skills/pptx/ooxml/scripts/unpack.py +29 -0
  137. package/skills/pptx/ooxml/scripts/validate.py +69 -0
  138. package/skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
  139. package/skills/pptx/ooxml/scripts/validation/base.py +951 -0
  140. package/skills/pptx/ooxml/scripts/validation/docx.py +274 -0
  141. package/skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
  142. package/skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
  143. package/skills/pptx/ooxml.md +427 -0
  144. package/skills/pptx/scripts/html2pptx.js +995 -0
  145. package/skills/pptx/scripts/inventory.py +1020 -0
  146. package/skills/pptx/scripts/rearrange.py +231 -0
  147. package/skills/pptx/scripts/replace.py +385 -0
  148. package/skills/pptx/scripts/thumbnail.py +450 -0
  149. package/skills/production-review/SKILL.md +152 -0
  150. package/skills/receiving-code-review/SKILL.md +213 -0
  151. package/skills/remotion-best-practices/SKILL.md +62 -0
  152. package/skills/remotion-best-practices/rules/3d.md +86 -0
  153. package/skills/remotion-best-practices/rules/animations.md +27 -0
  154. package/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  155. package/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  156. package/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +103 -0
  157. package/skills/remotion-best-practices/rules/assets.md +78 -0
  158. package/skills/remotion-best-practices/rules/audio-visualization.md +198 -0
  159. package/skills/remotion-best-practices/rules/audio.md +169 -0
  160. package/skills/remotion-best-practices/rules/calculate-metadata.md +134 -0
  161. package/skills/remotion-best-practices/rules/can-decode.md +81 -0
  162. package/skills/remotion-best-practices/rules/charts.md +120 -0
  163. package/skills/remotion-best-practices/rules/compositions.md +154 -0
  164. package/skills/remotion-best-practices/rules/display-captions.md +184 -0
  165. package/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  166. package/skills/remotion-best-practices/rules/ffmpeg.md +38 -0
  167. package/skills/remotion-best-practices/rules/fonts.md +152 -0
  168. package/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  169. package/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  170. package/skills/remotion-best-practices/rules/get-video-duration.md +60 -0
  171. package/skills/remotion-best-practices/rules/gifs.md +141 -0
  172. package/skills/remotion-best-practices/rules/images.md +134 -0
  173. package/skills/remotion-best-practices/rules/import-srt-captions.md +69 -0
  174. package/skills/remotion-best-practices/rules/light-leaks.md +73 -0
  175. package/skills/remotion-best-practices/rules/lottie.md +70 -0
  176. package/skills/remotion-best-practices/rules/maps.md +412 -0
  177. package/skills/remotion-best-practices/rules/measuring-dom-nodes.md +34 -0
  178. package/skills/remotion-best-practices/rules/measuring-text.md +140 -0
  179. package/skills/remotion-best-practices/rules/motion-design.md +215 -0
  180. package/skills/remotion-best-practices/rules/parameters.md +109 -0
  181. package/skills/remotion-best-practices/rules/sequencing.md +118 -0
  182. package/skills/remotion-best-practices/rules/sfx.md +30 -0
  183. package/skills/remotion-best-practices/rules/subtitles.md +36 -0
  184. package/skills/remotion-best-practices/rules/tailwind.md +11 -0
  185. package/skills/remotion-best-practices/rules/text-animations.md +20 -0
  186. package/skills/remotion-best-practices/rules/timing.md +179 -0
  187. package/skills/remotion-best-practices/rules/transcribe-captions.md +70 -0
  188. package/skills/remotion-best-practices/rules/transitions.md +197 -0
  189. package/skills/remotion-best-practices/rules/transparent-videos.md +106 -0
  190. package/skills/remotion-best-practices/rules/trimming.md +51 -0
  191. package/skills/remotion-best-practices/rules/videos.md +171 -0
  192. package/skills/remotion-best-practices/rules/voiceover.md +99 -0
  193. package/skills/requesting-code-review/SKILL.md +105 -0
  194. package/skills/requesting-code-review/code-reviewer.md +146 -0
  195. package/skills/short-form-video/SKILL.md +168 -0
  196. package/skills/sound-design/SKILL.md +154 -0
  197. package/skills/storytelling/SKILL.md +139 -0
  198. package/skills/subagent-driven-development/SKILL.md +277 -0
  199. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  200. package/skills/subagent-driven-development/implementer-prompt.md +113 -0
  201. package/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  202. package/skills/subtitle-production/SKILL.md +244 -0
  203. package/skills/subtitle-production/reference/burn_to_video.py +222 -0
  204. package/skills/subtitle-production/reference/export_srts.py +127 -0
  205. package/skills/subtitle-production/reference/gen_srt.py +42 -0
  206. package/skills/supabase/.skillfish.json +10 -0
  207. package/skills/supabase/SKILL.md +106 -0
  208. package/skills/supabase/assets/feedback-issue-template.md +17 -0
  209. package/skills/supabase/references/skill-feedback.md +17 -0
  210. package/skills/supabase-postgres-best-practices/.skillfish.json +10 -0
  211. package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  212. package/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  213. package/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  214. package/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  215. package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  216. package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  217. package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  218. package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  219. package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  220. package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  221. package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  222. package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  223. package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  224. package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  225. package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  226. package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  227. package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  228. package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  229. package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  230. package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  231. package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  232. package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  233. package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  234. package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  235. package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  236. package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  237. package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  238. package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  239. package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  240. package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  241. package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  242. package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  243. package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  244. package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  245. package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +57 -0
  246. package/skills/supabase-quickstart/SKILL.md +400 -0
  247. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  248. package/skills/systematic-debugging/SKILL.md +296 -0
  249. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  250. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  251. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  252. package/skills/systematic-debugging/find-polluter.sh +63 -0
  253. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  254. package/skills/systematic-debugging/test-academic.md +14 -0
  255. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  256. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  257. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  258. package/skills/test-driven-development/SKILL.md +371 -0
  259. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  260. package/skills/typography-video/SKILL.md +182 -0
  261. package/skills/typography-video/reference/KineticTitleScene.tsx +345 -0
  262. package/skills/using-git-worktrees/SKILL.md +218 -0
  263. package/skills/using-superpowers/SKILL.md +115 -0
  264. package/skills/using-superpowers/references/codex-tools.md +100 -0
  265. package/skills/using-superpowers/references/gemini-tools.md +33 -0
  266. package/skills/verification-before-completion/SKILL.md +139 -0
  267. package/skills/video-editing/SKILL.md +128 -0
  268. package/skills/video-production/SKILL.md +247 -0
  269. package/skills/video-prompting-guide/SKILL.md +268 -0
  270. package/skills/writing-plans/SKILL.md +152 -0
  271. package/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  272. package/skills/writing-skills/SKILL.md +655 -0
  273. package/skills/writing-skills/anthropic-best-practices.md +1150 -0
  274. package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  275. package/skills/writing-skills/graphviz-conventions.dot +172 -0
  276. package/skills/writing-skills/persuasion-principles.md +187 -0
  277. package/skills/writing-skills/render-graphs.js +168 -0
  278. package/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  279. package/skills/xlsx/.skillfish.json +10 -0
  280. package/skills/xlsx/SKILL.md +288 -0
  281. package/skills/xlsx/recalc.py +178 -0
  282. package/skills/youtube-clipper/SKILL.md +187 -0
@@ -0,0 +1,113 @@
1
+ # Implementer Subagent Prompt Template
2
+
3
+ Use this template when dispatching an implementer subagent.
4
+
5
+ ```
6
+ Task tool (general-purpose):
7
+ description: "Implement Task N: [task name]"
8
+ prompt: |
9
+ You are implementing Task N: [task name]
10
+
11
+ ## Task Description
12
+
13
+ [FULL TEXT of task from plan - paste it here, don't make subagent read file]
14
+
15
+ ## Context
16
+
17
+ [Scene-setting: where this fits, dependencies, architectural context]
18
+
19
+ ## Before You Begin
20
+
21
+ If you have questions about:
22
+ - The requirements or acceptance criteria
23
+ - The approach or implementation strategy
24
+ - Dependencies or assumptions
25
+ - Anything unclear in the task description
26
+
27
+ **Ask them now.** Raise any concerns before starting work.
28
+
29
+ ## Your Job
30
+
31
+ Once you're clear on requirements:
32
+ 1. Implement exactly what the task specifies
33
+ 2. Write tests (following TDD if task says to)
34
+ 3. Verify implementation works
35
+ 4. Commit your work
36
+ 5. Self-review (see below)
37
+ 6. Report back
38
+
39
+ Work from: [directory]
40
+
41
+ **While you work:** If you encounter something unexpected or unclear, **ask questions**.
42
+ It's always OK to pause and clarify. Don't guess or make assumptions.
43
+
44
+ ## Code Organization
45
+
46
+ You reason best about code you can hold in context at once, and your edits are more
47
+ reliable when files are focused. Keep this in mind:
48
+ - Follow the file structure defined in the plan
49
+ - Each file should have one clear responsibility with a well-defined interface
50
+ - If a file you're creating is growing beyond the plan's intent, stop and report
51
+ it as DONE_WITH_CONCERNS — don't split files on your own without plan guidance
52
+ - If an existing file you're modifying is already large or tangled, work carefully
53
+ and note it as a concern in your report
54
+ - In existing codebases, follow established patterns. Improve code you're touching
55
+ the way a good developer would, but don't restructure things outside your task.
56
+
57
+ ## When You're in Over Your Head
58
+
59
+ It is always OK to stop and say "this is too hard for me." Bad work is worse than
60
+ no work. You will not be penalized for escalating.
61
+
62
+ **STOP and escalate when:**
63
+ - The task requires architectural decisions with multiple valid approaches
64
+ - You need to understand code beyond what was provided and can't find clarity
65
+ - You feel uncertain about whether your approach is correct
66
+ - The task involves restructuring existing code in ways the plan didn't anticipate
67
+ - You've been reading file after file trying to understand the system without progress
68
+
69
+ **How to escalate:** Report back with status BLOCKED or NEEDS_CONTEXT. Describe
70
+ specifically what you're stuck on, what you've tried, and what kind of help you need.
71
+ The controller can provide more context, re-dispatch with a more capable model,
72
+ or break the task into smaller pieces.
73
+
74
+ ## Before Reporting Back: Self-Review
75
+
76
+ Review your work with fresh eyes. Ask yourself:
77
+
78
+ **Completeness:**
79
+ - Did I fully implement everything in the spec?
80
+ - Did I miss any requirements?
81
+ - Are there edge cases I didn't handle?
82
+
83
+ **Quality:**
84
+ - Is this my best work?
85
+ - Are names clear and accurate (match what things do, not how they work)?
86
+ - Is the code clean and maintainable?
87
+
88
+ **Discipline:**
89
+ - Did I avoid overbuilding (YAGNI)?
90
+ - Did I only build what was requested?
91
+ - Did I follow existing patterns in the codebase?
92
+
93
+ **Testing:**
94
+ - Do tests actually verify behavior (not just mock behavior)?
95
+ - Did I follow TDD if required?
96
+ - Are tests comprehensive?
97
+
98
+ If you find issues during self-review, fix them now before reporting.
99
+
100
+ ## Report Format
101
+
102
+ When done, report:
103
+ - **Status:** DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT
104
+ - What you implemented (or what you attempted, if blocked)
105
+ - What you tested and test results
106
+ - Files changed
107
+ - Self-review findings (if any)
108
+ - Any issues or concerns
109
+
110
+ Use DONE_WITH_CONCERNS if you completed the work but have doubts about correctness.
111
+ Use BLOCKED if you cannot complete the task. Use NEEDS_CONTEXT if you need
112
+ information that wasn't provided. Never silently produce work you're unsure about.
113
+ ```
@@ -0,0 +1,61 @@
1
+ # Spec Compliance Reviewer Prompt Template
2
+
3
+ Use this template when dispatching a spec compliance reviewer subagent.
4
+
5
+ **Purpose:** Verify implementer built what was requested (nothing more, nothing less)
6
+
7
+ ```
8
+ Task tool (general-purpose):
9
+ description: "Review spec compliance for Task N"
10
+ prompt: |
11
+ You are reviewing whether an implementation matches its specification.
12
+
13
+ ## What Was Requested
14
+
15
+ [FULL TEXT of task requirements]
16
+
17
+ ## What Implementer Claims They Built
18
+
19
+ [From implementer's report]
20
+
21
+ ## CRITICAL: Do Not Trust the Report
22
+
23
+ The implementer finished suspiciously quickly. Their report may be incomplete,
24
+ inaccurate, or optimistic. You MUST verify everything independently.
25
+
26
+ **DO NOT:**
27
+ - Take their word for what they implemented
28
+ - Trust their claims about completeness
29
+ - Accept their interpretation of requirements
30
+
31
+ **DO:**
32
+ - Read the actual code they wrote
33
+ - Compare actual implementation to requirements line by line
34
+ - Check for missing pieces they claimed to implement
35
+ - Look for extra features they didn't mention
36
+
37
+ ## Your Job
38
+
39
+ Read the implementation code and verify:
40
+
41
+ **Missing requirements:**
42
+ - Did they implement everything that was requested?
43
+ - Are there requirements they skipped or missed?
44
+ - Did they claim something works but didn't actually implement it?
45
+
46
+ **Extra/unneeded work:**
47
+ - Did they build things that weren't requested?
48
+ - Did they over-engineer or add unnecessary features?
49
+ - Did they add "nice to haves" that weren't in spec?
50
+
51
+ **Misunderstandings:**
52
+ - Did they interpret requirements differently than intended?
53
+ - Did they solve the wrong problem?
54
+ - Did they implement the right feature but wrong way?
55
+
56
+ **Verify by reading code, not by trusting report.**
57
+
58
+ Report:
59
+ - ✅ Spec compliant (if everything matches after code inspection)
60
+ - ❌ Issues found: [list specifically what's missing or extra, with file:line references]
61
+ ```
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: subtitle-production
3
+ description: >
4
+ Subtitle and caption production: timing strategies, cue length by format (vertical vs horizontal),
5
+ ASS/SRT styling, word-level timing, RTL support for Hebrew/Arabic, burn-in with FFmpeg,
6
+ readability rules. Use when generating, styling, or burning in subtitles.
7
+ Keywords: subtitle, caption, SRT, ASS, VTT, timing, burn-in, word-level, karaoke, RTL,
8
+ Hebrew, Arabic, font size, cue, readability
9
+ ---
10
+
11
+ # Subtitle & Caption Production
12
+
13
+ ## Output Formats
14
+
15
+ | Format | Extension | Use Case |
16
+ |--------|-----------|----------|
17
+ | SRT | `.srt` | Universal — FFmpeg, players, YouTube upload |
18
+ | VTT | `.vtt` | Web-native — HTML5 video, browser playback |
19
+ | ASS | `.ass` | Advanced styling, RTL support, per-word positioning |
20
+
21
+ ## Cue Length by Format
22
+
23
+ ### Vertical Short-Form (TikTok, Reels, Shorts)
24
+ - **Max 3-4 words per cue** — narrow screen, text must be large
25
+ - **Max 20 characters per line**
26
+ - Subtitles are **mandatory** (85% watch muted)
27
+
28
+ ### Horizontal Standard (YouTube, web)
29
+ - **Max 6-8 words per cue** — wider screen
30
+ - **Max 42 characters per line** (broadcast standard)
31
+
32
+ ### General Rules
33
+ - Average viewer reads ~15 characters/second
34
+ - Minimum display time: 0.5 seconds per cue
35
+ - Maximum display time: 5 seconds per cue
36
+
37
+ ## Styling for Burn-in
38
+
39
+ ### Vertical Video (1080x1920)
40
+ ```
41
+ font: Arial (or Heebo Bold for Hebrew)
42
+ font_size: 18
43
+ bold: true
44
+ primary_color: &H00FFFFFF (white, ASS format)
45
+ outline_color: &H00000000 (black)
46
+ outline_width: 3 (thick for readability)
47
+ shadow: 2
48
+ margin_v: 50
49
+ alignment: 2 (bottom center)
50
+ ```
51
+
52
+ ### Horizontal Video (1920x1080)
53
+ ```
54
+ font: Arial
55
+ font_size: 22
56
+ bold: true
57
+ primary_color: &H00FFFFFF
58
+ outline_color: &H00000000
59
+ outline_width: 2
60
+ shadow: 1
61
+ margin_v: 40
62
+ alignment: 2
63
+ ```
64
+
65
+ ### Common Mistakes
66
+ - **Wrong color format:** `&HFFFFFF` breaks positioning. Always use full 8-char `&H00FFFFFF`
67
+ - **Font too large on vertical:** `font_size: 28` fills center of 9:16. Use 18 max
68
+ - **Too many words per cue on vertical:** 5+ words creates multi-line blocks covering the face
69
+ - **MarginV too large:** Values over 200 push text off-screen. Stay under 100
70
+
71
+ ## Timing Best Practices
72
+
73
+ - Cue start must match word onset (not before the speaker starts)
74
+ - Cue end should extend ~200ms past the last word for comfortable reading
75
+ - Never let a cue linger into the next speaker's turn
76
+ - Don't split a thought across two cues if it fits in one
77
+
78
+ ## FFmpeg Burn-in Commands
79
+
80
+ ### Simple SRT
81
+ ```bash
82
+ ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='FontSize=22,Bold=1,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2'" -c:v libx264 -crf 18 -c:a copy output.mp4
83
+ ```
84
+
85
+ ### ASS with Custom Styling
86
+ ```bash
87
+ ffmpeg -i input.mp4 -vf "ass=styled_subs.ass" -c:v libx264 -crf 18 -c:a copy output.mp4
88
+ ```
89
+
90
+ ### Windows Path Escaping
91
+ ```bash
92
+ # Escape colons in subtitle filter paths on Windows
93
+ ffmpeg -i input.mp4 -vf "subtitles=C\\:/Users/path/subs.srt" output.mp4
94
+ ```
95
+
96
+ ## RTL (Hebrew/Arabic) — Proven Patterns
97
+
98
+ RTL subtitles are tricky. These patterns are battle-tested in Kolbo's video production pipeline.
99
+
100
+ **Reference implementations (bundled in `./reference/`):**
101
+ - `reference/burn_to_video.py` — Full burn pipeline with RTL progress bar (`geq` filter), chapter compositing, NVENC encoding
102
+ - `reference/export_srts.py` — SRT generation with chapter divider offset accounting
103
+ - `reference/gen_srt.py` — Word-level SRT from transcript JSON (8-word grouping, 1.5s gap detection)
104
+
105
+ ### Option 1: SRT with Simple Burn-in (easiest, works for most cases)
106
+
107
+ Plain SRT files work for Hebrew/Arabic if you use the right font and let FFmpeg's libass handle bidi:
108
+ ```bash
109
+ ffmpeg -i input.mp4 -vf "subtitles=subs.srt:force_style='FontName=Heebo,FontSize=22,Bold=1,Encoding=177,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,Outline=2'" -c:v libx264 -crf 18 -c:a copy output.mp4
110
+ ```
111
+ - **Font**: Heebo Bold for Hebrew, Cairo Bold for Arabic
112
+ - **Encoding=177** (Hebrew) or **Encoding=178** (Arabic) in ASS style
113
+
114
+ ### Option 2: ASS with Per-Word Positioning (for karaoke/highlighting)
115
+
116
+ When you need per-word color highlighting with RTL text, you MUST use separate ASS Dialogue lines per word:
117
+
118
+ - Each word gets its own `Dialogue` line with explicit `\pos(x,y)`
119
+ - Use PIL to measure word widths: apply `~0.74` scale factor (PIL→libass calibration)
120
+ - Use `Alignment=7` (top-left anchor) so `\pos` sets exact top-left of each word
121
+ - Two named ASS styles (e.g., White + Yellow) for highlight vs inactive — NO inline `\c` tags
122
+
123
+ **CRITICAL:** Any inline ASS tag (`\c`, `\K`, `\1c`) between RTL words **breaks Unicode bidi in libass** — words render LTR instead of RTL. Always use separate Dialogue lines per word.
124
+
125
+ ### Option 3: Remotion Captions (best for karaoke, full RTL control)
126
+
127
+ Remotion gives you full CSS control over RTL text. Proven pattern from Kolbo's video pipeline:
128
+
129
+ ```tsx
130
+ // Detect language and set direction
131
+ const isHebrew = language === "he" || language === "iw";
132
+ const fontFamily = isHebrew ? "'Heebo', sans-serif" : "'Poppins', sans-serif";
133
+
134
+ // Root container
135
+ <div style={{
136
+ direction: isHebrew ? "rtl" : "ltr",
137
+ fontFamily,
138
+ textTransform: isHebrew ? "none" : "uppercase",
139
+ letterSpacing: isHebrew ? 0 : -2,
140
+ }}>
141
+ {words.map((word, i) => {
142
+ const progress = interpolate(frame, [word.startFrame, word.endFrame], [0, 1], {
143
+ extrapolateLeft: "clamp", extrapolateRight: "clamp"
144
+ });
145
+ return (
146
+ <span key={i} style={{
147
+ color: progress > 0 ? accentColor : "#ffffff",
148
+ transition: "none", // No CSS transitions in Remotion!
149
+ }}>
150
+ {word.text}{" "}
151
+ </span>
152
+ );
153
+ })}
154
+ </div>
155
+ ```
156
+
157
+ **RTL-specific gotchas in Remotion (proven fixes):**
158
+ - Flip `paddingLeft` ↔ `paddingRight` when Hebrew
159
+ - Flip `transformOrigin`: `"top left"` → `"top right"` for Hebrew
160
+ - Gradient directions: `270deg` (RTL) vs `90deg` (LTR)
161
+ - Position logic: for Hebrew, "left" position actually means right side of screen
162
+ - `letterSpacing: 0` for Hebrew (negative kerning looks wrong with Hebrew fonts)
163
+ - `textTransform: "none"` for Hebrew (uppercase has no meaning in Hebrew)
164
+
165
+ ### RTL Progress Bar (FFmpeg)
166
+
167
+ Animated progress bar that fills right-to-left for Hebrew, using `geq` filter:
168
+
169
+ ```python
170
+ duration = 5.0 # seconds
171
+
172
+ # Hebrew (RTL): bar fills RIGHT → LEFT
173
+ bar_cond = f"gt(X,W*(1-T/{duration}))"
174
+
175
+ # English (LTR): bar fills LEFT → RIGHT
176
+ bar_cond = f"lt(X,W*T/{duration})"
177
+
178
+ # Apply as geq filter on bottom 4px strip (performant: 5760px/frame not 2M)
179
+ bar_geq = (
180
+ f"geq="
181
+ f"r='if({bar_cond},59,r(X,Y))':" # #3b82f6 blue
182
+ f"g='if({bar_cond},130,g(X,Y))':"
183
+ f"b='if({bar_cond},246,b(X,Y))'"
184
+ )
185
+ ```
186
+ Uses capital `T` for timestamp in `geq` — avoids conflict with drawbox's `t=fill`.
187
+
188
+ ### Language Detection
189
+
190
+ ```python
191
+ _lang_map = {"heb": "he", "eng": "en", "iw": "he", "ara": "ar", "rus": "ru"}
192
+ language_code = _lang_map.get(raw_lang, raw_lang)
193
+ is_rtl = language_code in ("he", "ar", "fa", "ur")
194
+ ```
195
+
196
+ ## Word-Level Timing (Karaoke / Motion Graphics)
197
+
198
+ For word-by-word highlighting:
199
+ 1. `transcribe_audio` via Kolbo MCP → get `word_by_word_srt_url` (ElevenLabs Scribe word-level timestamps)
200
+ 2. Each word has precise start/end timing
201
+ 3. Group words into display cues (8+ words or >1.5s gap triggers new line)
202
+ 4. **For Remotion**: use word timings directly as props — CSS `direction: rtl` handles Hebrew ordering automatically
203
+ 5. **For FFmpeg**: use ASS with per-word Dialogue lines (see Option 2 above)
204
+
205
+ ## Quality Checklist
206
+
207
+ - [ ] Every spoken word appears in a subtitle cue
208
+ - [ ] No cue exceeds the character limit for target format
209
+ - [ ] Subtitles in bottom 20% of frame — never covering the face
210
+ - [ ] Text readable on mobile at native resolution
211
+ - [ ] Timing matches speech — no early or late cues
212
+ - [ ] Cues don't overlap each other
213
+ - [ ] Outline/shadow provides sufficient contrast against all backgrounds
214
+
215
+ ---
216
+
217
+ ## Kolbo MCP Integration
218
+
219
+ | Task | Kolbo MCP Tool | Notes |
220
+ |------|---------------|-------|
221
+ | Transcribe → SRT | `transcribe_audio` | Returns `srt_url` (grouped) + `word_by_word_srt_url` |
222
+ | Word-level captions | `transcribe_audio` | `word_by_word_srt_url` for karaoke/Remotion |
223
+ | Burn-in to video | FFmpeg | Use SRT from transcription |
224
+ | Visual analysis | `chat_send_message` + Gemini | Analyze where speaker's face is for caption placement |
225
+
226
+ **Subtitle production workflow:**
227
+ 1. `transcribe_audio` → get `srt_url` and `word_by_word_srt_url`
228
+ 2. Download the SRT file
229
+ 3. Adjust styling for target format (vertical vs horizontal)
230
+ 4. Burn in with FFmpeg using the commands above
231
+ 5. For Remotion: use `word_by_word_srt_url` with CaptionOverlay component
232
+
233
+ **For Remotion captions (preferred over FFmpeg burn-in):**
234
+ - Load the word-by-word SRT
235
+ - Use Remotion's CaptionOverlay for animated word highlighting
236
+ - See `remotion-best-practices` skill for details
237
+
238
+ ---
239
+
240
+ ## Local / Free Option
241
+
242
+ > **IMPORTANT:** Always use Kolbo's `transcribe_audio` by default — it returns both grouped SRT and word-by-word SRT with no setup. FFmpeg burn-in is safe to use directly. Only suggest local transcription if the user explicitly asks for offline/free. Confirm before installing.
243
+
244
+ **Offline transcription:** `faster-whisper` runs on CPU, no GPU needed (`pip install faster-whisper`). Supports word-level timestamps for subtitle generation.
@@ -0,0 +1,222 @@
1
+ """
2
+ Full burn pipeline:
3
+ For each chapter:
4
+ 1. Render SectionDivider card (4s) + mux with SFX
5
+ 2. Cut raw footage segment
6
+ 3. Render ChapterProgress banner (ProRes alpha, exact chapter duration)
7
+ 4. Composite banner onto footage
8
+ Concatenate everything → final burned MP4
9
+ """
10
+ import json, os, sys, subprocess
11
+
12
+ _root = r"G:\Projects\Master Agent"
13
+ for _p in [os.path.join(_root, 'core'), os.path.join(_root, 'agents', 'content-creation')]:
14
+ if _p not in sys.path:
15
+ sys.path.insert(0, _p)
16
+
17
+ import config
18
+ sys.path.insert(0, os.path.join(_root, 'agents', 'content-creation', 'modules'))
19
+ from remotion_render import render as remotion_render, render_still
20
+
21
+ # ── Config ───────────────────────────────────────────────────────────────────
22
+ SOURCE_VIDEO = r"C:\Users\Zohar\Downloads\מכללת ספיר H.264.mp4"
23
+ CHAPTERS_JSON = r"G:\Projects\Master Agent\ytp_jobs\sapir_test\chapters.json"
24
+ SFX_FILE = r"G:\Projects\Master Agent\ytp_jobs\sapir_test\sfx\v1_cinematic_eq.mp3"
25
+ WORK_DIR = r"G:\Projects\Master Agent\ytp_jobs\sapir_test\burn"
26
+ FINAL_OUTPUT = r"G:\Projects\Youtube Editings\renders\sapir_edited_final.mp4"
27
+ VIDEO_DURATION = 1041.1
28
+ FPS = 30
29
+ FFMPEG = "ffmpeg"
30
+ NVENC = True # -bf 0 -rc-lookahead 0 eliminates encoder delay
31
+
32
+ os.makedirs(WORK_DIR, exist_ok=True)
33
+
34
+ # ── Load chapters ─────────────────────────────────────────────────────────────
35
+ with open(CHAPTERS_JSON, encoding='utf-8') as f:
36
+ chapters = json.load(f)
37
+
38
+ for i, ch in enumerate(chapters):
39
+ ch['end_time'] = chapters[i + 1]['start_time'] if i + 1 < len(chapters) else VIDEO_DURATION
40
+ ch['duration'] = ch['end_time'] - ch['start_time']
41
+
42
+ # ── Helpers ───────────────────────────────────────────────────────────────────
43
+ def _venc(cq=19):
44
+ """Return video encoder args — NVENC (GPU, no delay) or libx264 fallback."""
45
+ if NVENC:
46
+ # -bf 0 -rc-lookahead 0: zero encoder delay → no A/V drift with -c:a copy
47
+ return ["-c:v", "h264_nvenc", "-preset", "p4", "-cq", str(cq),
48
+ "-bf", "0", "-rc-lookahead", "0"]
49
+ return ["-c:v", "libx264", "-preset", "fast", "-crf", str(cq)]
50
+
51
+
52
+ def run(cmd, desc=""):
53
+ print(f"[ffmpeg] {desc}", flush=True)
54
+ r = subprocess.run(cmd, capture_output=True)
55
+ if r.returncode != 0:
56
+ raise RuntimeError(f"FAILED {desc}:\n{r.stderr.decode('utf-8','replace')[-600:]}")
57
+
58
+
59
+ def cut_footage(start, end, output):
60
+ if os.path.exists(output):
61
+ print(f"[skip] {os.path.basename(output)} exists")
62
+ return
63
+ duration = end - start
64
+ # Dual-seek: fast input seek to 5s before target, then frame-accurate output seek
65
+ # This gives exact A/V sync without decoding the full file from the beginning.
66
+ pre = min(5.0, start)
67
+ run([FFMPEG, "-y",
68
+ "-ss", str(start - pre), "-i", SOURCE_VIDEO,
69
+ "-ss", str(pre), "-t", str(duration),
70
+ *_venc(),
71
+ "-c:a", "copy",
72
+ "-movflags", "+faststart", output],
73
+ f"cut footage {start:.1f}s + {duration:.1f}s")
74
+
75
+
76
+ def mux_sfx(video, sfx, output, video_duration=4.0):
77
+ if os.path.exists(output):
78
+ print(f"[skip] {os.path.basename(output)} exists")
79
+ return
80
+ # Resample SFX to 48kHz to match source video, pad, then mux
81
+ run([FFMPEG, "-y",
82
+ "-i", video, "-i", sfx,
83
+ "-filter_complex", f"[1:a]aresample=48000,apad=pad_dur={video_duration}[a]",
84
+ "-map", "0:v", "-map", "[a]",
85
+ *_venc(cq=12), "-c:a", "aac", "-b:a", "192k", "-ar", "48000",
86
+ "-t", str(video_duration), output],
87
+ f"mux SFX into {os.path.basename(video)}")
88
+
89
+
90
+ def composite_with_banner(footage, banner_png, output, duration_sec, is_hebrew=True):
91
+ """Composite static banner PNG + animated progress bar.
92
+ Uses crop+geq+overlay on just the bottom 4 rows — fast (5760 px/frame not 2M).
93
+ geq uses capital T for timestamp, avoiding conflict with drawbox's t=fill.
94
+ """
95
+ if os.path.exists(output):
96
+ print(f"[skip] {os.path.basename(output)} exists")
97
+ return
98
+ d = float(duration_sec)
99
+ # geq on a 4px strip: T=timestamp(secs), W=strip width, X=pixel x-coord
100
+ # Hebrew RTL: fill right side first → X > W*(1 - T/D)
101
+ # LTR: fill left side first → X < W*T/D
102
+ if is_hebrew:
103
+ bar_cond = f"gt(X,W*(1-T/{d}))"
104
+ else:
105
+ bar_cond = f"lt(X,W*T/{d})"
106
+
107
+ bar_geq = (
108
+ f"geq="
109
+ f"r='if({bar_cond},59,r(X,Y))':"
110
+ f"g='if({bar_cond},130,g(X,Y))':"
111
+ f"b='if({bar_cond},246,b(X,Y))'"
112
+ )
113
+
114
+ # overlay=0:0 composites banner PNG onto footage
115
+ # split → crop bottom 4px → geq colors the bar → overlay back at bottom
116
+ fc = (
117
+ f"[0:v][1:v]overlay=0:0:format=auto,format=yuv420p[base];"
118
+ f"[base]split[main][bot_src];"
119
+ f"[bot_src]crop=iw:4:0:ih-4[strip];"
120
+ f"[strip]{bar_geq}[bar];"
121
+ f"[main][bar]overlay=0:H-4[v]"
122
+ )
123
+
124
+ run([FFMPEG, "-y",
125
+ "-i", footage,
126
+ "-i", banner_png,
127
+ "-filter_complex", fc,
128
+ "-map", "[v]", "-map", "0:a",
129
+ *_venc(),
130
+ "-c:a", "copy",
131
+ "-movflags", "+faststart", output],
132
+ f"composite+bar {os.path.basename(output)}")
133
+
134
+
135
+ # ── Main loop ─────────────────────────────────────────────────────────────────
136
+ parts = []
137
+ total = len(chapters)
138
+
139
+ for ch in chapters:
140
+ n = ch['chapter_number']
141
+ dur = ch['duration']
142
+ dur_frames = int(round(dur * FPS))
143
+
144
+ print(f"\n{'='*60}")
145
+ title_safe = ch['title'].encode('ascii','replace').decode('ascii')
146
+ print(f"Chapter {n}/{total}: {title_safe} ({dur:.1f}s = {dur_frames} frames)")
147
+ print('='*60)
148
+
149
+ # ── 1. SectionDivider render ──────────────────────────────────────────
150
+ divider_raw = os.path.join(WORK_DIR, f"ch{n:02d}_divider_raw.mp4")
151
+ divider_sfx = os.path.join(WORK_DIR, f"ch{n:02d}_divider.mp4")
152
+
153
+ if not os.path.exists(divider_raw):
154
+ print(f"[render] SectionDivider ch{n}...")
155
+ remotion_render(
156
+ composition_id="SectionDivider-16x9",
157
+ props={
158
+ "chapterNumber": n,
159
+ "title": ch['title'],
160
+ "subtitle": ch.get('subtitle', ''),
161
+ "language": "he",
162
+ "durationInFrames": 120,
163
+ "fps": FPS,
164
+ },
165
+ output_path=divider_raw,
166
+ job_dir=WORK_DIR,
167
+ alpha=False,
168
+ concurrency=16,
169
+ )
170
+ else:
171
+ print(f"[skip] divider ch{n} exists")
172
+
173
+ mux_sfx(divider_raw, SFX_FILE, divider_sfx, video_duration=4.0)
174
+ parts.append(divider_sfx)
175
+
176
+ # ── 2. Cut raw footage ────────────────────────────────────────────────
177
+ raw_clip = os.path.join(WORK_DIR, f"ch{n:02d}_raw.mp4")
178
+ cut_footage(ch['start_time'], ch['end_time'], raw_clip)
179
+
180
+ # ── 3. ChapterBanner still PNG render (single frame, fast) ───────────
181
+ banner_png = os.path.join(WORK_DIR, f"ch{n:02d}_banner.png")
182
+
183
+ if not os.path.exists(banner_png):
184
+ print(f"[still] ChapterBanner ch{n}...")
185
+ render_still(
186
+ composition_id="ChapterBanner-16x9",
187
+ props={
188
+ "chapterNumber": n,
189
+ "title": ch['title'],
190
+ "language": "he",
191
+ },
192
+ output_path=banner_png,
193
+ job_dir=WORK_DIR,
194
+ )
195
+ else:
196
+ print(f"[skip] banner ch{n} exists")
197
+
198
+ # ── 4. Composite banner + progress bar onto footage ───────────────────
199
+ composited = os.path.join(WORK_DIR, f"ch{n:02d}_composited.mp4")
200
+ composite_with_banner(raw_clip, banner_png, composited, dur, is_hebrew=True)
201
+ parts.append(composited)
202
+
203
+ # ── Concatenate all parts ─────────────────────────────────────────────────────
204
+ print(f"\n{'='*60}")
205
+ print(f"Concatenating {len(parts)} clips...")
206
+
207
+ concat_list = os.path.join(WORK_DIR, "concat.txt")
208
+ with open(concat_list, 'w', encoding='utf-8') as f:
209
+ for p in parts:
210
+ f.write(f"file '{p}'\n")
211
+
212
+ run([FFMPEG, "-y",
213
+ "-f", "concat", "-safe", "0",
214
+ "-i", concat_list,
215
+ *_venc(),
216
+ "-c:a", "copy",
217
+ "-movflags", "+faststart", FINAL_OUTPUT],
218
+ f"final concat -> {FINAL_OUTPUT}")
219
+
220
+ size_mb = os.path.getsize(FINAL_OUTPUT) / 1024 / 1024
221
+ print(f"\nDone! Final output: {FINAL_OUTPUT}")
222
+ print(f"Size: {size_mb:.0f} MB")