# Stage S5: Episode Breakdown

You are splitting a short story into episodes for a multi-episode microdrama series (vertical 9:16 video).

## Source Text

Read the full story: `source.txt`

## Story Bible

Read: `{bible_path}`

## Visual Style

Read: `{style_path}`

## Task

Break the story into episodes. Each episode is a self-contained vertical video with:
- A **grid layout** (3x3 = 9 scenes, or 4x4 = 16 scenes)
- A **clip duration** per scene (5s or 10s)
- Total duration = grid × clip_duration (e.g., 4x4 × 10s = 160s, 3x3 × 5s = 45s)

### Episode Design Principles

1. **Cliffhangers**: Each episode should end on a hook that makes viewers want the next one
2. **Self-contained arc**: Each episode has a mini-arc (setup → tension → partial resolution or cliffhanger)
3. **Pacing**: Match grid size and clip duration to story content:
   - Action/fast scenes → 5s clips, more scenes (4x4)
   - Dialogue/emotional scenes → 10s clips, fewer scenes (3x3)
   - Mix within the series based on episode content
4. **Dialogue moments**: Mark specific lines from the story that should be spoken in-video. Use the **voice prompt formula**:
   `He/She says in the voice of a [AGE] [GENDER], [TIMBRE], [TONE], [PACING]: "dialogue"`
   - AGE + GENDER + TIMBRE = character's constant "voice signature" (from story_bible.json)
   - TONE + PACING = vary per scene emotion (angry = faster, sad = slower, etc.)
5. **Scene specificity**: Each scene beat should be specific enough to generate a video prompt from

### Episode Structure

For each episode provide:
- **number**: Episode number (1, 2, 3...)
- **title**: Short evocative title
- **title_card_text**: Text for the episode title card (e.g., "Episode 1: Stranded")
- **summary**: 2-3 sentence summary
- **story_segment**: Which part of the original story this covers
- **source_text_range**: Approximate lines in source.txt
- **characters**: Character IDs that appear
- **locations**: Location IDs used
- **grid_layout**: "3x3" or "4x4"
- **clip_duration**: "5s" or "10s"
- **target_duration**: Total seconds (e.g., "90s")
- **scenes_outline**: Array of scene beats with duration
- **dialogue_moments**: Specific dialogue lines with speaker, voice direction
- **ends_on**: What the cliffhanger/ending beat is

## Output

Write TWO files:

1. **episodes.json**:
```json
{
  "total_episodes": 4,
  "grid_default": "4x4",
  "clip_duration_default": "5s",
  "episodes": [
    {
      "number": 1,
      "title": "...",
      "title_card_text": "Episode 1: ...",
      "summary": "...",
      "story_segment": "...",
      "source_text_range": "...",
      "characters": ["character_id", "..."],
      "locations": ["location_id", "..."],
      "grid_layout": "3x3",
      "clip_duration": "10s",
      "target_duration": "90s",
      "scenes_outline": [
        {"number": 1, "beat": "...", "duration": "10s"},
        {"number": 2, "beat": "...", "duration": "10s"}
      ],
      "dialogue_moments": [
        {"scene": 3, "speaker": "character_id", "line": "...", "voice_prompt": "He says in the voice of a young man, deep gravelly voice, desperate urgent tone, faster pacing"}
      ],
      "ends_on": "..."
    }
  ]
}
```

2. **user_message.txt** — Friendly summary: how many episodes, the pacing strategy, key moments in each episode.
