Agent skill

Debug Mastery

by xenitV1 in xenitV1/claude-code-maestro

Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards.

MITAuto-check: notesDevelopment

Install Debug Mastery

skills CLI
$ npx skills add xenitV1/claude-code-maestro --skill debug-mastery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install xenitV1/claude-code-maestro debug-mastery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/xenitV1/claude-code-maestro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/debug-mastery .claude/skills/debug-mastery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
debug-mastery
GitHub stars
229
Token cost
~2.5k tokens
SKILL.md length
1,211 words
Files
3
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards.

  • Works in 4 steps: Root Cause Investigation → Pattern Analysis → Hypothesis and Testing → …
  • Tasks that involve Debugging
  • SKILL.md covers 🚨 THE IRON LAW, 📋 WHEN TO USE, 🔄 THE FOUR PHASES and 🚨 RED FLAGS - STOP AND FOLLOW…, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Debug Mastery is an agent skill from xenitV1/claude-code-maestro. Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards. No fixes without investigation.

Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `defense-in-depth.md` and `root-cause-tracing.md`).

It sits in Development, covering Debugging, Root cause analysis and Observability. The licence is MIT.

When your agent uses it

  • Tasks that involve Debugging
  • Tasks that involve Root cause analysis
  • Tasks that involve Observability

Example prompts

  • “/debug-mastery”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Glob, Grep, Bash

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Root Cause Investigation
  2. Pattern Analysis
  3. Hypothesis and Testing
  4. Implementation

What it can do on your machine

Read from SKILL.md and the folder at commit 924315b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Glob
    • Grep
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Debug Mastery loads about 2.5k tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 1,211 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~2.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Glob, Grep, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from xenitV1/claude-code-maestro at commit 924315b, republished under its MIT licence (© xenitV1). 1,211 words, ~2,501 tokens.

Download SKILL.mdSave it as .claude/skills/debug-mastery/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
debug-mastery
description
Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards. No fixes without investigation.
allowed-tools
Read, Write, Edit, Glob, Grep, Bash

<domain_overview>

🐛 DEBUG MASTERY: SYSTEMATIC DEBUGGING

Philosophy: Random fixes waste time and create new bugs. Quick patches mask underlying issues. ALWAYS find root cause before attempting fixes. FORENSIC ANALYSIS MANDATE (CRITICAL): Never apply a fix without a confirmed root cause. AI-generated fixes often address symptoms rather than underlying architectural logic. You MUST perform a 'Forensic Investigation' that identifies the specific assumption or boundary condition that failed. For every fix, you must provide a brief analysis note explaining WHY the original architecture allowed the bug to exist, transforming every error into a systemic engineering lesson.


🚨 THE IRON LAW

NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST

If you haven't completed Phase 1, you cannot propose fixes. Violating the letter of this process is violating the spirit of debugging.

📋 WHEN TO USE

Use for ANY technical issue:

  • Test failures
  • Bugs in production
  • Unexpected behavior
  • Performance problems
  • Build failures
  • Integration issues Use 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 (systematic is faster than thrashing)
  • Manager wants it fixed NOW (systematic is faster than guess-and-check) </domain_overview> <debugging_phases>

🔄 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:
      - Log what data enters component
      - Log what data exits component
      - 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
  5. Trace Data Flow WHEN error is deep in call stack: See @root-cause-tracing.md 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
    • Don't fix multiple things at once
  3. Verify Before Continuing
    • Did it work? Yes → Phase 4
    • Didn't work? Form NEW hypothesis
    • DON'T add more fixes on top
  4. When You Don't Know
    • Say "I don't understand X"
    • Don't pretend to know
    • Ask for help
    • Research more
Phase 4: Implementation

Fix the root cause, not the symptom:

  1. Create Failing Test Case
    • Simplest possible reproduction
    • Automated test if possible
    • One-off test script if no framework
    • MUST have before fixing
    • Use the @tdd-mastery skill for writing proper failing tests
  2. Implement Single Fix
    • Address the root cause identified
    • ONE change at a time
    • No "while I'm here" improvements
    • No bundled refactoring
  3. Verify Fix
    • Test passes now?
    • No other tests broken?
    • Issue actually resolved?
  4. If Fix Doesn't Work
    • STOP
    • Count: How many fixes have you tried?
    • If < 3: Return to Phase 1, re-analyze with new information
    • If ≥ 3: STOP and question the architecture (step 5 below)
    • DON'T attempt Fix #4 without architectural discussion
  5. If 3+ Fixes Failed: Question Architecture Pattern indicating architectural problem:
    • Each fix reveals new shared state/coupling/problem in different place
    • Fixes require "massive refactoring" to implement
    • Each fix creates new symptoms elsewhere STOP and question fundamentals:
    • Is this pattern fundamentally sound?
    • Are we "sticking with it through sheer inertia"?
    • Should we refactor architecture vs. continue fixing symptoms? Discuss with user before attempting more fixes This is NOT a failed hypothesis - this is a wrong architecture. </debugging_phases> <red_flags_and_rationalizations>
