Communitygithub.com

Azure12355/weilanx-claude-videos

A workflow that takes a keyword from the user and generates a complete pixel-style talking-head animation video: from script writing and voice cloning to SRT subtitles, project assembly, and publishing copy, all in one automated pipeline.

What is weilanx-claude-videos?

This skill is an end-to-end video production workflow designed for AI agents (such as Claude Code) to create short, pixel-art-style talking-head animation videos from a single keyword. It is intended for developers or creators who want to automate the repetitive steps of producing educational or explanatory micro-videos for platforms like Xiaohongshu (Little Red Book). The workflow integrates several private skills (which the user must replace with their own equivalents): script writing, voice cloning (with 1.2x speed-up), speech-to-text for SRT subtitles, and project scaffolding within a Remotion-based engineering setup. It handles the full pipeline from keyword to final video preview, including creating episode directories, writing a spoken script, generating voiceover audio, producing subtitles, building the Remotion project (1080×1440 vertical video with a cover frame), and writing publishing copy. The user only needs to provide a keyword; the agent completes all steps sequentially, reports progress, and finally opens the Remotion Studio for the user to preview before confirming the export. The skill also includes robust error handling and quality checks (loudness normalization, subtitle alignment, cover image generation) and emphasizes a pixel-art style for characters (CC and AI assistant) with hand-drawn sticker aesthetics for other elements. The user must read the project's CLAUDE.md and library README before starting, and all npm/npx/node commands must be prefixed with `export NODE_OPTIONS=--max-old-space-size=4096`.

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

Ask in your favorite AI

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

Documentation

Keyword → One Pixel Talking-Head Animation Video

The user gives a keyword, and the workflow completes steps 0–5 in one go without waiting for confirmation mid-way. After each step, report progress in one or two sentences. Finally, present the project in Studio for the user to preview. Do not export the final video or commit to git unless the user explicitly requests it.

Before starting, read CLAUDE.md and src/library/README.md in the project root. All npm, npx, and node commands must be preceded by export NODE_OPTIONS=--max-old-space-size=4096.

Dependencies (Open Source Notes)

This workflow originally integrated several private skills from the author, which are not included in this repository. Replace them with your own tools; the interfaces only require 'input text/audio, output file':

