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-private 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
Use when a best-practice skill needs project-specific implementation details and no project skill exists at docs/maverick/skills/<topic>/SKILL.md. Scans the codebase and generates a project-specific skill file.
testing
Create or update technical documentation for a project. Covers architecture, service interactions, data flows, and design decisions. Produces professional markdown with Mermaid diagrams.
development
How to process code review feedback — verify before implementing, push back when wrong, clarify before acting on partial understanding. Applied when receiving review from the code-reviewer agent or human reviewers.
development
Analyze a project's codebase against Maverick standard practices and write a findings report. Checks linting, unit tests, integration tests, documentation, and CI/CD. Run when onboarding an existing project or on demand.