---
name: fp-resume
description: Pick up an in-flight feature where you left off. Prints watch-card state (phase progress, risk, updated-at), the recent diff vs base, the next approval needed, and queues the right /fp-new-feature invocation. Triggers on /fp-resume [slug].
---

# fp-resume

Kill the "where was I?" moment. Shows the full state of an in-flight feature and hands you the one command that continues it.

## Invocation

```
/fp-resume <slug>     # resume a named feature
/fp-resume            # auto-pick the most recently updated in-flight watch card
```

## Preflight

- Check `fastpace/watch-cards/` exists and has at least one `.json`. If not, say "nothing in flight" and suggest `/fp-new-feature "<description>"`.

## Process

1. Prefer the CLI:
   ```
   fastpace resume <slug>
   ```
   Its output is already formatted (phase chips + progress bar + diff summary + next gate + paste-me command).
2. Fallback (no CLI):
   - Load `fastpace/watch-cards/<slug>.json`. If slug is omitted, pick the card with the newest `updated_at` that isn't `status: completed`.
   - Read `fastpace/fastpace.config.yaml` to find the required approval role for the current phase.
   - Detect the branch state: does `refs/heads/<branch>` still exist? Get `git diff --stat <base>...<branch>` for a one-line summary.
3. Print a compact report and **end with the `/fp-new-feature <slug>` invocation** the user can paste.

## Output format

```
⚡ resume credit-card-validation

  Credit card validation
  feat/credit-card-validation → main
  risk: ● medium
  updated 2h ago

  ✓ planning  ✓ spec  ✓ write-tests  ▸ implement  run-tests  document  create-pr  push
  ████████████░░░░░░░░░░░░░░░░░░░░  3 of 8 · 37%

  diff since branch: 12 files changed, 248 insertions(+), 14 deletions(-)

next
  phase:    implement
  approval: developer

resume in Claude Code:
  /fp-new-feature credit-card-validation   — Claude rehydrates from the watch card
```

## Failure modes

- **Branch missing locally.** Don't silently proceed — surface: "branch `feat/<slug>` is missing locally. Was it deleted or merged? Re-create with `git checkout -b …`".
- **Watch card corrupt / unreadable JSON.** Report the path + error; don't try to repair.
- **Slug ambiguous** (partial match). List candidates and ask for an exact slug.

## Rules

- **Read-only.** Do not modify the watch card or run `/fp-new-feature` on behalf of the user — just surface the command.
- **Echo the branch state** every time, especially if it's missing.
- **Be precise about "next".** If `current_phase` + config says the next gate is `team_lead`, say so — the user should know what approval they're about to ask for.
- **Honor skip gates.** If the config says a phase is `skip`, don't list it as needing approval.

## Integration

- After the report, the `/fp-new-feature <slug>` block is the next step.
- If multiple cards are in flight, offer: "Other cards: `<slug-a>` (last touched 3d ago), `<slug-b>` (5d ago)".
- Suggest `fastpace ui` → In-flight features when the user wants to triage multiple at once.

## Exit criteria

- Report printed with: identity, risk, phase progress, diff summary, next approval, paste-me command.
- Zero files modified.
