- Home
- Skills
- Testing & Debugging
- python bug hunter
Works with the AI Agents you already use
python bug hunter
Evidence-driven Python debugger focused on minimal patches and regression testing.
$9.99
python bug hunter
Example session with this skill installed
I'm getting a KeyError in my data processor when the 'tags' field is missing from the JSON input, even though I have a default value set. Here is the traceback and the snippet.
- Read your context and instructions
- Compiled the python bug hunter
I have analyzed the traceback and the provided snippet. The issue stems from an explicit dictionary access before the default check is reached.
Python Bug Hunter Report
Failure Summary
A KeyError: 'tags' occurs in processor.py at line 42. The code attempts to access the key directly to check for length before the .get() default logic is applied.
Root Cause
| Status | Cause | Evidence | Location |
|---|---|---|---|
| CONFIRMED | Eager key access | Traceback points to len(data['tags']) before safety check. | processor.py:42 |
| LIKELY | Missing validation | Input schema allows empty or missing keys. | schemas.py:12 |
Minimal Fix
# processor.py
def process_data(data):
# Change: data['tags'] -> data.get('tags', [])
tags = data.get('tags', [])
if not tags:
return None
# ... rest of function
Regression Test
import pytest
from processor import process_data
def test_missing_tags_key():
"""Ensure missing tags field does not raise KeyError."""
input_data = {"id": 123, "content": "test"}
assert process_data(input_data) is None
def test_null_tags_value():
"""Ensure null tags field is handled gracefully."""
input_data = {"id": 124, "tags": None}
# This identifies a secondary risk if .get(key, []) returns None
with pytest.raises(TypeError):
process_data(input_data)
Verification
NOT RUN (Static analysis only)
Remaining Risk
The test_null_tags_value reveals that if the key exists but is explicitly None, the len() check will still fail. A more robust fix would be data.get('tags') or [].
Next steps
- Apply the suggested change to
processor.py. - Run the provided pytest cases to verify the fix.
- Update the input schema to enforce non-null values if
Noneis not valid.
Connects securely to your tools. The creator never sees your data.
About this skill
Debugging Python applications often involves chasing ghosts or applying broad refactors that introduce new regressions. This skill enforces an evidence-driven workflow to isolate the root cause and apply the smallest possible patch.
What it does
- Root Cause Isolation identifies the specific logic, state, or dependency failure using a traceback-to-source mapping.
- Evidence Labeling categorizes every finding as CONFIRMED, LIKELY, or NEEDS VERIFICATION to prevent debugging by guesswork.
- Minimal Patching generates the smallest safe code change required to fix the issue without unrelated refactoring.
- Regression Testing creates a specific test case for the failure and the nearest logical edge case.
- Risk Assessment documents potential side effects or remaining edge cases based only on supported evidence.
How it works
- Evidence Collection where the user provides logs, tracebacks, or failing test outputs.
- Trace Mapping to follow the execution path from the input to the point of failure.
- Hypothesis Verification where candidate causes are checked against actual code state and dependency behavior.
- Patch Generation producing a justified, minimal fix and a corresponding regression test.
Frameworks & tools
Works with any Python stack including FastAPI, Django, Flask, Pytest, and Unittest. Handles async/await concurrency, type-hinting issues, and third-party dependency conflicts.
Why this beats prompting it yourself
Generic prompts often hallucinate stack frames or suggest massive refactors for simple logic errors. This skill forces the agent to prove its findings with evidence and strictly limits changes to the minimal justified patch, preserving your existing architecture.
Use cases
- Debugging intermittent race conditions in async tasks.
- Resolving
NoneTypeerrors or unexpected boundary conditions in data pipelines. - Fixing broken dependency assumptions after package updates.
- Creating targeted regression tests for legacy code bugs.
Known limitations
Does not perform live execution unless your environment supports a Python interpreter tool. Cannot verify fixes for external infrastructure or closed-source API failures.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Requires user-provided tracebacks or logs for confirmation. Does not perform live runtime execution unless an interpreter tool is available to the agent.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Permissions
No special permissions declared or detected