---
name: promote
description: Promote a MASTER_PLAN to the active phase in WORKFLOW_STATE.md
arguments: "[PLAN_FILE]"
---

# /promote Command

Activate a MASTER_PLAN file as the current working phase, populating WORKFLOW_STATE.md with its step listing.

## Arguments

- `PLAN_FILE` (optional) — Path to the MASTER_PLAN file. If omitted, uses the most recent `MASTER_PLAN*.md` in the project root.

## Behavior

### Step 1: Check for Active Phase

Read `WORKFLOW_STATE.md`. If the `## Active Phase` section already shows an active plan (anything other than `Phase: idle`), warn the user:

> There is already an active phase: [phase name] (PLAN_FILE).
> Complete or archive it before promoting a new plan.

Then stop. Do NOT overwrite an active phase.

### Step 2: Locate the Plan File

If `PLAN_FILE` was provided, use it directly. Otherwise, use the Glob tool to find `MASTER_PLAN*.md` files in the project root and pick the one with the highest number.

If no plan file is found, tell the user:
> No MASTER_PLAN files found. Use `/next-plan` or `/formalize-plan` to create one.

### Step 3: Parse the Plan

Run the parse script to extract step data:

```bash
bash "${CLAUDE_PLUGIN_ROOT}/scripts/parse-plan-steps.sh" "PLAN_FILE"
```

Capture the output. Extract TITLE, TOTAL, DONE, and each STEP line.

### Step 4: Update WORKFLOW_STATE.md

Read `WORKFLOW_STATE.md` and replace the `## Active Phase` section with:

```
## Active Phase

Phase: [title from plan]
Plan: [filename]

### Steps

| # | Step | Status |
|---|------|--------|
| 1 | Step title | pending |
| 2 | Step title | pending |
| ... | ... | ... |
```

Steps that are already checked in the plan file should show `done` instead of `pending`.

### Step 5: Report

Tell the user:
- The plan has been promoted to the active phase
- Show the step count (e.g., "8 steps, 0 completed")
- Suggest using `/next-step` to see what to work on next
