jfl 0.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +313 -0
  3. package/clawdbot-skill/README.md +328 -0
  4. package/clawdbot-skill/SKILL.md +362 -0
  5. package/clawdbot-skill/index.ts +486 -0
  6. package/clawdbot-skill/package.json +28 -0
  7. package/clawdbot-skill/skill.json +28 -0
  8. package/dist/commands/agents.d.ts +5 -0
  9. package/dist/commands/agents.d.ts.map +1 -0
  10. package/dist/commands/agents.js +399 -0
  11. package/dist/commands/agents.js.map +1 -0
  12. package/dist/commands/context-hub.d.ts +12 -0
  13. package/dist/commands/context-hub.d.ts.map +1 -0
  14. package/dist/commands/context-hub.js +642 -0
  15. package/dist/commands/context-hub.js.map +1 -0
  16. package/dist/commands/deploy.d.ts +5 -0
  17. package/dist/commands/deploy.d.ts.map +1 -0
  18. package/dist/commands/deploy.js +370 -0
  19. package/dist/commands/deploy.js.map +1 -0
  20. package/dist/commands/feedback.d.ts +2 -0
  21. package/dist/commands/feedback.d.ts.map +1 -0
  22. package/dist/commands/feedback.js +178 -0
  23. package/dist/commands/feedback.js.map +1 -0
  24. package/dist/commands/hud.d.ts +4 -0
  25. package/dist/commands/hud.d.ts.map +1 -0
  26. package/dist/commands/hud.js +262 -0
  27. package/dist/commands/hud.js.map +1 -0
  28. package/dist/commands/init.d.ts +4 -0
  29. package/dist/commands/init.d.ts.map +1 -0
  30. package/dist/commands/init.js +553 -0
  31. package/dist/commands/init.js.map +1 -0
  32. package/dist/commands/login.d.ts +23 -0
  33. package/dist/commands/login.d.ts.map +1 -0
  34. package/dist/commands/login.js +818 -0
  35. package/dist/commands/login.js.map +1 -0
  36. package/dist/commands/ralph.d.ts +9 -0
  37. package/dist/commands/ralph.d.ts.map +1 -0
  38. package/dist/commands/ralph.js +67 -0
  39. package/dist/commands/ralph.js.map +1 -0
  40. package/dist/commands/repair.d.ts +7 -0
  41. package/dist/commands/repair.d.ts.map +1 -0
  42. package/dist/commands/repair.js +283 -0
  43. package/dist/commands/repair.js.map +1 -0
  44. package/dist/commands/session-mgmt.d.ts +33 -0
  45. package/dist/commands/session-mgmt.d.ts.map +1 -0
  46. package/dist/commands/session-mgmt.js +404 -0
  47. package/dist/commands/session-mgmt.js.map +1 -0
  48. package/dist/commands/session.d.ts +2 -0
  49. package/dist/commands/session.d.ts.map +1 -0
  50. package/dist/commands/session.js +639 -0
  51. package/dist/commands/session.js.map +1 -0
  52. package/dist/commands/skills.d.ts +31 -0
  53. package/dist/commands/skills.d.ts.map +1 -0
  54. package/dist/commands/skills.js +314 -0
  55. package/dist/commands/skills.js.map +1 -0
  56. package/dist/commands/status.d.ts +2 -0
  57. package/dist/commands/status.d.ts.map +1 -0
  58. package/dist/commands/status.js +127 -0
  59. package/dist/commands/status.js.map +1 -0
  60. package/dist/commands/synopsis.d.ts +10 -0
  61. package/dist/commands/synopsis.d.ts.map +1 -0
  62. package/dist/commands/synopsis.js +277 -0
  63. package/dist/commands/synopsis.js.map +1 -0
  64. package/dist/commands/update.d.ts +10 -0
  65. package/dist/commands/update.d.ts.map +1 -0
  66. package/dist/commands/update.js +165 -0
  67. package/dist/commands/update.js.map +1 -0
  68. package/dist/commands/voice.d.ts +410 -0
  69. package/dist/commands/voice.d.ts.map +1 -0
  70. package/dist/commands/voice.js +4763 -0
  71. package/dist/commands/voice.js.map +1 -0
  72. package/dist/index.d.ts +9 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +512 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/mcp/context-hub-mcp.d.ts +11 -0
  77. package/dist/mcp/context-hub-mcp.d.ts.map +1 -0
  78. package/dist/mcp/context-hub-mcp.js +548 -0
  79. package/dist/mcp/context-hub-mcp.js.map +1 -0
  80. package/dist/telegram/voice.d.ts +146 -0
  81. package/dist/telegram/voice.d.ts.map +1 -0
  82. package/dist/telegram/voice.js +351 -0
  83. package/dist/telegram/voice.js.map +1 -0
  84. package/dist/types/skills.d.ts +44 -0
  85. package/dist/types/skills.d.ts.map +1 -0
  86. package/dist/types/skills.js +5 -0
  87. package/dist/types/skills.js.map +1 -0
  88. package/dist/ui/banner.d.ts +18 -0
  89. package/dist/ui/banner.d.ts.map +1 -0
  90. package/dist/ui/banner.js +323 -0
  91. package/dist/ui/banner.js.map +1 -0
  92. package/dist/ui/index.d.ts +8 -0
  93. package/dist/ui/index.d.ts.map +1 -0
  94. package/dist/ui/index.js +8 -0
  95. package/dist/ui/index.js.map +1 -0
  96. package/dist/ui/prompts.d.ts +52 -0
  97. package/dist/ui/prompts.d.ts.map +1 -0
  98. package/dist/ui/prompts.js +72 -0
  99. package/dist/ui/prompts.js.map +1 -0
  100. package/dist/ui/theme.d.ts +82 -0
  101. package/dist/ui/theme.d.ts.map +1 -0
  102. package/dist/ui/theme.js +142 -0
  103. package/dist/ui/theme.js.map +1 -0
  104. package/dist/utils/auth-guard.d.ts +66 -0
  105. package/dist/utils/auth-guard.d.ts.map +1 -0
  106. package/dist/utils/auth-guard.js +348 -0
  107. package/dist/utils/auth-guard.js.map +1 -0
  108. package/dist/utils/ensure-project.d.ts +11 -0
  109. package/dist/utils/ensure-project.d.ts.map +1 -0
  110. package/dist/utils/ensure-project.js +70 -0
  111. package/dist/utils/ensure-project.js.map +1 -0
  112. package/dist/utils/git.d.ts +73 -0
  113. package/dist/utils/git.d.ts.map +1 -0
  114. package/dist/utils/git.js +219 -0
  115. package/dist/utils/git.js.map +1 -0
  116. package/dist/utils/github-auth.d.ts +54 -0
  117. package/dist/utils/github-auth.d.ts.map +1 -0
  118. package/dist/utils/github-auth.js +375 -0
  119. package/dist/utils/github-auth.js.map +1 -0
  120. package/dist/utils/github-repo.d.ts +30 -0
  121. package/dist/utils/github-repo.d.ts.map +1 -0
  122. package/dist/utils/github-repo.js +219 -0
  123. package/dist/utils/github-repo.js.map +1 -0
  124. package/dist/utils/platform-auth.d.ts +81 -0
  125. package/dist/utils/platform-auth.d.ts.map +1 -0
  126. package/dist/utils/platform-auth.js +191 -0
  127. package/dist/utils/platform-auth.js.map +1 -0
  128. package/dist/utils/project-config.d.ts +43 -0
  129. package/dist/utils/project-config.d.ts.map +1 -0
  130. package/dist/utils/project-config.js +97 -0
  131. package/dist/utils/project-config.js.map +1 -0
  132. package/dist/utils/skill-registry.d.ts +49 -0
  133. package/dist/utils/skill-registry.d.ts.map +1 -0
  134. package/dist/utils/skill-registry.js +192 -0
  135. package/dist/utils/skill-registry.js.map +1 -0
  136. package/dist/utils/wallet.d.ts +62 -0
  137. package/dist/utils/wallet.d.ts.map +1 -0
  138. package/dist/utils/wallet.js +252 -0
  139. package/dist/utils/wallet.js.map +1 -0
  140. package/dist/utils/x402-client.d.ts +86 -0
  141. package/dist/utils/x402-client.d.ts.map +1 -0
  142. package/dist/utils/x402-client.js +265 -0
  143. package/dist/utils/x402-client.js.map +1 -0
  144. package/package.json +76 -0
  145. package/scripts/postinstall.js +116 -0
  146. package/scripts/test-onboarding.sh +121 -0
  147. package/scripts/voice-start.sh +128 -0
  148. package/scripts/voice-stop.sh +33 -0
  149. package/template/.claude/settings.json +92 -0
  150. package/template/.claude/skills/agent-browser/SKILL.md +116 -0
  151. package/template/.claude/skills/brand-architect/SKILL.md +240 -0
  152. package/template/.claude/skills/brand-architect/config.yaml +137 -0
  153. package/template/.claude/skills/campaign-hud/config.yaml +112 -0
  154. package/template/.claude/skills/content-creator/SKILL.md +294 -0
  155. package/template/.claude/skills/debug/MULTI_AGENT.md +360 -0
  156. package/template/.claude/skills/debug/SKILL.md +549 -0
  157. package/template/.claude/skills/fly-deploy/SKILL.md +676 -0
  158. package/template/.claude/skills/founder-video/SKILL.md +467 -0
  159. package/template/.claude/skills/hud/SKILL.md +157 -0
  160. package/template/.claude/skills/ralph-tui/SKILL.md +210 -0
  161. package/template/.claude/skills/react-best-practices/AGENTS.md +2249 -0
  162. package/template/.claude/skills/react-best-practices/README.md +123 -0
  163. package/template/.claude/skills/react-best-practices/SKILL.md +125 -0
  164. package/template/.claude/skills/react-best-practices/metadata.json +15 -0
  165. package/template/.claude/skills/react-best-practices/rules/_sections.md +46 -0
  166. package/template/.claude/skills/react-best-practices/rules/_template.md +28 -0
  167. package/template/.claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  168. package/template/.claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
  169. package/template/.claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
  170. package/template/.claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
  171. package/template/.claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
  172. package/template/.claude/skills/react-best-practices/rules/async-parallel.md +28 -0
  173. package/template/.claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  174. package/template/.claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  175. package/template/.claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  176. package/template/.claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  177. package/template/.claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  178. package/template/.claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
  179. package/template/.claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  180. package/template/.claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  181. package/template/.claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
  182. package/template/.claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  183. package/template/.claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  184. package/template/.claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  185. package/template/.claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  186. package/template/.claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
  187. package/template/.claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  188. package/template/.claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
  189. package/template/.claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  190. package/template/.claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  191. package/template/.claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  192. package/template/.claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  193. package/template/.claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
  194. package/template/.claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  195. package/template/.claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  196. package/template/.claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  197. package/template/.claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  198. package/template/.claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  199. package/template/.claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  200. package/template/.claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  201. package/template/.claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  202. package/template/.claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  203. package/template/.claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  204. package/template/.claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  205. package/template/.claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
  206. package/template/.claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  207. package/template/.claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  208. package/template/.claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  209. package/template/.claude/skills/react-best-practices/rules/server-cache-react.md +26 -0
  210. package/template/.claude/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
  211. package/template/.claude/skills/react-best-practices/rules/server-serialization.md +38 -0
  212. package/template/.claude/skills/remotion-best-practices/SKILL.md +43 -0
  213. package/template/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
  214. package/template/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
  215. package/template/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  216. package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  217. package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  218. package/template/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
  219. package/template/.claude/skills/remotion-best-practices/rules/audio.md +172 -0
  220. package/template/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  221. package/template/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
  222. package/template/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
  223. package/template/.claude/skills/remotion-best-practices/rules/compositions.md +146 -0
  224. package/template/.claude/skills/remotion-best-practices/rules/display-captions.md +126 -0
  225. package/template/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  226. package/template/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
  227. package/template/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  228. package/template/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  229. package/template/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  230. package/template/.claude/skills/remotion-best-practices/rules/gifs.md +138 -0
  231. package/template/.claude/skills/remotion-best-practices/rules/images.md +130 -0
  232. package/template/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
  233. package/template/.claude/skills/remotion-best-practices/rules/lottie.md +68 -0
  234. package/template/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
  235. package/template/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  236. package/template/.claude/skills/remotion-best-practices/rules/sequencing.md +106 -0
  237. package/template/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
  238. package/template/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
  239. package/template/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
  240. package/template/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
  241. package/template/.claude/skills/remotion-best-practices/rules/transitions.md +122 -0
  242. package/template/.claude/skills/remotion-best-practices/rules/trimming.md +53 -0
  243. package/template/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
  244. package/template/.claude/skills/search/SKILL.md +220 -0
  245. package/template/.claude/skills/spec/SKILL.md +377 -0
  246. package/template/.claude/skills/startup/SKILL.md +310 -0
  247. package/template/.claude/skills/web-architect/SKILL.md +309 -0
  248. package/template/.claude/skills/x-algorithm/SKILL.md +305 -0
  249. package/template/.jfl/config.json +8 -0
  250. package/template/.mcp.json +11 -0
  251. package/template/CLAUDE.md +960 -0
  252. package/template/content/.gitkeep +0 -0
  253. package/template/context-hub +3 -0
  254. package/template/knowledge/BRAND_BRIEF.md +124 -0
  255. package/template/knowledge/BRAND_DECISIONS.md +168 -0
  256. package/template/knowledge/NARRATIVE.md +114 -0
  257. package/template/knowledge/ROADMAP.md +128 -0
  258. package/template/knowledge/THESIS.md +108 -0
  259. package/template/knowledge/VISION.md +74 -0
  260. package/template/knowledge/VOICE_AND_TONE.md +146 -0
  261. package/template/previews/.gitkeep +0 -0
  262. package/template/scripts/session/auto-commit.sh +245 -0
  263. package/template/scripts/session/auto-merge.sh +325 -0
  264. package/template/scripts/session/jfl-doctor.sh +587 -0
  265. package/template/scripts/session/session-end.sh +194 -0
  266. package/template/scripts/session/session-init.sh +163 -0
  267. package/template/scripts/session/session-sync.sh +167 -0
  268. package/template/scripts/session/test-context-preservation.sh +160 -0
  269. package/template/skills/agent-browser/SKILL.md +116 -0
  270. package/template/skills/brand-architect/SKILL.md +240 -0
  271. package/template/skills/brand-architect/config.yaml +137 -0
  272. package/template/skills/campaign-hud/config.yaml +112 -0
  273. package/template/skills/content-creator/SKILL.md +294 -0
  274. package/template/skills/debug/MULTI_AGENT.md +360 -0
  275. package/template/skills/debug/SKILL.md +549 -0
  276. package/template/skills/fly-deploy/SKILL.md +676 -0
  277. package/template/skills/founder-video/SKILL.md +467 -0
  278. package/template/skills/hud/SKILL.md +204 -0
  279. package/template/skills/ralph-tui/SKILL.md +210 -0
  280. package/template/skills/react-best-practices/AGENTS.md +2249 -0
  281. package/template/skills/react-best-practices/README.md +123 -0
  282. package/template/skills/react-best-practices/SKILL.md +125 -0
  283. package/template/skills/react-best-practices/metadata.json +15 -0
  284. package/template/skills/react-best-practices/rules/_sections.md +46 -0
  285. package/template/skills/react-best-practices/rules/_template.md +28 -0
  286. package/template/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  287. package/template/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
  288. package/template/skills/react-best-practices/rules/async-api-routes.md +38 -0
  289. package/template/skills/react-best-practices/rules/async-defer-await.md +80 -0
  290. package/template/skills/react-best-practices/rules/async-dependencies.md +36 -0
  291. package/template/skills/react-best-practices/rules/async-parallel.md +28 -0
  292. package/template/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  293. package/template/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  294. package/template/skills/react-best-practices/rules/bundle-conditional.md +31 -0
  295. package/template/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
  296. package/template/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
  297. package/template/skills/react-best-practices/rules/bundle-preload.md +50 -0
  298. package/template/skills/react-best-practices/rules/client-event-listeners.md +74 -0
  299. package/template/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  300. package/template/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
  301. package/template/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  302. package/template/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  303. package/template/skills/react-best-practices/rules/js-cache-storage.md +70 -0
  304. package/template/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  305. package/template/skills/react-best-practices/rules/js-early-exit.md +50 -0
  306. package/template/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  307. package/template/skills/react-best-practices/rules/js-index-maps.md +37 -0
  308. package/template/skills/react-best-practices/rules/js-length-check-first.md +49 -0
  309. package/template/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  310. package/template/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  311. package/template/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  312. package/template/skills/react-best-practices/rules/rendering-activity.md +26 -0
  313. package/template/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
  314. package/template/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
  315. package/template/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  316. package/template/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
  317. package/template/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
  318. package/template/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  319. package/template/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  320. package/template/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  321. package/template/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  322. package/template/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
  323. package/template/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
  324. package/template/skills/react-best-practices/rules/rerender-memo.md +44 -0
  325. package/template/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  326. package/template/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  327. package/template/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  328. package/template/skills/react-best-practices/rules/server-cache-react.md +26 -0
  329. package/template/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
  330. package/template/skills/react-best-practices/rules/server-serialization.md +38 -0
  331. package/template/skills/remotion-best-practices/SKILL.md +43 -0
  332. package/template/skills/remotion-best-practices/rules/3d.md +86 -0
  333. package/template/skills/remotion-best-practices/rules/animations.md +29 -0
  334. package/template/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
  335. package/template/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
  336. package/template/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
  337. package/template/skills/remotion-best-practices/rules/assets.md +78 -0
  338. package/template/skills/remotion-best-practices/rules/audio.md +172 -0
  339. package/template/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
  340. package/template/skills/remotion-best-practices/rules/can-decode.md +75 -0
  341. package/template/skills/remotion-best-practices/rules/charts.md +58 -0
  342. package/template/skills/remotion-best-practices/rules/compositions.md +146 -0
  343. package/template/skills/remotion-best-practices/rules/display-captions.md +126 -0
  344. package/template/skills/remotion-best-practices/rules/extract-frames.md +229 -0
  345. package/template/skills/remotion-best-practices/rules/fonts.md +152 -0
  346. package/template/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
  347. package/template/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
  348. package/template/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
  349. package/template/skills/remotion-best-practices/rules/gifs.md +138 -0
  350. package/template/skills/remotion-best-practices/rules/images.md +130 -0
  351. package/template/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
  352. package/template/skills/remotion-best-practices/rules/lottie.md +68 -0
  353. package/template/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
  354. package/template/skills/remotion-best-practices/rules/measuring-text.md +143 -0
  355. package/template/skills/remotion-best-practices/rules/sequencing.md +106 -0
  356. package/template/skills/remotion-best-practices/rules/tailwind.md +11 -0
  357. package/template/skills/remotion-best-practices/rules/text-animations.md +20 -0
  358. package/template/skills/remotion-best-practices/rules/timing.md +179 -0
  359. package/template/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
  360. package/template/skills/remotion-best-practices/rules/transitions.md +122 -0
  361. package/template/skills/remotion-best-practices/rules/trimming.md +53 -0
  362. package/template/skills/remotion-best-practices/rules/videos.md +171 -0
  363. package/template/skills/search/SKILL.md +220 -0
  364. package/template/skills/spec/SKILL.md +377 -0
  365. package/template/skills/startup/SKILL.md +310 -0
  366. package/template/skills/web-architect/SKILL.md +309 -0
  367. package/template/skills/x-algorithm/SKILL.md +305 -0
  368. package/template/suggestions/.gitkeep +0 -0
  369. package/template/templates/QUICKSTART_SKILL_TO_PRODUCT.md +242 -0
  370. package/template/templates/brand/BRAND_BRIEF.md +124 -0
  371. package/template/templates/brand/BRAND_DECISIONS.md +168 -0
  372. package/template/templates/brand/BRAND_GUIDELINES.md +251 -0
  373. package/template/templates/brand/VOICE_AND_TONE.md +146 -0
  374. package/template/templates/brand/global.css +240 -0
  375. package/template/templates/collaboration/CONTRIBUTOR.md +74 -0
  376. package/template/templates/collaboration/CRM.md +97 -0
  377. package/template/templates/collaboration/TASKS.md +83 -0
  378. package/template/templates/strategic/NARRATIVE.md +114 -0
  379. package/template/templates/strategic/ROADMAP.md +128 -0
  380. package/template/templates/strategic/THESIS.md +108 -0
  381. package/template/templates/strategic/VISION.md +74 -0
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: audio
3
+ description: Using audio and sound in Remotion - importing, trimming, volume, speed, pitch
4
+ metadata:
5
+ tags: audio, media, trim, volume, speed, loop, pitch, mute, sound, sfx
6
+ ---
7
+
8
+ # Using audio in Remotion
9
+
10
+ ## Prerequisites
11
+
12
+ First, the @remotion/media package needs to be installed.
13
+ If it is not installed, use the following command:
14
+
15
+ ```bash
16
+ npx remotion add @remotion/media # If project uses npm
17
+ bunx remotion add @remotion/media # If project uses bun
18
+ yarn remotion add @remotion/media # If project uses yarn
19
+ pnpm exec remotion add @remotion/media # If project uses pnpm
20
+ ```
21
+
22
+ ## Importing Audio
23
+
24
+ Use `<Audio>` from `@remotion/media` to add audio to your composition.
25
+
26
+ ```tsx
27
+ import { Audio } from "@remotion/media";
28
+ import { staticFile } from "remotion";
29
+
30
+ export const MyComposition = () => {
31
+ return <Audio src={staticFile("audio.mp3")} />;
32
+ };
33
+ ```
34
+
35
+ Remote URLs are also supported:
36
+
37
+ ```tsx
38
+ <Audio src="https://remotion.media/audio.mp3" />
39
+ ```
40
+
41
+ By default, audio plays from the start, at full volume and full length.
42
+ Multiple audio tracks can be layered by adding multiple `<Audio>` components.
43
+
44
+ ## Trimming
45
+
46
+ Use `trimBefore` and `trimAfter` to remove portions of the audio. Values are in frames.
47
+
48
+ ```tsx
49
+ const { fps } = useVideoConfig();
50
+
51
+ return (
52
+ <Audio
53
+ src={staticFile("audio.mp3")}
54
+ trimBefore={2 * fps} // Skip the first 2 seconds
55
+ trimAfter={10 * fps} // End at the 10 second mark
56
+ />
57
+ );
58
+ ```
59
+
60
+ The audio still starts playing at the beginning of the composition - only the specified portion is played.
61
+
62
+ ## Delaying
63
+
64
+ Wrap the audio in a `<Sequence>` to delay when it starts:
65
+
66
+ ```tsx
67
+ import { Sequence, staticFile } from "remotion";
68
+ import { Audio } from "@remotion/media";
69
+
70
+ const { fps } = useVideoConfig();
71
+
72
+ return (
73
+ <Sequence from={1 * fps}>
74
+ <Audio src={staticFile("audio.mp3")} />
75
+ </Sequence>
76
+ );
77
+ ```
78
+
79
+ The audio will start playing after 1 second.
80
+
81
+ ## Volume
82
+
83
+ Set a static volume (0 to 1):
84
+
85
+ ```tsx
86
+ <Audio src={staticFile("audio.mp3")} volume={0.5} />
87
+ ```
88
+
89
+ Or use a callback for dynamic volume based on the current frame:
90
+
91
+ ```tsx
92
+ import { interpolate } from "remotion";
93
+
94
+ const { fps } = useVideoConfig();
95
+
96
+ return (
97
+ <Audio
98
+ src={staticFile("audio.mp3")}
99
+ volume={(f) =>
100
+ interpolate(f, [0, 1 * fps], [0, 1], { extrapolateRight: "clamp" })
101
+ }
102
+ />
103
+ );
104
+ ```
105
+
106
+ The value of `f` starts at 0 when the audio begins to play, not the composition frame.
107
+
108
+ ## Muting
109
+
110
+ Use `muted` to silence the audio. It can be set dynamically:
111
+
112
+ ```tsx
113
+ const frame = useCurrentFrame();
114
+ const { fps } = useVideoConfig();
115
+
116
+ return (
117
+ <Audio
118
+ src={staticFile("audio.mp3")}
119
+ muted={frame >= 2 * fps && frame <= 4 * fps} // Mute between 2s and 4s
120
+ />
121
+ );
122
+ ```
123
+
124
+ ## Speed
125
+
126
+ Use `playbackRate` to change the playback speed:
127
+
128
+ ```tsx
129
+ <Audio src={staticFile("audio.mp3")} playbackRate={2} /> {/* 2x speed */}
130
+ <Audio src={staticFile("audio.mp3")} playbackRate={0.5} /> {/* Half speed */}
131
+ ```
132
+
133
+ Reverse playback is not supported.
134
+
135
+ ## Looping
136
+
137
+ Use `loop` to loop the audio indefinitely:
138
+
139
+ ```tsx
140
+ <Audio src={staticFile("audio.mp3")} loop />
141
+ ```
142
+
143
+ Use `loopVolumeCurveBehavior` to control how the frame count behaves when looping:
144
+
145
+ - `"repeat"`: Frame count resets to 0 each loop (default)
146
+ - `"extend"`: Frame count continues incrementing
147
+
148
+ ```tsx
149
+ <Audio
150
+ src={staticFile("audio.mp3")}
151
+ loop
152
+ loopVolumeCurveBehavior="extend"
153
+ volume={(f) => interpolate(f, [0, 300], [1, 0])} // Fade out over multiple loops
154
+ />
155
+ ```
156
+
157
+ ## Pitch
158
+
159
+ Use `toneFrequency` to adjust the pitch without affecting speed. Values range from 0.01 to 2:
160
+
161
+ ```tsx
162
+ <Audio
163
+ src={staticFile("audio.mp3")}
164
+ toneFrequency={1.5} // Higher pitch
165
+ />
166
+ <Audio
167
+ src={staticFile("audio.mp3")}
168
+ toneFrequency={0.8} // Lower pitch
169
+ />
170
+ ```
171
+
172
+ Pitch shifting only works during server-side rendering, not in the Remotion Studio preview or in the `<Player />`.
@@ -0,0 +1,104 @@
1
+ ---
2
+ name: calculate-metadata
3
+ description: Dynamically set composition duration, dimensions, and props
4
+ metadata:
5
+ tags: calculateMetadata, duration, dimensions, props, dynamic
6
+ ---
7
+
8
+ # Using calculateMetadata
9
+
10
+ Use `calculateMetadata` on a `<Composition>` to dynamically set duration, dimensions, and transform props before rendering.
11
+
12
+ ```tsx
13
+ <Composition id="MyComp" component={MyComponent} durationInFrames={300} fps={30} width={1920} height={1080} defaultProps={{videoSrc: 'https://remotion.media/video.mp4'}} calculateMetadata={calculateMetadata} />
14
+ ```
15
+
16
+ ## Setting duration based on a video
17
+
18
+ Use the `getMediaMetadata()` function from the mediabunny/metadata skill to get the video duration:
19
+
20
+ ```tsx
21
+ import {CalculateMetadataFunction} from 'remotion';
22
+ import {getMediaMetadata} from '../get-media-metadata';
23
+
24
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({props}) => {
25
+ const {durationInSeconds} = await getMediaMetadata(props.videoSrc);
26
+
27
+ return {
28
+ durationInFrames: Math.ceil(durationInSeconds * 30),
29
+ };
30
+ };
31
+ ```
32
+
33
+ ## Matching dimensions of a video
34
+
35
+ ```tsx
36
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({props}) => {
37
+ const {durationInSeconds, dimensions} = await getMediaMetadata(props.videoSrc);
38
+
39
+ return {
40
+ durationInFrames: Math.ceil(durationInSeconds * 30),
41
+ width: dimensions?.width ?? 1920,
42
+ height: dimensions?.height ?? 1080,
43
+ };
44
+ };
45
+ ```
46
+
47
+ ## Setting duration based on multiple videos
48
+
49
+ ```tsx
50
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({props}) => {
51
+ const metadataPromises = props.videos.map((video) => getMediaMetadata(video.src));
52
+ const allMetadata = await Promise.all(metadataPromises);
53
+
54
+ const totalDuration = allMetadata.reduce((sum, meta) => sum + meta.durationInSeconds, 0);
55
+
56
+ return {
57
+ durationInFrames: Math.ceil(totalDuration * 30),
58
+ };
59
+ };
60
+ ```
61
+
62
+ ## Setting a default outName
63
+
64
+ Set the default output filename based on props:
65
+
66
+ ```tsx
67
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({props}) => {
68
+ return {
69
+ defaultOutName: `video-${props.id}.mp4`,
70
+ };
71
+ };
72
+ ```
73
+
74
+ ## Transforming props
75
+
76
+ Fetch data or transform props before rendering:
77
+
78
+ ```tsx
79
+ const calculateMetadata: CalculateMetadataFunction<Props> = async ({props, abortSignal}) => {
80
+ const response = await fetch(props.dataUrl, {signal: abortSignal});
81
+ const data = await response.json();
82
+
83
+ return {
84
+ props: {
85
+ ...props,
86
+ fetchedData: data,
87
+ },
88
+ };
89
+ };
90
+ ```
91
+
92
+ The `abortSignal` cancels stale requests when props change in the Studio.
93
+
94
+ ## Return value
95
+
96
+ All fields are optional. Returned values override the `<Composition>` props:
97
+
98
+ - `durationInFrames`: Number of frames
99
+ - `width`: Composition width in pixels
100
+ - `height`: Composition height in pixels
101
+ - `fps`: Frames per second
102
+ - `props`: Transformed props passed to the component
103
+ - `defaultOutName`: Default output filename
104
+ - `defaultCodec`: Default codec for rendering
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: can-decode
3
+ description: Check if a video can be decoded by the browser using Mediabunny
4
+ metadata:
5
+ tags: decode, validation, video, audio, compatibility, browser
6
+ ---
7
+
8
+ # Checking if a video can be decoded
9
+
10
+ Use Mediabunny to check if a video can be decoded by the browser before attempting to play it.
11
+
12
+ ## The `canDecode()` function
13
+
14
+ This function can be copy-pasted into any project.
15
+
16
+ ```tsx
17
+ import { Input, ALL_FORMATS, UrlSource } from "mediabunny";
18
+
19
+ export const canDecode = async (src: string) => {
20
+ const input = new Input({
21
+ formats: ALL_FORMATS,
22
+ source: new UrlSource(src, {
23
+ getRetryDelay: () => null,
24
+ }),
25
+ });
26
+
27
+ try {
28
+ await input.getFormat();
29
+ } catch {
30
+ return false;
31
+ }
32
+
33
+ const videoTrack = await input.getPrimaryVideoTrack();
34
+ if (videoTrack && !(await videoTrack.canDecode())) {
35
+ return false;
36
+ }
37
+
38
+ const audioTrack = await input.getPrimaryAudioTrack();
39
+ if (audioTrack && !(await audioTrack.canDecode())) {
40
+ return false;
41
+ }
42
+
43
+ return true;
44
+ };
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ ```tsx
50
+ const src = "https://remotion.media/video.mp4";
51
+ const isDecodable = await canDecode(src);
52
+
53
+ if (isDecodable) {
54
+ console.log("Video can be decoded");
55
+ } else {
56
+ console.log("Video cannot be decoded by this browser");
57
+ }
58
+ ```
59
+
60
+ ## Using with Blob
61
+
62
+ For file uploads or drag-and-drop, use `BlobSource`:
63
+
64
+ ```tsx
65
+ import { Input, ALL_FORMATS, BlobSource } from "mediabunny";
66
+
67
+ export const canDecodeBlob = async (blob: Blob) => {
68
+ const input = new Input({
69
+ formats: ALL_FORMATS,
70
+ source: new BlobSource(blob),
71
+ });
72
+
73
+ // Same validation logic as above
74
+ };
75
+ ```
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: charts
3
+ description: Chart and data visualization patterns for Remotion. Use when creating bar charts, pie charts, histograms, progress bars, or any data-driven animations.
4
+ metadata:
5
+ tags: charts, data, visualization, bar-chart, pie-chart, graphs
6
+ ---
7
+
8
+ # Charts in Remotion
9
+
10
+ You can create bar charts in Remotion by using regular React code - HTML and SVG is allowed, as well as D3.js.
11
+
12
+ ## No animations not powered by `useCurrentFrame()`
13
+
14
+ Disable all animations by third party libraries.
15
+ They will cause flickering during rendering.
16
+ Instead, drive all animations from `useCurrentFrame()`.
17
+
18
+ ## Bar Chart Animations
19
+
20
+ See [Bar Chart Example](assets/charts/bar-chart.tsx) for a basic example implmentation.
21
+
22
+ ### Staggered Bars
23
+
24
+ You can animate the height of the bars and stagger them like this:
25
+
26
+ ```tsx
27
+ const STAGGER_DELAY = 5;
28
+ const frame = useCurrentFrame();
29
+ const {fps} = useVideoConfig();
30
+
31
+ const bars = data.map((item, i) => {
32
+ const delay = i * STAGGER_DELAY;
33
+ const height = spring({
34
+ frame,
35
+ fps,
36
+ delay,
37
+ config: {damping: 200},
38
+ });
39
+ return <div style={{height: height * item.value}} />;
40
+ });
41
+ ```
42
+
43
+ ## Pie Chart Animation
44
+
45
+ Animate segments using stroke-dashoffset, starting from 12 o'clock.
46
+
47
+ ```tsx
48
+ const frame = useCurrentFrame();
49
+ const {fps} = useVideoConfig();
50
+
51
+ const progress = interpolate(frame, [0, 100], [0, 1]);
52
+
53
+ const circumference = 2 * Math.PI * radius;
54
+ const segmentLength = (value / total) * circumference;
55
+ const offset = interpolate(progress, [0, 1], [segmentLength, 0]);
56
+
57
+ <circle r={radius} cx={center} cy={center} fill="none" stroke={color} strokeWidth={strokeWidth} strokeDasharray={`${segmentLength} ${circumference}`} strokeDashoffset={offset} transform={`rotate(-90 ${center} ${center})`} />;
58
+ ```
@@ -0,0 +1,146 @@
1
+ ---
2
+ name: compositions
3
+ description: Defining compositions, stills, folders, default props and dynamic metadata
4
+ metadata:
5
+ tags: composition, still, folder, props, metadata
6
+ ---
7
+
8
+ A `<Composition>` defines the component, width, height, fps and duration of a renderable video.
9
+
10
+ It normally is placed in the `src/Root.tsx` file.
11
+
12
+ ```tsx
13
+ import { Composition } from "remotion";
14
+ import { MyComposition } from "./MyComposition";
15
+
16
+ export const RemotionRoot = () => {
17
+ return (
18
+ <Composition
19
+ id="MyComposition"
20
+ component={MyComposition}
21
+ durationInFrames={100}
22
+ fps={30}
23
+ width={1080}
24
+ height={1080}
25
+ />
26
+ );
27
+ };
28
+ ```
29
+
30
+ ## Default Props
31
+
32
+ Pass `defaultProps` to provide initial values for your component.
33
+ Values must be JSON-serializable (`Date`, `Map`, `Set`, and `staticFile()` are supported).
34
+
35
+ ```tsx
36
+ import { Composition } from "remotion";
37
+ import { MyComposition, MyCompositionProps } from "./MyComposition";
38
+
39
+ export const RemotionRoot = () => {
40
+ return (
41
+ <Composition
42
+ id="MyComposition"
43
+ component={MyComposition}
44
+ durationInFrames={100}
45
+ fps={30}
46
+ width={1080}
47
+ height={1080}
48
+ defaultProps={{
49
+ title: "Hello World",
50
+ color: "#ff0000",
51
+ } satisfies MyCompositionProps}
52
+ />
53
+ );
54
+ };
55
+ ```
56
+
57
+ Use `type` declarations for props rather than `interface` to ensure `defaultProps` type safety.
58
+
59
+ ## Folders
60
+
61
+ Use `<Folder>` to organize compositions in the sidebar.
62
+ Folder names can only contain letters, numbers, and hyphens.
63
+
64
+ ```tsx
65
+ import { Composition, Folder } from "remotion";
66
+
67
+ export const RemotionRoot = () => {
68
+ return (
69
+ <>
70
+ <Folder name="Marketing">
71
+ <Composition id="Promo" /* ... */ />
72
+ <Composition id="Ad" /* ... */ />
73
+ </Folder>
74
+ <Folder name="Social">
75
+ <Folder name="Instagram">
76
+ <Composition id="Story" /* ... */ />
77
+ <Composition id="Reel" /* ... */ />
78
+ </Folder>
79
+ </Folder>
80
+ </>
81
+ );
82
+ };
83
+ ```
84
+
85
+ ## Stills
86
+
87
+ Use `<Still>` for single-frame images. It does not require `durationInFrames` or `fps`.
88
+
89
+ ```tsx
90
+ import { Still } from "remotion";
91
+ import { Thumbnail } from "./Thumbnail";
92
+
93
+ export const RemotionRoot = () => {
94
+ return (
95
+ <Still
96
+ id="Thumbnail"
97
+ component={Thumbnail}
98
+ width={1280}
99
+ height={720}
100
+ />
101
+ );
102
+ };
103
+ ```
104
+
105
+ ## Calculate Metadata
106
+
107
+ Use `calculateMetadata` to make dimensions, duration, or props dynamic based on data.
108
+
109
+ ```tsx
110
+ import { Composition, CalculateMetadataFunction } from "remotion";
111
+ import { MyComposition, MyCompositionProps } from "./MyComposition";
112
+
113
+ const calculateMetadata: CalculateMetadataFunction<MyCompositionProps> = async ({
114
+ props,
115
+ abortSignal,
116
+ }) => {
117
+ const data = await fetch(`https://api.example.com/video/${props.videoId}`, {
118
+ signal: abortSignal,
119
+ }).then((res) => res.json());
120
+
121
+ return {
122
+ durationInFrames: Math.ceil(data.duration * 30),
123
+ props: {
124
+ ...props,
125
+ videoUrl: data.url,
126
+ },
127
+ };
128
+ };
129
+
130
+ export const RemotionRoot = () => {
131
+ return (
132
+ <Composition
133
+ id="MyComposition"
134
+ component={MyComposition}
135
+ durationInFrames={100} // Placeholder, will be overridden
136
+ fps={30}
137
+ width={1080}
138
+ height={1080}
139
+ defaultProps={{ videoId: "abc123" }}
140
+ calculateMetadata={calculateMetadata}
141
+ />
142
+ );
143
+ };
144
+ ```
145
+
146
+ The function can return `props`, `durationInFrames`, `width`, `height`, `fps`, and codec-related defaults. It runs once before rendering begins.
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: display-captions
3
+ description: Displaying captions in Remotion with TikTok-style pages and word highlighting
4
+ metadata:
5
+ tags: captions, subtitles, display, tiktok, highlight
6
+ ---
7
+
8
+ # Displaying captions in Remotion
9
+
10
+ This guide explains how to display captions in Remotion, assuming you already have captions in the `Caption` format.
11
+
12
+ ## Prerequisites
13
+
14
+ First, the @remotion/captions package needs to be installed.
15
+ If it is not installed, use the following command:
16
+
17
+ ```bash
18
+ npx remotion add @remotion/captions # If project uses npm
19
+ bunx remotion add @remotion/captions # If project uses bun
20
+ yarn remotion add @remotion/captions # If project uses yarn
21
+ pnpm exec remotion add @remotion/captions # If project uses pnpm
22
+ ```
23
+
24
+ ## Creating pages
25
+
26
+ Use `createTikTokStyleCaptions()` to group captions into pages. The `combineTokensWithinMilliseconds` option controls how many words appear at once:
27
+
28
+ ```tsx
29
+ import {useMemo} from 'react';
30
+ import {createTikTokStyleCaptions} from '@remotion/captions';
31
+ import type {Caption} from '@remotion/captions';
32
+
33
+ // How often captions should switch (in milliseconds)
34
+ // Higher values = more words per page
35
+ // Lower values = fewer words (more word-by-word)
36
+ const SWITCH_CAPTIONS_EVERY_MS = 1200;
37
+
38
+ const {pages} = useMemo(() => {
39
+ return createTikTokStyleCaptions({
40
+ captions,
41
+ combineTokensWithinMilliseconds: SWITCH_CAPTIONS_EVERY_MS,
42
+ });
43
+ }, [captions]);
44
+ ```
45
+
46
+ ## Rendering with Sequences
47
+
48
+ Map over the pages and render each one in a `<Sequence>`. Calculate the start frame and duration from the page timing:
49
+
50
+ ```tsx
51
+ import {Sequence, useVideoConfig, AbsoluteFill} from 'remotion';
52
+ import type {TikTokPage} from '@remotion/captions';
53
+
54
+ const CaptionedContent: React.FC = () => {
55
+ const {fps} = useVideoConfig();
56
+
57
+ return (
58
+ <AbsoluteFill>
59
+ {pages.map((page, index) => {
60
+ const nextPage = pages[index + 1] ?? null;
61
+ const startFrame = (page.startMs / 1000) * fps;
62
+ const endFrame = Math.min(
63
+ nextPage ? (nextPage.startMs / 1000) * fps : Infinity,
64
+ startFrame + (SWITCH_CAPTIONS_EVERY_MS / 1000) * fps,
65
+ );
66
+ const durationInFrames = endFrame - startFrame;
67
+
68
+ if (durationInFrames <= 0) {
69
+ return null;
70
+ }
71
+
72
+ return (
73
+ <Sequence
74
+ key={index}
75
+ from={startFrame}
76
+ durationInFrames={durationInFrames}
77
+ >
78
+ <CaptionPage page={page} />
79
+ </Sequence>
80
+ );
81
+ })}
82
+ </AbsoluteFill>
83
+ );
84
+ };
85
+ ```
86
+
87
+ ## Word highlighting
88
+
89
+ A caption page contains `tokens` which you can use to highlight the currently spoken word:
90
+
91
+ ```tsx
92
+ import {AbsoluteFill, useCurrentFrame, useVideoConfig} from 'remotion';
93
+ import type {TikTokPage} from '@remotion/captions';
94
+
95
+ const HIGHLIGHT_COLOR = '#39E508';
96
+
97
+ const CaptionPage: React.FC<{page: TikTokPage}> = ({page}) => {
98
+ const frame = useCurrentFrame();
99
+ const {fps} = useVideoConfig();
100
+
101
+ // Current time relative to the start of the sequence
102
+ const currentTimeMs = (frame / fps) * 1000;
103
+ // Convert to absolute time by adding the page start
104
+ const absoluteTimeMs = page.startMs + currentTimeMs;
105
+
106
+ return (
107
+ <AbsoluteFill style={{justifyContent: 'center', alignItems: 'center'}}>
108
+ <div style={{fontSize: 80, fontWeight: 'bold', whiteSpace: 'pre'}}>
109
+ {page.tokens.map((token) => {
110
+ const isActive =
111
+ token.fromMs <= absoluteTimeMs && token.toMs > absoluteTimeMs;
112
+
113
+ return (
114
+ <span
115
+ key={token.fromMs}
116
+ style={{color: isActive ? HIGHLIGHT_COLOR : 'white'}}
117
+ >
118
+ {token.text}
119
+ </span>
120
+ );
121
+ })}
122
+ </div>
123
+ </AbsoluteFill>
124
+ );
125
+ };
126
+ ```