---
name: python-bug-squasher
description: "Identify bugs in your Python code and get detailed explanations and fixes. Use when the user wants help with Python Bug Squasher. Related topics: coding, python, debugging."
---

# Python Bug Squasher

Identify bugs in your Python code and get detailed explanations and fixes.

## How to use this skill

1. Ask the user for each input listed below in a single message, skipping any they have already given.
2. Where options are listed, offer them, but accept other answers too.
3. Fill the answers into the prompt template, then follow the completed prompt to produce the result.

## Inputs

- **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)
- **Paste your Python code here** (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)

## Prompt template

## Introduction
Find and fix bugs in your Python scripts quickly.

## Code Details
- Python Version: {{Python Version}}
- Framework used: {{Framework used}}
- Paste the problematic code:
{{Paste your Python code here}}

## Error Information
- Error Message (if any): {{Error Message (if any)}}
- Expected Behavior: {{Expected Behavior}}

## Feedback Preferences
- Fix strategy: {{Fix strategy}}
- Focus areas: {{Focus areas}}
- Provide inline comments in the fixed code? {{Provide inline comments in the fixed code?}}

---
**Goal**: Analyze the code, explain the root cause of the bug, and provide the corrected code snippet.

---

Source: [Python Bug Squasher on PromptBuild](https://promptbuild.io/prompt/OYNZtVhVN6NsXfIh7NbV/python-bug-squasher)
