---
name: eck:resume
version: "0.7.4"
description: "Resume an interrupted session by reading STATE.md and dispatching to the last active command."
disable-model-invocation: false
---

# Resume

Resume the last interrupted `/eck:spec`, `/eck:design`, `/eck:develop`, `/eck:validate`, or `/eck:deploy` session.

> Reads STATE.md to determine where work stopped and resumes from that point. Never loses work (P6).

---

## Visual Framework

Follow these conventions for all terminal output displayed to the user via the Bash tool.

### Output Mode Awareness

Before producing output, read the user's preferred output mode:

```bash
cat $ECK_HOME/user-preferences.json 2>/dev/null
```

Extract the `outputMode` field and adapt verbosity:

- **guided** — Add explanatory prose after key steps. Describe what is happening and why.
- **standard** (default) — Balanced. Show steps with brief context for non-obvious decisions.
- **concise** — Steps and summary box only. No prose, no explanations.

If the file is missing or `outputMode` is absent, use **standard**.

### ANSI Colors

Declare these variables at the top of **every** Bash tool call (shell state does not persist between calls):

```bash
source $ECK_HOME/colors.sh
```

Every color sequence **must** end with `${RESET}`. No exceptions.

### Stage Banners

Mark major stage transitions with a banner. One blank line before and after.

```bash
echo ""
printf '%b\n' "${ORANGE}${BOLD}STAGE NAME${RESET}"
echo ""
```

### Status Symbols

| Symbol | Meaning          | Color       |
| ------ | ---------------- | ----------- |
| `[*]`  | Active / running | `${CYAN}`   |
| `[x]`  | Completed        | `${GREEN}`  |
| `[!]`  | Error            | `${RED}`    |
| `[-]`  | Skipped          | `${DIM}`    |
| `[>]`  | In progress      | `${YELLOW}` |
| `[ ]`  | Pending          | `${DIM}`    |

No emoji in output. Use only these bracket symbols for status.

### Summary Boxes

Display at checkpoints and at the end of the skill. One blank line before and after.

### Error Format

```bash
printf '%b\n' "${RED}[!]${RESET} Error message here"
printf '%b\n' "    ${DIM}Recovery guidance here.${RESET}"
```

### Spacing Rules

- One blank line before and after stage banners and summary boxes.
- No blank lines within step lists.
- Maximum output line width: 70 characters.

---

## Task Registration

| Stage | Subject             | Active Form      | Statusline      |
| ----- | ------------------- | ---------------- | --------------- |
| 1     | Stage 1: Read State | Reading state    | ReadState (1/3) |
| 2     | Stage 2: Validate   | Validating state | Validate (2/3)  |
| 3     | Stage 3: Dispatch   | Resuming work    | Dispatch (3/3)  |

### Statusline Stage Updates

At the **start** of each stage, update the statusline:

```bash
bash $ECK_HOME/update-stage.sh "{Statusline text from table}"
```

At **skill completion** (success or error), reset:

```bash
bash $ECK_HOME/update-stage.sh
```

---

## Usage

```
/eck:resume
```

No arguments needed — STATE.md contains all context.

---

## Stage 1: Read State

### Inputs

- `$CLAUDE_PROJECT_DIR/.claude/STATE.md`

### Activities

1. Read STATE.md using `ops:state-read` primitive:
   ```bash
   cat "$CLAUDE_PROJECT_DIR/.claude/STATE.md" 2>/dev/null
   ```
2. If STATE.md not found:
   ```
   [!] No saved state found
       No interrupted session to resume. Start fresh with /eck:spec or /eck:design.
   ```
   → STOP
3. Parse STATE.md fields:
   - `Command:` — which orchestrator was running (`/eck:spec`, `/eck:design`, `/eck:develop`, etc.)
   - `Stopped at:` — stage number and name where work halted
   - `Completed:` — list of completed stages/tasks
   - `Remaining:` — list of remaining stages/tasks
   - `Context:` — TASKS.md path, feature name, flags, mode
   - `Timestamp:` — when state was saved
4. Display state summary box:

   ```
   Saved State

   Command: /eck:develop
   Stopped at: Stage 4: Execute (Wave 2, Task D)
   Completed: 3 of 7 stages, 5 of 12 tasks
   Saved: 2026-03-03 14:32
   ```

### Outputs

- Parsed session state (command, stopped-at stage, completed list, remaining list, context)

### Exit Criteria

- STATE.md found and parsed, or error displayed and skill stops

## Stage 2: Validate

### Inputs

- Parsed session state from Stage 1
- Current git branch and log

### Activities

1. Verify the git branch matches the saved state
2. Verify committed work from completed tasks is present (check git log)
3. Check for conflicts or uncommitted changes that might interfere
4. If validation fails:
   ```
   [!] State mismatch: branch has diverged since last save
       Manual resolution needed. Check git log for details.
   ```
5. Use AskUserQuestion to confirm resume:
   - "Resume from {stopped_at}?"
   - Options: "Resume", "Start over", "Cancel"

### Outputs

- Validation result (pass/fail) and user confirmation to proceed

### Exit Criteria

- Git state validated and user has confirmed intent to resume

## Stage 3: Dispatch

### Inputs

- Validated session state from Stage 2
- Saved command, context, completed task list, remaining stages

### Activities

1. Re-invoke the saved command with saved context and `--resume-from` marker:
   - If `/eck:spec` → re-invoke with remaining stages only
   - If `/eck:design` → re-invoke with remaining stages only
   - If `/eck:develop` → re-invoke starting from the interrupted wave/task
   - If `/eck:validate` → re-invoke with remaining gates only
   - If `/eck:deploy` → re-invoke from interrupted step
2. Pass all saved context (TASKS.md path, flags, mode, completed task list)
3. Delete STATE.md after successful dispatch (the resumed command owns state now)
4. Reset statusline: `bash $ECK_HOME/update-stage.sh`

### Outputs

- Resumed orchestrator running from the interrupted point
- STATE.md deleted

### Exit Criteria

- Saved command re-invoked with correct context; STATE.md removed

---

## STATE.md Format

The STATE.md file is written by `/eck:pause` or automatically on failure. Format:

```markdown
# ECK Session State

Command: /eck:develop
Feature: AUTH-123 User Authentication
Plan: .claude/TASKS.md
Mode: standard
Flags: --tdd
Branch: feat/auth-123

## Stopped at

Stage 4: Execute — Wave 2, Task AUTH-126

## Completed

- Stage 1: Load Plan
- Stage 2: Dep Graph
- Stage 3: Waves
- Stage 4: Execute — Wave 1 (Tasks AUTH-124, AUTH-125)

## Remaining

- Stage 4: Execute — Wave 2 (Tasks AUTH-126, AUTH-127)
- Stage 4: Execute — Wave 3 (Task AUTH-128)
- Stage 5: Simplify
- Stage 6: Verify
- Stage 7: Report

## Timestamp

2026-03-03T14:32:00Z
```

---

## Error Handling

- STATE.md is never deleted until a successful resume dispatch
- If the resumed command fails again, it writes a new STATE.md (not lost)
- Branch validation prevents resuming into a diverged state
- User confirmation is required before resume (P6: never auto-resume)
- At completion, reset statusline: `bash $ECK_HOME/update-stage.sh`