Show full SKILL.md (473 more words)Show less

🚨 RED FLAGS - STOP AND FOLLOW PROCESS

If you catch yourself thinking:

  • "Quick fix for now, investigate later"
  • "Just try changing X and see if it works"
  • "Add multiple changes, run tests"
  • "Skip the test, I'll manually verify"
  • "It's probably X, let me fix that"
  • "I don't fully understand but this might work"
  • "Pattern says X but I'll adapt it differently"
  • "Here are the main problems: [lists fixes without investigation]"
  • Proposing solutions before tracing data flow
  • "One more fix attempt" (when already tried 2+)
  • Each fix reveals new problem in different place ALL of these mean: STOP. Return to Phase 1. If 3+ fixes failed: Question the architecture (see Phase 4.5)

🚫 COMMON RATIONALIZATIONS

ExcuseReality
"Issue is simple, don't need process"Simple issues have root causes too. Process is fast for simple bugs.
"Emergency, no time for process"Systematic debugging is FASTER than guess-and-check thrashing.
"Just try this first, then investigate"First fix sets the pattern. Do it right from the start.
"I'll write test after confirming fix works"Untested fixes don't stick. Test first proves it.
"Multiple fixes at once saves time"Can't isolate what worked. Causes new bugs.
"Reference too long, I'll adapt the pattern"Partial understanding guarantees bugs. Read it completely.
"I see the problem, let me fix it"Seeing symptoms ≠ understanding root cause.
"One more fix attempt" (after 2+ failures)3+ failures = architectural problem. Question pattern, don't fix again.
</red_flags_and_rationalizations>
<observability_and_references>

📊 QUICK REFERENCE

PhaseKey ActivitiesSuccess Criteria
1. Root CauseRead errors, reproduce, check changes, gather evidenceUnderstand WHAT and WHY
2. PatternFind working examples, compareIdentify differences
3. HypothesisForm theory, test minimallyConfirmed or new hypothesis
4. ImplementationCreate test, fix, verifyBug resolved, tests pass

🛠️ SUPPORTING TECHNIQUES

These techniques are part of systematic debugging:

  • @root-cause-tracing.md - Trace bugs backward through call stack to find original trigger
  • @defense-in-depth.md - Add validation at multiple layers after finding root cause

🛰️ OBSERVABILITY TOOLING

Precision Logging (JSON-First)

Mandatory Fields: timestamp, level, traceId, component, message, context Log Levels:

  • ERROR: System failure, data loss, crash. Immediate audit required.
  • WARN: Recoverable anomaly (retry, fallback triggered).
  • INFO: Significant state change (phase transition, tool started).
  • DEBUG: Detailed execution path, raw payloads, environment.
Distributed Tracing
  1. Propagation: Every request/action carries TraceID
  2. Span Definition: Wrap tool calls and complex logic to measure latency
Domain-Specific Troubleshooting

Frontend:

  • Time-Travel: Redux DevTools, state snapshots
  • Visual Regression: ux-audit.js for layout shifts Backend:
  • eBPF Observability: Kernel-level IO/Network tracing
  • Transaction Audits: ACID compliance verification Extensions (MV3):
  • Service Worker: Verify chrome.alarms pulses
  • Context Bridge: Check "Disconnected Port" errors

📈 REAL-WORLD IMPACT

From debugging sessions:

  • Systematic approach: 15-30 minutes to fix
  • Random fixes approach: 2-3 hours of thrashing
  • First-time fix rate: 95% vs 40%
  • New bugs introduced: Near zero vs common

  • @tdd-mastery - For creating failing test case (Phase 4, Step 1)
  • @verification-mastery - Verify fix worked before claiming success
  • @clean-code - Prevent bugs through good practices </observability_and_references>

© xenitV1, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in skills/debug-mastery of xenitV1/claude-code-maestro.

  • SKILL.md
  • defense-in-depth.md
  • root-cause-tracing.md

Open the folder on GitHubat commit 924315b

Compare with similar skills

