用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kofj/rdd --skill rdd-loop命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rdd-loop |
| description | Autonomous multi-stage execution — auto-detects incomplete stages from roadmap, executes with hard quality gates |
Purpose: Autonomous stage execution loop with auto-detection, fine-grained persistence, hard quality gates, and crash-resilient recovery.
The RDD Loop provides the operational framework for autonomous multi-stage execution. It auto-detects incomplete stages from the roadmap, resolves dependencies, executes each stage through all 5 gates, and persists state at every key action to survive context overflow and process termination.
Key design decisions (ADR 22A-22F):
start subcommand: /rdd-loop is inherently "start"--goal NL parsing: Roadmap Goal field is the authoritative data sourcetask test/task lint/task fmt executiontask entries/rdd-loop [options]
/rdd-loop status|pause|resume
| Option | Description | Default |
|---|---|---|
| (none) | Auto-detect all incomplete stages, execute all | — |
--from N | Start from stage N | first incomplete |
--to M | Stop after stage M | last incomplete |
--parallel N | Max parallel stages | 1 |
/rdd-loop invoked
│
▼
Read stage-roadmap.md → auto-detect incomplete stages
│
▼
Apply --from/--to filter (if specified)
│
▼
Topological sort by dependencies
│
▼
Display execution plan → request confirmation
│
▼
For each stage (parallel groups where possible):
│
├─→ GATE 0: Stage Startup Check
│ ├─ Verify roadmap exists
│ ├─ Check dependencies complete
│ ├─ Load ADRs, tech debt, previous stages
│ └─ [persist: gate-enter]
│
├─→ GATE 1: Design Document Pre-Check
│ ├─ Verify design doc exists
│ ├─ Check section completeness
│ ├─ Detect scope creep
│ └─ [persist: gate-exit]
│
├─→ GATE 2: Design Review
│ ├─ Multi-model review
│ ├─ AI pre-filter (expect ~50% false positives)
│ ├─ Fix critical/high findings
│ └─ [persist: gate-exit]
│
├─→ GATE 3: Implementation & Testing (HARDENED)
│ ├─ task test:unit ← non-zero exit = BLOCK
│ ├─ task test:e2e ← non-zero exit = BLOCK
│ ├─ task test:coverage ← below threshold = BLOCK
│ ├─ task lint:check ← errors = BLOCK, warnings pass
│ ├─ task fmt:check ← violations = BLOCK
│ ├─ task registry:verify ← orphans = BLOCK
│ └─ [persist: test results, gate-exit]
│
├─→ GATE 4: Code Review
│ ├─ Multi-model code review
│ ├─ Triangulation verification
│ ├─ Fix critical/high findings
│ └─ [persist: gate-exit]
│
├─→ GATE 5: Completion Check
│ ├─ Verify acceptance criteria
│ ├─ Check test reproducibility
│ ├─ Update all documents (stage-N.md, roadmap, ADR, tech-debt, next-steps, CHANGELOG)
│ ├─ Run fresh-agent-check
│ └─ [persist: gate-exit, send P2 notification]
│
└─→ Mark stage complete in roadmap → proceed to next
| File | Purpose | Update Frequency |
|---|---|---|
.rdd/cache/loop-state.yaml | Canonical loop execution state | every key action |
.rdd/cache/checkpoints.json | Backward compat (single-stage) | gate transitions |
.rdd/cache/heartbeat/*.yaml | Timestamped snapshots | every 5 min |
docs/08-autonomous-decisions.md | ADR log | on decision |
docs/12-technical-debt.md | Tech debt ledger | on debt discovery |
Session restart
│
▼
.rdd/cache/loop-state.yaml exists?
├─ Yes → Recovery Mode
│ ├─ Read loop-state.yaml → determine current stage + gate
│ ├─ Read ADR log → decisions since session start
│ ├─ Read debt ledger → debt discovered
│ ├─ Run task test → verify environment intact
│ └─ Resume from last saved action (not last gate boundary)
│
└─ No → checkpoints.json exists?
├─ Yes → Fallback to single-stage recovery
└─ No → Fresh start (scan roadmap)
Maximum data loss window: 5 minutes (heartbeat interval).
Gate 3 is the critical quality barrier. No check is bypassable.
task test:unit # exit ≠ 0 → gate blocked
task test:e2e # exit ≠ 0 → gate blocked
task test:coverage # below threshold → gate blocked
task lint:check # errors → gate blocked, warnings pass
task fmt:check # violations → gate blocked
task registry:verify # orphans → gate blocked
All pass → Gate 3 approved → proceed to Gate 4.
Every script must be registered as a task entry. The task registry:verify check ensures zero orphans.
scripts/health.sh → task health:check
scripts/metrics.sh → task metrics:show
scripts/logger.sh → task logger:test
... and so on for all scripts/ and .rdd/scripts/
| Category | Example | Response |
|---|---|---|
| Recoverable | Test failure, lint warning | Auto-fix, retry up to 3 times |
| Degradable | Feature too complex for one stage | Reduce scope, record as tech debt |
| Blockable | Missing dependency, design flaw | Pause, notify human (P0) |
| Fatal | Data loss, security issue | Stop immediately, notify (P0) |
| No progress | Action |
|---|---|
| 15 min | Warning, try alternative |
| 30 min | First degradation strategy |
| 45 min | Second degradation strategy |
| 60 min | Escalate to human (P0) |
| Level | Trigger | Blocks? |
|---|---|---|
| P3 | Daily summary, milestone reached | ❌ No — auto-continue |
| P2 | Stage complete, handoff generated | ❌ No — auto-continue |
| P1 | Stage failed, retries exceeded, merge conflict | ❌ No — continue with caution |
| P0 | Fatal error, core hypothesis falsified, max retries exceeded across stages | ✅ Yes — wait for human |
This skill integrates with:
| Component | Script |
|---|---|
| Auto-detection | .rdd/scripts/auto-detect.sh |
| Persistence | .rdd/scripts/loop-persist.sh |
| Task registry | .rdd/scripts/task-registry.sh |
| Worktree pool | .rdd/scripts/worktree-pool.sh |
| Subagent scheduler | .rdd/scripts/subagent-scheduler.sh |
| Progress dashboard | .rdd/scripts/progress-dashboard.sh |
| Checkpoint (backward compat) | .rdd/scripts/checkpoint.sh |
docs/stages/stage-22.md — Stage 22 design document (v2.1)docs/stages/stage-22-review-log.md — Design & code review findingsdocs/08-autonomous-decisions.md — ADR 22A-22Fdocs/operations/release-guide.md — Release & version upgrade