본문으로 건너뛰기
Skillpedia
일반 코딩6.0k · #14480

bug-detective

하는 일

이 스킬은 AI에게 코드의 버그, 예외, 실패를 추적하는 단계별 방법을 제공합니다. 코드가 망가졌고 신중하며 증거에 기반한 수정을 원하는 사람을 위한 것입니다.

사용하는 경우

  • ✓조사할 오류 메시지, 예외 또는 스택 트레이스가 있을 때.
  • ✓무언가 고장 나거나 갑자기 기능이 멈췄을 때.
  • ✓코드가 실패하는 이유를 묻는데 원인이 분명하지 않을 때.

스킬 링크

https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/bug-detective/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Galaxy-Dawn/claude-scholar/blob/main/skills/bug-detective/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지난 배포 후 제 로그인 페이지에서 500 오류가 납니다. 원인을 찾아서 고쳐 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 오류 세부 정보를 모으고, 오류 유형을 분류하고, 가능한 원인을 세운 다음 각각을 시험합니다. 그다음 수정을 적용하고 검증합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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:

  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 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:

  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

자주 묻는 질문

어떤 정보를 주어야 하나요?

전체 오류 메시지, 알고 있다면 파일과 줄 번호, 재현 단계, 기대했던 동작을 알려 주세요.

수정을 추측하나요?

아니요. 가능한 원인을 세우고 각각 확인한 뒤에야 코드를 바꿉니다.

흔한 오류 패턴을 아나요?

네. 진단을 빠르게 하도록 흔한 오류 패턴을 포함하고 있습니다.

상세 정보

작성자의 원본 설명

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.

repo: Galaxy-Dawn/claude-scholar

인기도

GitHub 스타
6.0k
순위
#14480
라이선스
MIT
업데이트
2026. 10. 19.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