Логотип Debug Hypothesis

Debug Hypothesis

Сообщество
LichAmnesia
debug-hypothesis

Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the

Обзор

ИздательLichAmnesia
Репозиторийlich-skills
Название навыкаdebug-hypothesis
Звёзды
231
Форки
26
Встроенные файлы
Только инструкции
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Всё необходимое — в инструкциях

    Всё необходимое для модели содержится в инструкциях — никаких дополнительных файлов для синхронизации.

  • Открытый исходный код

    Опубликовано на GitHub: LichAmnesia. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Debug Hypothesis в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/LichAmnesia/lich-skills/tree/main/skills/debug-hypothesis
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/LichAmnesia/lich-skills.git /tmp/lich-skills
mkdir -p .claude/skills
cp -r /tmp/lich-skills/skills/debug-hypothesis .claude/skills/debug-hypothesis
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Debug Hypothesis в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Debug Hypothesis, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Debug Hypothesis не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Hypothesis-Driven Debugging

A four-phase loop that turns debugging from "try random fixes and hope" into a disciplined investigation. Each phase has a goal, hard rules, and a rationalization table for the excuses an agent will invent to skip it.

The core principle: you may not write a fix until you have evidence that your hypothesis is correct. Guessing is not debugging.

When to Use

  • A test fails and the cause is not immediately obvious
  • The same bug has been "fixed" twice and came back
  • The agent tried a fix that didn't work — stop it from trying another
  • A crash or error message you haven't seen before
  • Performance regression with no obvious culprit
  • Behavior differs between environments (local vs CI, dev vs prod)
  • The agent is stuck in a loop, applying the same wrong fix

When NOT to Use

  • Typos, missing imports, or syntax errors — just fix them
  • Build failures with an obvious single-line cause
  • Compiler/linter messages that tell you exactly what and where
  • You already know the root cause and just need to write the fix

If the bug survived one fix attempt, switch to this skill immediately.

The Debug Loop

  OBSERVE  ──▶  HYPOTHESIZE  ──▶  EXPERIMENT  ──▶  CONCLUDE
     │              │                  │               │
     ▼              ▼                  ▼               ▼
  Gather          List 3-5         One minimal       Root cause
  symptoms,       possible         test per          confirmed
  reproduce       causes +         hypothesis,       or loop
  reliably        evidence         max 5 lines       back
     │              │                  │               │
     └──────────────┴──────────────────┴───────────────┘
              write everything to DEBUG.md

Hard rules:

  1. Everything gets written to DEBUG.md. Context compaction will eat your reasoning if it only lives in the conversation.
  2. You may not write fix code during Observe, Hypothesize, or Experiment.
  3. You may not skip Hypothesize. "I think I know what it is" is a hypothesis — write it down and test it like the others.
  4. Each experiment changes at most 5 lines. If your experiment needs more, your hypothesis is too vague — split it.

Phase 1: OBSERVE

Goal. Collect raw facts. Reproduce the bug. Separate what you know from what you assume.

Steps.

  1. Reproduce the bug. Get the exact error message, stack trace, or wrong output. If you cannot reproduce it, that is your first finding.
  2. Find the minimal reproduction. Strip away unrelated code until the bug still appears.
  3. Record the environment: OS, runtime version, dependencies, config.
  4. Note what does work. The boundary between working and broken is where the bug lives.
  5. Write all observations to DEBUG.md under ## Observations.

Exit criteria.

  • Bug reproduced (or documented as non-reproducible with conditions)
  • Exact error message or wrong behavior recorded
  • Minimal reproduction identified
  • Observations written to DEBUG.md

Common Rationalizations

ExcuseReality
"I already know what's wrong"Then write it as a hypothesis and prove it. If you're right, it takes 2 minutes.
"Let me just try this quick fix first"That's how you end up 45 minutes deep with 6 failed attempts.
"The error message is clear enough"Error messages describe symptoms, not causes. NullPointerException tells you what died, not why.
"I don't need to reproduce it, I can see the bug in the code"Can you? Then why hasn't it been fixed yet?

Phase 2: HYPOTHESIZE

Goal. Generate 3-5 possible root causes. For each, list supporting and conflicting evidence from Phase 1. Rank by likelihood.

Steps.

  1. List 3-5 hypotheses. Not 1. Not "I think it's X." Three minimum. Think across categories:
    • Data: wrong input, missing field, type mismatch, encoding
    • Logic: wrong condition, off-by-one, race condition, wrong order
    • Environment: config, version, dependency, permissions
    • State: stale cache, leaked state, initialization order
  2. For each hypothesis, write:
    • Supports: evidence from observations that backs this theory
    • Conflicts: evidence that argues against it
    • Test: the minimal experiment that would prove or disprove it
  3. Mark the ROOT HYPOTHESIS — the one with supporting evidence and no conflicting evidence. If multiple qualify, pick the easiest to test.
  4. Write everything to DEBUG.md under ## Hypotheses.

Example format in DEBUG.md:

markdown
## Hypotheses

### H1: Race condition in session middleware (ROOT HYPOTHESIS)
- Supports: only happens under concurrent requests, timing-dependent
- Conflicts: none yet
- Test: add mutex lock around session read, check if bug disappears

