This skill helps you diagnose and fix root causes of bugs quickly by guiding stack trace analysis, reproduction, and minimal changes.
npx playbooks add skill gigaverse-app/skillet --skill pythonista-debugging
Find and fix the root cause. NEVER work around problems with wrappers or complexity.
# Stack traces read bottom-to-top. The last frame is where error occurred.
Traceback (most recent call last):
File "main.py", line 10, in <module> # Entry point
result = process_data(data) # Calling function
File "processor.py", line 25, in process_data
return transform(item) # Where it failed
TypeError: 'NoneType' has no attribute 'items' # What went wrong
Key info: File, line number, function name, actual error message.
# Create minimal reproduction
pytest tests/test_module.py::test_specific -v
# Or write a quick script
python -c "from module import func; func(problematic_input)"
# Quick debugging with print (remove after!)
print(f"DEBUG: {variable=}, {type(variable)=}")
# Better: Use debugger
import pdb; pdb.set_trace() # Interactive debugger
# Or breakpoint() in Python 3.7+
breakpoint()
# Find which commit introduced the bug
git bisect start
git bisect bad HEAD
git bisect good v1.0.0
# Git will guide you through testing commits
When you encounter an error, your instinct may be to:
__getattr__ for dynamic delegation# type: ignore to suppress errorsThis is WRONG. These are signs you're working around instead of fixing.
__getattr__# WRONG - Magic delegation
class TestWrapper:
def __init__(self, obj):
self.obj = obj
def __getattr__(self, name):
return getattr(self.obj, name)
# CORRECT - Simple helper function
def test_helper(obj):
pass
# WRONG - Adapter to hide interface mismatch
class TestAdapter:
def __init__(self, production_obj):
self.obj = production_obj
def adapted_method(self):
return self.obj.method().to_dict()
# CORRECT - Transform inline, fix the interface
def test_something(production_obj):
result = production_obj.method()
assert result.to_dict()["field"] == expected
# WRONG - Hiding the problem
result = maybe_none.items() # type: ignore
# CORRECT - Handle the None case
if maybe_none is not None:
result = maybe_none.items()
You're working around instead of fixing if you're:
__getattr__ or other magic methods# type: ignore without investigating whyWeekly roundup of top Claude Code skills, MCP servers, and AI coding tips.