Agent skill

Debugging Strategies

by MadAppGang in MadAppGang/claude-code

A skill your agent uses when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack.

MITAuto-check passedDevelopment

Install Debugging Strategies

skills CLI
$ npx skills add MadAppGang/claude-code --skill debugging-strategies -a claude-code

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

GitHub CLI
$ gh skill install MadAppGang/claude-code debugging-strategies --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/MadAppGang/claude-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/dev/skills/core/debugging-strategies .claude/skills/debugging-strategies && 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
debugging-strategies
GitHub stars
285
Token cost
~2.3k tokens
SKILL.md length
487 words
Files
1
Skills in repo
69
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack.

  • Works in 5 steps: Observe: Gather information about the bug → Hypothesize: Form theories about the cause → Predict: What would confirm/refute each… → …
  • Troubleshooting bugs
  • SKILL.md covers Overview, Debugging Methodology, Error Analysis and Debugging Techniques, plus 5 more sections
  • Calls git and node

What it does

Debugging Strategies is an agent skill from MadAppGang/claude-code. Use when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Debugging and Responsive design. The repository describes itself as: claude code plugins marketplace. The licence is MIT.

When your agent uses it

  • Troubleshooting bugs
  • Analyzing stack traces
  • Using debugging tools (breakpoints
  • Applying systematic debugging methodology across any technology stack

Example prompts

  • “/debugging-strategies”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Observe: Gather information about the bug
  2. Hypothesize: Form theories about the cause
  3. Predict: What would confirm/refute each theory?
  4. Test: Run experiments to validate
  5. Conclude: Identify root cause and fix

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • node

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Debugging Strategies loads about 2.3k tokens when it runs. Until then it costs about 49 tokens; SKILL.md has 487 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 MadAppGang/claude-code at commit 6097ad4, republished under its MIT licence (© MadAppGang). 487 words, ~2,295 tokens.

Download SKILL.mdSave it as .claude/skills/debugging-strategies/SKILL.md (or your agent's skills folder).
name
debugging-strategies
description
Use when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack.
version
1.0.0
keywords
debugging, troubleshooting, stack traces, breakpoints, logging, error analysis, bug fixing, debugging tools
plugin
dev
updated
2026-01-20

Universal Debugging Strategies

Overview

Language-agnostic debugging techniques and strategies applicable across all technology stacks.

Debugging Methodology

The Scientific Method for Debugging
  1. Observe: Gather information about the bug
  2. Hypothesize: Form theories about the cause
  3. Predict: What would confirm/refute each theory?
  4. Test: Run experiments to validate
  5. Conclude: Identify root cause and fix
Systematic Approach
1. Reproduce the bug reliably
2. Isolate the failing code path
3. Trace backwards from the error
4. Identify the root cause
5. Verify the fix
6. Add tests to prevent regression

Error Analysis

Stack Trace Reading

Read stack traces bottom to top:

Error: Cannot read property 'name' of undefined
    at formatUser (src/utils/format.ts:42)      ← Error thrown here
    at processUsers (src/services/user.ts:28)    ← Called from here
    at UserList.render (src/components/UserList.tsx:15)
    at App.render (src/App.tsx:8)                ← Entry point

Focus on YOUR code - skip framework/library internals initially.

Error Categories
CategoryExamplesCommon Causes
Null/UndefinedCannot read property 'x' of undefinedMissing data, async timing
Type Errorsx is not a functionWrong type, typo
Logic ErrorsWrong output, no errorIncorrect conditions
Runtime ErrorsOut of bounds, division by zeroInvalid input
Async ErrorsUnhandled promise rejectionMissing error handler
Network ErrorsTimeout, connection refusedAPI down, wrong URL

Debugging Techniques

Binary Search (Bisection)

When the bug is somewhere in a large codebase:

1. Find a known good state (commit, version)
2. Find current bad state
3. Test the midpoint
4. Narrow to half with bug
5. Repeat until found

Git bisect:

bash
git bisect start
git bisect bad                    # Current commit is broken
git bisect good v1.0.0           # v1.0.0 was working
# Git checks out midpoint, test it
git bisect good/bad              # Mark and continue
Wolf Fence Algorithm

Split the code into sections and determine which section contains the bug:

┌─────────────────────────────────────┐
│           Code Section A            │ ← Test: Bug here?
├─────────────────────────────────────┤
│           Code Section B            │ ← Test: Bug here?
├─────────────────────────────────────┤
│           Code Section C            │ ← Test: Bug here?
└─────────────────────────────────────┘

Add logging/breakpoints at section boundaries, narrow down.

Rubber Duck Debugging

Explain the code line by line (to a rubber duck, colleague, or yourself):

  1. Explain what the code SHOULD do
  2. Explain what it ACTUALLY does
  3. The discrepancy reveals the bug
Change One Thing at a Time

When experimenting:

  • Make ONE change
  • Test
  • Observe result
  • Revert if no improvement
  • Repeat

Data Flow Tracing

Backwards Tracing

Start at the error, trace backwards:

1. Error occurs at line 42: user.name is undefined
2. Where does `user` come from? Line 38: const user = getUser(id)
3. What does getUser return? Check function...
4. getUser queries database, returns undefined if not found
5. Root cause: No null check after getUser
Forward Tracing

Start at input, trace forward:

1. User enters email: "test@example"
2. Form submits to /api/register
3. API validates email... passes (bug: missing TLD check)
4. Saves to database with invalid email
5. Later processes fail on invalid email

Logging Strategies

Strategic Log Placement
typescript
function processOrder(order) {
  console.log('processOrder START', { orderId: order.id });

  try {
    const validated = validateOrder(order);
    console.log('Validation passed', { orderId: order.id });

    const result = saveOrder(validated);
    console.log('processOrder SUCCESS', { orderId: order.id, result });

    return result;
  } catch (error) {
    console.error('processOrder FAILED', {
      orderId: order.id,
      error: error.message,
      stack: error.stack
    });
    throw error;
  }
}
Log Levels
LevelUse ForExample
ERRORFailures requiring attentionFailed to save order: DB connection lost
WARNPotential issuesRetry 2/3 for API call
INFOSignificant eventsUser logged in: user123
DEBUGDetailed diagnosticsValidating email: test@example.com
TRACEVery verboseEntering function processOrder
Show full SKILL.md (190 more words)Show less
Structured Logging
typescript
// BAD: Unstructured
console.log('User ' + userId + ' ordered ' + items.length + ' items');

// GOOD: Structured
logger.info('Order placed', {
  userId,
  itemCount: items.length,
  total: order.total,
  timestamp: new Date().toISOString()
});

Breakpoint Strategies

Types of Breakpoints
TypeUse Case
LineStop at specific line
ConditionalStop only when condition is true
LogpointLog without stopping
ExceptionStop on thrown exception
DOMStop on DOM modification (browser)
Effective Breakpoint Placement
  1. Before the error - See state leading to failure
  2. At decision points - Check which branch executes
  3. At data boundaries - API calls, DB queries
  4. In loops - Check iteration values

Common Bug Patterns

Off-by-One Errors
typescript
// BUG: Index out of bounds
for (let i = 0; i <= array.length; i++) {
  console.log(array[i]); // Fails on last iteration
}

// FIX
for (let i = 0; i < array.length; i++) {
  console.log(array[i]);
}
Race Conditions
typescript
// BUG: Race condition
async function getData() {
  fetchData().then(data => { this.data = data; });
  processData(this.data); // May run before fetch completes!
}

// FIX: Await the result
async function getData() {
  this.data = await fetchData();
  processData(this.data);
}
Null Reference
typescript
// BUG: Accessing property of undefined
const name = user.profile.name;

// FIX: Optional chaining or guard
const name = user?.profile?.name;
// or
if (user && user.profile) {
  const name = user.profile.name;
}
State Mutation
typescript
// BUG: Mutating input
function addTax(price) {
  price.total = price.amount * 1.2; // Mutates input!
  return price;
}

// FIX: Return new object
function addTax(price) {
  return {
    ...price,
    total: price.amount * 1.2
  };
}
Closure Pitfalls
javascript
// BUG: All callbacks share same i
for (var i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 100); // Logs: 3, 3, 3
}

// FIX: Use let (block scope) or capture value
for (let i = 0; i < 3; i++) {
  setTimeout(() => console.log(i), 100); // Logs: 0, 1, 2
}

Environment-Specific Debugging

Browser (JavaScript)
  • DevTools Console
  • Network tab for API calls
  • Elements tab for DOM
  • Sources tab for breakpoints
  • Performance tab for bottlenecks
  • Application tab for storage
Node.js
bash
# Start with inspector
node --inspect app.js

# Break on first line
node --inspect-brk app.js
Backend APIs
  • Request/response logging
  • Database query logging
  • Trace IDs for distributed tracing
  • Health check endpoints

Debugging Checklist

When stuck, verify:

  • Input: Is input data correct?
  • Config: Are environment variables set?
  • Dependencies: Are all services running?
  • Versions: Is the correct version deployed?
  • Cache: Is stale data being used?
  • Permissions: Does the code have required access?
  • Timing: Are async operations completing?
  • State: Is application state as expected?

Prevention

Defensive Coding
typescript
function processUser(user) {
  // Guard clauses
  if (!user) throw new Error('User is required');
  if (!user.email) throw new Error('User email is required');

  // Type assertions (TypeScript)
  const email = user.email as string;

  // Proceed with validated data
  return formatUser(user);
}
Assertions
typescript
// Development-time checks
function divide(a, b) {
  console.assert(b !== 0, 'Division by zero');
  return a / b;
}
Error Boundaries
typescript
try {
  riskyOperation();
} catch (error) {
  // Log with context
  logger.error('Operation failed', {
    error: error.message,
    stack: error.stack,
    context: { userId, operation: 'riskyOperation' }
  });

  // Recover or rethrow
  throw new OperationError('Failed to complete operation', { cause: error });
}

Debugging strategies applicable to all technology stacks

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

Files

Just SKILL.md in plugins/dev/skills/core/debugging-strategies of MadAppGang/claude-code.

Open the folder on GitHubat commit 6097ad4

Compare with similar skills

Debugging Strategies 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.

Debugging Strategies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Debugging Strategies this skillMadAppGang/claude-code285—~2.3kAutomated safety check: PassMIT
Gearcoleco Debuggingdrhelius/Gearcoleco142—~3.5kAutomated safety check: PassGPL-3.0
MCP Debuggerdebugmcp/mcp-debugger172—~3.8kAutomated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
Ue Live DebuggingJasonMa0012/MooaToon750—~2.9kAutomated safety check: NotesCustom licence
Commodore64 Vice Debuggingidolpx/meatloaf128—~4.8kAutomated safety check: PassGPL-3.0

Similar skills

  • Gearcoleco Debugging

    drhelius/Gearcoleco

    Debug and trace ColecoVision and Super Game Module games using the Gearcoleco emulator MCP server.

    142 GitHub stars~3.5k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • MCP Debugger

    debugmcp/mcp-debugger

    A skill your agent uses when investigating a bug, failing test, or unexpected runtime behavior and the mcp-debugger MCP server is available — drives real step-through debuggers (breakpoints, stack…

    172 GitHub stars~3.8k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Ue Live Debugging

    JasonMa0012/MooaToon

    A skill your agent uses when debugging UE C++ crashes, runtime bugs, or unexpected behavior with Rider MCP available.

    750 GitHub stars~2.9k tokensUpdated 21 days ago
    DevelopmentAuto-check: notes
  • Debug Commodore 64 programs running under the VICE emulator through its binary monitor: BASIC, cc65-compiled C, and 6502 assembly.

    128 GitHub stars~4.8k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Tilelang Debug Helper

    tile-ai/tilelang-ascend

    How to add debugging capabilities to TileLang Ascend example operators.

    402 GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from MadAppGang/claude-code

All 69 skills in this repo
  • Content Brief

    MadAppGang/claude-code

    Content brief template and creation methodology for SEO-optimized content.

    285 GitHub starsUsed in 1 repo~959 tokens
    Auto-check passed
  • Context Detection

    MadAppGang/claude-code

    A skill your agent uses when detecting project technology stack from files/configs/directory structure, auto-loading framework-specific skills, or analyzing multi-stack fullstack projects (e.g…

    285 GitHub stars~5.4k tokensUpdated 6 mo ago
    Auto-check passed
  • Content Optimizer

    MadAppGang/claude-code

    On-page SEO optimization techniques including keyword density, meta tags, heading structure, and readability.

    285 GitHub starsUsed in 1 repo~694 tokens
    Auto-check passed
  • Keyword Cluster Builder

    MadAppGang/claude-code

    Techniques for expanding seed keywords and clustering by topic and intent.

    285 GitHub starsUsed in 1 repo~674 tokens
    Auto-check passed
  • Serp Analysis

    MadAppGang/claude-code

    SERP analysis techniques for intent classification, feature identification, and competitive intelligence.

    285 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Agent Coordination Discipline

    MadAppGang/claude-code

    A skill your agent uses when deciding whether to launch an agent, selecting which agent to use, or coordinating multiple agents.

    285 GitHub stars~3.8k tokensUpdated 6 mo ago
    Auto-check passed

Categories

Questions about Debugging Strategies

What does Debugging Strategies do?

A skill your agent uses when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack. Debugging Strategies is an agent skill from MadAppGang/claude-code. Use when troubleshooting bugs, analyzing stack traces, using debugging tools (breakpoints, loggers), or applying systematic debugging methodology across any technology stack.

When should I use Debugging Strategies?

Debugging Strategies fits situations like: troubleshooting bugs; analyzing stack traces; using debugging tools (breakpoints; applying systematic debugging methodology across any technology stack.

How do I install Debugging Strategies in Claude Code?

Run `npx skills add MadAppGang/claude-code --skill debugging-strategies -a claude-code`. Or copy the skill folder (plugins/dev/skills/core/debugging-strategies in MadAppGang/claude-code) into .claude/skills/debugging-strategies in your project. Claude Code loads it when a task matches its description.

How do I install Debugging Strategies in Codex?

Run `npx skills add MadAppGang/claude-code --skill debugging-strategies -a codex`. Or copy the skill folder (plugins/dev/skills/core/debugging-strategies in MadAppGang/claude-code) into .agents/skills/debugging-strategies in your project. Codex loads it when a task matches its description.

Can I use Debugging Strategies 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 MadAppGang/claude-code --skill debugging-strategies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/debugging-strategies, .gemini/skills/debugging-strategies, .github/skills/debugging-strategies and .opencode/skills/debugging-strategies in your project.

What does Debugging Strategies need to run?

Going by SKILL.md and its folder, Debugging Strategies needs the command-line tools its instructions call (git and node). Our summary lists: Node.js.

Does Debugging Strategies access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Debugging Strategies safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Debugging Strategies use?

Debugging Strategies 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 Debugging Strategies use?

About 2.3k tokens (SKILL.md is roughly 9.2k 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 Debugging Strategies?

Skills that share tags, products or a category with Debugging Strategies: Gearcoleco Debugging (drhelius/Gearcoleco, 142 stars), MCP Debugger (debugmcp/mcp-debugger, 172 stars), Dbg (theodo-group/debug-that, 158 stars) and Ue Live Debugging (JasonMa0012/MooaToon, 750 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Debugging Strategies?

MadAppGang (a GitHub organization) maintains it in MadAppGang/claude-code, which has 285 GitHub stars. The repository holds 69 skills in this directory. The repository was last updated on March 15, 2026.

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