StepAuthor's Private SkillReplacement
Write spoken scriptweilanx-creator-spoken-script (author's writing style)Write your own, or have the agent follow 'strong hook start, coherent sentences, no colons or parentheses'
Voiceoverweilanx-doubao-voice-clone (Doubao voice cloning)Any TTS or real recording, output wav/mp3
Subtitlesweilanx-doubao-voice-srt (Doubao speech recognition)Any speech recognition tool, output SRT

The in-project steps (subtitle import, rendering, export) do not depend on these.

0. Determine Episode Number and Directories

  • Look at the highest episode number in src/episodes/. The new episode gets the next number. Write the work ID as epNN-shortEnglishName, e.g., ep06-context. From now on, denote this as <ep>.
  • If materials/ already has a directory with the same topic (e.g., a previously written script), reuse it rather than creating a new one.
  • Place materials in materials/<ep>/, code in src/episodes/<ep>/, and audio in public/audio/<ep>/.
  • The candidate pool is in materials/选题候选池.md. If the user says 'pick one from the pool', prioritize topics with a ⭐. When starting work, change that row to 🎬; after export, change to ✅ and fill in the episode number. If the user's keyword is not in the pool, add a new row to the 'Done' table.

1. Write Spoken Script

Call the weilanx-creator-spoken-script skill, passing the keyword.

  • If the user hasn't specified a duration, default to 1.5–2 minutes, i.e., 600–800 characters (Chinese).
  • Save the script to materials/<ep>/口播稿.txt. Only include the text to be spoken aloud; do not include references or non-spoken content.
  • In your reply, paste the full script, state the character count, and list any facts the user should verify. Then proceed directly to the next step.

2. Voiceover and 1.2x Speed-Up

Call the weilanx-doubao-voice-clone skill.

  1. Check voice availability: python3 scripts/voice.py status
  2. Synthesize:
    python3 scripts/voice.py synthesize --text-file <project>/materials/<ep>/口播稿.txt --output <project>/materials/<ep>/<ep>-口播-中文标准版.mp3
    
  3. Speed up 1.2x while preserving pitch, output 48kHz 16-bit:
    ffmpeg -i materials/<ep>/<ep>-口播-中文标准版.mp3 -filter:a atempo=1.2 -ar 48000 -c:a pcm_s16le materials/<ep>/<ep>-口播-1.2x.wav
    

3. Convert to SRT

Call the weilanx-doubao-voice-srt skill, recognizing the already sped-up <ep>-口播-1.2x.wav. Do not speed it up again.

  • Proofread against the script. Each line should be a complete thought, 6–16 characters, with punctuation removed.
  • Output materials/<ep>/字幕.srt and 字幕稿.md. The filenames must be exactly these; 字幕稿.md will be used during export.
  • If the recognition results don't match the script (usually due to TTS misreading), note those discrepancies and inform the user to listen.

4. Build Project and Edit

Follow the 'New Episode Workflow' in CLAUDE.md. All scenes must be in vertical 3:4 (1080×1440), with the first frame as the cover. Refer to the vertical version of ep06: src/episodes/ep06-context/Ep06ContextTall.tsx (configuration), tall/part1.tsx, tall/part2.tsx (scenes), tall/Cover.tsx. The new episode does not need a horizontal version; scenes go directly under scenes/.

  1. Voice: Measure loudness with ebur128, then adjust to around −16 LUFS (±0.5) using volume=<gain>dB,alimiter=limit=0.8:level=false. Convert to 48kHz stereo 16-bit, save as public/audio/<ep>/voice.wav.
  2. Subtitles: Run npm run cues -- materials/<ep>/字幕.srt src/episodes/<ep>/cues.json. In cues.ts, set VOICE_SECONDS to the voice duration plus 0.3–0.5 seconds, and ensure it is not shorter than the end time of the last subtitle.
  3. Background Music: Create audio/episodes/<ep>.mjs with the segment table. Run only node audio/episodes/<ep>.mjs, not npm run audio, to avoid regenerating other episodes.
  4. Scenes: Create src/episodes/<ep>/ containing Ep*.tsx, cues.ts, scenes/part1.tsx, part2.tsx, scenes/Cover.tsx, and index.ts.
    • Layout: w: 1080, h: 1440, stage: {top: 120, h: 1080}, subY: 1250, chapter: {y: 34, align: 'center'}, look: 'sticker'. keywords should contain words to highlight in subtitles. The stage is a 1080×1080 square; content is stacked vertically, with font sizes larger than horizontal: title 80–140, sticky note ~40, body text no smaller than 34.
    • Style: Only CC and the AI assistant are pixel-art (wrap root component with <CharStyle.Provider value="pixel">). Fonts, cards, backgrounds should be hand-drawn sticker style; do not use pixel fonts.
    • A-roll: Use HostTall (vertical studio, host centered, top 960×360 for title). B-roll: Host uses PiP in the bottom-right corner: {x: 950, y: 1050, s: 0.7}.
    • The hook scene should visualize the hook (e.g., quiz, contrast, declaration). Transitions and conclusions use A-roll studio Host. Main content uses B-roll with host PiP in the bottom-right corner.
    • Every concept needs an understandable illustration. Emphasize key moments with Burst, FocusLines, jolt, red sticker large text. Every scene needs sound effects.
    • Use only these skins: headphones, santa, cowboy, chef, detective. Rotate them between scenes. CC has no mouth.
    • For illustrative numbers, mark them as 'illustrative' – do not fabricate real data.
  5. Cover: Write scenes/Cover.tsx. In the configuration, set cover: {C: CoverComponent, frames: startFrameOfFirstSubtitle − 5} so the cover displays full-screen for a few frames, then fades out over 6 frames before the first spoken scene. Follow ep06-context/tall/Cover.tsx:
    • Top-left slanted label: '一分钟看懂 AI', no episode number.
    • Two-line main title: first line white, second line larger red, containing the hook question.
    • Central keyword banner as large as possible: centered yellow banner with Chinese text size 80 and English text size 120, white outline, e.g., '上下文 context', '智能体 Agent'.
    • Center: the most representative image for this episode: pixel AI assistant, CC, plus episode-specific props.
    • Bottom black bar with a one-line takeaway, e.g., '3 approaches to make it smart again'.
    • Render frame 0 as a separate image: npx remotion still src/index.ts <ep> materials/<ep>/封面-3x4.png --frame=0.
  6. Registration and Testing: Register the work in src/Root.tsx. Add tests similar to tests/episodes/ep05-token.test.ts. Then npm run typecheck and npm test must both pass.
  7. Frame-by-frame self-check: Must check frame 0 (cover) and the cover fade-out frames. Check at least one frame per scene, plus intermediate states of key animations. Use ffmpeg hstack/vstack to compose images and look for overlaps, out-of-bounds, or late appearances. Fix any issues, then re-check.

Common Pitfalls

  • cw(n, 'word') attached to a word at the end of a sentence may cause the sticker to appear just as the scene transitions. Attach punchlines to earlier words, or delay the next scene by a few frames.
  • For scenes with chapter labels, the title on stage must start from y ≥ 30 to avoid overlapping the label; leave the bottom-right area (x ≥ 820, y ≥ 860) for the host.
  • The vertical stage is only 1080 pixels wide. Do not place two windows side by side; stack them vertically, or slide the old one out while the new one slides in.
  • This machine's shell is zsh. for fr in $FR will not split on spaces; use bash -c '…'. remotion still renders one frame at a time sequentially; running too many concurrently will freeze.
  • Do not run prettier on the whole file – there is no prettier config, and it will reformat everything.
  • Intermediate recognition files in $TMPDIR may be cleaned up by the system; re-run recognition if needed.
  • Do not import src/episodes/ from within src/library/. If a newly created component is reusable, move it into the library and update README.md.

5. Write Publishing Copy and Open Studio for User

  • Call the dbs-xhs-title skill. Based on this episode's content, provide one main title and two backup titles. For each, note which formula from the formula library was used. Titles must be no more than 20 characters including punctuation.
  • For the description, follow the format in out/ep07-agent/发布文案.md: first sentence is a hook, then a list of key points and actionable takeaways, and finally a line of topic tags. Only include data that was mentioned in the spoken script.
  • Save as materials/<ep>/发布文案.md. It will be automatically copied to out/<ep>/ during export.
  • Check if Studio is running with lsof -i :3000 -sTCP:LISTEN. If running, it will hot-reload; if not, start npm run studio in the background.
  • Give the user the preview URL http://localhost:3000/<ep>. Do not run npm run export.
  • Finally, report:
    • Script character count and duration
    • Voice loudness
    • Number of subtitle lines
    • Cover: appearance of frame 0 and path to 封面-3x4.png
    • Publishing copy: main title and two backup titles
    • Scene table (each scene's time and visual description)
    • Facts requiring user verification, potential TTS misreads, illustrative data
    • Reminder: only the user can judge the listening experience
  • After the user confirms, proceed to step 6 for export.

6. Export (After User Confirmation)

npm run export -- <ep> generates:

out/<ep>/
├── <ep>.mp4        Final video, audio tracks re-mixed and limited
├── stems/          voice.wav, bgm.wav, sfx.wav
├── 封面-3x4.png     Separate cover image for platforms that require separate upload
├── 字幕稿.md        Full Chinese subtitle script
└── 发布文案.md      Title (with formula number), backup titles, description, topics
  • The cover image, subtitle script, and publishing copy are automatically copied from materials/<ep>/ by scripts/export.sh. Therefore, in step 3, the subtitle file must be named 字幕稿.md. If subtitles are redone later, the latest version must still have this name; rename old versions to 字幕稿-v1.md etc.
  • After export, verify: video duration, 1080×1440, first frame is cover, overall loudness about −16 LUFS, peak below −1 dBFS, and that 封面-3x4.png, 字幕稿.md, and 发布文案.md are all in out/<ep>/.
  • Also copy the final video to materials/<ep>/ for backup.

Individual skills in this repo

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

Azure12355/weilanx-claude-videos

「参考视频 → 新风格素材包」蒸馏工作流:把用户给的一支或多支参考视频逐镜头拆解(硬切、镜头表、关键帧、联系表、主色板与强调色、运动强度、动效切片、配乐卡点),提炼出配色、字体、版式、入场 / 转场 / 镜头运动、节奏和招牌画面这些「画面语法」,再在 weilanx-claude-videos 工程里从零写成一套可复用的 Remotion 风格素材包:src/library 下一个以风格 ID 命名的组件目录、一个 library- 开头的预览作品、styles/我的风格 下的风格配方卡,并登记进素材库目录和风格总表。用户说「蒸馏这个视频的风格」「把这几个视频的风格整理成一套素材」「一比一复刻这个视频的样式」「拆解这个视频的动效和画面」「照这个视频做一套新风格」,或者丢来参考视频(template/、Downloads 里的 mp4)想学它的样子时都用这个 skill;只想复刻单个动画片段、不需要进素材库的,也先用它做拆解。

Azure12355/weilanx-claude-videos

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

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