debugginglisted
Install: claude install-skill aiskillstore/marketplace
# Debugging
## When to use this skill
- Encountering runtime errors or exceptions
- Code produces unexpected output or behavior
- Performance degradation or memory issues
- Intermittent or hard-to-reproduce bugs
- Understanding unfamiliar error messages
- Post-incident analysis and prevention
## Instructions
### Step 1: Gather Information
Collect all relevant context about the issue:
**Error details**:
- Full error message and stack trace
- Error type (syntax, runtime, logic, etc.)
- When did it start occurring?
- Is it reproducible?
**Environment**:
- Language and version
- Framework and dependencies
- OS and runtime environment
- Recent changes to code or config
```bash
# Check recent changes
git log --oneline -10
git diff HEAD~5
# Check dependency versions
npm list --depth=0 # Node.js
pip freeze # Python
```
### Step 2: Reproduce the Issue
Create a minimal, reproducible example:
```python
# Bad: Vague description
"The function sometimes fails"
# Good: Specific reproduction steps
"""
1. Call process_data() with input: {"id": None}
2. Error occurs: TypeError at line 45
3. Expected: Return empty dict
4. Actual: Raises exception
"""
# Minimal reproduction
def test_reproduce_bug():
result = process_data({"id": None}) # Fails here
assert result == {}
```
### Step 3: Isolate the Problem
Use binary search debugging to narrow down the issue:
**Print/Log debugging**:
```python
def problematic_function(data):
print(f"[DEBUG] Input: {data}") #