本文へスキップ
Skillpedia
一般的なプログラミング260k · #625

systematic-debugging

できること

このスキルは、当て推量の素早い修正をせずに、計画的にバグを調べるようAIに求めます。テストの失敗、本番のバグ、予期しない動作に直面している開発者向けです。

使う場面

  • ✓テストが失敗する、またはプログラムが予期しない動作をし、原因が分からないとき。
  • ✓素早い修正が失敗し、本当の問題を理解する必要があるとき。
  • ✓ビルドが失敗したり、連携が壊れたりしていて、まず根本原因を見つけたいとき。

スキルのリンク

https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/systematic-debugging/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/systematic-debugging/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ログインのページは本番環境でだけ失敗し、素早い修正は効きませんでした。何かを変える前に、根本原因を見つける手伝いをしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、AIにまず問題を示す速いテストを作らせ、その後に証拠を集めて仮説を立てさせます。根本原因が確認されて初めて、修正を提案してテストします。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Systematic Debugging

Overview

Random fixes waste time and create new bugs. Quick patches mask underlying issues.

Core principle: ALWAYS find root cause before attempting fixes. Symptom fixes are failure.

Violating the letter of this process is violating the spirit of debugging.

The Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

If you haven't completed Phase 1, you cannot propose fixes.

The Feedback Loop Rule

The feedback loop is the debugging work. Before reading code to build a theory, create or identify a tight command that can go red on the user's exact symptom and green when the bug is fixed. A tight loop is fast, deterministic, agent-runnable, and specific enough to catch this bug — not merely "doesn't crash".

When a clean repro is hard, spend disproportionate effort building the loop. Guessing without a red-capable loop is the failure mode this skill exists to prevent.

When to Use

Use for ANY technical issue:

  • Test failures
  • Bugs in production
  • Unexpected behavior
  • Performance problems
  • Build failures
  • Integration issues

Use this ESPECIALLY when:

  • Under time pressure (emergencies make guessing tempting)
  • "Just one quick fix" seems obvious
  • You've already tried multiple fixes
  • Previous fix didn't work
  • You don't fully understand the issue

Don't skip when:

  • Issue seems simple (simple bugs have root causes too)
  • You're in a hurry (rushing guarantees rework)
  • Someone wants it fixed NOW (systematic is faster than thrashing)

The Four Phases

You MUST complete each phase before proceeding to the next.


Phase 1: Root Cause Investigation

BEFORE attempting ANY fix:

1. Read Error Messages Carefully

  • Don't skip past errors or warnings
  • They often contain the exact solution
  • Read stack traces completely
  • Note line numbers, file paths, error codes

Action: Use read_file on the relevant source files. Use search_files to find the error string in the codebase.

2. Build a Tight Feedback Loop

  • Can you trigger the user's exact symptom with one command?
  • Does the command fail for this bug and only pass once the bug is fixed?
  • Is it fast enough to run repeatedly?
  • Is it deterministic? For flaky bugs, can you raise the reproduction rate high enough to debug?
  • If not reproducible → gather more data, don't guess.

Ways to construct a loop — try in roughly this order:

  1. Failing test at the seam that reaches the bug: unit, integration, or end-to-end.
  2. HTTP script / curl against a running dev server.
  3. CLI invocation with fixture input, diffing stdout/stderr against expected output.
  4. Headless browser script (Playwright/Puppeteer) asserting on DOM, console, or network.
  5. Replay a captured trace: HAR, request payload, event log, queue message, or webhook body.
  6. Throwaway harness that boots the smallest useful slice of the system and calls the failing path.
  7. Property / fuzz loop when the bug is intermittent wrong output over a broad input space.
  8. Bisection harness suitable for git bisect run when the bug appeared between two known states.
  9. Differential loop comparing old vs new version, two configs, two providers, or two datasets.
  10. Human-in-the-loop script only as a last resort: script the human steps and capture their result so the loop stays structured.

Tighten the loop once it exists:

  • Make it faster: cache setup, narrow scope, skip unrelated initialization.
  • Make the signal sharper: assert the exact symptom, not generic success.
  • Make it more deterministic: pin time, seed randomness, isolate filesystem, freeze network.

For non-deterministic bugs, the immediate goal is a higher reproduction rate, not perfection. Run the trigger 100x, parallelize, add stress, narrow timing windows, or inject sleeps. A 50% flake is debuggable; a 1% flake usually is not.

Action: Use the terminal tool to run the tight loop:

# Run a specific failing test
pytest tests/test_module.py::test_name -v

# Or run a scripted repro
python scripts/repro_bug.py

# Or run a high-repetition flaky repro
for i in {1..100}; do pytest tests/test_flake.py::test_name -q || break; done

3. Check Recent Changes

  • What changed that could cause this?
  • Git diff, recent commits
  • New dependencies, config changes

Action:

# Recent commits
git log --oneline -10

# Uncommitted changes
git diff

# Changes in specific file
git log -p --follow src/problem
よくある質問

なぜ素早い修正を試さないのですか?

スキルによると、場当たり的な修正は時間を無駄にし、新しいバグを生むことがあるため、根本原因が先です。

フィードバックループとは何ですか?

スキルは、バグがあれば失敗し、修正されれば成功する、素早いコマンドだと説明しています。

簡単なバグにも当てはまりますか?

スキルによると、簡単なバグにも手順に従うべきです。本当の原因が隠れていることがあるからです。

詳細

作者による元の説明

4-phase root cause debugging: understand bugs before fixing.

repo: NousResearch/hermes-agent

人気

GitHubのスター
260k
ランキング
#625
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル