systematic-debugging
Debug concrete failure: first run tea-rags:bug-hunt for ranked suspect list
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Debug concrete failure: first run tea-rags:bug-hunt for ranked suspect list
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Decide HOW to write new code by inspecting git signals on neighbors — pulls strategy and templates from proven, low-churn nearby implementations rather than guessing from training data. Triggers on "implement function X", "add method to class Y", "write a helper for Z", "напиши функцию", "добавь метод". NOT for discovery or exploration — use tea-rags:explore for that. This skill activates ONCE the agent is about to write code.
Agentic-only enrichment skill — surface battle-tested reference code from project as templates for generation / modification. Three-level locality cascade (target subdomain → domain → project), quality gate by overlay labels + project-wide proven rerank preset. Returns ranked list of reference chunks + locality annotation (L1 / L2 / L3 / none). Invoked by `tea-rags:data-driven-generation` Step 2 (TEMPLATE), `dinopowers:writing-plans` (per code-gen Task), `dinopowers:executing-plans` (per Task during execute). Skipped when no `positiveIds` / `positiveCode` and no `behaviorQuery` available.
Run automated TeaRAGs install wizard from scratch — detects environment, installs deps (Node.js, tea-rags, Ollama/ONNX, Qdrant), tunes performance, configures MCP server. Progress saves to ~/.tea-rags/setup-progress.json for resumable install. Triggers on "install tea-rags", "set up TeaRAGs MCP", "configure tea-rags from scratch", "поставить tea-rags в проект". NOT for tuning an existing install — use tune for that.
Agent-only. Raise test coverage above a failed pre-commit threshold: locate the
Brainstorm code change seeing risk, ownership, tech-debt signals from tea-rags first — creative exploration grounded in actual state of affected area. Triggers on "brainstorm X", "design feature", "refactor Y", "let's discuss", "давай обсудим", "как перестроить", "что может сломаться". NOT for trivial edits or stylistic questions with no code area to enrich. Wraps superpowers:brainstorming with tea-rags risk-signal enrichment step.
Execute written implementation plan whose Tasks edit code, per-Task SAFE/CAUTION/UNSAFE git-signal verdict before edit AND code-style cascade for code-generation Tasks (style from silo authors, strategy+template from proven neighbors). Triggers on "execute the plan", "start Task N", "выполни план", "начни задачу", "run the plan", "implement the plan steps". NOT for one-off edits without a written plan. Wraps superpowers:executing-plans with tea-rags git-signal verdicts and tea-rags:data-driven-generation cascade.
Wrapper over superpowers:systematic-debugging. Debug loop starts from real
bug-proneness data — historically buggy code ranked by bugFixRate + churn —
not flat search over whole codebase.
Skill(tea-rags:bug-hunt) MUST run BEFORE
Skill(superpowers:systematic-debugging) — whenever bug has concrete symptom
(error text, stack trace, reproducible behavior).
Core value: correct delegation (tea-rags:bug-hunt skill, not ad-hoc
semantic_search) + correct symptom framing + correct ordering + honest
handling of empty suspects.
If "bug" purely speculative ("maybe there's a race condition somewhere") with no
symptom: skip wrapper, invoke superpowers:systematic-debugging directly. Do
not fabricate symptom to justify bug-hunt.
Chaining rule: see CHAINING.md — every dinopowers:X redirects superpowers:X. NEVER bypass wrapper.
Index freshness: see FRESHNESS.md and
tea-rags/rules/index-freshness.md. No background reindex hook — worktree-plan
freshness explicit (clone + per-task reindex in dinopowers:executing-plans);
run mcp__tea-rags__index_codebase manually to search code edited but not
committed, BEFORE first tea-rags call.
From user report, extract:
| Element | Example |
|---|---|
| Symptom text | error message, stack trace, reproduction sentence |
| Affected path (optional) | src/core/domains/ingest/** if user mentions a subsystem |
| Expected vs actual | "expected X, got Y" if stated |
Compose:
symptom: concise sentence (goes into tea-rags:bug-hunt as query)pathHint: optional pathPattern if scope is knownIf no symptom text (only vague "something's off"): skip to Step 4 with no suspect block, state "symptom not framed — bug-hunt skipped".
Invoke Skill tool with tea-rags:bug-hunt. Pass symptom (and pathHint if
present) as input. Skill internally runs semantic_search with
rerank="bugHunt" preset, applies own triage:
bugFixRate "critical" → prime suspectbugFixRate "concerning" + high churn → secondary suspectbugFixRate "healthy" → SKIPWait for its PRESENT output — ranked suspect list with file:line + signal
labels + one-sentence observation per suspect.
Do NOT substitute:
| Wrong approach | Why wrong |
|---|---|
Direct mcp__tea-rags__semantic_search with rerank="bugHunt" | Bypasses the tea-rags:bug-hunt triage (healthy → SKIP, concerning+churn rule) and the PRESENT format |
Named preset "hotspots" / "techDebt" | bugHunt is calibrated for symptom→suspect matching; these are broader risk lenses |
mcp__tea-rags__hybrid_search on the error string | BM25 on error text returns wherever that string is logged, not where the bug originates |
| Custom rerank weights | bug-hunt skill owns the weighting logic — don't duplicate it in the wrapper |
| Built-in Grep / Read on stack trace files | Loses bugFixRate signal; you'll read code that's actually healthy |
git log --grep / git blame for bug history | bug-hunt reads git signals via overlay; manual git commands are slower and noisier |
Take bug-hunt PRESENT output, reshape as hypothesis block:
### Bug-hunt priors for: "<symptom>"
**Prime suspects (bugFixRate critical):**
- <file>:<startLine>-<endLine> — <observation>
signals: bugFixRate <X%>, commitCount <N>, ageDays <N>
**Secondary suspects (concerning + churn):**
- <file>:<startLine>-<endLine> — <observation>
signals: bugFixRate <X%>, relativeChurn <Y>
**Skipped (healthy):** <N> files with bugFixRate=healthy — likely not the root cause.
If bug-hunt returned 0 suspects (all healthy): state "no bug-prone zones for
this symptom — root cause likely in recently-added untracked code or external
dependency".
Bug-hunt gives flat suspect list. When you also have entry/repro point —
symbol where failing flow starts (test, request handler, CLI entry, symbol in
top user-code stack frame) — promote prime suspect from point to chain: call
mcp__tea-rags__trace_path from entry symbol to suspect symbol. Requires
codegraph (prime shows codegraph.symbols); when off trace_path not
registered — skip this step, stay with flat suspect list from Step 2/3.
mcp__tea-rags__trace_path(
from="<entry/repro symbol>", # e.g. the failing test or request handler
to="<prime suspect symbol>", # the bugFixRate-critical symbol from Step 2/3
rerank="bugHunt" # danger-rank the steps the same lens as bug-hunt
)
What this collapses: instead of N manual get_callers / get_callees turns to
hand-walk call graph from entry to fault, trace_path returns static call CHAIN
in one call AND attaches temporal risk to every step.
Read the result like this:
dangerRanking[0] — step to inspect FIRST. Not entry, not suspect
necessarily — riskiest hop on path between them. Start hypothesis there.dangerOverlay per step — carries bugFixRate / churn for that hop, so
quiet-looking intermediate function with critical history surfaces instead of
hiding between entry and suspect.from to to. Hypothesis "the
entry flow reaches this suspect" is structurally false. Useful negative
signal: either repro point wrong, bug reached via dynamic/async edge static
graph doesn't see, or suspect unrelated. Drop it, trace to next suspect.Preset selection for trace:
| Situation | rerank |
|---|---|
| General symptom, history-ranked chain (default) | bugHunt |
| Fresh regression — "worked last release" | recent |
| Suspect is a hot, frequently-touched path | hotspots |
| Failure smells like a wide blast-radius change | blastRadius |
For fresh regression prefer rerank="recent": ranks most recently-changed
step on path first — hop most likely introduced by change that broke things.
Bound search with maxDepth / maxPaths if graph deep or branchy.
Append traced chain under hypothesis block from Step 3:
**Causal chain (entry → prime suspect), danger-ranked:**
- inspect first: <dangerRanking[0] symbol> @ <file>:<line>
overlay: bugFixRate <X%>, churn <Y>
- full path: <from> → … → <to> (<N> hops)
If no clear entry/repro point, skip this step — bug-hunt's flat ranking from Step 3 enough to seed hypotheses.
Invoke Skill tool with superpowers:systematic-debugging. Prepend hypothesis
block as context. Phrase handoff as:
"Before forming hypotheses, note these bug-hunt priors: …… Start hypothesis space with prime suspects; escalate to secondary only if primes rule out.
Chaining rule reminder: when you (the inner skill) would next invoke
superpowers:test-driven-developmentorsuperpowers:verification-before-completion(or any wrappedsuperpowers:Y), invokedinopowers:Yinstead — see the Chaining rule section above."
Let superpowers:systematic-debugging run its standard hypothesis-form /
experiment / rule-out cycle. Wrapper does not replace it — it seeds hypothesis
space.
semantic_search with rerank="bugHunt" → missed triage.
Invoke the skill.superpowers:systematic-debugging → extract
hypothesis block firstsymptom when user only said "it feels off" → skip Step 2, state
itsuperpowers:systematic-debugging chain into raw
superpowers:test-driven-development /
superpowers:verification-before-completion without redirecting to
dinopowers:Y wrapper → intercept, invoke wrapper instead (see Chaining rule)| Mistake | Reality |
|---|---|
Start superpowers:systematic-debugging with the error message as hypothesis | Flat search. Bug-hunt narrows to bug-prone zones first. |
Use tea-rags:bug-hunt AFTER hypotheses formed ("to validate") | Wrong order. Bug-hunt seeds the hypothesis space, not validates it post-hoc. |
| Ignore the "healthy" skip signal | Healthy zones are calibrated-out by bug-hunt. If you still want to look there, you're overriding a trusted prior. |
| Re-run bug-hunt on each new hypothesis | One bug-hunt call per symptom. Hypothesis iteration is superpowers:systematic-debugging's job. |
| Invoke on speculative "maybe there's a race" questions | That's brainstorming (use dinopowers:brainstorming), not debugging a symptom. |
Pass the full stack trace as symptom | Stack traces contain noise (framework frames). Extract the user-code frame or error message only. |
Hand-walk get_callers / get_callees from entry to suspect | trace_path(from, to, rerank="bugHunt") returns the whole chain in one call and danger-ranks the hops. |
Treat an empty trace_path result as "tool failed" | When codegraph is on (prime shows codegraph.symbols): empty = no static call path, so the hypothesis that the entry reaches that suspect is structurally false — drop it. When codegraph is off trace_path is not registered (absent, not empty) — that is NOT evidence; keep the hypothesis and verify via bug-hunt suspects / manual call reading. |
Use rerank="recent" for an old, always-flaky symptom | recent ranks the newest-changed hop first — that's for fresh regressions. For long-standing bugs keep bugHunt. |