home / skills / duc01226 / easyplatform / recover

This skill helps you restore workflow context and todo items from the latest checkpoint after session loss, enabling seamless resumption.

npx playbooks add skill duc01226/easyplatform --skill recover

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.8 KB
---
name: recover
description: "[Tooling & Meta] Restore workflow context from checkpoint after session loss"
infer: true
---

# Recover Workflow Context

Restore workflow state and todo items from checkpoint files after context compaction or session loss.

## Usage

Use this command when:
- Context was compacted and you've lost track of the workflow
- Session was interrupted and needs to resume
- Todo items need to be restored from a checkpoint
- The automatic recovery didn't trigger

## Recovery Process

### Step 1: Find Latest Checkpoint

Look for checkpoint files in the reports directory:

```bash
ls -la plans/reports/memory-checkpoint-*.md | tail -5
```

Or search for all recent checkpoints:

```bash
find plans -name "memory-checkpoint-*.md" -mmin -60 | head -5
```

### Step 2: Read Checkpoint File

Read the most recent checkpoint to understand the saved state:

```
Read the checkpoint file at: plans/reports/memory-checkpoint-YYMMDD-HHMMSS.md
```

### Step 3: Extract Recovery Metadata

The checkpoint file contains a JSON metadata block at the end:

```json
{
  "sessionId": "...",
  "activePlan": "plans/YYMMDD-slug/",
  "workflowType": "feature",
  "currentStep": "cook",
  "remainingSteps": ["test", "code-review"],
  "pendingTodos": [...]
}
```

### Step 4: Restore Todo Items

**IMMEDIATELY call TodoWrite** with the pending todos from the checkpoint.

### Step 5: Read Active Plan (if exists)

If `activePlan` is set in the metadata, read the plan file.

### Step 6: Continue Workflow

Resume from the `currentStep` identified in the metadata. Execute the remaining workflow steps in order.

## Recovery Checklist

- [ ] Located most recent checkpoint file
- [ ] Read checkpoint content
- [ ] Extracted recovery metadata JSON
- [ ] Restored todo items via TodoWrite
- [ ] Read active plan (if applicable)
- [ ] Identified current workflow step
- [ ] Ready to continue from interrupted step

## Automatic vs Manual Recovery

| Scenario                      | Recovery Type | Trigger                          |
| ----------------------------- | ------------- | -------------------------------- |
| Session resume after compact  | Automatic     | `session-resume.cjs` hook        |
| New session in same directory | Manual        | This `/recover` command          |
| Explicit user request         | Manual        | This `/recover` command          |
| No workflow state found       | Manual        | This `/recover` command          |

## Related Commands

- `/checkpoint` - Create a manual checkpoint (before expected loss)
- `/compact` - Manually trigger context compaction
- `/context` - Load project context
- `/watzup` - Generate progress summary

---

**IMPORTANT Task Planning Notes (MUST FOLLOW)**
- Always plan and break work into many small todo tasks
- Always add a final review todo task to verify work quality and identify fixes/enhancements

Overview

This skill restores workflow state and todo items from checkpoint files after context compaction or a lost session. It helps recover the active plan, current workflow step, and pending todos so you can resume work with minimal manual reconstruction. Use it when automatic recovery did not occur or you started a new session in the same project directory.

How this skill works

The skill locates the latest memory checkpoint files in the plans/reports directory and reads the most recent checkpoint markdown. It extracts the JSON recovery metadata block (sessionId, activePlan, workflowType, currentStep, remainingSteps, pendingTodos). It immediately reinstates pending todos via TodoWrite, optionally loads the active plan file, and then resumes the workflow from the recorded currentStep, executing remaining steps in order.

When to use it

  • Context was compacted and workflow state is missing
  • A session was interrupted and you need to resume work
  • Todo items were lost and must be restored from a checkpoint
  • Automatic recovery did not trigger or failed
  • You opened a new session in the same project directory and want to pick up where you left off

Best practices

  • Run this recovery as soon as you detect missing context to avoid diverging state
  • Always inspect the most recent checkpoint and confirm the extracted metadata before restoring
  • Immediately call TodoWrite with pendingTodos to preserve task continuity
  • If activePlan is present, read the plan file to reconcile plan details with restored state
  • Add a final review todo after recovery to verify quality and identify required fixes

Example use cases

  • Resume a multi-step feature workflow after your terminal session crashed
  • Restore a list of pending todos after automatic context compaction removed in-memory tasks
  • Recover the current step and remaining steps when a collaborative session drops and automatic hooks did not run
  • Manually trigger recovery when starting a new session in the same repository to continue an interrupted plan

FAQ

What files does recovery inspect?

It searches for files named memory-checkpoint-*.md in plans/reports and picks the most recent checkpoint to read its embedded JSON metadata.

What if the checkpoint lacks an activePlan entry?

You still restore pending todos and resume from currentStep. If activePlan is absent, manually load project context or recreate the plan as needed.

How are todos restored safely?

The process immediately calls TodoWrite with the pendingTodos block from the checkpoint to re-create tasks in the task store before executing further workflow steps.