Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
alonw0 avatar

Python Debugging

  • 2 installs
  • 10 repo stars
  • Updated January 19, 2026
  • alonw0/python-debugger-skill

python-debugging is a skill that debugs Python scripts with breakpoints, stepping, variable inspection, and stack navigation via a CLI debugger.

About

A skill for debugging Python scripts with breakpoints, stepping, variable inspection, and stack navigation. It drives a bundled debugger script that supports line, conditional, and exception breakpoints and returns JSON state. It provides a systematic methodology and tables mapping common bug patterns to debugging approaches.

  • PyCharm-like breakpoints, stepping, and variable inspection via a CLI debugger
  • Conditional and exception breakpoints
  • Decision framework and common Python bug-pattern table

Python Debugging by the numbers

  • 2 all-time installs (skills.sh)
  • Ranked #467 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

python-debugging capabilities & compatibility

Free; runs a local Python debugger script

Capabilities
debugging · testing
Use cases
debugging
Pricing
Free
From the docs

What python-debugging says it does

Debug Python scripts with breakpoints, stepping, variable inspection, and stack navigation.
SKILL.md
Form a hypothesis first** - Before setting breakpoints, have a theory about what's wrong
SKILL.md
python scripts/debugger.py break -e ValueError # Exception breakpoint
SKILL.md
npx skills add https://github.com/alonw0/python-debugger-skill --skill python-debugging

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars10
Last updatedJanuary 19, 2026
Repositoryalonw0/python-debugger-skill

What it does

Debugs Python scripts with breakpoints, stepping, variable inspection, and stack navigation to find root causes.

Who is it for?

Diagnosing Python crashes, wrong output, and intermittent bugs

Skip if: Debugging non-Python languages

When should I use this skill?

When a user wants to debug a Python script, set breakpoints, step through code, inspect variables, or understand a crash

What you get

Bugs are isolated through hypothesis-driven breakpoints, inspection, and verification.

By the numbers

  • 6-step debugging process
  • 7 documented Python bug patterns

Files

SKILL.mdMarkdownGitHub ↗

Python Debugging

Debug Python scripts with breakpoints, stepping, variable inspection, and stack navigation.

Quick Reference

# Start debugging
python scripts/debugger.py start script.py [args...]

# Breakpoints
python scripts/debugger.py break -f script.py -l 45           # Line breakpoint
python scripts/debugger.py break -f script.py -l 45 -c "x>10" # Conditional
python scripts/debugger.py break -e ValueError               # Exception breakpoint
python scripts/debugger.py breakpoints                        # List all

# Execution
python scripts/debugger.py continue   # Run until next breakpoint
python scripts/debugger.py step       # Step into
python scripts/debugger.py next       # Step over
python scripts/debugger.py finish     # Run until return

# Inspection
python scripts/debugger.py locals     # Local variables
python scripts/debugger.py globals    # Global variables
python scripts/debugger.py eval "expression"
python scripts/debugger.py inspect variable_name

# Stack
python scripts/debugger.py stack      # View call stack
python scripts/debugger.py up         # Move up stack
python scripts/debugger.py down       # Move down stack

# Session
python scripts/debugger.py status     # Check status
python scripts/debugger.py quit       # End session

Debugging Methodology

Debug systematically, not randomly. Follow these principles:

1. Form a hypothesis first - Before setting breakpoints, have a theory about what's wrong 2. Reproduce consistently - Ensure you can trigger the bug reliably 3. Read error messages carefully - They often point directly to the problem 4. Binary search for bugs - Narrow down by halving the search space 5. Verify assumptions - Use eval to check values are what you expect 6. Change one thing at a time - Isolate variables to identify root cause

Decision Framework

SituationApproach
Script crashes with exceptionbreak -e ExceptionTypecontinue → inspect locals and stack
Wrong output, unknown causeBinary search: breakpoint at midpoint, check state, narrow down
Loop produces wrong resultbreak -l <line> -c "i == <problem_iteration>"
Function returns wrong valueBreakpoint at return, inspect all locals before return
Variable has unexpected valueTrace backwards: where was it last assigned?
Intermittent bugbreak -e "*" to catch any exception

Python Bug Patterns

Bug PatternSymptomsHow to Debug
None propagationAttributeError: 'NoneType'eval "var" at each step to find where it became None
Mutable default argsFunction "remembers" valueseval "func.__defaults__"
Off-by-one errorsMissing first/last itembreak -c "i == 0 or i == len(items)-1"
Scope issuesUnboundLocalErrorCompare locals vs globals
Type coercionUnexpected concatenationeval "type(var)"
Dict key errorsKeyErroreval "key in dict" before access
Mutating while iteratingMissing itemseval "len(collection)" each iteration

The Debugging Process

1. REPRODUCE   →  Trigger the bug reliably
2. HYPOTHESIZE →  "I think X is wrong because Y"
3. INSTRUMENT  →  Set strategic breakpoint(s)
4. OBSERVE     →  Run to breakpoint, inspect state
5. ANALYZE     →  Does evidence support hypothesis?
   YES → Fix it    NO → New hypothesis, goto 2
6. VERIFY      →  Run again to confirm fix

Common Workflows

Debugging Exceptions

python scripts/debugger.py start script.py
python scripts/debugger.py break -e ValueError  # Or -e "*" for any
python scripts/debugger.py continue
# When exception occurs:
python scripts/debugger.py locals               # What values caused this?
python scripts/debugger.py stack                # How did we get here?
python scripts/debugger.py up                   # Check caller's context

Debugging Wrong Output

python scripts/debugger.py start script.py
python scripts/debugger.py break -f script.py -l <output_line>
python scripts/debugger.py continue
python scripts/debugger.py eval "output_var"    # Already wrong?
# Binary search: set breakpoint at midpoint, repeat

Debugging Loops

python scripts/debugger.py break -f script.py -l <loop_line> -c "i == 5"
python scripts/debugger.py continue
python scripts/debugger.py locals               # Check loop state
python scripts/debugger.py next                 # Step through iteration

Anti-Patterns (Avoid These)

  • Random breakpoint placement - Think first, then place strategically
  • Not reading error messages - Python errors are descriptive
  • Changing code without understanding - Understand before fixing
  • Assuming instead of verifying - Use eval to check
  • Skipping reproduction - Can't verify fix without consistent repro

JSON Output Format

All commands return JSON:

{
  "status": "paused",
  "stop_reason": "line",
  "location": {
    "file": "/path/to/script.py",
    "line": 45,
    "function": "process_data",
    "code": "    result = calculate(item)"
  },
  "variables": {
    "locals": {
      "item": {"type": "dict", "value": "{'id': 1}"},
      "result": {"type": "NoneType", "value": "None"}
    }
  }
}

Additional Resources

  • Methodology & Best Practices - Detailed debugging methodology
  • Command Reference - Complete command documentation
  • Troubleshooting - Common issues and solutions
  • Examples - Example debugging sessions

Related skills

FAQ

What kinds of breakpoints are supported?

Line breakpoints, conditional breakpoints, and exception breakpoints, including catching any exception.

What is the debugging methodology?

Reproduce, hypothesize, instrument with breakpoints, observe state, analyze, then verify the fix.

Debuggingbackendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.