Skip to main content
ClaudeWave
Slash Command136 repo starsupdated 4d ago

resume

Resume a long-running DMP workflow (engagement / campaign-plan / content-engine / seo-audit / competitor-analysis / campaign-audit / launch-campaign) that was interrupted partway through

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/indranilbanerjee/digital-marketing-pro/HEAD/commands/resume.md -o ~/.claude/commands/resume.md
Then start a new Claude Code session; the slash command loads automatically.

resume.md

# Resume Interrupted Workflow

Pick up a long-running DMP workflow that stopped before the final step — instead of restarting from scratch, load the saved part outputs and continue from the next part.

## Trigger

User runs `/digital-marketing-pro:resume` (with optional `workflow` and/or `run-id` arguments). Also surface this command in any error message when a workflow terminates abnormally.

## What this fixes

DMP's headline workflow `/digital-marketing-pro:engagement` runs the 12-Part Strategy Flow producing 50-60 canonical files in roughly 60 minutes on Opus 4.7. Pre-v3.7.7, if the session terminated partway through (context-window exhaustion, network blip, the user cancels, machine sleeps), the in-memory part outputs were lost and the user had to restart from Part 1. The same applied to `/campaign-plan`, `/content-engine`, `/seo-audit`, `/competitor-analysis`, `/campaign-audit`, `/launch-campaign`.

As of v3.7.7 every part of every long workflow writes its output via `scripts/checkpoint-manager.py`, so a fresh session can reload those artifacts and skip the parts that already completed. This is the direct fix for the v3.12.2-cycle user-team feedback that "dm pro also taking too long to process" — the workflow itself is not made faster, but a single interruption no longer means losing 30+ minutes of work.

## Process

### Step 1: Pick the run to resume

If the user supplied a `run-id`, use it directly. If they supplied only a `workflow` (e.g. `engagement` / `campaign-plan`), filter to in-progress runs of that workflow and pick the most recent. Otherwise list every in-progress run and ask the user to choose if there's ambiguity.

```bash
# Auto-pick the most recent in-progress run for the active brand
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py resume --brand "{active_brand}"

# Filter to a specific workflow
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py resume --brand "{active_brand}" --workflow engagement

# Resume a specific run id
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py resume --brand "{active_brand}" --run-id "{run_id}"

# List everything (use when there are several)
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py list --brand "{active_brand}"
```

The `resume` action returns the status of the selected run, including `completed_steps`, `remaining_steps`, `next_step`, `next_step_label`, and the absolute path of every saved artifact.

If there are no in-progress runs, say so and offer to start a fresh workflow. Do NOT silently start a new run.

### Step 2: Reload the saved artifacts

For each completed step, load the saved file via `checkpoint-manager.py load` and put its contents back into context:

```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py load \
    --brand "{active_brand}" --run-id "{run_id}" --step 1
# ... repeat for every step in completed_steps
```

Use the loaded content as the **input** to the next step that has NOT been checkpointed — do not re-execute earlier steps.

### Step 3: Continue from `next_step`

For the `engagement` workflow, hand control to the agent or sub-flow that owns the next part (see the 12-Part Strategy Flow in [`README.md`](../README.md)). After that part finishes, save its output:

```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py save \
    --brand "{active_brand}" --run-id "{run_id}" \
    --step {step_id} --content-file {tmp_output_path} --extension {md|json}
```

Continue until every step is checkpointed, then:

```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/checkpoint-manager.py finalize \
    --brand "{active_brand}" --run-id "{run_id}" --status completed
```

Optionally bulk-publish every artifact to the user-visible output folder:

```bash
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/output-publisher.py publish-run \
    --brand "{active_brand}" --run-id "{run_id}"
```

### Step 4: Surface the resumption summary

Before continuing, tell the user what's being skipped vs re-run:

```
🔁 Resuming {workflow} run {run_id}
   Topic: {topic}
   Brand: {brand}

   ✅ Already completed (skipping): Part 1, Part 2, Part 3 (Four Core Documents)
   ➡️  Resuming from: Part 4 (Competitive / customer / market analysis)
   📋 Remaining: 4 → 5 → 6 → 7 → 8 → 9 → 10 → 11 → 12

   Estimated remaining time: ~30 min on Opus 4.7 (based on the part-time benchmarks)
```

