Communitygithub.com

Reference Video → New Style Asset Pack

Distills visual grammar (color, typography, transitions, motion) from reference videos into a reusable Remotion style asset pack, with zero content plagiarism.

What is Reference Video → New Style Asset Pack?

This skill enables AI agents like Claude Code to analyze one or more reference videos provided by the user, break down each shot's visual language, and produce a complete, reusable Remotion style asset pack. It performs machine analysis (shot cuts, keyframes, motion intensity, color palettes, audio beats) and human-guided inspection to extract the 'visual grammar' — color schemes, typography, layout, entrances/transitions/camera moves, rhythm, and signature frames. The output is a structured component directory under `src/library/<styleID>/`, a preview composition (`library-<styleID>`), a style recipe card in `styles/我的风格/<ChineseName>/`, and entries in the library index and style registry. Crucially, it enforces ethical boundaries: it learns style but never copies content (text, watermarks, branded elements, copyrighted characters). It supports the weilanx-claude-videos project ecosystem and can be used standalone for single-animation recreation. The workflow executes steps 0–7 sequentially without pausing for confirmation, provides progress updates, and avoids git commits or exports unless requested. It requires reading project configuration files (CLAUDE.md, READMEs) for engineering conventions.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Azure12355/weilanx-claude-videos/tree/HEAD/.claude/skills/weilanx-creator-distill-video

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

What does Reference Video → New Style Asset Pack do?

Reference result: The Gilded Text style (src/library/gilded/, library-gilded, styles/我的风格/暗金文献风/) was distilled from a single reference video (not committed to git). User-recognized effect: The style is instantly recognizable, but all components are rewritten, sample content is original, and nothing from the original footage (copy, titles, watermarks) is carried over.

Execute steps 0–7 in one go, without waiting for user confirmation between steps. After each step, provide a one- or two-sentence progress update. Do not export or commit to git unless the user explicitly asks. Before starting, read the project root CLAUDE.md, src/library/README.md, and styles/README.md. Prefix all npm / npx / node commands with export NODE_OPTIONS=--max-old-space-size=4096.

Boundaries of Distillation (Think Before Acting)

Distill visual grammar, not content. You may learn the style itself (color tendencies, font pairings, layout grids, entrance methods, transition techniques, rhythm); you may not copy a specific work.

  • Learn: Color system, font personality and hierarchy, layout positions, element entrance/exit/transition methods, easing and duration, camera motion, rhythm (cut frequency, shot length, beat matching), chart/prop drawing techniques, textures (grain, glows, paper textures).
  • Do not copy: Original copy and subtitles, titles, specific scene layout and storyboard order, creator names / watermarks / brand identifiers, portraits of people from the original footage, third-party logos and trademarks.
  • Characters: If the original footage includes well-known copyrighted characters (anime, game, brand mascots), learn their construction technique (geometry, proportions, strokes, coloring) but create an obviously different original character — do not draw something "vaguely similar".
  • Music: Do not include the original soundtrack in the asset pack; if music is wanted, use the music library (public/music/) and clearly note in the README that licensing is unconfirmed.
  • Sample copy in previews: Write your own, on a different topic than the original footage. Use placeholders like "Sample Text" or "Example Person" for cited book names or people.

When the user says "replicate one-to-one", follow the boundaries above and reply with a single sentence: "Style is one-to-one; content is not copied."

0. Define Style ID and Directories

  • Style ID: Lowercase English kebab-case, based on the most prominent visual feature (e.g., gilded, ink-scroll, neon-grid). Must not conflict with existing directories in src/library/. Chinese name: 3–6 characters (e.g., 暗金文献风, 宣纸水墨风).
  • Distillation package: Place under materials/distill/<styleID>/<videoName>/ (materials/ is not committed to git; original footage frames must not enter the repository).
  • Output: src/library/<styleID>/, src/library/previews/<Name>Demo.tsx, styles/我的风格/<chineseName>/README.md + preview.jpg.

