用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kofj/rdd --skill rdd-diagnosis命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rdd-diagnosis |
| description | Diagnose RDD project issues, analyze root causes, and provide remediation recommendations |
Purpose: Diagnose issues, analyze root causes, and provide remediation recommendations.
This skill helps diagnose problems in RDD projects by systematically analyzing symptoms, identifying root causes, and recommending remediation steps.
When to Use:
Command: /rdd-diagnosis <area> [--depth N]
| Area | Description |
|---|---|
tests | Diagnose test failures |
stage | Diagnose stage issues |
quality | Diagnose quality gate failures |
docs | Diagnose documentation issues |
all | Run full diagnostic |
┌─────────────────┐
│ Collect Symptoms│
└────────┬────────┘
│
▼
┌─────────────────┐
│ Form Hypotheses│
└────────┬────────┘
│
▼
┌─────────────────┐
│ Test Hypotheses│
└────────┬────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐
│ Root Cause Found │─────│ Identify Fix │
│ ? │ No │ │
└────────┬────────┘ └────────┬────────┘
│ Yes │
│ ▼
│ ┌─────────────────┐
│ │ Gather More │
│ │ Evidence │
│ └────────┬────────┘
│ │
│ └──────────┐
▼ │
┌─────────────────┐ │
│ Document Finding│◄────────────────────────┘
└────────┬────────┘
│
▼
┌─────────────────┐
│ Recommend Fix │
└─────────────────┘
Test Failure Symptoms
=====================
## Which tests are failing?
[ ] Unit tests
[ ] Integration tests
[ ] E2E tests
[ ] All tests
## When do they fail?
[ ] Always
[ ] Intermittently
[ ] In specific environment
[ ] After specific change
## What is the error?
[ ] Assertion failure
[ ] Timeout
[ ] Exception
[ ] Resource unavailable
## What changed recently?
[ ] New code
[ ] Dependency update
[ ] Environment change
[ ] Configuration change
| Pattern | Symptoms | Likely Cause | Diagnosis |
|---|---|---|---|
| Flaky Test | Passes sometimes | Race condition, timing | Check test isolation |
| Missing Mock | External API fails | Unmocked dependency | Check mock coverage |
| State Leak | Order-dependent | Shared state | Check test cleanup |
| Environment | Works locally | Config/env difference | Compare environments |
| Data | Specific data fails | Edge case | Check test data |
| Timeout | Slow operations | Performance issue | Profile operation |
Isolate the Failure
# Run single test
task test --filter "test_name"
# Run with verbose output
task test --verbose
Check Test Environment
# Check dependencies
task doctor
# Check environment variables
env | grep PROJECT
Analyze Error Message
Check Recent Changes
# Check git log
git log --oneline -10
# Check diff
git diff HEAD~5
Compare with Working State
# Run tests on previous commit
git stash
git checkout HEAD~1
task test
git checkout main
git stash pop
Stage Blockage Symptoms
========================
## Where is it stuck?
[ ] Gate 0: Stage Startup
[ ] Gate 1: Design Document
[ ] Gate 2: Design Review
[ ] Gate 3: Implementation
[ ] Gate 4: Code Review
[ ] Gate 5: Completion
## What is blocking?
[ ] Missing information
[ ] Failed check
[ ] External dependency
[ ] Resource constraint
[ ] Design issue
## How long stuck?
[ ] Minutes
[ ] Hours
[ ] Days
[ ] Weeks
## Retry history?
[ ] Never retried
[ ] Retried 1-2 times
[ ] Retried 3+ times
[ ] Max retries exceeded
| Gate | Common Blockages | Diagnosis |
|---|---|---|
| Gate 0 | Missing roadmap, unmet dependencies | Check roadmap, verify dependencies |
| Gate 1 | Incomplete design, scope unclear | Review design template |
| Gate 2 | Review findings, scope creep | Apply pre-filters, check against roadmap |
| Gate 3 | Tests failing, coverage low | Run test diagnosis |
| Gate 4 | Code issues, review findings | Apply code review checklist |
| Gate 5 | Missing docs, fresh-agent-check fails | Run doc diagnosis |
Check Stage Status
Read: docs/stages/stage-N.md
Check: Status field, current gate
Check Review Log
Read: docs/stages/stage-N-review-log.md
Check: Unresolved findings
Check Tech Debt
Read: docs/12-technical-debt.md
Check: Blocking debt
Check Handoff
Read: docs/handoff/handoff-latest.md
Check: Blockers, next action
Run Gate Check Manually
Manually verify each gate requirement
Document which check fails
Quality Gate Failure Symptoms
==============================
## Which quality gate failed?
[ ] Test coverage
[ ] Code quality (lint)
[ ] Security scan
[ ] Documentation
[ ] fresh-agent-check
## What is the metric?
Current: X
Required: Y
Gap: Z
## When did it start failing?
[ ] After recent change
[ ] After dependency update
[ ] Suddenly (no change)
[ ] Always failed
## Can it be fixed quickly?
[ ] Yes, simple fix
[ ] Maybe, need investigation
[ ] No, requires significant work
| Gate | Threshold | Typical Failure |
|---|---|---|
| Test Coverage | >= 20% | Not enough tests |
| Lint | 0 errors | Code style issues |
| Security | 0 high/critical | Vulnerabilities |
| Docs | Complete sections | Missing documentation |
| Fresh Agent | Pass | Tacit knowledge |
Get Current Metrics
# Test coverage
task test:coverage
# Lint
task lint
# Security
task security:scan
Identify Gap
Find Low-Hanging Fruit
Plan Remediation
Documentation Issue Symptoms
=============================
## What's wrong?
[ ] Missing sections
[ ] Outdated information
[ ] Inconsistent state
[ ] Tacit knowledge
[ ] fresh-agent-check fails
## Which documents affected?
[ ] Roadmap
[ ] Stage documents
[ ] ADRs
[ ] Tech debt ledger
[ ] Handoff documents
## How severe?
[ ] Blocking progress
[ ] Causing confusion
[ ] Minor inconsistency
[ ] Future maintenance issue
Documentation Health Checklist
==============================
## Roadmap (stage-roadmap.md)
[ ] Vision is clear
[ ] Stages are listed
[ ] Current stage identified
[ ] Dependencies clear
[ ] Progress accurate
## Stage Documents (stage-N.md)
[ ] Goals defined
[ ] Non-goals explicit
[ ] Hypotheses testable
[ ] Acceptance criteria measurable
[ ] Status current
[ ] Implementation notes complete (if in progress)
## ADRs (autonomous-decisions.md)
[ ] Decisions are numbered
[ ] Background is clear
[ ] Rationale is explained
[ ] Impact on subsequent stages is NOT empty
[ ] Dates are present
## Tech Debt (technical-debt.md)
[ ] Each debt has ID
[ ] Priority is assigned
[ ] Source is documented
[ ] Resolution stage is planned
## fresh-agent-check
[ ] New agent can understand project purpose
[ ] Current stage is clear
[ ] Next actions are clear
[ ] No tacit knowledge required
Run fresh-agent-check
/rdd-fresh-check
Check Template Compliance
Compare each doc against templates in rdd-templates.md
Check Cross-References
Verify all references between documents are valid
Check Timestamps
Ensure documents are not stale
Full Diagnostic
===============
## 1. Test Health
[ ] All tests pass
[ ] Coverage meets threshold
[ ] No flaky tests
## 2. Stage Health
[ ] Current stage identified
[ ] Gate progression normal
[ ] No blockers
## 3. Quality Health
[ ] Lint passes
[ ] Security scan passes
[ ] No high debt
## 4. Documentation Health
[ ] All docs present
[ ] All docs current
[ ] fresh-agent-check passes
## 5. Configuration Health
[ ] .rdd/config.yml valid
[ ] .rdd/hooks.yml valid
[ ] .rdd/templates.yml valid
## 6. Integration Health
[ ] Hook scripts executable
[ ] Notification channels configured
[ ] Task commands work
# RDD Diagnostic Report
**Date**: YYYY-MM-DD HH:MM
**Project**: [Project Name]
## Summary
| Area | Status | Issues |
|------|--------|--------|
| Tests | ✅/❌ | X |
| Stage | ✅/❌ | X |
| Quality | ✅/❌ | X |
| Docs | ✅/❌ | X |
| Config | ✅/❌ | X |
| Integration | ✅/❌ | X |
## Detailed Findings
### Tests
[Findings and recommendations]
### Stage
[Findings and recommendations]
### Quality
[Findings and recommendations]
### Docs
[Findings and recommendations]
### Config
[Findings and recommendations]
### Integration
[Findings and recommendations]
## Recommended Actions
1. [Priority 1 action]
2. [Priority 2 action]
3. [Priority 3 action]
## Next Steps
[What to do next]
| Skill | When to Use |
|---|---|
rdd-recovery | After diagnosis, to recover from issues |
rdd-knowledge | To record findings as tech debt |
rdd-fresh-check | As part of doc diagnosis |
For related information, see:
.claude/skills/rdd-core/SKILL.md - Core RDD concepts.claude/skills/rdd-recovery/SKILL.md - Recovery procedures.claude/skills/rdd-stage-auto/SKILL.md - Stage execution