Python Bug Squasher skill for Claude and Codex
Finds the root cause of a Python bug from the code and traceback, explains why it happens in plain terms, and returns corrected code with the fix marked, plus…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when Python code throws or misbehaves and the traceback or wrong output needs tracing to a root cause with corrected code. Do not use for reviewing working Python for style, or scaffolding a new application. Related topics: coding, python, debugging.
What it will ask you for
- Python version (choose one: Python 3.9, Python 3.10, Python 3.11, Python 3.12)
- Framework used (choose one: None, Django, Flask, FastAPI, Pandas, NumPy)
- Problematic code (longer free text)
- Error message (if any) (longer free text)
- Expected behavior (free text, e.g. "What should the code do?")
- Fix strategy (choose one: Quick Fix, Detailed Explanation, Refactor for Performance)
- Focus areas (choose any: Syntax Errors, Logic Errors, Memory Leaks, Security Vulnerabilities)
- Provide inline comments in the fixed code? (choose one: Yes, No)
How it works
- Locate the failing line from the last user-code frame and the exception type, or by tracing state against the expected behavior when there is no traceback.
- Name the root cause as a mechanism, not a symptom, and explain it in two or three sentences.
- Apply the chosen fix strategy with syntax valid for the selected Python version and framework.
- Check the selected focus areas for problems unrelated to the reported bug and list them separately.
- Return the corrected code in a python fence with changes commented when requested, plus one test or assertion that proves the fix.
What you get
Root cause (two or three sentences), the corrected code in a fenced python block with changed lines marked when requested, separate findings from the focus areas, and a one-line test or assertion that proves the fix.
What it watches out for
- Fixing the line in the traceback when the bad value was created several frames earlier.
- Wrapping the failure in a try/except that swallows the exception and calls it fixed.
- Suggesting a standard library feature that does not exist in the selected Python version.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.