1. Machine Analysis (Run Once per Video)

uv run --with numpy --with pillow python .claude/skills/weilanx-creator-distill-video/scripts/analyze.py \
  <video> --out materials/distill/<styleID>/<videoName>

Produces report.md (read this first), data.json, keyframes/ (keyframe per shot), sheets/ (contact sheet every 3 seconds), palette.png. The report includes: hard cuts and shot table, motion intensity per second, main palette (by area) and accent colors (by saturated pixels, not drowned by large backgrounds), brightness/saturation, audio loudness and beat points (calls the gilded style skill's beats.py).

If there are too many or too few hard cuts, adjust --cut (default 0.30; smaller = more sensitive). If the contact sheet is too dense or too sparse, adjust --every.

2. Human Inspection: Understanding Why It Looks Good

See references/拆解方法.md for details. Order:

  1. Contact sheet: Scan through, classify into categories (title card, year header, chart, object, quote…), note the time range for each.
  2. Keyframes: Look at each one, crop and zoom to examine fonts, strokes, shadows, textures (ffmpeg -vf crop=…).
  3. Motion slices: Cut one slice each for entrance, exit, transition, and signature action. Count "how many frames to complete", "ease-in-out or linear", "blur/scale/offset present":
    uv run --with pillow python .claude/skills/weilanx-creator-distill-video/scripts/strip.py <video> \
      --at 16.6 --span 1.2 --n 8 --out materials/distill/<styleID>/strips/t16.6.jpg
    
    Slices should also be taken at peaks in the motion intensity curve and before/after cut points in the shot table.
  4. Color picking: Get accent colors from the report; pick pixel colors for specific elements from keyframes (uv run --with pillow python -c "…getpixel…").
  5. Multiple videos: Analyze each independently, then find common grammar; document inconsistencies as "variants" (e.g., warm-tone vs. cold-tone glow).

3. Write the Style Recipe Card

Using the structure from references/配方卡模板.md, write into styles/我的风格/<chineseName>/README.md: one-sentence positioning, visual characteristics (base texture, color scheme, fonts, fixed layout, entrances, transitions, camera, rhythm, signature frames), component list, key code locations, usage table, "things intentionally not copied". This is the design document before writing code; clarify it before moving on.

4. Write the Asset Pack Code

Follow the layering of src/library/gilded/ (it is the result of the first distillation and its structure can be directly referenced):

FileWhat to Place
theme.tsColor constants, font constants, style functions (gradient text, glow), generic entrance functions (e.g., soft) and easing values
stage.tsxScene layer: background, texture (grain/dust/paper texture), fixed layout elements (headers, quotes, captions), title card, quote card, soft-entry container
props.tsxObjects and props
charts.tsxHow this style draws charts (only present if the original footage includes charts)

Hard rules (engineering conventions, see CLAUDE.md):

  • Animation is a pure function of frame number: Components take f and compute their state; use rand(seed) for randomization. No CSS animations, no Math.random().
  • The library must not import from src/episodes/.
  • Use fonts already in the repository (public/fonts/, OFL) or system fonts. To add a new font, confirm its license, add it to public/fonts/ and update public/fonts/LICENSES.md.
  • Each component must have a one-line Chinese comment explaining its purpose and key parameters.

5. Preview Composition

  • src/library/previews/<Name>Demo.tsx: Every 150 frames, demonstrate each component in sequence. Use this style's own transitions between sections. Write original sample copy on a different topic from the original footage.
  • Export <NAME>_DEMO_FRAMES, register library-<styleID> in src/Root.tsx. Aspect ratio should match the original video.
  • npm run typecheck && npm test.

6. Side-by-Side Verification (At Least Two Rounds)

  • For each section, render one frame: npx remotion still src/index.ts library-<styleID> /tmp/<styleID>/sN.jpg --frame=N --scale=0.5 --timeout=120000. Render only one frame at a time (parallel rendering causes memory overflow).
  • Compare with a keyframe of the same type from the original footage by stacking them horizontally (ffmpeg -i original-frame -i our-frame -filter_complex hstack). Check point by point: background color, main color, accent color, font personality, font size hierarchy, layout position, texture, whitespace.
  • Motion comparison: For the same type of entrance, compare original slices vs. our slices — do frame counts and easing match?
  • Each round: list discrepancies → fix → re-render. Common issues: gradient text on small font sizes turning brown, glow too weak, elements too small with too much whitespace, charts cramped in the center.
  • After fixes, stitch the 4 sections into styles/我的风格/<chineseName>/preview.jpg (use only our rendered frames, do not include original footage screenshots).

7. Registration and Delivery

  • Add a section to src/library/README.md (following the format of "暗金文献风 gilded/": file | content table + bullet points).
  • Add a row to "我的风格" table in styles/README.md. In the recipe card's usage table, write "not yet used".
  • Studio preview link: http://localhost:3000/library-<styleID> (if not open, start in background with npx remotion studio src/index.ts --no-open --port 3000).
  • In your reply, include: key points of this style (3–5 items), component list, what was fixed after side-by-side verification, what was intentionally not copied, and what remains to be improved.
  • If the user wants to immediately use it in an episode, proceed with the corresponding episode production workflow. For non-narrated knowledge shorts, you can reference the weilanx-creator-gilded-video process, substituting the new asset pack.

Individual skills in this repo

This repo contains 3 individual skills — each has its own dedicated page.

Azure12355/weilanx-claude-videos

「暗金文献风纯音乐知识短片」工作流:给一个知识点(数学、经济、心理、科学、历史上的某个规律或冷知识),不配音、不找素材,只用代码画面 + 中英双语字幕 + 一首配乐,在 weilanx-claude-videos 工程里做成横屏 16:9 的 30~60 秒短片:近黑底、金色细线、衬线字,先找一个「锚词」,开头用第二人称写观众的处境,第一个高潮踩在配乐的「换气 + 重拍」上让锚词砸出来,结尾重新定义锚词并抛一个问题。最后打开 Remotion Studio 给用户预览,确认后再导出。用户说「做一期暗金风的」「像棋盘麦粒那期一样做一期」「用金色风格讲讲 XX」「做一条纯音乐的知识视频」「Vibe 知识视频」「不要口播,只要字幕和音乐」时都用这个 skill,即使没提「暗金」两个字,只要是无口播、靠画面和字幕讲一个知识点的短片也用它。

Azure12355/weilanx-claude-videos

“一个关键词出一期像素风口播动画”工作流。用户只给一个主题或关键词(比如“上下文是什么”“MCP”),就依次写口播稿、用复刻音色配音并加速 1.2 倍、转 SRT、在 weilanx-claude-videos 工程里新建一期(竖屏 3:4、首帧带封面)并剪好、写好发布文案(标题和描述),最后打开 Remotion Studio 给用户预览;用户确认后再导出,成片目录里同时带字幕稿和发布文案。用户说“做一期 XX”“用这个关键词出一期视频”“按工作流来”时使用。

Azure12355/weilanx-claude-videos

「Vox 拼贴风科普短视频」工作流:给一个科普主题(新闻、诺奖、科学发现、科技事件),先上网查权威资料和可用的真实素材(NASA、Wikimedia Commons、官方新闻稿插图),写一份像聊天一样有语气、有强钩子和深度结尾的口播稿,用带语气提示的豆包复刻音色配音,再在 weilanx-claude-videos 工程里做成横屏 16:9 的 Vox 拼贴片:A-roll 是黑卡大字,B-roll 是钉在旧纸桌面上的真实视频和照片,按字幕硬切,配一条有律动的电子配乐。最后打开 Remotion Studio 给用户预览,确认后再导出。用户说「做一期 Vox 风格的科普」「用 Vox 风格讲讲 XX」「做一期 XX 的科普,要真实素材」「像诺奖那期一样做一期」时使用。

Related Skills