Session recovery

From Sir-chawakorn/power-ranger-toolkit · View interactive version

Session recovery is an AI agent skill from the GitHub repository Sir-chawakorn/power-ranger-toolkit. Recover context and continue work after session interruptions or restarts

How to use this skill

Skill file

🔄 Session Recovery Skill


name: session-recovery

description: Recover context and continue work after session interruptions or restarts


🎯 Purpose

Seamlessly recover from session interruptions, crashes, or context switches without losing progress.

📋 When to Use

🚨 Recovery Triggers

| Trigger | Action |

|---------|--------|

| New session | Load last context |

| User says "continue" | Resume last task |

| IDE restart | Restore state |

| Crash recovery | Check incomplete tasks |

📝 Recovery Process

Step 1: Detect Context

Check for:
1. [ ] Active task files (task.md, active.md)
2. [ ] Recent git changes
3. [ ] Unsaved work
4. [ ] Error logs

Step 2: Load Context

Read in order:
1. memory/active.md → Current task
2. memory/summary.md → Project context
3. memory/decisions.md → Recent decisions
4. task.md → Pending items

Step 3: Summarize State

"Last session you were working on [task].
Progress was [X]% complete.
You were in the middle of [specific action].
Would you like to continue?"

Step 4: Resume or Restart

Options:
- Continue from last point
- Start fresh with context
- Switch to different task

🗂️ Context Files

| File | Purpose | Priority |

|------|---------|----------|

| active.md | Current task | 🔴 High |

| task.md | Task checklist | 🔴 High |

| summary.md | Project overview | 🟡 Medium |

| decisions.md | Architecture choices | 🟡 Medium |

| changelog.md | Recent changes | 🟢 Low |

📋 Recovery Template

## 🔄 Session Recovery

### Last Session
- **Date**: [date]
- **Duration**: [time]
- **Project**: [name]

### Work in Progress
- Task: [description]
- Progress: [X]%
- Last action: [what was happening]

### Pending Items
- [ ] Item 1
- [ ] Item 2

### Files Modified
- `file1.js` - [changes]
- `file2.css` - [changes]

### Would you like to:
1. Continue from last point
2. Review changes first
3. Start fresh

🔧 Auto-Recovery Features

1. State Persistence

// Save state before session ends
saveState({
  currentTask: taskName,
  progress: percentage,
  openFiles: fileList,
  recentActions: actionLog
});

2. Crash Detection

// Check for incomplete state
if (activeTask && !taskCompleted) {
  recoveryMode = true;
  loadLastCheckpoint();
}

3. Git Integration

# Check uncommitted changes
git status --porcelain

# Get recent commits
git log --oneline -5

💡 Best Practices

  1. Save frequently: Update active.md during work
  2. Checkpoint: Mark milestones in progress
  3. Commit often: Small, frequent commits
  4. Document blockers: Note where you got stuck

🔗 Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.