Agent skill · magnus919
systematic-debugging
4-phase root cause debugging protocol: understand bugs before fixing.
What it needs
About 11k tokens when loaded.
What this skill does
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. The Iron Law If you haven't completed Phase 1, you cannot propose fixes. When to Use Use for ANY technical issue: Test failures Bugs in production Unexpected behavior Performance problems Build failures Integration issues 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 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: Read the relevant source files at the error locations and search the codebase for the error string to find all related code paths. 2. Reproduce Consistently Can you trigger it reliably? What are the exact steps? If not reproducible → gather more data, don't guess Action: Run the failing test or trigger the bug: 3. Check Recent Changes What changed that could cause this? Git diff, recent commits, new dependencies, config changes Action: 4. Gather Evidence in Multi-Component Systems WHEN system has multiple components (API → service → database, CI → build → deploy): Add diagnostic instrumentation BEFORE proposing fixes. For EACH component boundary: Log what data enters the component Log what data exits the component Verify environment/config propagation Check state at each layer Run once to gather evidence showing WHERE it breaks. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills magnus919/systematic-debugging