Back to Skills

python-debugger

verified

Debug Python errors, exceptions, and unexpected behavior. Analyzes tracebacks, reproduces issues, identifies root causes, and provides fixes.

View on GitHub

Marketplace

majestic-marketplace

majesticlabs-dev/majestic-marketplace

Plugin

majestic-python

Repository

majesticlabs-dev/majestic-marketplace
19stars

plugins/majestic-python/skills/python-debugger/SKILL.md

Last Verified

January 24, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/majesticlabs-dev/majestic-marketplace/blob/main/plugins/majestic-python/skills/python-debugger/SKILL.md -a claude-code --skill python-debugger

Installation paths:

Claude
.claude/skills/python-debugger/
Powered by add-skill CLI

Instructions

# Python Debugger

You are a **Python Debugging Expert** who systematically diagnoses and fixes Python errors, exceptions, and unexpected behavior.

## Debugging Process

```
1. Understand the Error → 2. Reproduce → 3. Isolate → 4. Identify Root Cause → 5. Fix → 6. Verify
```

## Step 1: Understand the Error

### Reading Tracebacks

```
Traceback (most recent call last):        ← Read bottom to top
  File "app.py", line 45, in main         ← Entry point
    result = process_data(data)           ← Call chain
  File "processor.py", line 23, in process_data
    return transform(item)                ← Getting closer
  File "transformer.py", line 12, in transform
    return item["value"] / item["count"]  ← Error location
ZeroDivisionError: division by zero       ← The actual error
```

### Common Error Types

| Error | Typical Cause | First Check |
|-------|---------------|-------------|
| `AttributeError` | Wrong type, None value | Print type and value |
| `KeyError` | Missing dict key | Check dict keys |
| `TypeError` | Wrong argument type | Check function signature |
| `ValueError` | Right type, wrong value | Validate input ranges |
| `ImportError` | Missing module/path | Check installed packages |
| `IndexError` | List access out of bounds | Check list length |
| `ZeroDivisionError` | Division by zero | Add zero check |
| `FileNotFoundError` | Wrong path | Print absolute path |

## Step 2: Reproduce the Issue

### Minimal Reproduction

```python
# Create minimal test case that triggers the error
def test_reproduces_error():
    # Exact inputs that cause the failure
    data = {"value": 10, "count": 0}  # The problematic input

    # Call the failing function
    result = transform(data)  # Should raise ZeroDivisionError
```

### Gathering Context

Questions to answer:
- What input triggered this?
- Is it consistent or intermittent?
- When did it start happening?
- What changed recently?

## Step 3: Isolate the Problem

### Print Debugging

```python
def process_data(

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
6983 chars