---
name: eck:resume-feature
version: "0.7.4"
description: "Switch to a parked feature from the lifecycle queue and show the next step."
disable-model-invocation: false
---

# Resume Feature

Switch to a parked feature from the lifecycle queue. If a feature is currently active, it is auto-parked first.

> Feature-level context switch — reads and updates `.claude/lifecycle.json`.

---

## 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 bold 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: Select   | Selecting feature  | Select (1/2)   |
| 2     | Stage 2: Activate | Activating feature | Activate (2/2) |

### 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-feature              # interactive selection
/eck:resume-feature WA-088       # direct {KEY}-XXX
/eck:resume-feature billing-api  # by slug (resolved via manage-features.js)
```

---

## Stage 1: Select

### Inputs

- `.claude/lifecycle.json` via `update-lifecycle.js read` and `queue` — for active feature and parked detection
- `$CLAUDE_PROJECT_DIR/.claude/features.json` — `display_name` per feature (looked up by feature ID)
- Optional argument: <KEY>-XXX or feature slug/name

### Activities

1. Read lifecycle state:
   ```bash
   node $ECK_HOME/update-lifecycle.js read
   ```
2. If a feature is already active, auto-park it:
   ```bash
   node $ECK_HOME/update-lifecycle.js deactivate
   ```
   Display: `[x] Auto-parked: {active_feature_name}`
3. Get the list of parked features (features with `first_started_at` set — excludes backlog):
   ```bash
   QUEUE=$(node $ECK_HOME/update-lifecycle.js queue 2>/dev/null)
   # Filter to parked only: features in queue that have first_started_at set
   PARKED=$(echo "$QUEUE" | node -e "
     const q=JSON.parse(require('fs').readFileSync(0,'utf-8'));
     const fs=require('fs'),p=process.env.CLAUDE_PROJECT_DIR+'/.claude/';
     const lc=fs.existsSync(p+'lifecycle-registry.json')?JSON.parse(fs.readFileSync(p+'lifecycle-registry.json','utf-8')):JSON.parse(fs.readFileSync(p+'lifecycle.json','utf-8'));
     const parked=q.filter(f=>lc.features[f.slug]&&lc.features[f.slug].first_started_at);
     console.log(JSON.stringify(parked));
   " 2>/dev/null || echo "[]")
   ```
4. If parked list is empty, stop with error:
   ```
   [!] No parked features to resume
       For backlog features, use /eck:select-feature.
       To create a new feature, use /eck:create-feature.
   ```
   -> STOP (reset statusline first)
5. If an argument was provided, resolve it to a <KEY>-XXX:
   - If argument matches `<KEY>-XXX` format → use directly
   - Otherwise → `node $ECK_HOME/manage-features.js resolve "$ARGUMENT"` to get <KEY>-XXX
   - If resolved <KEY>-XXX is in parked list → select it
   - If not found or not parked → show error `[!] Feature "{argument}" not found in parked queue` and fall through to interactive selection
6. If exactly 1 feature in parked list, auto-select it. Look up its name from `features.json`:
   ```bash
   FEATURES_JSON="$CLAUDE_PROJECT_DIR/.claude/features.json"
   NAME=$(jq -r --arg id "$FEAT_ID" '.features[$id].display_name // "<unknown>"' "$FEATURES_JSON")
   if [ "$NAME" = "<unknown>" ]; then
     printf 'Warning: orphan registry entry: %s has no features.json entry\n' "$FEAT_ID" >&2
   fi
   ```
   ```
   [x] Auto-selected: {KEY}-XXX $NAME (only parked feature)
   ```
7. If multiple features, present a numbered list:

   ```
   Parked Features

   1. WA-042  User Auth
      [x] Spec  [x] Design  [ ] Dev  [ ] Val  [ ] Deploy

   2. WA-088  Billing API
      [x] Spec  [ ] Design  [ ] Dev  [ ] Val  [ ] Deploy
   ```

   Use AskUserQuestion to prompt for selection by number.

### Outputs

- A <KEY>-XXX selected for activation

### Exit Criteria

- Feature selected (auto or user choice)
- No conflicting active feature (was auto-parked if needed)

---

## Stage 2: Activate

### Inputs

- Selected <KEY>-XXX from Stage 1

### Activities

1. Activate the selected feature:
   ```bash
   node $ECK_HOME/update-lifecycle.js activate "$FEAT_ID"
   ```
2. Determine the next step:
   ```bash
   node $ECK_HOME/update-lifecycle.js next "$FEAT_ID"
   ```
3. Build a progress breadcrumb from the step statuses. Use `[x]` for done/skipped steps and `[ ]` for pending/gated steps.
4. Look up the feature name from `features.json`:
   ```bash
   FEATURES_JSON="$CLAUDE_PROJECT_DIR/.claude/features.json"
   NAME=$(jq -r --arg id "$FEAT_ID" '.features[$id].display_name // "<unknown>"' "$FEATURES_JSON")
   if [ "$NAME" = "<unknown>" ]; then
     printf 'Warning: orphan registry entry: %s has no features.json entry\n' "$FEAT_ID" >&2
   fi
   ```
5. Display summary box:

   ```
   Feature Activated

   Feature         {KEY}-XXX $NAME
   Progress        [x] Spec  [x] Design  [ ] Dev  [ ] Val  [ ] Deploy
   Next command    /eck:{next_step} {KEY}-XXX

   Run: /eck:{next_step} {KEY}-XXX
   ```

6. Log activity:
   ```bash
   node $ECK_HOME/log-activity.js --skill "eck:resume-feature" --outcome "success" --summary "Activated {KEY}-XXX $NAME"
   ```
7. Reset statusline:
   ```bash
   bash $ECK_HOME/update-stage.sh
   ```

### Outputs

- Feature is active in lifecycle.json (keyed by <KEY>-XXX)
- Statusline reflects active feature (reads lifecycle.json directly)
- User sees next command to run

### Exit Criteria

- Feature activated and statusline reflects it
- User has clear guidance on next step

---

## Error Handling

- If `activate` fails, show the error output and stop
- If `bridge` fails, log warning but continue (non-fatal)
- If no lifecycle.json exists, treat as empty queue
- At completion (success or error), always reset statusline
