Communitygithub.com

gagahsu/forestreels

Turn an episode of the "Why Forest" podcast into a highlight Reel: add timestamps → select clips → await user confirmation → make-props → check frames → output mp4. Used when the user says "make a Reel for epNN" or "/new-reel epNN_xxx"; supports batch processing.

What is forestreels?

This skill automates the creation of a short-form video Reel from a specific episode of the "Why Forest" podcast. It is designed for AI coding agents (like Claude Code, Cursor, or Codex) that operate within a project repository. The skill helps generate engaging social media clips by selecting the most impactful dialogue segments, ensuring proper narration, and producing a final MP4 video. Key platforms include any system where the agent runs Python and Node.js. The workflow is API-free beyond optional off-device narration generation (requiring user consent), relying on local scripts and cached data. The skill intelligently selects a 45–55 second section of character dialogue, skipping repetitive or transitional content while preserving the core question, experiment, and answer. It integrates tightly with the podcast's episode structure, timeline files, and sound effects library to create polished, ready-to-share Reels without incurring cloud costs.

Works with✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/gagahsu/forestreels/tree/HEAD/.claude/skills/new-reel

Ask in your favorite AI

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

Documentation

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

  1. Episode number → episode name: Check the filenames in ../podcast/episodes/ (e.g., 2 → ep02_fish).
  2. Verify ../podcast/build/<episodeName>.mp3 exists; if not, the podcast hasn't generated this episode—stop and inform the user.
  3. If ../podcast/build/<episodeName>.timeline.json does not exist, generate it in the podcast (no quota cost, reads cache only):
    cd ../podcast && PYTHONUTF8=1 py generate_episode.py episodes/<episodeName>.md --offline --timeline-only
    
    If it fails (e.g., incomplete cache), stop and explain; do not remove --offline. The Bash tool must use py; python also works on this machine, but the podcast's CLAUDE.md uses py.

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.json already 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-props will 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 from SOUNDS in ../podcast/generate_episode.py (e.g., night_crickets.wav for night_crickets, river_flowing.wav for river_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

  1. First output three test frames (--still=<frame count>, 30 fps): opening hook (approx. frame 90), middle of character segment, closing (last 2 seconds).
    node render.mjs build/<episodeName>/props.json out/<episodeName>_hook.png --still=90
    
    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 in CHARACTERS) appears, the avatar will be 💬; inform the user and ask for character artwork.
  2. Output: node render.mjs build/<episodeName>/props.json out/<episodeName>.mp4. Use ffprobe to measure duration and file size.
  3. 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/, and out/ are not version-controlled; data/clips/*.json must be committed.
  • When updating the workflow or conventions, reflect changes in this skill and CLAUDE.md.

Related Skills