bug-detective
What it does
This skill gives your AI a step-by-step way to track down bugs, exceptions and failures in code. It is for anyone whose code is broken and who wants a careful, evidence-based fix.
When to use it
- βWhen you have an error message, exception or stack trace to investigate.
- βWhen something is broken or a feature suddenly stops working.
- βWhen you ask why a piece of code is failing and the cause is not obvious.
Skill link
https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/bug-detective/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βMy login page throws a 500 error after the last deploy. Find the cause and fix it.β
5 new skills a week. 1 minute to read.
How it works
The agent collects the error details, sorts the type of error, forms possible causes, tests each one, and then applies and verifies the fix.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Bug Detective
A systematic debugging workflow for investigating and resolving code errors, exceptions, and failures. Provides structured debugging methods and common error pattern recognition.
Core Philosophy
Debugging is a scientific problem-solving process that requires:
- Understand the problem - Clearly define symptoms and expected behavior
- Gather evidence - Collect error messages, logs, stack traces
- Form hypotheses - Infer possible causes based on evidence
- Verify hypotheses - Confirm or eliminate causes through experiments
- Resolve the issue - Apply fixes and verify
Debugging Workflow
Step 1: Understand the Problem
Before starting to debug, clarify the following information:
Required information to collect:
- Complete error message content
- Exact location of the error (filename and line number)
- Reproduction steps (how to trigger the error)
- Expected behavior vs actual behavior
- Environment info (OS, versions, dependencies)
Question template:
1. What is the exact error message?
2. Which file and line does the error occur at?
3. How can this issue be reproduced? Provide detailed steps.
4. What was the expected result? What actually happened?
5. What recent changes might have introduced this issue?
Step 2: Analyze Error Type
Choose a debugging strategy based on error type:
| Error Type | Characteristics | Debugging Method |
|---|---|---|
| Syntax Error | Code cannot be parsed | Check syntax, bracket matching, quotes |
| Import Error | ModuleNotFoundError | Check module installation, path config |
| Type Error | TypeError | Check data types, type conversions |
| Attribute Error | AttributeError | Check if object attribute exists |
| Key Error | KeyError | Check if dictionary key exists |
| Index Error | IndexError | Check list/array index range |
| Null Reference | NoneType/NullPointerException | Check if variable is None |
| Network Error | ConnectionError/Timeout | Check network connection, URL, timeout settings |
| Permission Error | PermissionError | Check file permissions, user permissions |
| Resource Error | FileNotFoundError | Check if file path exists |
Step 3: Locate the Problem Source
Use the following methods to locate the issue:
1. Binary Search Method
- Comment out half the code, check if the problem persists
- Progressively narrow the scope until the problematic code is found
2. Log Tracing
- Add print/logging statements at key locations
- Track variable value changes
- Confirm code execution path
3. Breakpoint Debugging
- Use debugger breakpoint functionality
- Step through code execution
- Inspect variable state
4. Stack Trace Analysis
- Find the call chain from the stack trace in the error message
- Determine the direct cause of the error
- Trace back to the root cause
Step 4: Form and Verify Hypotheses
Hypothesis framework:
Hypothesis: [problem description] causes [error phenomenon]
Verification steps:
1. [verification method 1]
2. [verification method 2]
Expected results:
- If hypothesis is correct: [expected phenomenon]
- If hypothesis is wrong: [expected phenomenon]
Step 5: Apply Fix
After fixing, verify:
- The original error is resolved
- No new errors have been introduced
- Related functionality still works correctly
- Tests added to prevent regression
Python Common Error Patterns
1. Indentation Errors
2. Mutable Default Arguments
3. Closure Issues in Loops
4. Modifying a List While Iterating
5. Using is for String Comparison
6. Forgetting to Call super().__init__()
JavaScript/TypeScript Common Error Patterns
1. this Binding Issues
2. Async Error Handling
3. Object Reference Comparison
Bash/Zsh Common Error Patterns
1. Spacing Issues
# β No spaces allowed in assignment
name = "John" # Error: tries to run 'name' command
# β
Correct assignment
name="John"
# β Missing spaces in conditional test
if[$name -eq 1]; then # Error
# β
Correct
if [ $name -eq 1 ]; then
2. Quoting Issues
# β Variables not expanded inside single quotes
echo 'The value is $var' # Output: The value is $var
# β
Use double quotes
echo "The value is $var" # Output: The value is actual_value
# β Using backticks for command substitution (confusing)
result=`command`
# β
Use $()
result=$(command)
3. Unquoted Variables
FAQ
What information should I give?
The full error message, the file and line if known, steps to reproduce it, and what you expected to happen.
Does it guess at fixes?
No. It forms possible causes and checks each one before changing the code.
Does it know common error patterns?
Yes. It includes common error patterns to speed up diagnosis.
Details
Original description by the author
This skill should be used when the user asks to "debug this", "fix this error", "investigate this bug", "troubleshoot this issue", "find the problem", "something is broken", "this isn't working", "why is this failing", or reports errors/exceptions/bugs. Provides systematic debugging workflow and common error patterns.
Popularity
- GitHub stars
- 6.0k
- Ranking position
- #14480
- License
- MIT
- Updated
- 10/19/2026
Comments
- β¦
More skills from this repository
agent-identifier
6.0kTeaches your agent to create Claude Code agents, writing their name, trigger description, system prompt and settings correctly.
architecture-design
6.0kTeaches your agent the standard layout for machine learning project code, using factory and registry patterns when adding registrable parts.
citation-verification
6.0kTeaches your agent to check each citation in an academic paper against trusted scholarly sources, catching fake or wrong references.
code-review-excellence
6.0kHelps your agent review code changes and pull requests with clear, kind, prioritized feedback that catches real bugs and improves the code.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.