From bdk
Debug issues through structured investigation, failing test creation, and targeted fixes. Use when the user provides an error message, traceback, steps-to-reproduce, or describes unexpected behavior.
npx claudepluginhub broneq/bdk --plugin bdkThis skill is limited to using the following tools:
> Relies on BDK foundation (STARTUP_INSTRUCTIONS.md) for project context and MCP tool preference.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Relies on BDK foundation (STARTUP_INSTRUCTIONS.md) for project context and MCP tool preference.
Diagnose bugs via structured investigation, reproduce with failing tests, then fix or plan.
Announce at start: "Using debug to investigate the issue."
Core principle: Understand first → test second → confirm with user → fix third.
On start: create tasks for phases 1–4 only via TaskCreate:
Mark each task complete (TaskUpdate) only when phase fully done. Never mark Phase 4 complete until user responded.
After user responds to Phase 4: create Phase 5 task (TaskCreate) for chosen path — "Fix Inline" or "Hand Off to /bdk:create-plan" — then proceed.
digraph debug_flow {
rankdir=TB
node [shape=box, style="rounded,filled", fillcolor="#f0f0f0"]
start [label="Phase 1\nParse Input", fillcolor="#d4edda"]
investigate [label="Phase 2\nInvestigate"]
tests [label="Phase 3\nWrite Failing Tests"]
decide [label="Phase 4\nPropose & ASK USER\n(HARD STOP)", fillcolor="#fff3cd", shape=octagon]
fix [label="Phase 5a\nFix Inline + Verify"]
plan [label="Phase 5b\nHand off to /bdk:create-plan"]
done [label="Done", fillcolor="#d4edda", shape=doublecircle]
start -> investigate
investigate -> tests
tests -> decide
decide -> fix [label="user: 'Fix now'"]
decide -> plan [label="user: 'Create plan'"]
decide -> investigate [label="user: 'Something else'"]
fix -> done
plan -> done
}
[debug] Issue: {one-line summary}
[debug] Signals: error={exception class or "none"}, component={file/class or "unknown"}
GATE: Must have enough signal to start investigation.
Inject available search tools:
!python3 ${CLAUDE_PLUGIN_ROOT}/scripts/inject.py --chain ${CLAUDE_PLUGIN_ROOT}/fragments/tool-tiers/search.chain.json
Using the search tools above:
!python3 ${CLAUDE_PLUGIN_ROOT}/scripts/inject.py --chain ${CLAUDE_PLUGIN_ROOT}/fragments/tool-tiers/impact.chain.json
8. Scan for related test gaps — same class of problem in nearby code only
9. Print investigation summary:
[debug] Root cause: {one sentence}
[debug] Affected: {file path}:{line range}
[debug] Test gaps found: {N}
GATE: Must identify root cause before Phase 3.
Write tests that precisely reproduce bug. Tests RED until fix applied.
Rules:
Inject test command: !python3 ${CLAUDE_PLUGIN_ROOT}/scripts/get_settings.py test-tools
Delegate to test-runner subagent using injected command above (fall back to detecting from project context if unavailable) to confirm all new tests RED.
[debug] Failing tests confirmed: {N} red
GATE: All new tests must be RED before proceeding.
Mandatory checkpoint. STOP and wait for user decision.
Step 1: Describe proposed solution (what changes, why it fixes root cause, risks)
Step 2: Assess complexity:
Step 3: Ask user via AskUserQuestion:
## Proposed Fix
{solution summary}
## Complexity: {LOW or HIGH}
{justification}
## What would you like to do?
1. **Fix now** — apply the inline fix and verify tests pass
2. **Create plan** — hand off to `/bdk:create-plan` with failing tests as acceptance criteria
3. **Something else** — redirect, reconsider, investigate more
{recommendation}
AskUserQuestion MUST be last tool call in this phase.
HARD STOP: After calling
AskUserQuestion, output NO text, call NO tools, take NO action. Turn ends here. Phase 4 task stays open. Phase 5 does not start until user replies.
GATE: User explicitly chose option. Only then: mark Phase 4 complete, begin Phase 5.
Inject project tools context:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/get_settings.py test-toolspython3 ${CLAUDE_PLUGIN_ROOT}/scripts/get_settings.py lint-toolstest-runner — run only new failing tests using injected test commandstatic-analyse — run lint/type-check using injected lint command[debug] Done.
Root cause: {one sentence}
Tests added: {N}
Fix applied: {brief description}
Status: all tests GREEN
[debug] Routing to /bdk:create-plan/bdk:create-plan passing:
AskUserQuestion in Phase 4 — turn ends there