---
name: optim-agent-resume-previous-plan
description: "Use when the user wants to resume or rediscover an interrupted optim-plans run; automatically run the active recovery path when one is available."
license: "MIT"
metadata:
  decimalai-skill-id: "2ffc13c3-aed2-4c55-bcaa-c4eaf26d3296"
  decimalai-version-id: "a2bb01a0-da35-4b52-baa3-486003932997"
  decimalai-version: "1"
  decimalai-body-sha256: "72a3da8e58a0666a08fc7d3005f97379ebdfe7d508470b8f67668a166dbc62a1"
  decimalai-name: "optim-agent/resume-previous-plan"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "agent-tooling"
  decimalai-source: "https://app.decimal.ai/s/optim-agent-resume-previous-plan@1/SKILL.md"
---
# Resume Previous Plan

Find the user's previous optim-plans run and continue the active recovery path when one is available.

1. First run active status for the current worktree:

   ```bash
   python3 scripts/optim_plans.py status --repo <repo>
   ```

2. If status succeeds, report the active `run_id`, `status`, `next_action`, and any controller-provided recovery fields:
   `resume_command`, `retry_command`, `retry_item_id`, `finish_approval_nonce`, and `finish_choices`.

3. If `resume_command` is present, run it. This covers already approved execution launch and retryable execution recovery until the controller reports `blocked`.

4. If status fails with no active pointer, run the Git-common fallback:

   ```bash
   python3 scripts/optim_plans.py previous-run --repo <repo>
   ```

5. If `previous-run` returns a `candidate`, report its `run_id`, `status`, `artifact_dir`, `terminal_time`, `last_event_type`, and `next_action`. If it returns `candidate: null`, say no preserved run was found.

`awaiting_retry_decision` is covered for retryable execution failures: run `resume_command`. Manual recovery and blocked/finish cases still require explicit user approval.

Do not approve execution launch, approve finish, restore an active pointer, delete evidence, or edit files from this skill. If only `finish_approval_nonce` is available, report `finish_choices` and stop because there is no unambiguous resume outcome.
