bug-detective

Diagnose code errors using a systematic debugging workflow across Python, JavaScript, and Bash.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill bug-detective-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bug-detective
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/bug-detective
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill bug-detective-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When code throws errors or behaves unexpectedly, developers often guess at fixes instead of investigating systematically. This Skill provides a structured five-step debugging workflow—understand, analyze, locate, hypothesize, fix—plus language-specific error pattern catalogs so bugs get resolved methodically instead of by trial and error. ## Core Features & Use Cases - Structured Debugging Workflow: A five-step process covering evidence gathering, error-type classification, binary search, log tracing, and hypothesis verification. - Language-Specific Error Patterns: Detailed catalogs of common Python, JavaScript/TypeScript, and Bash/Zsh errors with wrong-vs-correct code examples. - Debugging Tool Commands: Ready-to-use commands for pdb, Node.js inspector, git bisect, shellcheck, and bash strict modes. - Use Case: A user reports "my script deletes files in the wrong directory." The Skill identifies the classic unquoted-variable and missing set -e pattern, explains why cd failure continued execution, and provides the corrected script with set -euo pipefail. ## Quick Start Ask the assistant to debug this error and paste the full error message, stack trace, and the code that triggers it.

Frequently Asked Questions about bug-detective

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a Python error systematically?

Start by collecting the full error message, stack trace, and reproduction steps. Classify the error type (TypeError, KeyError, IndexError, etc.), then use binary search, logging, or pdb breakpoints to locate the source before forming and verifying a hypothesis about the cause.

How to debug Bash scripts that fail silently?

Run the script with bash -x to trace each command, and add set -euo pipefail at the top so errors, undefined variables, and pipe failures stop execution immediately. ShellCheck can statically detect common mistakes like unquoted variables before runtime.

What are the most common Python error patterns?

Frequent patterns include mutable default arguments, modifying a list while iterating over it, closure variable binding in loops, using is for value comparison, and accessing None object attributes. Each has a standard fix such as using None defaults or list comprehensions.

Why does my Bash variable stay unchanged inside a while loop?

Piping into a while loop creates a subshell, so variable changes do not persist outside it. Replace the pipe with input redirection or process substitution, for example while read line; do ... done < file.txt, to keep the loop in the current shell.

When should I use git bisect for debugging?

Use git bisect when a bug appeared at an unknown point in history and you have a known-good commit. It binary-searches commits between good and bad states to identify the exact commit that introduced the regression.