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':
| Step | Author's Private Skill | Replacement |
|---|---|---|
| Write spoken script | weilanx-creator-spoken-script (author's writing style) | Write your own, or have the agent follow 'strong hook start, coherent sentences, no colons or parentheses' |
| Voiceover | weilanx-doubao-voice-clone (Doubao voice cloning) | Any TTS or real recording, output wav/mp3 |
| Subtitles | weilanx-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 asepNN-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 insrc/episodes/<ep>/, and audio inpublic/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.
- Check voice availability:
python3 scripts/voice.py status - Synthesize:
python3 scripts/voice.py synthesize --text-file <project>/materials/<ep>/口播稿.txt --output <project>/materials/<ep>/<ep>-口播-中文标准版.mp3 - 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>/字幕.srtand字幕稿.md. The filenames must be exactly these;字幕稿.mdwill 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/.
- Voice: Measure loudness with
ebur128, then adjust to around −16 LUFS (±0.5) usingvolume=<gain>dB,alimiter=limit=0.8:level=false. Convert to 48kHz stereo 16-bit, save aspublic/audio/<ep>/voice.wav. - Subtitles: Run
npm run cues -- materials/<ep>/字幕.srt src/episodes/<ep>/cues.json. Incues.ts, setVOICE_SECONDSto the voice duration plus 0.3–0.5 seconds, and ensure it is not shorter than the end time of the last subtitle. - Background Music: Create
audio/episodes/<ep>.mjswith the segment table. Run onlynode audio/episodes/<ep>.mjs, notnpm run audio, to avoid regenerating other episodes. - Scenes: Create
src/episodes/<ep>/containingEp*.tsx,cues.ts,scenes/part1.tsx,part2.tsx,scenes/Cover.tsx, andindex.ts.- Layout:
w: 1080, h: 1440,stage: {top: 120, h: 1080},subY: 1250,chapter: {y: 34, align: 'center'},look: 'sticker'.keywordsshould 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 usesPiPin 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.
- Layout:
- Cover: Write
scenes/Cover.tsx. In the configuration, setcover: {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. Followep06-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.
- Registration and Testing: Register the work in
src/Root.tsx. Add tests similar totests/episodes/ep05-token.test.ts. Thennpm run typecheckandnpm testmust both pass. - 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/vstackto 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 ≥ 30to 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 $FRwill not split on spaces; usebash -c '…'.remotion stillrenders 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
$TMPDIRmay be cleaned up by the system; re-run recognition if needed. - Do not import
src/episodes/from withinsrc/library/. If a newly created component is reusable, move it into the library and updateREADME.md.
5. Write Publishing Copy and Open Studio for User
- Call the
dbs-xhs-titleskill. 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 toout/<ep>/during export. - Check if Studio is running with
lsof -i :3000 -sTCP:LISTEN. If running, it will hot-reload; if not, startnpm run studioin the background. - Give the user the preview URL
http://localhost:3000/<ep>. Do not runnpm 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>/byscripts/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.mdetc. - 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发布文案.mdare all inout/<ep>/. - Also copy the final video to
materials/<ep>/for backup.