agentsclimarketplace

Debug helper

Skill pbans-agent/skillpack/skills/debug-helper

Git-backed source of truth for reusable AI Agent Skills

Install
npx -y skills add pbans-agent/skillpack --skill debug-helper

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Systematically diagnoses and resolves software bugs through structured debugging. Use when the user reports an error, asks to fix a bug, needs help understanding a crash, wants to trace through code execution, or needs to identify the root cause of unexpected behavior.

SKILL.md

4.2 KB, as published. Nobody here has run it

Debug Helper

Purpose

Provide a systematic approach to diagnosing and fixing software bugs. Turn "it doesn't work" into "here's the root cause and the fix."

When to Use

  • An error message needs interpretation
  • Unexpected behavior needs tracing
  • A crash needs root-cause analysis
  • Performance needs profiling
  • A flaky test needs stabilization
  • A regression needs bisecting

Debugging Process

1. Reproduce the Issue

  • Get the exact steps to reproduce
  • Identify the environment (OS, version, config)
  • Determine if it's consistent or intermittent
  • Create a minimal reproduction case

2. Read the Error

  • Full error message including traceback
  • Error type and what it means
  • Line number and surrounding code
  • Stack trace showing the call path

3. Form Hypotheses

  • What could cause this symptom?
  • What changed recently?
  • What are the common causes for this error type?
  • Rank hypotheses by likelihood

4. Test Hypotheses

  • Check one hypothesis at a time
  • Use logging/print statements strategically
  • Inspect variables at each level
  • Verify assumptions with evidence

5. Fix and Verify

  • Make the minimal fix
  • Verify the original issue is resolved
  • Check for side effects
  • Add a test to prevent regression

Common Error Patterns

Python

ErrorCommon CauseFirst Check
NameErrorUndefined variableTypo or missing import
TypeErrorWrong type operationType of operands
KeyErrorMissing dict keyKey existence / .get()
IndexErrorOut of range indexList length
AttributeErrorMissing attributeObject type and available attrs
ImportErrorModule not foundPackage installed? Correct path?
FileNotFoundErrorMissing fileAbsolute vs relative path
RecursionErrorInfinite recursionBase case logic

JavaScript/TypeScript

ErrorCommon CauseFirst Check
TypeError: undefined is not a functionAccessing property on null/undefinedOptional chaining
ReferenceErrorUndeclared variableScope and spelling
SyntaxErrorParse errorBracket/paren matching
RangeErrorInvalid length/valueArray size or recursion
ENOENTFile not foundWorking directory

General

SymptomCommon Cause
Works locally, fails in CIEnvironment differences, missing env vars
Works once, fails on retryState not properly cleaned up
Slow over timeMemory leak, growing data structure
Random failuresRace condition, timing dependency
Fails only on large inputOff-by-one, integer overflow, OOM

Debugging Tools

Logging Strategy

# BAD: too vague
print("here")

# GOOD: structured and specific
import logging
logger.debug(f"Processing user_id={user_id}, items={len(items)}, stage=validate")

Binary Search Debugging

When you don't know where the bug is:

  1. Place a checkpoint in the middle of the execution
  2. Is the state correct at that point?
  3. If yes: bug is after the checkpoint
  4. If no: bug is before the checkpoint
  5. Repeat in the relevant half

Git Bisect

git bisect start
git bisect bad HEAD
git bisect good <last-known-good-commit>
# Git checks out middle commit; test it
git bisect good  # or git bisect bad
# Repeat until found
git bisect reset

Output Format

When reporting a debug finding:

## Issue
<one-sentence description of the bug>

## Root Cause
<what is actually wrong>

## Evidence
- <traceback, logs, or test output showing the issue>
- <specific line(s) of code involved>

## Fix
<what to change and why>

## Prevention
<how to prevent this class of bug in the future>

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.