/kata:kata-doctorfrom kata
Run health checks on Kata project structure, detecting and fixing format issues. Triggers include "doctor", "health check", "fix roadmap", "check project", "kata doctor".
Ships in kata. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Health Checks:
When invoked directly by user: run interactively with confirmation prompts.
When invoked by other skills (auto mode): format migration proceeds automatically, collision fix reports the problem and suggests /kata-doctor for interactive resolution.
<execution_context> @./references/roadmap-format-spec.md </execution_context>
Mode: $ARGUMENTS (optional: --auto for non-interactive mode)@.planning/ROADMAP.md @.planning/STATE.md
Parse arguments for mode:
AUTO_MODE=false
if echo "$ARGUMENTS" | grep -q "\-\-auto"; then
AUTO_MODE=true
fi
Display diagnostic banner:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Kata ► PROJECT HEALTH CHECK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Running diagnostics...
Run format detection:
node "${CLAUDE_PLUGIN_ROOT}/skills/kata-doctor/scripts/kata-lib.cjs" check-roadmap 2>/dev/null
FORMAT_EXIT=$?
Exit code handling:
0 = Current format, skip migration1 = Old format, needs migration2 = No ROADMAP.md, skip checkIf exit code 0:
✓ ROADMAP.md format: current
Continue to Check 2.
If exit code 2:
— ROADMAP.md: not found (skipped)
Continue to Check 2.
If exit code 1:
⚠ ROADMAP.md format: old (needs migration)
Proceed to roadmap migration.
Only runs if format check returned exit code 1.
Step 1: Parse old-format ROADMAP.md
Read the existing ROADMAP.md and extract:
# Roadmap: or # heading)cat .planning/ROADMAP.md
Step 2: Detect milestone boundaries
Analyze phases to group them by milestone. Look for:
<details> blocks (already partially migrated)Step 3: Build current-format structure
Transform to canonical format per roadmap-format-spec.md:
## Milestones overview section with status icons<details> blocks## Current Milestone: heading for active workStep 4: Write migrated ROADMAP.md
Use Write tool to update .planning/ROADMAP.md with new format.
Step 5: Verify migration
node "${CLAUDE_PLUGIN_ROOT}/skills/kata-doctor/scripts/kata-lib.cjs" check-roadmap 2>/dev/null
VERIFY_EXIT=$?
If exit code 0:
✓ ROADMAP.md migrated to current format
If still exit code 1:
✗ ROADMAP.md migration failed - manual review needed
Display the file for user review.
Step 6: Commit (if enabled)
COMMIT_PLANNING_DOCS=$(node "${CLAUDE_PLUGIN_ROOT}/skills/kata-doctor/scripts/kata-lib.cjs" read-config "commit_docs" "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
If COMMIT_PLANNING_DOCS=true:
git add .planning/ROADMAP.md
git commit -m "docs: migrate ROADMAP.md to current format"
Scan for duplicate numeric prefixes across all phase state directories:
DUPES=$(for state in active pending completed; do
ls .planning/phases/${state}/ 2>/dev/null
done | grep -oE '^[0-9]+' | sort -n | uniq -d)
# Also check flat directories (unmigrated projects)
FLAT_DUPES=$(ls .planning/phases/ 2>/dev/null | grep -E '^[0-9]' | grep -oE '^[0-9]+' | sort -n | uniq -d)
ALL_DUPES=$(echo -e "${DUPES}\n${FLAT_DUPES}" | sort -nu | grep -v '^$')
If no duplicates:
✓ Phase directories: no collisions
Continue to completion.
If duplicates found:
⚠ Phase directories: collisions detected
Duplicate prefixes: [list]
If AUTO_MODE=true:
Collision fix requires user confirmation.
Run `/kata-doctor` interactively to resolve.
Exit without fixing.
If AUTO_MODE=false:
Proceed to collision migration.
Only runs if collisions detected AND AUTO_MODE=false.
This step incorporates the full logic from kata-migrate-phases:
Step 1: Validate environment
[ -f .planning/ROADMAP.md ] || { echo "ERROR: No ROADMAP.md found."; exit 1; }
[ -f .planning/STATE.md ] || { echo "ERROR: No STATE.md found."; exit 1; }
Step 2: Build milestone chronology
Parse ROADMAP.md to build globally sequential phase numbering:
GLOBAL_SEQ=0
CHRONOLOGY=""
while IFS= read -r line; do
name=$(echo "$line" | grep -oE 'Phase [0-9.]+: .+' | sed 's/Phase [0-9.]*: //' | sed 's/\*\*$//' | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd 'a-z0-9-')
if [ -n "$name" ]; then
CHRONOLOGY="${CHRONOLOGY}${GLOBAL_SEQ} ${name}\n"
GLOBAL_SEQ=$((GLOBAL_SEQ + 1))
fi
done < <(grep -E 'Phase [0-9.]+:' .planning/ROADMAP.md)
Display: Chronology ([N] phases): 00 → foundation, 01 → api-endpoints, ...
Step 3: Map directories to phases
For each chronology entry, find matching directory across all states.
Build mapping: STATE/OLD_DIR → STATE/NEW_PREFIX-SLUG
Step 4: Present migration plan
Migration Plan:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
completed/01-foundation → completed/00-foundation
completed/02-api-endpoints → completed/01-api-endpoints
completed/01-setup → completed/02-setup
...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Total: [N] directories to rename
Use AskUserQuestion:
If cancelled: exit with "Migration cancelled."
Step 5: Execute two-pass rename
Pass 1: Rename all directories to temporary names: mv OLD tmp-{seq}-{slug}
Pass 2: Rename from temporary to final: mv tmp-{seq}-{slug} {padded}-{slug}
For active/pending phases, also rename internal files (*-PLAN.md, *-RESEARCH.md, etc.).
Step 6: Update documentation
Update ROADMAP.md current milestone phase numbers.
Update STATE.md current position.
Leave historical <details> blocks unchanged.
Step 7: Verify
Re-run collision detection:
DUPES=$(for state in active pending completed; do
ls .planning/phases/${state}/ 2>/dev/null
done | grep -oE '^[0-9]+' | sort -n | uniq -d)
If clean:
✓ Phase directories migrated to globally sequential numbers
✓ No duplicate prefixes remain
Step 8: Commit
COMMIT_PLANNING_DOCS=$(node "${CLAUDE_PLUGIN_ROOT}/skills/kata-doctor/scripts/kata-lib.cjs" read-config "commit_docs" "true")
git check-ignore -q .planning 2>/dev/null && COMMIT_PLANNING_DOCS=false
If COMMIT_PLANNING_DOCS=true:
git add .planning/phases/ .planning/ROADMAP.md .planning/STATE.md
git commit -m "chore: migrate phase directories to globally sequential numbering"
Display completion summary:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Kata ► HEALTH CHECK COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[List each check with status]
✓ ROADMAP.md format: [current | migrated | not found]
✓ Phase directories: [no collisions | migrated | skipped]
If any migrations were performed:
Changes committed. Run `/kata-track-progress` to continue.
<anti_patterns>
<details> blocks content (only add if missing)<success_criteria>
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gannonh/kata-marketplace --plugin kata32 skills in this plugin
/kata-add-issueCapture an idea, task, or issue that surfaces during a Kata session as a structured issue for later work. This skill creates markdown issue files in the .planning/issues/open directory with relevant metadata and content extracted from the conversation. Triggers include "add issue", "capture issue", "new issue", "create issue", "log issue", "file issue", "add todo" (deprecated), "capture todo" (deprecated), "new todo" (deprecated)./kata-add-milestoneAdd a milestone to an existing project, starting a new milestone cycle, creating the first milestone after project init, or defining what's next after completing work. Triggers include "add milestone", "new milestone", "start milestone", "create milestone", "first milestone", "next milestone", and "milestone cycle"./kata-add-phaseAdd planned work discovered during execution to the end of the current milestone in the roadmap. This skill appends sequential phases to the current milestone's phase list, automatically calculating the next phase number. Triggers include "add phase", "append phase", "new phase", and "create phase". This skill updates ROADMAP.md and STATE.md accordingly./kata-audit-milestoneVerify milestone achievement against its definition of done, checking requirements coverage, cross-phase integration, and end-to-end flows. Triggers include "audit milestone", "verify milestone", "check milestone", and "milestone audit". This skill reads existing phase verification files, aggregates technical debt and gaps, and spawns an integration checker for cross-phase wiring./kata-brainstormRun structured brainstorming sessions using paired explorer/challenger agent teams. Explorers generate ideas, challengers play devil's advocate, and 2-3 rounds of debate produce pressure-tested proposals. Use when brainstorming product ideas, exploring feature directions, evaluating strategic options, generating milestone candidates, or when the user says "brainstorm", "explore ideas", "what should we build next", "generate options", or "run an ideation session"./kata-check-issuesReview open issues, selecting an issue to work on, filtering issues by area, pulling GitHub issues, or deciding what to work on next. Triggers include "check issues", "list issues", "what issues", "open issues", "show issues", "view issues", "select issue to work on", "github issues", "backlog issues", "pull issues", "check todos" (deprecated), "list todos" (deprecated), "pending todos" (deprecated).