用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kofj/rdd --skill rdd-recovery命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rdd-recovery |
| description | Recover an RDD project from failures, blockers, and interrupted stages |
Purpose: Recover from failures, blockers, and interrupted stages.
This skill provides procedures for recovering from various failure scenarios in RDD. It handles interrupted sessions, blocked stages, failed gates, and other exceptional situations.
When to Use:
Command: /rdd-recovery <scenario>
| Scenario | Description |
|---|---|
interrupted | Session ended during stage execution |
blocked | Stage blocked by external dependency |
gate-failed | Gate check failed multiple times |
rollback | Need to rollback to previous stage |
corrupted | Documentation or state corrupted |
┌─────────────────┐
│ Detect Failure │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Assess Situation│
└────────┬────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐
│ Can Auto-Recover│─────│ Auto Recovery │
│ ? │ No │ │
└────────┬────────┘ └────────┬────────┘
│ Yes │
│ ▼
│ ┌─────────────────┐
│ │ Escalate to │
│ │ Human │
│ └─────────────────┘
▼
┌─────────────────┐
│ Resume from │
│ Checkpoint │
└─────────────────┘
Session was interrupted if:
docs/handoff/handoff-latest.md exists with recent timestampLoad Context
Read these files in order:
1. docs/handoff/handoff-latest.md # Recent context
2. docs/stages/stage-roadmap.md # Overall status
3. docs/stages/stage-N.md # Current stage
4. docs/08-autonomous-decisions.md # Recent decisions
5. docs/12-technical-debt.md # Known issues
Identify Last Checkpoint
From handoff document:
Resume from Checkpoint
If at Gate 0: Start from Stage Startup
If at Gate 1: Resume from Design Document
If at Gate 2: Resume from Design Review
If at Gate 3: Resume from Implementation
If at Gate 4: Resume from Code Review
If at Gate 5: Resume from Completion Check
Verify State
Update Progress
Log recovery in docs/11-next-steps.md:
### Recovery Log
**Time**: YYYY-MM-DD HH:MM
**Action**: Session recovered from interruption
**Last Gate**: Gate N
**Resuming from**: [Action]
The handoff document should contain:
If handoff document is missing or incomplete, use rdd-knowledge context to rebuild context.
Stage is blocked if:
Identify Blocker
Check docs/11-next-steps.md for documented blockers.
Assess Blocker Type
| Blocker Type | Auto-Recoverable | Action |
|---|---|---|
| External API | No | Wait or skip |
| Missing info | Sometimes | Use defaults |
| Design flaw | No | Redesign |
| Human decision | No | Notify and wait |
| Resource limit | Sometimes | Degrade scope |
Attempt Auto-Recovery
If blocker might be resolved:
- Wait specified time
- Retry the blocked operation
- If still blocked after max retries, escalate
Escalate if Needed
If auto-recovery fails:
- Create detailed handoff document
- Trigger Hook notification (P1)
- Document blocker clearly
- Provide options for human
Degrade if Possible
If scope can be reduced:
- Document what's being reduced
- Record as tech debt
- Continue with reduced scope
- Update stage goals
## Blocker: [Title]
**Status**: Active / Resolved
**Priority**: P0 / P1 / P2
**Type**: External / Design / Decision / Resource
**Stage**: Stage N
**Gate**: Gate X
### Description
[What is blocking progress]
### Impact
[What is affected]
### Resolution Options
1. [Option 1]
2. [Option 2]
3. [Option 3]
### Recommended Action
[Recommended resolution]
### Resolution
[How it was resolved, if applicable]
**Resolved Date**: YYYY-MM-DD
**Resolution Method**: [How resolved]
Gate check failed if:
Identify Failed Gate
| Gate | Common Failures |
|---|---|
| Gate 0 | Missing roadmap, unmet dependencies |
| Gate 1 | Missing/incomplete design doc |
| Gate 2 | Design issues, scope creep |
| Gate 3 | Tests failing, coverage low |
| Gate 4 | Code issues, review findings |
| Gate 5 | Missing docs, fresh-agent-check failed |
Analyze Failure
- What specific check failed?
- What is the error message?
- Can it be fixed automatically?
Fix or Degrade
Fix: If issue can be resolved:
Degrade: If issue requires scope change:
Max Retry Handling
After max retries (3 for tests, 2 for gates):
- Stop current work
- Create handoff document
- Notify via Hook (P1)
- Wait for human intervention
| Check Type | Max Retries | After Max |
|---|---|---|
| Unit test | 3 | Degrade scope |
| Gate check | 2 | Escalate |
| Implementation | 2 | Try alternative |
| Full stage | 1 | Rollback |
Identify Rollback Target
From stage document:
## Rollback Plan
Version: vX.Y.Z
Commit: abc123
Procedure: [Steps]
Execute Rollback
# If using git
git checkout [rollback-commit]
# Or follow documented procedure
Update Documentation
## Rollback Log
**Time**: YYYY-MM-DD HH:MM
**From**: Stage N (Gate X)
**To**: Stage M (Complete)
**Reason**: [Why rollback was needed]
**Data Migration**: [If applicable]
Update Roadmap
Mark stage as "Rolled back" in roadmap.
Create Tech Debt
If rollback leaves unresolved issues:
Create tech debt entry for:
- Root cause of failure
- What needs to be fixed before retry
Notify
Trigger Hook notification (P1):
Stage N rolled back to Stage M
Reason: [Reason]
Next steps: [What needs to happen]
State is corrupted if:
Assess Corruption
Check which files are affected:
- Roadmap file
- Stage documents
- ADRs
- Tech debt ledger
- Handoff documents
Restore from Backup
If backups exist:
# Restore from git
git checkout HEAD -- [file]
# Or restore from backup directory
cp .rdd/cache/backup/[file] [destination]
Rebuild from Scratch
If no backup:
- Use templates to recreate files
- Reconstruct from git history
- Document what was lost
Verify Integrity
After restoration:
- All required files exist
- Files are valid format
- Cross-references are correct
- Status is consistent
Run fresh-agent-check
/rdd-fresh-check
If you need to recreate files from scratch, use templates from:
rdd-init skill for structurerdd-templates skill for contentAfter any recovery:
## Recovery Checklist
### Context
[ ] Read handoff document
[ ] Read roadmap
[ ] Read current stage document
[ ] Read recent ADRs
[ ] Read tech debt ledger
### State
[ ] Verified current gate
[ ] Verified test status
[ ] Verified file integrity
[ ] Verified documentation sync
### Actions
[ ] Resumed from correct checkpoint
[ ] Logged recovery in next-steps
[ ] Updated handoff document
[ ] Notified if needed
### Prevention
[ ] Identified what caused interruption
[ ] Documented how to prevent recurrence
[ ] Updated degradation strategy if needed
| Skill | When to Use |
|---|---|
rdd-knowledge | For handoff generation and context loading |
rdd-stage-auto | For resuming stage execution |
rdd-diagnosis | For diagnosing root cause of failures |
For related information, see:
.claude/skills/rdd-core/SKILL.md - Core RDD concepts.claude/skills/rdd-loop/SKILL.md - Loop control and state machine.claude/skills/rdd-knowledge/SKILL.md - Handoff generation