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.
- package/LICENSE +21 -0
- package/README.md +313 -0
- package/clawdbot-skill/README.md +328 -0
- package/clawdbot-skill/SKILL.md +362 -0
- package/clawdbot-skill/index.ts +486 -0
- package/clawdbot-skill/package.json +28 -0
- package/clawdbot-skill/skill.json +28 -0
- package/dist/commands/agents.d.ts +5 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +399 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/context-hub.d.ts +12 -0
- package/dist/commands/context-hub.d.ts.map +1 -0
- package/dist/commands/context-hub.js +642 -0
- package/dist/commands/context-hub.js.map +1 -0
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +370 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/feedback.d.ts +2 -0
- package/dist/commands/feedback.d.ts.map +1 -0
- package/dist/commands/feedback.js +178 -0
- package/dist/commands/feedback.js.map +1 -0
- package/dist/commands/hud.d.ts +4 -0
- package/dist/commands/hud.d.ts.map +1 -0
- package/dist/commands/hud.js +262 -0
- package/dist/commands/hud.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +553 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +23 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +818 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/ralph.d.ts +9 -0
- package/dist/commands/ralph.d.ts.map +1 -0
- package/dist/commands/ralph.js +67 -0
- package/dist/commands/ralph.js.map +1 -0
- package/dist/commands/repair.d.ts +7 -0
- package/dist/commands/repair.d.ts.map +1 -0
- package/dist/commands/repair.js +283 -0
- package/dist/commands/repair.js.map +1 -0
- package/dist/commands/session-mgmt.d.ts +33 -0
- package/dist/commands/session-mgmt.d.ts.map +1 -0
- package/dist/commands/session-mgmt.js +404 -0
- package/dist/commands/session-mgmt.js.map +1 -0
- package/dist/commands/session.d.ts +2 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +639 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/skills.d.ts +31 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +314 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +127 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/synopsis.d.ts +10 -0
- package/dist/commands/synopsis.d.ts.map +1 -0
- package/dist/commands/synopsis.js +277 -0
- package/dist/commands/synopsis.js.map +1 -0
- package/dist/commands/update.d.ts +10 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +165 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/voice.d.ts +410 -0
- package/dist/commands/voice.d.ts.map +1 -0
- package/dist/commands/voice.js +4763 -0
- package/dist/commands/voice.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +512 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/context-hub-mcp.d.ts +11 -0
- package/dist/mcp/context-hub-mcp.d.ts.map +1 -0
- package/dist/mcp/context-hub-mcp.js +548 -0
- package/dist/mcp/context-hub-mcp.js.map +1 -0
- package/dist/telegram/voice.d.ts +146 -0
- package/dist/telegram/voice.d.ts.map +1 -0
- package/dist/telegram/voice.js +351 -0
- package/dist/telegram/voice.js.map +1 -0
- package/dist/types/skills.d.ts +44 -0
- package/dist/types/skills.d.ts.map +1 -0
- package/dist/types/skills.js +5 -0
- package/dist/types/skills.js.map +1 -0
- package/dist/ui/banner.d.ts +18 -0
- package/dist/ui/banner.d.ts.map +1 -0
- package/dist/ui/banner.js +323 -0
- package/dist/ui/banner.js.map +1 -0
- package/dist/ui/index.d.ts +8 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +8 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/prompts.d.ts +52 -0
- package/dist/ui/prompts.d.ts.map +1 -0
- package/dist/ui/prompts.js +72 -0
- package/dist/ui/prompts.js.map +1 -0
- package/dist/ui/theme.d.ts +82 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +142 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/utils/auth-guard.d.ts +66 -0
- package/dist/utils/auth-guard.d.ts.map +1 -0
- package/dist/utils/auth-guard.js +348 -0
- package/dist/utils/auth-guard.js.map +1 -0
- package/dist/utils/ensure-project.d.ts +11 -0
- package/dist/utils/ensure-project.d.ts.map +1 -0
- package/dist/utils/ensure-project.js +70 -0
- package/dist/utils/ensure-project.js.map +1 -0
- package/dist/utils/git.d.ts +73 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +219 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/github-auth.d.ts +54 -0
- package/dist/utils/github-auth.d.ts.map +1 -0
- package/dist/utils/github-auth.js +375 -0
- package/dist/utils/github-auth.js.map +1 -0
- package/dist/utils/github-repo.d.ts +30 -0
- package/dist/utils/github-repo.d.ts.map +1 -0
- package/dist/utils/github-repo.js +219 -0
- package/dist/utils/github-repo.js.map +1 -0
- package/dist/utils/platform-auth.d.ts +81 -0
- package/dist/utils/platform-auth.d.ts.map +1 -0
- package/dist/utils/platform-auth.js +191 -0
- package/dist/utils/platform-auth.js.map +1 -0
- package/dist/utils/project-config.d.ts +43 -0
- package/dist/utils/project-config.d.ts.map +1 -0
- package/dist/utils/project-config.js +97 -0
- package/dist/utils/project-config.js.map +1 -0
- package/dist/utils/skill-registry.d.ts +49 -0
- package/dist/utils/skill-registry.d.ts.map +1 -0
- package/dist/utils/skill-registry.js +192 -0
- package/dist/utils/skill-registry.js.map +1 -0
- package/dist/utils/wallet.d.ts +62 -0
- package/dist/utils/wallet.d.ts.map +1 -0
- package/dist/utils/wallet.js +252 -0
- package/dist/utils/wallet.js.map +1 -0
- package/dist/utils/x402-client.d.ts +86 -0
- package/dist/utils/x402-client.d.ts.map +1 -0
- package/dist/utils/x402-client.js +265 -0
- package/dist/utils/x402-client.js.map +1 -0
- package/package.json +76 -0
- package/scripts/postinstall.js +116 -0
- package/scripts/test-onboarding.sh +121 -0
- package/scripts/voice-start.sh +128 -0
- package/scripts/voice-stop.sh +33 -0
- package/template/.claude/settings.json +92 -0
- package/template/.claude/skills/agent-browser/SKILL.md +116 -0
- package/template/.claude/skills/brand-architect/SKILL.md +240 -0
- package/template/.claude/skills/brand-architect/config.yaml +137 -0
- package/template/.claude/skills/campaign-hud/config.yaml +112 -0
- package/template/.claude/skills/content-creator/SKILL.md +294 -0
- package/template/.claude/skills/debug/MULTI_AGENT.md +360 -0
- package/template/.claude/skills/debug/SKILL.md +549 -0
- package/template/.claude/skills/fly-deploy/SKILL.md +676 -0
- package/template/.claude/skills/founder-video/SKILL.md +467 -0
- package/template/.claude/skills/hud/SKILL.md +157 -0
- package/template/.claude/skills/ralph-tui/SKILL.md +210 -0
- package/template/.claude/skills/react-best-practices/AGENTS.md +2249 -0
- package/template/.claude/skills/react-best-practices/README.md +123 -0
- package/template/.claude/skills/react-best-practices/SKILL.md +125 -0
- package/template/.claude/skills/react-best-practices/metadata.json +15 -0
- package/template/.claude/skills/react-best-practices/rules/_sections.md +46 -0
- package/template/.claude/skills/react-best-practices/rules/_template.md +28 -0
- package/template/.claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/template/.claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/template/.claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/template/.claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/template/.claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/template/.claude/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/template/.claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/template/.claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/template/.claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/template/.claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/template/.claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/template/.claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/template/.claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/template/.claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/template/.claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/template/.claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/template/.claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/template/.claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/template/.claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/template/.claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/template/.claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/template/.claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/template/.claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/template/.claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/template/.claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/template/.claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/template/.claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/template/.claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/template/.claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/template/.claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/template/.claude/skills/react-best-practices/rules/server-cache-react.md +26 -0
- package/template/.claude/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/template/.claude/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/template/.claude/skills/remotion-best-practices/SKILL.md +43 -0
- package/template/.claude/skills/remotion-best-practices/rules/3d.md +86 -0
- package/template/.claude/skills/remotion-best-practices/rules/animations.md +29 -0
- package/template/.claude/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/template/.claude/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/template/.claude/skills/remotion-best-practices/rules/assets.md +78 -0
- package/template/.claude/skills/remotion-best-practices/rules/audio.md +172 -0
- package/template/.claude/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/template/.claude/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/template/.claude/skills/remotion-best-practices/rules/charts.md +58 -0
- package/template/.claude/skills/remotion-best-practices/rules/compositions.md +146 -0
- package/template/.claude/skills/remotion-best-practices/rules/display-captions.md +126 -0
- package/template/.claude/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/template/.claude/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/template/.claude/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/template/.claude/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/template/.claude/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/template/.claude/skills/remotion-best-practices/rules/gifs.md +138 -0
- package/template/.claude/skills/remotion-best-practices/rules/images.md +130 -0
- package/template/.claude/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/template/.claude/skills/remotion-best-practices/rules/lottie.md +68 -0
- package/template/.claude/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/template/.claude/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/template/.claude/skills/remotion-best-practices/rules/sequencing.md +106 -0
- package/template/.claude/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/template/.claude/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/template/.claude/skills/remotion-best-practices/rules/timing.md +179 -0
- package/template/.claude/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/template/.claude/skills/remotion-best-practices/rules/transitions.md +122 -0
- package/template/.claude/skills/remotion-best-practices/rules/trimming.md +53 -0
- package/template/.claude/skills/remotion-best-practices/rules/videos.md +171 -0
- package/template/.claude/skills/search/SKILL.md +220 -0
- package/template/.claude/skills/spec/SKILL.md +377 -0
- package/template/.claude/skills/startup/SKILL.md +310 -0
- package/template/.claude/skills/web-architect/SKILL.md +309 -0
- package/template/.claude/skills/x-algorithm/SKILL.md +305 -0
- package/template/.jfl/config.json +8 -0
- package/template/.mcp.json +11 -0
- package/template/CLAUDE.md +960 -0
- package/template/content/.gitkeep +0 -0
- package/template/context-hub +3 -0
- package/template/knowledge/BRAND_BRIEF.md +124 -0
- package/template/knowledge/BRAND_DECISIONS.md +168 -0
- package/template/knowledge/NARRATIVE.md +114 -0
- package/template/knowledge/ROADMAP.md +128 -0
- package/template/knowledge/THESIS.md +108 -0
- package/template/knowledge/VISION.md +74 -0
- package/template/knowledge/VOICE_AND_TONE.md +146 -0
- package/template/previews/.gitkeep +0 -0
- package/template/scripts/session/auto-commit.sh +245 -0
- package/template/scripts/session/auto-merge.sh +325 -0
- package/template/scripts/session/jfl-doctor.sh +587 -0
- package/template/scripts/session/session-end.sh +194 -0
- package/template/scripts/session/session-init.sh +163 -0
- package/template/scripts/session/session-sync.sh +167 -0
- package/template/scripts/session/test-context-preservation.sh +160 -0
- package/template/skills/agent-browser/SKILL.md +116 -0
- package/template/skills/brand-architect/SKILL.md +240 -0
- package/template/skills/brand-architect/config.yaml +137 -0
- package/template/skills/campaign-hud/config.yaml +112 -0
- package/template/skills/content-creator/SKILL.md +294 -0
- package/template/skills/debug/MULTI_AGENT.md +360 -0
- package/template/skills/debug/SKILL.md +549 -0
- package/template/skills/fly-deploy/SKILL.md +676 -0
- package/template/skills/founder-video/SKILL.md +467 -0
- package/template/skills/hud/SKILL.md +204 -0
- package/template/skills/ralph-tui/SKILL.md +210 -0
- package/template/skills/react-best-practices/AGENTS.md +2249 -0
- package/template/skills/react-best-practices/README.md +123 -0
- package/template/skills/react-best-practices/SKILL.md +125 -0
- package/template/skills/react-best-practices/metadata.json +15 -0
- package/template/skills/react-best-practices/rules/_sections.md +46 -0
- package/template/skills/react-best-practices/rules/_template.md +28 -0
- package/template/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/template/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/template/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/template/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/template/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/template/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/template/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/template/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/template/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/template/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/template/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/template/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/template/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/template/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/template/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/template/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/template/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/template/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/template/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/template/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/template/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/template/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/template/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/template/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/template/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/template/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/template/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/template/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/template/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/template/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/template/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/template/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/template/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/template/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/template/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/template/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/template/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/template/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/template/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/template/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/template/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/template/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/template/skills/react-best-practices/rules/server-cache-react.md +26 -0
- package/template/skills/react-best-practices/rules/server-parallel-fetching.md +79 -0
- package/template/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/template/skills/remotion-best-practices/SKILL.md +43 -0
- package/template/skills/remotion-best-practices/rules/3d.md +86 -0
- package/template/skills/remotion-best-practices/rules/animations.md +29 -0
- package/template/skills/remotion-best-practices/rules/assets/charts-bar-chart.tsx +173 -0
- package/template/skills/remotion-best-practices/rules/assets/text-animations-typewriter.tsx +100 -0
- package/template/skills/remotion-best-practices/rules/assets/text-animations-word-highlight.tsx +108 -0
- package/template/skills/remotion-best-practices/rules/assets.md +78 -0
- package/template/skills/remotion-best-practices/rules/audio.md +172 -0
- package/template/skills/remotion-best-practices/rules/calculate-metadata.md +104 -0
- package/template/skills/remotion-best-practices/rules/can-decode.md +75 -0
- package/template/skills/remotion-best-practices/rules/charts.md +58 -0
- package/template/skills/remotion-best-practices/rules/compositions.md +146 -0
- package/template/skills/remotion-best-practices/rules/display-captions.md +126 -0
- package/template/skills/remotion-best-practices/rules/extract-frames.md +229 -0
- package/template/skills/remotion-best-practices/rules/fonts.md +152 -0
- package/template/skills/remotion-best-practices/rules/get-audio-duration.md +58 -0
- package/template/skills/remotion-best-practices/rules/get-video-dimensions.md +68 -0
- package/template/skills/remotion-best-practices/rules/get-video-duration.md +58 -0
- package/template/skills/remotion-best-practices/rules/gifs.md +138 -0
- package/template/skills/remotion-best-practices/rules/images.md +130 -0
- package/template/skills/remotion-best-practices/rules/import-srt-captions.md +67 -0
- package/template/skills/remotion-best-practices/rules/lottie.md +68 -0
- package/template/skills/remotion-best-practices/rules/measuring-dom-nodes.md +35 -0
- package/template/skills/remotion-best-practices/rules/measuring-text.md +143 -0
- package/template/skills/remotion-best-practices/rules/sequencing.md +106 -0
- package/template/skills/remotion-best-practices/rules/tailwind.md +11 -0
- package/template/skills/remotion-best-practices/rules/text-animations.md +20 -0
- package/template/skills/remotion-best-practices/rules/timing.md +179 -0
- package/template/skills/remotion-best-practices/rules/transcribe-captions.md +19 -0
- package/template/skills/remotion-best-practices/rules/transitions.md +122 -0
- package/template/skills/remotion-best-practices/rules/trimming.md +53 -0
- package/template/skills/remotion-best-practices/rules/videos.md +171 -0
- package/template/skills/search/SKILL.md +220 -0
- package/template/skills/spec/SKILL.md +377 -0
- package/template/skills/startup/SKILL.md +310 -0
- package/template/skills/web-architect/SKILL.md +309 -0
- package/template/skills/x-algorithm/SKILL.md +305 -0
- package/template/suggestions/.gitkeep +0 -0
- package/template/templates/QUICKSTART_SKILL_TO_PRODUCT.md +242 -0
- package/template/templates/brand/BRAND_BRIEF.md +124 -0
- package/template/templates/brand/BRAND_DECISIONS.md +168 -0
- package/template/templates/brand/BRAND_GUIDELINES.md +251 -0
- package/template/templates/brand/VOICE_AND_TONE.md +146 -0
- package/template/templates/brand/global.css +240 -0
- package/template/templates/collaboration/CONTRIBUTOR.md +74 -0
- package/template/templates/collaboration/CRM.md +97 -0
- package/template/templates/collaboration/TASKS.md +83 -0
- package/template/templates/strategic/NARRATIVE.md +114 -0
- package/template/templates/strategic/ROADMAP.md +128 -0
- package/template/templates/strategic/THESIS.md +108 -0
- 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
|
+
```
|