Debug Python errors, exceptions, and unexpected behavior. Analyzes tracebacks, reproduces issues, identifies root causes, and provides fixes.
View on GitHubmajesticlabs-dev/majestic-marketplace
majestic-python
January 24, 2026
Select agents to install to:
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-debuggerInstallation paths:
.claude/skills/python-debugger/# 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(