Debug Mastery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Debug Mastery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Debug Mastery this skillxenitV1/claude-code-maestro229—~2.5kAutomated safety check: NotesMIT
Evlog Log Analyzerevloghq/evlog1.9k—~2.4kAutomated safety check: PassMIT
Production Error Huntdifferent-ai/openwork24k—~803Automated safety check: PassCustom licence
Axiom SRE Investigatoropenclaw/clawhub9.5k—~7.1kAutomated safety check: PassMIT
Claude Session Router Debuggerweave-os/router5.6k—~2.9kAutomated safety check: PassApache-2.0
Kubernetes Troubleshooting with Inspektor Gadgetinspektor-gadget/inspektor-gadget2.9k—~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • Evlog Log Analyzer

    evloghq/evlog

    Reads the structured wide-event logs that evlog writes to .evlog/logs/ so the agent can debug errors, find slow requests and explain what the app did.

    1.9k GitHub stars~2.4k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Production Error Hunt

    different-ai/openwork

    Traces an opaque production error in an OpenWork build to its cause using local server logs and Sentry, names the regressing PR and files a report.

    24k GitHub stars~803 tokensUpdated today
    DevelopmentAuto-check passed
  • Axiom SRE Investigator

    openclaw/clawhub

    Investigates incidents and production problems with hypothesis-driven debugging, queries Axiom observability data when available, and keeps secrets out of commands and output.

    9.5k GitHub stars~7.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Correlates a Claude Code session's local transcript with a model router's production cloud logs to explain why a specific response rendered the way it did.

    5.6k GitHub stars~2.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Kubernetes Troubleshooting with Inspektor Gadget

    inspektor-gadget/inspektor-gadget

    Traces what the kernel is doing for a misbehaving pod using Inspektor Gadget's eBPF tools, tagged with namespace, pod, container and node, without changing workloads.

    2.9k GitHub stars~2.3k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Logging Patterns

    decebals/claude-code-java

    Java logging best practices with SLF4J, structured logging (JSON), and MDC for request tracing.

    750 GitHub starsUsed in 1 repo~3.3k tokens
    DevelopmentAuto-check passed

More from xenitV1/claude-code-maestro

All 13 skills in this repo
  • Ralph Wiggum

    xenitV1/claude-code-maestro

    Surgical Debugger & Code Optimizer. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub starsUsed in 1 repo~795 tokens
    Auto-check: notes
  • Maestro

    xenitV1/claude-code-maestro

    A skill your agent uses when you need to act as an Elite Software Architect (Maestro) to manage complex repositories.

    229 GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check passed
  • Clean Code

    xenitV1/claude-code-maestro

    The Foundation Skill. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub stars~1.5k tokensUpdated 8 mo ago
    Auto-check passed
  • Backend Design

    xenitV1/claude-code-maestro

    Elite Tier Backend standards, including Vertical Slice Architecture, Zero Trust Security, and High-Performance API protocols.

    229 GitHub stars~2.1k tokensUpdated 8 mo ago
    Auto-check: notes
  • Brainstorming

    xenitV1/claude-code-maestro

    Design-first methodology. An agent skill from xenitV1/claude-code-maestro.

    229 GitHub stars~2k tokensUpdated 8 mo ago
    Auto-check passed
  • Browser Extension

    xenitV1/claude-code-maestro

    Master specialized skill for building 2025/2026-grade browser extensions.

    229 GitHub stars~1.2k tokensUpdated 8 mo ago
    Auto-check: notes

Questions about Debug Mastery

What does Debug Mastery do?

Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards. Debug Mastery is an agent skill from xenitV1/claude-code-maestro. Systematic debugging methodology with 4-phase process, root cause tracing, and elite observability standards.

When should I use Debug Mastery?

Debug Mastery fits situations like: tasks that involve Debugging; tasks that involve Root cause analysis; tasks that involve Observability.

How do I install Debug Mastery in Claude Code?

Run `npx skills add xenitV1/claude-code-maestro --skill debug-mastery -a claude-code`. Or copy the skill folder (skills/debug-mastery in xenitV1/claude-code-maestro) into .claude/skills/debug-mastery in your project. Claude Code loads it when a task matches its description.

How do I install Debug Mastery in Codex?

Run `npx skills add xenitV1/claude-code-maestro --skill debug-mastery -a codex`. Or copy the skill folder (skills/debug-mastery in xenitV1/claude-code-maestro) into .agents/skills/debug-mastery in your project. Codex loads it when a task matches its description.

Can I use Debug Mastery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add xenitV1/claude-code-maestro --skill debug-mastery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debug-mastery, .gemini/skills/debug-mastery, .github/skills/debug-mastery and .opencode/skills/debug-mastery in your project.

What does Debug Mastery need to run?

SKILL.md names no scripts, command-line tools or credentials: Debug Mastery is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Glob, Grep, Bash.

Does Debug Mastery access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Debug Mastery safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Debug Mastery use?

Debug Mastery is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Debug Mastery use?

About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Debug Mastery?

Skills that share tags, products or a category with Debug Mastery: Evlog Log Analyzer (evloghq/evlog, 1.9k stars), Production Error Hunt (different-ai/openwork, 24k stars), Axiom SRE Investigator (openclaw/clawhub, 9.5k stars) and Claude Session Router Debugger (weave-os/router, 5.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Debug Mastery?

xenitV1 (a GitHub user) maintains it in xenitV1/claude-code-maestro, which has 229 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on January 24, 2026.

Source: xenitV1/claude-code-maestro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.