## Edge cases

- **Resume mid-loop.** If a part failed its quality gate and triggered a loop back to an earlier part, the checkpoint reflects whatever was last saved. The user should re-run that part's quality gate after resuming.
- **Ancient run.** If `last_updated` is more than 7 days old, warn before resuming — market data has drifted, sources may have moved. Offer to start fresh instead.
- **Multiple in-progress runs.** If there are several, list them with `list` and ask which to resume rather than guessing.
- **No checkpoint manager script.** Sessions started before v3.7.7 have no checkpoints. `list` returns an empty `runs` array — tell the user no resumable runs exist and offer to start a new workflow.

## Related

- [`commands/engagement.md`](engagement.md) — the headline 12-Part workflow this command resumes
- [`commands/campaign-plan.md`](campaign-plan.md), [`commands/content-engine.md`](content-engine.md), [`commands/seo-audit.md`](seo-audit.md), [`commands/competitor-analysis.md`](competitor-analysis.md) — other long workflows that benefit from checkpointing
- [`commands/output-folder.md`](output-folder.md) — reveal the user-visible `~/Documents/DigitalMarketingPro/` folder where published artifacts land
- [`scripts/checkpoint-manager.py`](../scripts/checkpoint-manager.py) — the storage layer
- [`scripts/output-publisher.py`](../scripts/output-publisher.py) — the dual-copy publisher
agency-operationsSubagent

Invoke when the user needs to manage multiple client brands, view portfolio-level dashboards, generate client reports, manage SOPs, switch credential profiles, assign team tasks, configure regions, or generate executive summaries. Triggers on requests involving multi-client management, agency workflows, client onboarding, or portfolio oversight.

analytics-analystSubagent

Invoke when the user needs help with marketing measurement, KPI definition, dashboard design, attribution modeling, performance analysis, anomaly detection, competitive benchmarking, or translating data into marketing decisions. Triggers on requests involving metrics, reporting, analytics setup, or data interpretation.

brand-guardianSubagent

Invoke when marketing content needs quality control review — brand voice consistency checks, regulatory compliance verification (GDPR, CAN-SPAM, CCPA, HIPAA, FTC, industry-specific), accessibility auditing (WCAG 2.1), inclusive language review, or brand safety assessment. Automatically invoked as a final review step before any content is published or delivered.

competitive-intelSubagent

Invoke when the user needs competitor analysis — content strategy teardowns, SEO gap analysis, paid ad analysis from ad libraries, social media benchmarking, AI visibility comparisons, pricing and positioning research, or market landscape mapping. Triggers on requests mentioning competitors, competitive gaps, market analysis, or benchmarking.

competitor-intelligenceSubagent

Use when the task requires ongoing competitive monitoring, competitor change detection, share of voice tracking, competitive alerts, ad monitoring, price monitoring, win/loss analysis, or competitive narrative mapping.

content-creatorSubagent

Invoke when the user needs any form of marketing content created or refined — blog posts, ad copy, email campaigns, social media posts, landing page copy, press releases, video scripts, product descriptions, or newsletter content. Triggers on requests to write, draft, rewrite, or improve marketing copy.

crm-managerSubagent

Invoke when the user needs to manage CRM operations — creating contacts, importing leads, updating deals, syncing campaign data, segmenting audiences, managing pipelines, or connecting marketing data to Salesforce, HubSpot, Zoho, or Pipedrive. Triggers on requests involving CRM data, lead management, pipeline updates, or sales-marketing alignment.

cro-specialistSubagent

Invoke when the user needs help with conversion rate optimization — landing page audits, A/B test design, form optimization, pricing page strategy, checkout flow improvement, personalization, statistical significance calculations, page speed impact analysis, or mobile conversion optimization. Triggers on requests involving conversions, landing pages, A/B testing, or optimization experiments.