Find Bugs
Analyze a file to detect bugs and propose fixes.
Trigger
Slash command: /find-bugs
Auto-detection: "find bugs", "debug this file", "what bugs in", "analyze this file for errors", "bug hunt", "cherche les bugs", "quels bugs dans", "analyse ce fichier pour les erreurs".
Process
- Identify the target file. If the user doesn't specify, ask which file to analyze.
- Read the file with Read.
- If relevant, run available static analysis tools (linter, type-checker, compiler) via Bash to collect additional signals.
- Analyze the code to detect bugs: logical errors, off-by-one, unhandled null/undefined, race conditions, resource leaks, poor error handling, security vulnerabilities.
- Present results as a numbered list. For each bug:
- Line(s): affected line number(s)
- Issue: clear description of the bug
- Impact: what can go wrong
- Proposed fix: the correction as a diff or snippet
- Ask the user: "Do you want me to apply these fixes? (all / some / none)"
- Apply only the confirmed fixes via Edit.
Constraints
- Never modify the file without explicit user confirmation.
- Focus on real bugs — no refactoring, no stylistic suggestions, no performance optimizations unless they cause a bug.
- One file at a time. If the user requests multiple files, process sequentially asking confirmation for each.
- If no bugs are found, say so clearly rather than inventing problems.
Output
A numbered list of bugs with explanation and fix, followed by a proposal to apply the corrections after user agreement.
1---2name: find-bugs3description: Find Bugs4---5# Find Bugs67Analyze a file to detect bugs and propose fixes.89## Trigger1011Slash command: `/find-bugs`1213Auto-detection: "find bugs", "debug this file", "what bugs in", "analyze this file for errors", "bug hunt", "cherche les bugs", "quels bugs dans", "analyse ce fichier pour les erreurs".1415## Process16171. Identify the target file. If the user doesn't specify, ask which file to analyze.182. Read the file with Read.193. If relevant, run available static analysis tools (linter, type-checker, compiler) via Bash to collect additional signals.204. Analyze the code to detect bugs: logical errors, off-by-one, unhandled null/undefined, race conditions, resource leaks, poor error handling, security vulnerabilities.215. Present results as a numbered list. For each bug:22 - **Line(s)**: affected line number(s)23 - **Issue**: clear description of the bug24 - **Impact**: what can go wrong25 - **Proposed fix**: the correction as a diff or snippet266. Ask the user: "Do you want me to apply these fixes? (all / some / none)"277. Apply only the confirmed fixes via Edit.2829## Constraints3031- Never modify the file without explicit user confirmation.32- Focus on real bugs — no refactoring, no stylistic suggestions, no performance optimizations unless they cause a bug.33- One file at a time. If the user requests multiple files, process sequentially asking confirmation for each.34- If no bugs are found, say so clearly rather than inventing problems.3536## Output3738A numbered list of bugs with explanation and fix, followed by a proposal to apply the corrections after user agreement.