Create a Reel for One Episode
Users typically provide only the episode name (or number). All other rules are defined in this skill and CLAUDE.md; do not ask the user for supplementary data. If uncertain, make a decision based on the principles and explain it in the summary.
This repo does not call any external APIs. The entire flow consumes no Gemini quota. Only when the "Reel narration" is missing for an episode do you need to generate it in the podcast (see Step 2), and only with the user's permission.
Step 1: Find the Episode & Add Timestamps
- Episode number → episode name: Check the filenames in
../podcast/episodes/(e.g., 2 →ep02_fish). - Verify
../podcast/build/<episodeName>.mp3exists; if not, the podcast hasn't generated this episode—stop and inform the user. - If
../podcast/build/<episodeName>.timeline.jsondoes not exist, generate it in the podcast (no quota cost, reads cache only):If it fails (e.g., incomplete cache), stop and explain; do not removecd ../podcast && PYTHONUTF8=1 py generate_episode.py episodes/<episodeName>.md --offline --timeline-only--offline. The Bash tool must usepy;pythonalso works on this machine, but the podcast's CLAUDE.md usespy.
Step 2: Confirm the Reel Narration Includes This Episode
The opening hook and outro come from the podcast's Reel narration scripts: episodes 1–13 are in episodes/reels_s1.md, episodes 14–26 in reels_s2.md, and so on (one file per season).
- Locate the file for the season this episode belongs to. Verify it contains the line: "The child asks you: '<this episode's question>'" and that
build/reels_sN.timeline.jsonalready exists. - The question must match the first heading in the episode script (the podcast may change topics mid-stream, leaving the narration outdated).
- Missing file, missing line, or mismatched question: Stop and inform the user. Adding narration requires editing the season's file and regenerating it—a single batch API call. The user must approve this first; follow the podcast's CLAUDE.md (do not use
--limit).
Step 3: Select Clips
Read ../podcast/episodes/<episodeName>.md and the timeline (per-sentence timestamps), then select character clips.
- Content: Lili asks a question → Grandpa Gu's little experiment → the answer. The opening narration has already asked the question, so the "discovery" dialogue at the beginning can usually be omitted.
- Length: Character speech 45–55 seconds (plus narration and pauses, total video ~70 seconds). To trim: remove redundant buildup, transitional lines like "That's a great question," and minor rounds of the experiment; do not remove the answer line.
- Do not select: relaxation guidance, shared segments (opening, Grandpa Gu's introductory narration), or the sleep induction and closing ritual.
- Avoid story narration within the clips (the Reel's narration targets parents; mixing them causes confusion). If truly needed, explain in the summary.
- After removing interior lines, ensure seamless flow: each paragraph's first line must be understandable without prior context.
Write data/clips/<episodeName>.json following the format of data/clips/ep01_moon.json:
{
"episode": "<episodeName>",
"no": <episodeNumber>,
"title": "Why Forest|Episode N",
"question": "<this episode's question, including question mark>",
"narration": "reels_s1",
"hook": "<fragment of the episode's question, e.g., Why does the moon follow me?>",
"outro": "A complete bedtime story",
"ranges": [["start phrase", "end phrase"], ["single phrase"]],
"maxGap": 0.6,
"bed": "<ambient sound filename>",
"bedVolume": 0.15
}
- Fragments must be sufficiently long and unique within the episode.
make-propswill halt if it matches 0 or more than one sentence. Adjust the fragment; do not guess. bed: Use the ambient sound for the scene in the selected clip. Look up the filename fromSOUNDSin../podcast/generate_episode.py(e.g.,night_crickets.wavfornight_crickets,river_flowing.wavforriver_flowing).
Then run node scripts/make-props.mjs data/clips/<episodeName>.json; it will print the character sentence count and speech duration.
Step 4: Pause for User Confirmation
Provide a short summary:
- Which sentences were selected (character + lines, one per line), and which were removed and why
- Character speaking time, narration time, estimated total video length
- Ambient sound used
When processing multiple episodes, list each one before asking for confirmation. Output the MP4 only after the user confirms the selections (each output takes several minutes).
Step 5: Check Frames & Output
- First output three test frames (
--still=<frame count>, 30 fps): opening hook (approx. frame 90), middle of character segment, closing (last 2 seconds).
Verify: the question is not broken across two lines with only 1–2 characters remaining, no strange symbols in subtitles, correct character avatars, and "AI voice" labels present. If a new character (not innode render.mjs build/<episodeName>/props.json out/<episodeName>_hook.png --still=90CHARACTERS) appears, the avatar will be 💬; inform the user and ask for character artwork. - Output:
node render.mjs build/<episodeName>/props.json out/<episodeName>.mp4. Use ffprobe to measure duration and file size. - Provide a review checklist for the user:
- Approximate seconds for each edit point (narration → character, removed lines)—are they noticeable?
- Ambient sound volume (
bedVolume) - Lines with sound markers (e.g.,
<chuckle>)
Wrap-Up
- Only commit when the user requests it.
public/ep*/,public/reels_*/,build/, andout/are not version-controlled;data/clips/*.jsonmust be committed. - When updating the workflow or conventions, reflect changes in this skill and CLAUDE.md.