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

systematic-debugging

できること

このツールは、プログラムのエラーや予期しない動作など、技術的な問題の本当の原因を見つけるのに役立ちます。修正を試みる前に調査を行うよう案内し、一時しのぎではなく根本的な解決につなげます。

使う場面

  • ✓プログラムに表示された、意味のわからないエラーに対処するとき。
  • ✓何度か修正を試みたものの、うまくいかなかったとき。
  • ✓緊急時で、すぐに応急処置をしたくなるとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/systematic-debugging/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“コードでファイルを保存しようとすると変なエラーが出ます。根本原因を調べるにはどうすればよいですか?”

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

仕組み

このツールは、整理された手順に沿って進めることを提案します。まず、エラーの内容を理解し、再現方法を確認します。次に、最近どこが変更されたかを確認します。その後で仮説を立て、原因を確かめるために可能な限り小さな変更を試します。

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

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

Systematic Debugging

Overview

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

Core principle: Investigate before guessing and separate a verified repair from a temporary mitigation. During an incident, an authorized rollback or containment action may restore service while root-cause work continues.

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

The Iron Law

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

Start with the observable failure and the smallest useful evidence check. Label any emergency mitigation explicitly and preserve evidence for the later root-cause investigation.

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)
  • Manager 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
  2. Reproduce Consistently

    • Can you trigger it reliably?
    • What are the exact steps?
    • Does it happen every time?
    • If not reproducible → gather more data, don't guess
  3. Check Recent Changes

    • What changed that could cause this?
    • Git diff, recent commits
    • New dependencies, config changes
    • Environmental differences
  4. Gather Evidence in Multi-Component Systems

    WHEN system has multiple components (CI → build → signing, API → service → database):

    BEFORE proposing fixes, add diagnostic instrumentation:

    For EACH component boundary:
      - Record allowed field names, sizes, statuses and correlation IDs
      - Redact secrets and private payloads before logging
      - Verify environment/config propagation
      - Check state at each layer
    
    Run once to gather evidence showing WHERE it breaks
    THEN analyze evidence to identify failing component
    THEN investigate that specific component
    

    Example (multi-layer system):

    # In each relevant process, report presence only; never dump secret values.
    if [ -n "${IDENTITY:-}" ]; then
      echo 'IDENTITY is set'
    else
      echo 'IDENTITY is absent or empty'
    fi
    
    # Read-only validation of an already-built artifact, when available.
    codesign --verify --verbose=2 "$APP"
    

    Interpretation: Compare presence checks at the actual workflow/build boundaries. Artifact verification does not itself prove that the correct signing identity propagated.

  5. Trace Data Flow

    WHEN error is deep in call stack:

    See root-cause-tracing.md in this directory for the complete backward tracing technique.

    Quick version:

    • Where does bad value originate?
    • What called this with bad value?
    • Keep tracing up until you find the source
    • Fix at source, not at symptom

Phase 2: Pattern Analysis

Find the pattern before fixing:

  1. Find Working Examples

    • Locate similar working code in same codebase
    • What works that's similar to what's broken?
  2. Compare Against References

    • If implementing pattern, read reference implementation COMPLETELY
    • Don't skim - read every line
    • Understand the pattern fully before applying
  3. Identify Differences

    • What's different between working and broken?
    • List every difference, however small
    • Don't assume "that can't matter"
  4. Understand Dependencies

    • What other components does this need?
    • What settings, config, environment?
    • What assumptions does it make?

Phase 3: Hypothesis and Testing

Scientific method:

  1. Form Single Hypothesis

    • State clearly: "I think X is the root cause because Y"
    • Write it down
    • Be specific, not vague
  2. Test Minimally

    • Make the SMALLEST possible change to test hypothesis
    • One variable at a time

…

よくある質問

なぜ応急処置をすぐに試してはいけないのですか?

応急処置は本当の問題を隠してしまうことがあり、新たなバグを生んだり、結局は多くの時間を失ったりする原因になります。根本原因を調べることで、長く使える解決策につながります。

「根本原因」とは何ですか?

問題が起きる根本的な理由のことです。目に見えるエラー(症状)だけを対処するのではなく、もとの問題を解決すれば、同じエラーが再び起きないようにできます。

システムの複数の部分が関係している場合はどうすればよいですか?

このツールは、部分どうしの連携を確認し、それぞれの「境界」(ある部分が別の部分とやり取りする箇所)でログを記録して、どこで最初に失敗が起きているかを突き止めるよう提案します。

詳細

作者による元の説明

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#5918
ライセンス
MIT
更新日
2026/10/15

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

0

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

コメント

  • …

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

似ているスキル