skills/mav-systematic-debugging/SKILL.md
Use when encountering any bug, test failure, or unexpected behaviour during implementation. Requires root cause investigation before proposing fixes.
npx skillsauth add thermiteau/maverick mav-systematic-debuggingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Find root cause before attempting fixes. Random fixes waste time, create new bugs, and mask underlying issues.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you have not completed Phase 1, you cannot propose fixes.
Use for any technical issue encountered during implementation:
Use this especially when:
Complete each phase before proceeding to the next.
digraph debugging {
"Phase 1: Root Cause Investigation" [shape=box];
"Root cause identified?" [shape=diamond];
"Phase 2: Pattern Analysis" [shape=box];
"Phase 3: Hypothesis and Test" [shape=box];
"Hypothesis confirmed?" [shape=diamond];
"Phase 4: Fix and Verify" [shape=box];
"Fix works?" [shape=diamond];
"Done" [shape=box];
"Attempts >= 3?" [shape=diamond];
"Escalate — question architecture" [shape=box];
"Phase 1: Root Cause Investigation" -> "Root cause identified?";
"Root cause identified?" -> "Phase 2: Pattern Analysis" [label="yes"];
"Root cause identified?" -> "Phase 1: Root Cause Investigation" [label="no — gather more evidence"];
"Phase 2: Pattern Analysis" -> "Phase 3: Hypothesis and Test";
"Phase 3: Hypothesis and Test" -> "Hypothesis confirmed?";
"Hypothesis confirmed?" -> "Phase 4: Fix and Verify" [label="yes"];
"Hypothesis confirmed?" -> "Phase 3: Hypothesis and Test" [label="no — new hypothesis"];
"Phase 4: Fix and Verify" -> "Fix works?";
"Fix works?" -> "Done" [label="yes"];
"Fix works?" -> "Attempts >= 3?" [label="no"];
"Attempts >= 3?" -> "Phase 1: Root Cause Investigation" [label="no — re-investigate"];
"Attempts >= 3?" -> "Escalate — question architecture" [label="yes"];
}
Before attempting any fix:
1. Read error messages carefully
2. Reproduce consistently
3. Check recent changes
git diff, recent commits)4. Gather evidence in multi-component systems
When the system has multiple layers (API → service → database, CI → build → deploy):
For EACH component boundary:
- Log what data enters the component
- Log what data exits the component
- Verify environment/config at each layer
Run once to gather evidence showing WHERE it breaks.
THEN analyse evidence to identify the failing component.
THEN investigate that specific component.
Use the project's logging standards (structured JSON, logger.debug()) for diagnostic instrumentation. Remove diagnostic logging before committing.
5. Trace data flow
Find the pattern before fixing:
Apply the scientific method:
Fix the root cause, not the symptom:
If three or more fix attempts have failed, this is likely an architectural problem, not a code bug.
Indicators of an architectural problem:
Action:
| Temptation | Why it fails | |---|---| | "Quick fix, investigate later" | Later never comes. The quick fix becomes permanent. | | "Just try changing X" | Without understanding why, you cannot know if the fix is correct. | | "Add multiple changes, see what works" | Cannot isolate what helped. Introduces new bugs. | | "It is probably X, let me fix that" | Seeing symptoms is not understanding root cause. | | "Skip the test, manually verify" | Manual verification does not prevent regression. | | "One more fix attempt" (after 2+ failures) | 3+ failures means the problem is architectural. | | "Increase the timeout" | Timeouts mask the real issue. Find why it is slow. |
When debugging occurs during plan execution (do-issue workflows):
development
--- name: do-test description: Write or update tests for a code change. Operates in two modes: `unit` (module-scoped, fast, deterministic) and `integration` (crosses module / service / database boundaries). Intended to be invoked once per testable change from inside a do-issue-* or do-epic phase. Mode is required. argument-hint: mode: unit or integration user-invocable: true disable-model-invocation: false --- **Depends on:** mav-bp-unit-testing, mav-bp-integration-testing, mav-local-verificati
development
Implement a focused code change. Use this skill as the wrapper for any implementation work so the Maverick workflow report captures what was done and so the agent applies the project's coding standards before editing. Intended to be invoked once per task from inside a do-issue-* or do-epic phase, not standalone.
testing
How to stack a PR on top of an unmerged sibling branch, and how to retarget it to the repo's default branch once the sibling merges. Prevents orphan-merge incidents when a dependent story is ready before its parent.
development
Claim, lease, heartbeat, and release protocols for when multiple Claude Code instances may act on the same issue or epic concurrently. GitHub labels and marker comments are the coordination surface; local state is a cache.