Systematic debugging

From vstorm-co/pydantic-deepagents · View interactive version

Systematic debugging is an AI agent skill from the GitHub repository vstorm-co/pydantic-deepagents. Systematic approach to diagnosing and fixing errors

How to use this skill

Skill file

Systematic Debugging

A structured approach to finding and fixing bugs.

The Debugging Loop

1. REPRODUCE → 2. ISOLATE → 3. DIAGNOSE → 4. FIX → 5. VERIFY

Never skip steps. Never guess-and-check repeatedly.

Step 1: Reproduce

Step 2: Isolate

Step 3: Diagnose

Read the error message carefully

| Error type | Where to look |

|-----------|---------------|

| Compile error | The FIRST error (later ones are often cascading) |

| Segfault | Last function in the stack trace, check array bounds and null pointers |

| Python traceback | The innermost frame (bottom), but also check the middle for context |

| Wrong output | Diff expected vs actual: diff <(expected) <(actual) |

| Timeout/hang | Is it an infinite loop? Deadlock? I/O bound? Add a timer or counter |

Add minimal instrumentation

Step 4: Fix

Step 5: Verify

Common Failure Patterns

"It compiles but gives wrong output"

  1. Print all intermediate values
  2. Compare with a known-correct reference implementation
  3. Check: integer overflow, floating point precision, endianness

"It works on small input but times out on large"

  1. Check algorithm complexity — O(n²) on 1M items = timeout
  2. Profile: which loop/function takes the most time?
  3. Restructure: hash maps, sorting, streaming

"It works locally but fails in the test"

  1. Check: absolute vs relative paths
  2. Check: different working directory
  3. Check: different input format than expected
  4. Read the test script to understand what it actually checks
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.