From plan-cascade
Diagnoses conflicts, duplicates, and superseded Architecture Decision Records (ADRs) across project design documents, displays report, and interactively applies resolutions.
npx claudepluginhub taoidle/plan-cascade --plugin plan-cascade# Memory Doctor — 决策健康诊断 You are running a full diagnosis on all Architecture Decision Records (ADRs) across the project's design documents. ## Step 1: Collect and Diagnose All Decisions **CRITICAL**: Use Bash to run the memory doctor script in full diagnosis mode: This script collects all decisions from every `design_doc.json` in the project (root, worktrees, feature directories) and uses LLM to detect conflicts, superseded entries, and semantic duplicates. Exit code handling: - **Exit 0**: No issues found, or no decisions to check — display "No issues found" and stop here - **Exit ...
You are running a full diagnosis on all Architecture Decision Records (ADRs) across the project's design documents.
CRITICAL: Use Bash to run the memory doctor script in full diagnosis mode:
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/memory-doctor.py" \
--mode full \
--project-root "$(pwd)"
This script collects all decisions from every design_doc.json in the project (root, worktrees, feature directories) and uses LLM to detect conflicts, superseded entries, and semantic duplicates.
Exit code handling:
ANTHROPIC_API_KEY, OPENAI_API_KEY, or DEEPSEEK_API_KEYdesign_doc.json files found in the projectDisplay the full diagnosis report from Step 1 output. The report groups findings by type:
CRITICAL: For each diagnosis finding, use AskUserQuestion to let the user choose an action:
For CONFLICT findings:
deprecated (recommended)For SUPERSEDED findings:
deprecated (recommended)For DUPLICATE findings:
Present each finding with its explanation and suggestion from the diagnosis report. Example question:
ADR-F003 vs ADR-F012: Two decisions conflict on API response format. Old: "API uses custom JSON structure" (feature-auth/design_doc.json) New: "API uses JSON:API spec" (feature-order/design_doc.json) Suggestion: Deprecate ADR-F003
How would you like to resolve this?
CRITICAL: Construct a JSON array of the user's choices and invoke the script to apply them.
Save the user's choices to a temporary file _doctor_actions.json:
[
{
"action": "deprecate",
"diagnosis": {
"type": "conflict",
"decision_a": {"id": "ADR-F003", "_source": "path/to/design_doc.json"},
"decision_b": {"id": "ADR-F012"},
"source_a": "path/to/design_doc.json",
"source_b": "other/design_doc.json"
}
}
]
Then run:
uv run python "${CLAUDE_PLUGIN_ROOT}/skills/hybrid-ralph/scripts/memory-doctor.py" \
--apply _doctor_actions.json \
--project-root "$(pwd)"
Clean up the temporary file after execution:
rm -f _doctor_actions.json
Display a summary of all actions taken:
Memory Doctor — 处理结果
━━━━━━━━━━━━━━━━━━━━━━━━
✓ Deprecated: N decisions
✓ Merged: N decision pairs
○ Skipped: N findings
If any design_doc.json files were modified, list them so the user knows which files changed.
After the diagnosis is complete:
git diff to verify the modifications/plan-cascade:hybrid-auto and /plan-cascade:mega-plan when new design documents are generated