From 0c82945447c59f7e8389af4cca778b03e86518aa Mon Sep 17 00:00:00 2001 From: zlei9 Date: Sun, 29 Mar 2026 13:22:33 +0800 Subject: [PATCH] Initial commit with translated description --- SKILL.md | 149 +++++++++++ _meta.json | 6 + rules/3d.md | 86 +++++++ rules/animations.md | 29 +++ rules/assets.md | 78 ++++++ rules/assets/charts-bar-chart.tsx | 173 +++++++++++++ rules/assets/text-animations-typewriter.tsx | 100 ++++++++ .../assets/text-animations-word-highlight.tsx | 108 ++++++++ rules/audio.md | 172 +++++++++++++ rules/calculate-metadata.md | 104 ++++++++ rules/can-decode.md | 75 ++++++ rules/charts.md | 58 +++++ rules/compositions.md | 146 +++++++++++ rules/display-captions.md | 126 +++++++++ rules/extract-frames.md | 229 +++++++++++++++++ rules/fonts.md | 152 +++++++++++ rules/get-audio-duration.md | 58 +++++ rules/get-video-dimensions.md | 68 +++++ rules/get-video-duration.md | 58 +++++ rules/gifs.md | 138 ++++++++++ rules/images.md | 130 ++++++++++ rules/import-srt-captions.md | 67 +++++ rules/lottie.md | 68 +++++ rules/measuring-dom-nodes.md | 35 +++ rules/measuring-text.md | 143 +++++++++++ rules/rendering.md | 241 ++++++++++++++++++ rules/sequencing.md | 106 ++++++++ rules/tailwind.md | 11 + rules/text-animations.md | 20 ++ rules/timing.md | 179 +++++++++++++ rules/transcribe-captions.md | 19 ++ rules/transitions.md | 122 +++++++++ rules/trimming.md | 53 ++++ rules/videos.md | 171 +++++++++++++ 34 files changed, 3478 insertions(+) create mode 100644 SKILL.md create mode 100644 _meta.json create mode 100644 rules/3d.md create mode 100644 rules/animations.md create mode 100644 rules/assets.md create mode 100644 rules/assets/charts-bar-chart.tsx create mode 100644 rules/assets/text-animations-typewriter.tsx create mode 100644 rules/assets/text-animations-word-highlight.tsx create mode 100644 rules/audio.md create mode 100644 rules/calculate-metadata.md create mode 100644 rules/can-decode.md create mode 100644 rules/charts.md create mode 100644 rules/compositions.md create mode 100644 rules/display-captions.md create mode 100644 rules/extract-frames.md create mode 100644 rules/fonts.md create mode 100644 rules/get-audio-duration.md create mode 100644 rules/get-video-dimensions.md create mode 100644 rules/get-video-duration.md create mode 100644 rules/gifs.md create mode 100644 rules/images.md create mode 100644 rules/import-srt-captions.md create mode 100644 rules/lottie.md create mode 100644 rules/measuring-dom-nodes.md create mode 100644 rules/measuring-text.md create mode 100644 rules/rendering.md create mode 100644 rules/sequencing.md create mode 100644 rules/tailwind.md create mode 100644 rules/text-animations.md create mode 100644 rules/timing.md create mode 100644 rules/transcribe-captions.md create mode 100644 rules/transitions.md create mode 100644 rules/trimming.md create mode 100644 rules/videos.md diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..5d52250 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,149 @@ +--- +name: remotion-video-toolkit +description: "使用Remotion + React进行程序化视频创建的完整工具包。" +--- + +# Remotion Video Toolkit + +Write React components, get real MP4 videos. This skill teaches your AI agent how to build with Remotion — from a first animation to a production rendering pipeline. + +29 rules. Every major Remotion feature covered. + +--- + +## What you can build with this + +**Personalized video at scale** +Feed user data as JSON props, render a unique video per user. Think Spotify Wrapped, GitHub Unwrapped, onboarding walkthroughs — one template, thousands of outputs. + +**Automated social media clips** +Pull live data (stats, leaderboards, product metrics) and render daily or weekly video posts without anyone touching a timeline editor. + +**Dynamic ads and marketing videos** +Swap in customer name, product image, pricing. Same template, infinite variations. Render server-side via API or Lambda. + +**Animated data visualizations** +Turn dashboards and KPI reports into shareable video clips with animated charts and transitions. + +**TikTok and Reels captions** +Transcribe audio, display word-by-word highlighted subtitles, export ready for upload. + +**Product showcase videos** +Auto-generate from your database — images, specs, pricing — straight to MP4. + +**Educational and explainer content** +Animated course materials, certificate videos, step-by-step walkthroughs — all driven by code. + +**Video generation as a service** +Expose rendering as an HTTP endpoint. Your app sends JSON, gets back a video file. + +--- + +## Requirements + +- **Node.js** 18+ +- **React** 18+ (Remotion renders React components frame-by-frame) +- **Remotion** — scaffold with `npx create-video@latest` +- **FFmpeg** — ships with `@remotion/renderer`, no separate install needed +- For serverless rendering: **AWS** account (Lambda) or **GCP** account (Cloud Run) + +--- + +## What's inside + +### Core + +| Rule | Description | +|------|-------------| +| [Compositions](rules/compositions.md) | Define videos, stills, folders, default props, dynamic metadata | +| [Rendering](rules/rendering.md) | CLI, Node.js API, AWS Lambda, Cloud Run, Express server patterns | +| [Calculate metadata](rules/calculate-metadata.md) | Set duration, dimensions, and props dynamically at render time | + +### Animation and timing + +| Rule | Description | +|------|-------------| +| [Animations](rules/animations.md) | Fade, scale, rotate, slide | +| [Timing](rules/timing.md) | Interpolation curves, easing, spring physics | +| [Sequencing](rules/sequencing.md) | Delay, chain, and orchestrate scenes | +| [Transitions](rules/transitions.md) | Scene-to-scene transitions | +| [Trimming](rules/trimming.md) | Cut the start or end of any animation | + +### Text and typography + +| Rule | Description | +|------|-------------| +| [Text animations](rules/text-animations.md) | Typewriter, word highlight, reveal effects | +| [Fonts](rules/fonts.md) | Google Fonts and local font loading | +| [Measuring text](rules/measuring-text.md) | Fit text to containers, detect overflow | + +### Media + +| Rule | Description | +|------|-------------| +| [Videos](rules/videos.md) | Embed, trim, speed, volume, loop, pitch shift | +| [Audio](rules/audio.md) | Import, trim, fade, volume and speed control | +| [Images](rules/images.md) | The Img component | +| [GIFs](rules/gifs.md) | Timeline-synced GIF playback | +| [Assets](rules/assets.md) | Importing any media into compositions | +| [Decode check](rules/can-decode.md) | Validate browser compatibility | + +### Captions and subtitles + +| Rule | Description | +|------|-------------| +| [Transcribe captions](rules/transcribe-captions.md) | Audio to captions via Whisper, Deepgram, or AssemblyAI | +| [Display captions](rules/display-captions.md) | TikTok-style word-by-word highlighting | +| [Import SRT](rules/import-srt-captions.md) | Load existing .srt files | + +### Data visualization + +| Rule | Description | +|------|-------------| +| [Charts](rules/charts.md) | Animated bar charts, line graphs, data-driven visuals | + +### Advanced + +| Rule | Description | +|------|-------------| +| [3D content](rules/3d.md) | Three.js and React Three Fiber | +| [Lottie](rules/lottie.md) | After Effects animations via Lottie | +| [TailwindCSS](rules/tailwind.md) | Style compositions with Tailwind | +| [DOM measurement](rules/measuring-dom-nodes.md) | Measure element dimensions at render time | + +### Media utilities + +| Rule | Description | +|------|-------------| +| [Video duration](rules/get-video-duration.md) | Get length in seconds | +| [Video dimensions](rules/get-video-dimensions.md) | Get width and height | +| [Audio duration](rules/get-audio-duration.md) | Get audio length | +| [Extract frames](rules/extract-frames.md) | Pull frames at specific timestamps | + +--- + +## Quick start + +```bash +# Scaffold a project +npx create-video@latest my-video + +# Preview in browser +cd my-video && npm start + +# Render to MP4 +npx remotion render src/index.ts MyComposition out/video.mp4 + +# Pass dynamic data +npx remotion render src/index.ts MyComposition out.mp4 --props '{"title": "Hello"}' +``` + +--- + +## Contribute + +**Source:** [github.com/shreefentsar/remotion-video-toolkit](https://github.com/shreefentsar/remotion-video-toolkit) + +Missing something? Found a better approach? Open a PR — new rules, improved examples, bug fixes all welcome. + +Built by [Zone 99](https://99.zone) diff --git a/_meta.json b/_meta.json new file mode 100644 index 0000000..e4cf83a --- /dev/null +++ b/_meta.json @@ -0,0 +1,6 @@ +{ + "ownerId": "kn7fm1n0cnckxtz0587yh5cxxn801rq4", + "slug": "remotion-video-toolkit", + "version": "1.4.0", + "publishedAt": 1769673913622 +} \ No newline at end of file diff --git a/rules/3d.md b/rules/3d.md new file mode 100644 index 0000000..31fa5c6 --- /dev/null +++ b/rules/3d.md @@ -0,0 +1,86 @@ +--- +name: 3d +description: 3D content in Remotion using Three.js and React Three Fiber. +metadata: + tags: 3d, three, threejs +--- + +# Using Three.js and React Three Fiber in Remotion + +Follow React Three Fiber and Three.js best practices. +Only the following Remotion-specific rules need to be followed: + +## Prerequisites + +First, the `@remotion/three` package needs to be installed. +If it is not, use the following command: + +```bash +npx remotion add @remotion/three # If project uses npm +bunx remotion add @remotion/three # If project uses bun +yarn remotion add @remotion/three # If project uses yarn +pnpm exec remotion add @remotion/three # If project uses pnpm +``` + +## Using ThreeCanvas + +You MUST wrap 3D content in `` and include proper lighting. +`` MUST have a `width` and `height` prop. + +```tsx +import { ThreeCanvas } from "@remotion/three"; +import { useVideoConfig } from "remotion"; + +const { width, height } = useVideoConfig(); + + + + + + + + + +``` + +## No animations not driven by `useCurrentFrame()` + +Shaders, models etc MUST NOT animate by themselves. +No animations are allowed unless they are driven by `useCurrentFrame()`. +Otherwise, it will cause flickering during rendering. + +Using `useFrame()` from `@react-three/fiber` is forbidden. + +## Animate using `useCurrentFrame()` + +Use `useCurrentFrame()` to perform animations. + +```tsx +const frame = useCurrentFrame(); +const rotationY = frame * 0.02; + + + + + +``` + +## Using `` inside `` + +The `layout` prop of any `` inside a `` must be set to `none`. + +```tsx +import { Sequence } from "remotion"; +import { ThreeCanvas } from "@remotion/three"; + +const { width, height } = useVideoConfig(); + + + + + + + + + +``` \ No newline at end of file diff --git a/rules/animations.md b/rules/animations.md new file mode 100644 index 0000000..7e15623 --- /dev/null +++ b/rules/animations.md @@ -0,0 +1,29 @@ +--- +name: animations +description: Fundamental animation skills for Remotion +metadata: + tags: animations, transitions, frames, useCurrentFrame +--- + +All animations MUST be driven by the `useCurrentFrame()` hook. +Write animations in seconds and multiply them by the `fps` value from `useVideoConfig()`. + +```tsx +import { useCurrentFrame } from "remotion"; + +export const FadeIn = () => { + const frame = useCurrentFrame(); + const { fps } = useVideoConfig(); + + const opacity = interpolate(frame, [0, 2 * fps], [0, 1], { + extrapolateRight: 'clamp', + }); + + return ( +
Hello World!
+ ); +}; +``` + +CSS transitions or animations are FORBIDDEN - they will not render correctly. +Tailwind animation class names are FORBIDDEN - they will not render correctly. \ No newline at end of file diff --git a/rules/assets.md b/rules/assets.md new file mode 100644 index 0000000..04c8ad5 --- /dev/null +++ b/rules/assets.md @@ -0,0 +1,78 @@ +--- +name: assets +description: Importing images, videos, audio, and fonts into Remotion +metadata: + tags: assets, staticFile, images, fonts, public +--- + +# Importing assets in Remotion + +## The public folder + +Place assets in the `public/` folder at your project root. + +## Using staticFile() + +You MUST use `staticFile()` to reference files from the `public/` folder: + +```tsx +import {Img, staticFile} from 'remotion'; + +export const MyComposition = () => { + return ; +}; +``` + +The function returns an encoded URL that works correctly when deploying to subdirectories. + +## Using with components + +**Images:** + +```tsx +import {Img, staticFile} from 'remotion'; + +; +``` + +**Videos:** + +```tsx +import {Video} from '@remotion/media'; +import {staticFile} from 'remotion'; + +