resume-from

$npx mdskill add tranhieutt/software_development_department/resume-from

Restores cognitive state from a checkpoint to resume interrupted tasks instantly.

  • Solves the problem of losing progress after agent crashes or session restarts.
  • Depends on Read, Write, Glob, Bash tools and checkpoint files in .tasks/checkpoints/.
  • Validates task_id argument, then loads and parses the corresponding checkpoint file.
  • Surfaces the checkpoint context and continues execution from the exact next step.

SKILL.md

.github/skills/resume-fromView on GitHub ↗
---
name: resume-from
type: workflow
description: "Restores cognitive state from an atomic checkpoint in .tasks/checkpoints/[task_id].md, enabling instant recovery at the exact point of failure without re-running the full task."
argument-hint: "<task_id>"
user-invocable: true
allowed-tools: Read, Write, Glob, Bash
effort: 2
when_to_use: "Use after an agent crash, session restart, or context compaction when a specific task was interrupted mid-execution. Requires a checkpoint previously written by /save-state <task_id>."
---

# Resume From Checkpoint

Restore the working context of a specific task from its atomic checkpoint at `.tasks/checkpoints/[task_id].md`, then continue execution from the exact next step — without re-running completed work.

## Steps

### 1. Validate argument

`$ARGUMENTS` must contain a `task_id`. If missing or empty:

```text
❌ Usage: /resume-from <task_id>
   Example: /resume-from 042
   Example: /resume-from auth-api

Available checkpoints:
[Run: ls .tasks/checkpoints/ and list files excluding .gitkeep]
```

Stop here if no `task_id` is provided.

### 2. Load checkpoint

Read `.tasks/checkpoints/[task_id].md`.

If the file does not exist:

```text
❌ No checkpoint found for task: [task_id]
   Expected: .tasks/checkpoints/[task_id].md

Available checkpoints:
[List files in .tasks/checkpoints/ excluding .gitkeep]

Tip: Run /save-state [task_id] first to create a checkpoint.
```

Stop here if file is missing.

### 3. Parse and surface checkpoint

Extract the following fields from the checkpoint and display them clearly:

```text
🔁 Resuming task: [task_id]
   Agent:         [agent_id]
   Saved at:      [saved_at]
   Retry count:   [retry_count]

📄 Output Snapshot (last known state):
   [output_snapshot content]

✅ Completed Steps:
   [completed steps list]

⏭️  Next Step:
   [next_step content]

❓ Open Questions:
   [open_questions content — or "None" if empty]

📁 Files Modified So Far:
   [files_modified list]
```

### 4. Apply exponential backoff if retrying

Check `retry_count` in the checkpoint frontmatter:

- `retry_count = 0` → proceed immediately, no wait
- `retry_count = 1` → wait 2s before continuing
- `retry_count = 2` → wait 4s before continuing
- `retry_count = 3` → wait 8s before continuing
- `retry_count >= 4` → surface a warning:

```text
⚠️  This task has failed [retry_count] times.
    Continuing, but consider escalating to a senior agent or the user
    if the same error recurs.
```

Then increment `retry_count` and update `backoff_next_s` (double the previous value, max 64s) in the checkpoint file before proceeding.

### 5. Resume execution

Hand off context to the appropriate agent (`agent_id` from checkpoint) with the following instruction:

> "You are resuming task `[task_id]`. The completed steps and output snapshot above are already done — do NOT repeat them. Your only job is to execute the **Next Step** listed above and continue from there."

### 6. Update checkpoint on success

When the task completes successfully, update `.tasks/checkpoints/[task_id].md`:

- Set `status: completed`
- Set `completed_at: [ISO timestamp]`
- Append to `## Completed Steps`

Print:

```text
✅ Task [task_id] completed successfully.
   Checkpoint updated → .tasks/checkpoints/[task_id].md (status: completed)
```

---

## Checkpoint lifecycle

```
/save-state [task_id]   → creates  .tasks/checkpoints/[task_id].md (status: in_progress)
/resume-from [task_id]  → reads checkpoint, increments retry_count, resumes
                        → on success: sets status: completed
```

Completed checkpoints are kept for audit — they are never auto-deleted.
To list all checkpoints: `ls .tasks/checkpoints/`

More from tranhieutt/software_development_department

SkillDescription
agent-healthReads production/traces/agent-metrics.jsonl and displays a per-agent performance summary table for the current or a specified session. Highlights agents with high error rates or OPEN circuit breaker state.
agent-styleProvides the vendored agent-style v0.3.5 prose rule pack as a portable Claude skill. Use when installing, syncing, applying, or auditing SDD Agent-Style support in another project, or when a style-review workflow needs the bundled rules.
angular-best-practicesProvides Angular best practices for components, modules, services, and reactive patterns. Use when working with Angular TypeScript files, component templates, NgModules, RxJS observables, or when the user mentions Angular, ng, or Angular CLI.
annotateRecords unexpected API behaviors, undocumented caveats, version bugs, or non-obvious workarounds into .claude/memory/annotations.md. Use immediately when an undocumented behavior or surprising caveat is discovered during development.
aws-serverlessProvides AWS serverless architecture patterns for Lambda, API Gateway, DynamoDB, SQS, and SAM/CDK. Use when working with AWS serverless files (serverless.yml, CDK stacks) or when the user mentions Lambda, API Gateway, serverless, or AWS SAM.
backend-architectDesigns scalable backend architectures covering microservices, event-driven systems, API gateways, and data stores. Use when designing a backend system or when the user mentions backend architecture, scalability, or distributed systems.
cloud-run-puppeteerDeploys Puppeteer browser automation on Google Cloud Run with Docker. Use when running headless browser tasks on Cloud Run, or when the user mentions Cloud Run, Puppeteer, headless Chrome, or serverless browser automation.
codex-sddAdapts SDD for Codex while preserving Claude Code behavior. Use when working in Codex, setting up Codex compatibility, mapping Claude tools to Codex tools, or explaining how SDD should run outside Claude Code.
database-architectDesigns relational and NoSQL database schemas, indexing strategies, migration plans, and data modeling patterns. Use when designing a database or when the user mentions database architecture, schema design, or data modeling.
db-reviewReviews database schemas, queries, and migrations for correctness, performance, security, and best practices. Use when reviewing SQL migration files or when the user mentions database review, schema review, or query audit.