---
name: revise
description: Process annotations and formatting edits from the Revision Editor (Production Console → Revision tab) — apply type changes, rewrites, deletions, and moves interactively.
allowed-tools: Read, Write, Edit, Glob, Bash
argument-hint: "[project] [annotations_file]"
---

# /revise - Annotation-Driven Script Revision

Process annotations and formatting edits exported from the Revision Editor (Production Console → Revision tab). Applies type changes automatically, then walks through rewrites, deletions, moves, and flags interactively.

## Usage

```
/revise [project] [annotations_file]
```

**Examples:**
```
/revise the-hike THE-HIKE-COMPLETE-gen5-annotations.json
/revise leviathan LEVIATHAN-COMPLETE-annotations.json
```

## Parameters

| Parameter | Required | Default | Description |
|-----------|----------|---------|-------------|
| `project` | Yes | -- | Project folder name |
| `annotations_file` | Yes | -- | JSON file exported from editors/revision_editor.html (in project root or specified path) |

## What It Does

1. **Phase 0:** Parses the annotations JSON, reports summary (edit counts, annotation counts by episode)
2. **Phase 1:** Applies formatting edits automatically (type changes, text fixes from the Revision Editor)
3. **Phase 2:** Processes annotations interactively (REWRITE, DELETE, MOVE, FLAG) with AI suggestions, manual edit, and skip options
4. Creates per-episode backups before any modification
5. Validates V12 word count constraints after each change
6. Logs all decisions to `revision_log.json` in the project state directory
7. Supports session persistence (quit mid-session, resume later)

## Execution

When this skill is invoked:

1. **Read the agent protocol:** `/agents/revision_agent.md`
2. **Follow the protocol exactly** -- it defines the full interactive workflow, backup system, error handling, and summary report format
