baphuongna/pi-crew/async-worker-recovery
Claude Code and agent skill by baphuongna/pi-crew
- community
Checking that the SKILL.md file is still in the repository.
Background worker, heartbeat, stale-run, crash-recovery, and deadletter workflow. Use when debugging stuck/dead workers or changing async run reliability. When NOT to use: pure investigation without async context (use read-only-explorer); one-shot fixes that don't need recovery infrastructure.
Install
npx vskill@latest install baphuongna/pi-crew/async-worker-recoverySKILL.md
async-worker-recovery
Use this skill when a pi-crew run is stuck, stale, interrupted, or has dead workers.
Source patterns distilled
- pi-subagents async patterns: detached runner, status files, result watcher, stale PID reconciler
- pi-crew runtime:
src/runtime/background-runner.ts,async-runner.ts,heartbeat-watcher.ts,worker-heartbeat.ts,crash-recovery.ts,stale-reconciler.ts,deadletter.ts,delivery-coordinator.ts - UI recovery controls:
src/ui/run-dashboard.ts,src/ui/dashboard-panes/health-pane.ts,src/ui/run-action-dispatcher.ts
Rules
- Distinguish historical dead-heartbeat events from current active failures. Check manifest/task status and event timestamps.
- Heartbeat warnings should only apply to currently running/waiting work, never terminal runs/tasks.
- Stale reconciliation order: result/terminal evidence → PID liveness → stale threshold/active evidence.
- Reconcile state under run lock and re-read inside the lock before repair.
- Deadletter entries are evidence, not automatic proof of permanent failure; inspect attempts and later completion events.
- For background runs, verify PID liveness and background log before declaring stuck.
- Session delivery should queue while inactive and flush only to the current generation/session.
- Do not poll in sleep loops waiting for async completion if the system has a watcher/result notification path.
Operator checklist
- Load manifest/tasks and recent events.
- Check
manifest.async.pidand process liveness. - Check heartbeat
lastSeenAt, progresslastActivityAt, and terminal status. - Inspect deadletter and diagnostic report.
- Choose recovery: resume, retry, kill stale, diagnostic, or no-op historical notification.
Enforcement — Worker Recovery Gate
Before taking recovery action, verify:
- [ ] Run status is not terminal (completed/failed/cancelled)
- [ ] Heartbeat is genuinely stale (not just delayed polling)
- [ ] PID is dead or stale threshold exceeded
- [ ] Recovery action matches run state (resume vs retry vs kill)
- [ ] Session generation matches before state modification
If ANY answer is NO → Stop. Re-check status. Do not apply stale recovery to active runs.
Verification
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/async-worker-recovery/SKILL.md
Popularity
- Repository stars
- 58
- Repository forks
- 22
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/baphuongna/pi-crew/async-worker-recovery)