---
name: treatment
description: Transform episode_arc.md into prose treatment.md — the MASTER document for episode generation.
allowed-tools: Read, Write, Glob, Bash
argument-hint: "[project] [--batch|--close-read|--validate-only]"
---

# /treatment - Treatment Generation

Transform episode_arc.md into prose treatment.md — the MASTER document for episode generation.

## Prerequisites (HARD GATE)

**Before running this command, the project MUST be promoted.**

Run this validation before treatment generation:
```bash
python3 .claude/hooks/validate_pre_treatment.py ./[project]
```

**Required files (created by `/promote`):**
- `bible/episode_arc.md` — Must exist with all 60 episodes
- `bible/characters.md` — Must pass behavioral DNA validation
- `bible/series_bible.md` — Must exist with content
- `state/current_state.json` — Must be initialized

**If prerequisites are not met:**
```
ERROR: Pre-treatment gate failed.

This project must be promoted first:
  1. Complete 34/34 checklist in /projects/[project]/development/
  2. Run /validate [project]
  3. Run /promote [project]
  4. Then retry /treatment [project]
```

---

## Usage

```
/treatment [project]                      # Full treatment (all 60 episodes + close read)
/treatment [project] --batch N-M          # Generate episodes N through M only
/treatment [project] --close-read         # Close read pass on existing treatment
/treatment [project] --validate-only      # Check existing treatment.md
/treatment [project] --plus [N,N,N]       # Improve specific weak episodes
/treatment [project] --flag-weak          # Identify weak episodes
```

**Examples:**
```
/treatment olympus                    # Full treatment generation (includes close read)
/treatment olympus --batch 1-10       # First batch only
/treatment olympus --close-read       # Run close read on existing treatment
/treatment olympus --validate-only    # Validation check
/treatment olympus --plus 23,24,25    # Improve specific episodes
/treatment olympus --flag-weak        # Find weak spots
```

## Parameters

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `project` | Yes | — | Project folder name (e.g., `olympus`, `leviathan`) |
| `--batch N-M` | No | all | Generate only episodes N through M |
| `--validate-only` | No | false | Check format without changes |
| `--plus [N,N,N]` | No | — | Comma-separated episode numbers to improve |
| `--close-read` | No | false | Run close read pass (continuity, spatial, motivation, threads) |
| `--flag-weak` | No | false | Run weak episode detection |

## What It Does

1. Transforms bullet-point `episode_arc.md` into flowing prose paragraphs
2. Identifies THE MOMENT for each episode (the one beat that must land)
3. Specifies concrete cliffhanger images (not just types)
4. Tracks hook/cliffhanger distribution (70-85% SILENT, 70-85% MID-ACTION) (per CONSTANTS.md)
5. Creates the MASTER document that drives episode generation
6. **Close read pass** — catches cliffhanger→hook logic, spatial gaps, physical consistency, motivation, and thread integrity issues before they propagate to 60 generated episodes

## Execution

When this skill is invoked:

1. **Read the agent prompt:** `/agents/treatment_agent.md`
2. **Follow the workflow** specified in the agent
3. **Validate output** with `python3 /tools/validate_treatment.py ./[project]`

## Workflow Position

Treatment comes AFTER Promotion (Phase 4).

```
/projects/[project]/development/    ← Development phase (34/34 checklist)
    ↓
/validate [project]               ← Pre-promotion validation
    ↓
/promote [project]                ← Creates scripting folder + transforms docs
    ↓
validate_pre_treatment.py         ← HARD GATE (runs automatically)
    ↓
/treatment [project]              ← THIS COMMAND
```

**Requires (created by /promote):**
- `bible/episode_arc.md` — 60 episodes with cliffhangers
- `bible/characters.md` — Production format, validated
- `bible/series_bible.md` — World, theme, concept