### H2: Stale cache returning expired token
- Supports: works after restart (cache cleared)
- Conflicts: cache TTL is 5min, bug appears within 30s
- Test: disable cache, reproduce

### H3: Wrong env variable in CI
- Supports: works locally, fails in CI
- Conflicts: env diff shows identical values
- Test: print actual runtime value in CI logs

Exit criteria.

  • At least 3 hypotheses written
  • Each has supporting/conflicting evidence
  • Each has a specific, minimal test
  • ROOT HYPOTHESIS identified
  • All written to DEBUG.md

Common Rationalizations

ExcuseReality
"I only have one theory"You have one favorite theory. Think harder. What if it's not that?
"Writing this down is slow"Debugging without writing is slower. You'll forget hypothesis 2 after compaction eats it.
"The first hypothesis is obviously right"Then proving it takes 2 minutes. If you skip proof, you'll spend 30 minutes when it turns out wrong.
"I don't have conflicting evidence"That means you haven't looked hard enough, or it really is the root cause. Either way, test it.

Phase 3: EXPERIMENT

Goal. Test the ROOT HYPOTHESIS with the smallest possible change. You are a scientist — you are trying to falsify, not confirm.

Steps.

  1. Write the experiment before running it. What will you change? What result confirms the hypothesis? What result rejects it?
  2. Make the change. Maximum 5 lines. If you need more, your hypothesis is too vague.
  3. Run the reproduction from Phase 1.
  4. Record the result in DEBUG.md under ## Experiments.

Experiment rules.

  • One variable at a time. Do not combine two fixes "to save time."
  • Do not write production fix code. Write diagnostic code: log statements, assertions, simplified logic, hardcoded values.
  • Revert the experiment after recording results. Keep the tree clean.
  • If the experiment is inconclusive, that's a result — record it and test the next hypothesis.

Exit criteria.

  • Experiment executed (one change, one variable)
  • Result recorded: confirmed, rejected, or inconclusive
  • Experimental code reverted
  • Results written to DEBUG.md

Common Rationalizations

ExcuseReality
"Let me just fix it instead of testing"Fixing without confirming the cause is how you ship a wrong fix that breaks something else.
"I'll test two things at once to save time"When both change and the bug disappears, which one fixed it? Now you have to test again.
"5 lines isn't enough"5 lines is enough to add a log, an assertion, a hardcoded value, or a short-circuit. If it isn't, your hypothesis is "something is wrong somewhere" — not a hypothesis.
"I don't need to revert, the fix is basically the experiment"The experiment is diagnostic. The fix is production code. They have different quality bars.

Phase 4: CONCLUDE

Goal. Confirm root cause, write the real fix, and add a regression test.

Steps.

  1. If ROOT HYPOTHESIS confirmed:
    • Write the root cause in one sentence in DEBUG.md.
    • Now — and only now — write production fix code.
    • Add a regression test that fails without the fix and passes with it.
    • Commit fix and test together.
  2. If ROOT HYPOTHESIS rejected:
    • Record the rejection and evidence in DEBUG.md.
    • Promote the next hypothesis to ROOT. Return to Phase 3.
    • If all hypotheses rejected, return to Phase 1 with new observations.
  3. Update DEBUG.md with the final ## Root Cause and ## Fix sections.

Exit criteria.

  • Root cause identified and written in one sentence
  • Fix committed
  • Regression test committed
  • DEBUG.md complete with full investigation trail
  • Original reproduction case now passes

Common Rationalizations

ExcuseReality
"I don't need a regression test, it's a simple fix"Simple fixes for simple bugs don't need this skill. You're here because it wasn't simple. Add the test.
"The DEBUG.md is just for debugging, I'll delete it"Keep it. Future-you debugging the same area will thank present-you.
"All hypotheses failed, I'm stuck"Go back to Observe. You missed something. The bug exists, therefore a cause exists.

The Anti-Bulldozer Rule

The #1 failure mode of AI debugging: the agent forms a theory, writes 150 lines of "fix" code, it doesn't work, so it writes another 150 lines going deeper into the same wrong theory.

This skill exists to prevent that. If you catch yourself or the agent:

  • Writing more than 5 lines before confirming a hypothesis → STOP. Back to Phase 2.
  • Trying the same approach a second time → STOP. The hypothesis is rejected. Next one.
  • Ignoring conflicting evidence → STOP. Write it down. Re-rank hypotheses.
  • Feeling "almost there" after 3 failed attempts → STOP. You are bulldozing.

Write it down. Test it. Prove it. Then fix it.

Часто задаваемые вопросы

Что делает навык ИИ Debug Hypothesis?

Use when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the

Зачем использовать Debug Hypothesis в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Debug Hypothesis — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Debug Hypothesis в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/LichAmnesia/lich-skills/tree/main/skills/debug-hypothesis. TypingMind прочитает файл SKILL.md и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Debug Hypothesis?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Debug Hypothesis?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Debug Hypothesis: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Debug Hypothesis?

Да. Навык опубликован на GitHub автором LichAmnesia по лицензии MIT. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