Overview
Thehealth command validates .planning/ directory integrity, reports actionable issues, and optionally repairs them. It checks for missing files, invalid configurations, inconsistent state, and orphaned plans.
Syntax
Automatically fix detected issues. Without this flag, health command only reports problems without making changes.
How It Works
- Scans
.planning/directory for structure and files - Validates critical files (STATE.md, ROADMAP.md, CONTEXT.md)
- Checks phase consistency between plans and roadmap
- Detects orphaned work (incomplete phases, abandoned debugs)
- Reports issues with severity levels
- Repairs if
--repairflag is provided
Health Checks
Critical Files
✅ Checks:.planning/STATE.mdexists and is valid JSON/YAML.planning/ROADMAP.mdexists with phase definitions.planning/CONTEXT.mdexists (can be empty)
- Missing STATE.md
- Corrupted STATE.md (invalid format)
- Missing ROADMAP.md
- Missing CONTEXT.md
Phase Consistency
✅ Checks:- Phases in roadmap match phase directories
- Completed phases have SUMMARY.md
- In-progress phases have PLAN.md
- Phase numbers are sequential
- Phase in roadmap but no directory
- Phase directory but not in roadmap
- Completed phase without SUMMARY.md
- Phase number gaps or duplicates
Orphaned Work
✅ Checks:- No
.continue-here.mdolder than 7 days - No debug sessions in
investigatingstate older than 3 days - No quick tasks without STATE.md entries
- Stale checkpoint files
- Abandoned debug sessions
- Untracked quick tasks
Git Consistency
✅ Checks:- No uncommitted changes in
.planning/ - Phase commits exist for completed phases
- No
.planning/files in gitignore
- Uncommitted planning files
- Completed phase without commit
Usage Examples
Check health without repairs
Check and repair issues
Healthy project
Corrupted state
Issue Severity Levels
❌ Critical (Blocks Work)
- Missing STATE.md
- Corrupted STATE.md
- Missing ROADMAP.md
- Invalid phase structure
⚠️ Warning (Should Fix)
- Missing SUMMARY.md for completed phase
- Phase directory without roadmap entry
- Stale checkpoint files (>7 days)
- Abandoned debug sessions (>3 days)
ℹ️ Info (Nice to Fix)
- Uncommitted changes in
.planning/ - Quick tasks not in STATE.md
- Empty CONTEXT.md sections
Repair Actions
STATE.md Reconstruction
Phase Sync
Checkpoint Cleanup
Debug Session Cleanup
When to Run Health Check
Run health check
- After long break from project
- After manual file edits
- Before important milestones
- If commands behave unexpectedly
- After force-push or branch operations
- Periodically (monthly for active projects)
Run with --repair
- When health check reports issues
- After recovering from editor crash
- After git conflicts in
.planning/ - When STATE.md seems wrong
- Before demo or presentation
Exit Codes
0- No issues detected1- Warning-level issues (doesn’t block work)2- Critical issues (blocks work)
Related Commands
resume-work- Resumes work (runs health check implicitly)progress- Shows progress (reports if health issues)new-project- Creates healthy structurepause-work- Creates checkpoint (checked by health)