Enhance bd doctor with bd prime migration recommendations (bd-0fvq)

Add comprehensive detection and migration guidance for old beads integration
patterns. This helps users adopt the more efficient bd prime approach.

Changes:
- Enhanced CheckLegacyBeadsSlashCommands with detailed migration steps
  and token efficiency benefits (99% reduction: ~10.5k → ~50 tokens)
- Added CheckAgentDocumentation to detect missing AGENTS.md/CLAUDE.md
  and suggest bd onboard or bd setup claude
- Enhanced CheckClaude to recommend bd prime hooks for MCP-only setups
  with clear token efficiency messaging
- Added comprehensive tests for all new checks

bd doctor now detects:
1. Old slash command patterns (/beads:*) and recommends bd prime hooks
2. Missing agent documentation and suggests creating it
3. MCP-only setups without hooks and shows token savings potential
4. Provides clear migration paths and benefits for all scenarios

Token efficiency messaging:
- MCP mode: ~50 tokens vs ~10.5k for full scan (99% reduction)
- CLI mode: ~1-2k tokens with automatic context recovery
- Hooks auto-refresh context on SessionStart and PreCompact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-11-20 19:35:18 -05:00
parent 1458519536
commit f01326832f
5 changed files with 3340 additions and 3014 deletions

View File

@@ -58,14 +58,34 @@ func CheckClaude() DoctorCheck {
Name: "Claude Integration",
Status: "warning",
Message: "MCP server installed but hooks missing",
Fix: "Run: bd setup claude",
Detail: "MCP-only mode: relies on tools for every query (~10.5k tokens)\n" +
" bd prime hooks provide much better token efficiency",
Fix: "Add bd prime hooks for better token efficiency:\n" +
" 1. Run 'bd setup claude' to add SessionStart/PreCompact hooks\n" +
"\n" +
"Benefits:\n" +
" • MCP mode: ~50 tokens vs ~10.5k for full tool scan (99% reduction)\n" +
" • Automatic context refresh on session start and compaction\n" +
" • Works alongside MCP tools for when you need them\n" +
"\n" +
"See: bd setup claude --help",
}
} else {
return DoctorCheck{
Name: "Claude Integration",
Status: "warning",
Message: "Not configured",
Fix: "Run: bd setup claude (and install beads plugin for slash commands)",
Detail: "Claude can use bd more effectively with hooks and optional plugin",
Fix: "Set up Claude integration:\n" +
" 1. Run 'bd setup claude' to add SessionStart/PreCompact hooks\n" +
" 2. (Optional) Install beads plugin for slash commands\n" +
"\n" +
"Benefits:\n" +
" • Hooks: Auto-inject workflow context (~50-2k tokens)\n" +
" • Plugin: Convenient slash commands + MCP tools\n" +
" • CLI mode: Works without plugin (hooks + manual 'bd prime')\n" +
"\n" +
"See: bd setup claude --help",
}
}
}