Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bug-diagnosis

БесплатноЗапускает вложенные скриптыНе проверен

Find the root cause of hard bugs with a fast pass/fail repro, ranked falsifiable hypotheses and bisection. Use when a bug resists quick fixes, a failure is…

borgheiот borghei★ 1 250 звёзд на GitHub

Об этом скилле

Bug Diagnosis

A disciplined loop for bugs that survived the first obvious fix. The order is fixed: build a signal that says "bug present / bug absent" in seconds, write down competing explanations with predictions that could prove them wrong, test the cheapest likely one, narrow the search space by halving, and lock the cause in with a regression test that was seen failing. Most wasted debugging time comes from skipping the first step and reading code to build a theory with nothing to check it against.

When to use this skill

  • A bug resisted a first fix — the patch went in and the symptom came back, or moved
  • The failure is intermittent — passes locally, fails in CI one run in five
  • A regression appeared between two releases and nobody knows which change caused it
  • The symptom is far from the cause — wrong totals, corrupted records, a hang with no error
  • A performance regression needs a measured cause rather than a guess
  • Logs or traces need sharing with a teammate, vendor or assistant and may contain credentials

Inputs the skill expects

  • The reported symptom in exact terms: error text, wrong value, measured latency
  • Where it reproduces (local, CI, staging, production only) and how often
  • The last known-good state if one exists: a release, a commit, a dataset, a flag set
  • Access the agent has: can it run the code, the tests, a local database, git bisect?
  • Any artefacts already captured (logs, dumps, traces) — redacted before they are pasted

Clarify First

What most shapes a diagnosis is whether a reproduction signal can be built and how far the cause might hide. Settle the inputs below before producing anything. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • The exact symptom: a signal must assert this specific symptom; "it's broken" yields a check that goes red on the wrong bug.
  • Where it reproduces: decides the harness — a local test, a recorded request replay, or a request for environment access.
  • Last known-good state: if one exists, bisection usually beats hypothesis testing and should come first.
  • Blast-radius limits: whether the agent may touch shared environments, production data or code outside the failing module.

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Validate a diagnosis log and see which hypothesis to test next
python3 engineering/bug-diagnosis/scripts/hypothesis_log.py \
  --input engineering/bug-diagnosis/assets/sample_diagnosis_log_passing.json

# Check a log file for secrets before pasting it anywhere
python3 engineering/bug-diagnosis/scripts/redact_scan.py \
  --paths engineering/bug-diagnosis/assets/sample_debug_log.txt --pii

Workflows

Workflow 1 — Build the reproduction signal [PROVEN]

No signal, no hypotheses. The agent spends disproportionate effort here because every later step consumes this one command.

  1. Pick the harness from the bug class: failing test at the narrowest seam, replayed request, fixture-driven CLI run, timing harness for performance, or a differential run between versions (see references/reproduction-signals.md).
  2. Start from assets/repro-script-template.sh so the signal exits 0 for good, 1 for bad and 125 for untestable — directly usable by git bisect run.
  3. Make it assert the reported symptom. A check for "no exception" is not a signal.
  4. Pin clock, random seeds, locale, network and worker count. Run it 3+ times; record runs, red runs and runtime.
  5. If the failure is intermittent, raise its rate (loop in-process, parallel copies, smaller timeouts, injected delay) until at least 30% of runs go red.
  6. Minimise: remove inputs, records, steps and config one at a time, keeping only what keeps the signal red.

Validation checkpoint: the signal is one command, asserts the symptom, red on 3+ runs (or ≥30% for intermittent bugs), and runs in under 30 seconds. If it cannot be built within the timebox, stop and ask for access, a redacted artefact, or permission for tagged instrumentation.

Workflow 2 — Hypothesise, rank, test one at a time [PROVEN]

  1. Write 3–5 hypotheses before testing any, each naming a mechanism and a prediction in the form "if X is the cause, then changing Y makes the symptom disappear".
  2. Give each a prior (0–1) and an experiment cost in minutes. Record them in a diagnosis log JSON (shape: assets/sample_diagnosis_log_passing.json).
  3. Show the ranked list to the reporter before testing; their context often re-ranks it.
  4. Run the validator. It ranks open hypotheses by prior ÷ cost and rejects vague predictions, multi-variable experiments and confirmations with no evidence.
  5. Run the top experiment, record the result and evidence, re-run the validator, repeat.
python3 engineering/
Полный SKILL.md на GitHub

Установить bug-diagnosis в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/diagnosis-log-template.mdassets/repro-script-template.shassets/sample_debug_log.txtassets/sample_diagnosis_log.jsonassets/sample_diagnosis_log_passing.jsonreferences/bisection-instrumentation-redaction.mdreferences/reproduction-signals.mdscripts/hypothesis_log.pyscripts/redact_scan.py

FAQ

Что делает скилл bug-diagnosis?

Find the root cause of hard bugs with a fast pass/fail repro, ranked falsifiable hypotheses and bisection. Use when a bug resists quick fixes, a failure is intermittent, or a regression needs tracing to its cause.

Как установить скилл bug-diagnosis?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bug-diagnosis запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bug-diagnosis с