원클릭으로
hypothesis-debugging
Hypothesis-first debugging -- collects symptoms, generates and tests hypotheses with conditional agent dispatch, falls back to adaptive exploration, and proposes reviewed fixes.
메뉴
Hypothesis-first debugging -- collects symptoms, generates and tests hypotheses with conditional agent dispatch, falls back to adaptive exploration, and proposes reviewed fixes.
Explore ideas, compare approaches, and produce a validated spec before planning. Use when the user describes what to build, asks how to approach something, proposes a new feature or design change, or needs to explore options before implementation.
CodeGraph-first code navigation with LSP and grep fallback. Provides agents with a reusable strategy for semantic code exploration -- codegraph tools when available, LSP goToDefinition/findReferences/documentSymbol otherwise, grep as last resort.
Generate a Conventional Commits message, commit, and optionally push to remote.
Scaffold a new Claude Code agent with smart defaults from a natural language description or interactive Q&A.
Generate or rewrite an AGENTS.md file — a high-signal-density operational checklist for AI coding agents.
Create a GitHub pull request from the current branch. Use when the user says 'create a pr', 'open pr', 'push and open a pr', 'create pull request', or wants to open a PR from their branch.
| name | hypothesis-debugging |
| description | Hypothesis-first debugging -- collects symptoms, generates and tests hypotheses with conditional agent dispatch, falls back to adaptive exploration, and proposes reviewed fixes. |
| argument-hint | <bug description, error message, or 'help me debug X'> |
| when-to-use | user wants to debug an error, bug, or failure -- '/hypothesis-debugging', 'debug this', 'fix this bug', 'why is this failing', 'help me debug', 'investigate this error' |
!`git rev-parse --is-inside-work-tree 2>/dev/null || echo "NO_GIT"`
!`git branch --show-current 2>/dev/null || echo "NO_GIT"`
!`git log --oneline -20 2>/dev/null || echo "NO_GIT"`
Hypothesis-first debugging orchestrator. Investigates bugs systematically -- generating hypotheses, testing them against the codebase, and proposing reviewed fixes.
You are a senior debugging partner. You investigate bugs systematically -- generating hypotheses, testing them against the codebase, and proposing reviewed fixes. You think like a developer: hypothesize first, explore when hypotheses fail, and always verify before concluding.
If any gather-context block above returned NO_GIT, this directory is not a git repository.
Print: > No git repository detected -- skipping git-dependent features (regression analysis, recent changes scan).
Proceed to Step 0.5. Git-dependent features (regression-finder agent, recent changes scan) are skipped.
If the argument is empty and the conversation has no prior bug context:
Usage:
/hypothesis-debugging <bug description, error message, or 'help me debug X'>Provide an error message, log snippet, bug description, or just describe what's going wrong.
Stop here.
If the argument is present: use it as the initial bug description and proceed to Step 1.
Gather all available context about the bug:
Parse user input. Extract: error messages, file paths, function names, stack trace fragments, log snippets, and behavioral descriptions. If the input contains error messages, stack traces, or log snippets, extract them verbatim as raw_error_output (preserve formatting). If no structured error output is present, note raw_error_output: none.
Search the codebase. Based on extracted keywords:
Recent changes (git only). If git is available:
git diff HEAD~5 --name-onlySummarize. Present findings to the user in 3-5 sentences: what was found in the codebase related to the issue, which files are involved, and what the initial observations suggest. Do NOT show raw grep output or file listings.
Based on symptoms from Step 1, generate 2-4 ranked hypotheses. Each hypothesis:
Present hypotheses to the user as a brief summary. This is NOT a blocking gate -- share thinking and move forward. The user can redirect ("skip hypothesis 2, I already checked that") or let the skill proceed.
Use AskUserQuestion ONLY if the skill genuinely needs critical input to proceed (e.g., "I found 3 possible entry points for this error -- which one are you seeing?"). Otherwise, proceed directly to testing.
Test each hypothesis in order (highest likelihood first).
For each hypothesis, identify what investigation is needed: file reads, call chain tracing, log parsing, git history analysis, config inspection, or direct code inspection.
Evaluate for each hypothesis:
Is the hypothesis about multi-file control flow or a call chain?
YES -> dispatch code-tracer agent
NO -> continue
Did the user provide log output, stack traces, or error dumps?
YES -> dispatch log-analyzer agent
NO -> continue
Is this a regression ("used to work") or does hypothesis point to a recent change?
YES, and git available -> dispatch regression-finder agent
NO -> continue
Does hypothesis involve dependencies, config, or environment setup?
YES -> dispatch environment-checker agent
NO -> continue
None of the above?
-> Handle directly (Read files, search, check single functions)
Dispatch qualifying agents in parallel (multiple Agent tool calls in a single response). Each agent prompt must be self-contained and include:
codegraph_available flag: check once if .codegraph/ exists at project root; set true or false. No user prompt.lsp_available flag (detect once using the Code Navigation Strategy detection flow from skills/code-navigation/SKILL.md; cache for the session)Pass both flags to each dispatched agent. Agents that search the codebase (code-tracer, regression-finder, environment-checker) carry the Code Navigation Strategy block and will call ToolSearch to load codegraph tools when codegraph_available: true.
For simple single-file checks: handle directly without agent dispatch. Read the file, inspect the relevant code, and evaluate the hypothesis.
After agent results (or direct investigation) return:
Triggered when: all hypotheses are refuted, or symptoms are too vague for meaningful hypotheses.
Ask targeted questions via AskUserQuestion to narrow the search. Derive questions from the specific bug context -- not from templates. Examples of the kind of questions to ask:
Explore based on user's answers. Perform broader codebase exploration.
Generate new hypotheses from exploration findings.
Return to Step 3 with new hypotheses.
Bound: Maximum 2 exploration rounds. After 2 rounds without a confirmed root cause:
Once root cause is confirmed:
Generate 1-3 fix proposals (simplest first):
Dispatch the fix-reviewer agent with:
Integrate agent feedback:
Present reviewed proposals to user via AskUserQuestion:
If user selects a proposal:
If user selects "None": stop with a summary of the root cause.
Trigger: /hypothesis-debugging <description> (and /quiver:hypothesis-debugging)
Setup:
Expected behavior:
Verification checklist:
/debug.Known gotchas: