plan-doctor
Plan Doctor Skill
Role: Post-hoc diagnostic for plan artifacts. Walks TASK-*.json files for one or all plans, scans title and description for lesson-ID-shaped tokens, verifies each token against the live manage-lessons inventory, and emits structured findings for any tokens that resolve to non-existent lessons.
In addition to the TASK-level lesson-ID sweep, scan --all also runs three plan-directory-shape diagnostics:
orphan-plan-directory— a subdirectory under.plan/local/plans/that lacksstatus.json, or hasstatus.jsonbut none ofrequest.md/references.json/solution_outline.md.stuck-low-confidence-archive— a subdirectory under.plan/local/archived-plans/whosestatus.jsonhasmetadata.confidence < 95(or the project-configured threshold), every phase after2-refineispending, andmetadata.archived_reasonis absent.dangling-worktree— a subdirectory under.plan/local/worktrees/whose corresponding.plan/local/plans/{name}/directory does not exist.
This skill complements the at-write-time validation in manage-tasks (which prevents new bad references) by sweeping plans that may already contain stale or phantom lesson-ID references introduced before the at-write check existed (or via direct file edits that bypassed manage-tasks).
Enforcement
Execution mode: Select scan or scan-task-file based on inputs and execute immediately.