Communitygithub.com

gagahsu/forestreels

把「為什麼森林」podcast 的某一集做成精華 Reel:補時間軸 → 選段 → 等使用者確認 → make-props → 檢查畫格 → 輸出 mp4。使用者說「做 epNN 的 Reel」「幫我做新一集的 Reel」「/new-reel epNN_xxx」時使用;可以一次給好幾集。

forestreels 是什么?

forestreels is a Claude Code agent skill that 把「為什麼森林」podcast 的某一集做成精華 Reel:補時間軸 → 選段 → 等使用者確認 → make-props → 檢查畫格 → 輸出 mp4。使用者說「做 epNN 的 Reel」「幫我做新一集的 Reel」「/new-reel epNN_xxx」時使用;可以一次給好幾集。.

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

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.

相关技能