Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计通过

bug-detective错误侦探

Agent Skill

bug-detective 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,997

周安装

80

GitHub Stars

3,509

下载量

646
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bug-detective(错误侦探)
来源仓库:https://github.com/galaxy-dawn/claude-scholar
仓库路径:skills/bug-detective
安装命令:
npx skills add https://github.com/galaxy-dawn/claude-scholar --skill bug-detective
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/galaxy-dawn/claude-scholar --skill bug-detective

简介

bug-detective 提供结构化的调试工作流,用于系统化调查代码错误、异常和失败的根本原因。

  • 适用于需要科学排查问题、形成假设并通过实验验证的场景,常见于开发或运维排障过程。
  • 采用对话式引导方式逐步收集证据、缩小范围,最终定位问题根源并提供可操作的修复建议。
  • 使用时需注意仅依赖用户提供信息,不自动执行命令或修改代码,确保操作边界清晰可控。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

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:

  1. Understand the problem - Clearly define symptoms and expected behavior
  2. Gather evidence - Collect error messages, logs, stack traces
  3. Form hypotheses - Infer possible causes based on evidence
  4. Verify hypotheses - Confirm or eliminate causes through experiments
  5. 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 TypeCharacteristicsDebugging Method
Syntax ErrorCode cannot be parsedCheck syntax, bracket matching, quotes
Import ErrorModuleNotFoundErrorCheck module installation, path config
Type ErrorTypeErrorCheck data types, type conversions
Attribute ErrorAttributeErrorCheck if object attribute exists
Key ErrorKeyErrorCheck if dictionary key exists
Index ErrorIndexErrorCheck list/array index range
Null ReferenceNoneType/NullPointerExceptionCheck if variable is None
Network ErrorConnectionError/TimeoutCheck network connection, URL, timeout settings
Permission ErrorPermissionErrorCheck file permissions, user permissions
Resource ErrorFileNotFoundErrorCheck 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:

  1. The original error is resolved
  2. No new errors have been introduced
  3. Related functionality still works correctly
  4. 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

# ❌ Unquoted variable, empty value causes errors
rm -rf $dir/*  # If dir is empty, deletes all files in current directory

# ✅ Always quote variables
[ -n "$dir" ] && rm -rf "$dir"/*

# Or use set -u to prevent undefined variables
set -u  # or set -o nounset

4. Variable Scope in Loops

# ❌ Pipe creates subshell, outer variable unchanged
cat file.txt | while read line; do
    count=$((count + 1))  # Outer count won't change
done
echo "Total: $count"  # Outputs 0

# ✅ Use process substitution or redirection
while read line; do
    count=$((count + 1))
done < file.txt
echo "Total: $count"  # Correct output

5. Array Operations

# ❌ Incorrect array access
arr=(1 2 3)
echo $arr[1]  # Outputs 1[1]

# ✅ Correct array access
echo ${arr[1]}  # Outputs 2
echo ${arr[@]}  # Outputs all elements
echo ${#arr[@]} # Outputs array length

6. String Comparison

# ✅ Use `=` inside POSIX `[` tests and `==` inside Bash `[[ ]]` tests
if [ "$name" = "John" ]; then
if [[ "$name" == "John" ]]; then

# ❌ Using -eq for numeric comparison instead of =
if [ $age = 18 ]; then  # Wrong

# ✅ Use arithmetic operators for numeric comparison
if [ $age -eq 18 ]; then
if (( age == 18 )); then

7. Command Failure Continues Execution

# ❌ Execution continues after command failure
cd /nonexistent
rm file.txt  # Deletes file.txt in current directory

# ✅ Use set -e to exit on error
set -e  # or set -o errexit
cd /nonexistent  # Script exits here
rm file.txt

# Or check if command succeeded
cd /nonexistent || exit 1

Common Debugging Commands

Python pdb Debugger

python -m pdb script.py
pytest -x -vv tests/test_target.py

Node.js Inspector

node --inspect-brk app.js
node --trace-warnings app.js

Git Bisect

git bisect start
git bisect bad
git bisect good <known-good-commit>

Bash Debugging

# Run script in debug mode
bash -x script.sh  # Print each command
bash -v script.sh  # Print command source
bash -n script.sh  # Syntax check, no execution

# Enable debugging within a script
set -x  # Enable command tracing
set -v  # Enable verbose mode
set -e  # Exit on error
set -u  # Error on undefined variables
set -o pipefail  # Fail if any command in pipe fails

Preventive Debugging

1. Use Type Checking

2. Input Validation

3. Defensive Programming

4. Logging

Debugging Checklist

Before Starting

  • Obtain the complete error message
  • Record the stack trace of the error
  • Confirm reproduction steps
  • Understand expected behavior

During Debugging

  • Check recent code changes
  • Use binary search to locate the issue
  • Add logs to trace variables
  • Verify hypotheses

After Resolution

  • Confirm the original error is fixed
  • Test related functionality
  • Add tests to prevent regression
  • Document the problem and solution

Additional Resources

Reference Files

For detailed debugging techniques and patterns:

  • references/python-errors.md - Python error details
  • references/javascript-errors.md - JavaScript/TypeScript error details
  • references/shell-errors.md - Bash/Zsh script error details
  • references/debugging-tools.md - Debugging tools usage guide
  • references/common-patterns.md - Common error patterns

Example Files

Working debugging examples:

  • examples/debugging-workflow.py - Complete debugging workflow example
  • examples/error-handling-patterns.py - Error handling patterns
  • examples/debugging-workflow.sh - Shell script debugging example

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.68%
按下载量换算237

Claude

30.26%
按下载量换算195

Cursor

18.16%
按下载量换算117

Gemini CLI

9.19%
按下载量换算59

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/galaxy-dawn/claude-scholar --skill bug-detective 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills