본문으로 건너뛰기
Skillpedia
테스트48k · #4353

debugging-and-error-recovery

하는 일

이 가이드는 컴퓨터 프로그램의 오류를 체계적으로 찾고 고치는 방법을 알려 줍니다. 추측하지 않고 멈춰서 근본 원인을 조사한 뒤 고치는 방법을 가르칩니다.

사용하는 경우

  • ✓변경 후 테스트가 실패할 때.
  • ✓프로그램이 예상치 못하게 작동을 멈출 때.
  • ✓무엇이 잘못되었는지 모를 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/debugging-and-error-recovery/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“이해할 수 없는 이상한 오류가 나고 있어요. 원인을 함께 조사해 주시겠어요?”

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

작동 방식

오류를 재현하고, 어디에서 발생하는지 찾고, 문제를 단순화한 뒤 실제 원인을 고치는 단계를 제안합니다. 마지막으로 오류가 다시 생기지 않도록 테스트를 추가하라고 권합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Debugging and Error Recovery

Overview

Systematic debugging with structured triage. When something breaks, stop adding features, preserve evidence, and follow a structured process to find and fix the root cause. Guessing wastes time. The triage checklist works for test failures, build errors, runtime bugs, and production incidents.

When to Use

  • Tests fail after a code change
  • The build breaks
  • Runtime behavior doesn't match expectations
  • A bug report arrives
  • An error appears in logs or console
  • Something worked before and stopped working

The Stop-the-Line Rule

When anything unexpected happens:

1. STOP adding features or making changes
2. PRESERVE evidence (error output, logs, repro steps)
3. DIAGNOSE using the triage checklist
4. FIX the root cause
5. GUARD against recurrence
6. RESUME only after verification passes

Don't push past a failing test or broken build to work on the next feature. Errors compound. A bug in Step 3 that goes unfixed makes Steps 4-6 wrong.

The Triage Checklist

Work through these steps in order. Do not skip steps.

Step 1: Reproduce

Make the failure happen reliably. If you can't reproduce it, you can't fix it with confidence.

Can you reproduce the failure?
├── YES → Proceed to Step 2
└── NO
    ├── Gather more context (logs, environment details)
    ├── Try reproducing in a minimal environment
    └── If truly non-reproducible, document conditions and monitor

When a bug is non-reproducible:

Cannot reproduce on demand:
├── Timing-dependent?
│   ├── Add timestamps to logs around the suspected area
│   ├── Try with artificial delays (setTimeout, sleep) to widen race windows
│   └── Run under load or concurrency to increase collision probability
├── Environment-dependent?
│   ├── Compare Node/browser versions, OS, environment variables
│   ├── Check for differences in data (empty vs populated database)
│   └── Try reproducing in CI where the environment is clean
├── State-dependent?
│   ├── Check for leaked state between tests or requests
│   ├── Look for global variables, singletons, or shared caches
│   └── Run the failing scenario in isolation vs after other operations
└── Truly random?
    ├── Add defensive logging at the suspected location
    ├── Set up an alert for the specific error signature
    └── Document the conditions observed and revisit when it recurs

For test failures:

# Run the specific failing test
npm test -- --grep "test name"

# Run with verbose output
npm test -- --verbose

# Run in isolation (rules out test pollution)
npm test -- --testPathPattern="specific-file" --runInBand

Step 2: Localize

Narrow down WHERE the failure happens:

Which layer is failing?
├── UI/Frontend     → Check console, DOM, network tab
├── API/Backend     → Check server logs, request/response
├── Database        → Check queries, schema, data integrity
├── Build tooling   → Check config, dependencies, environment
├── External service → Check connectivity, API changes, rate limits
└── Test itself     → Check if the test is correct (false negative)

Use bisection for regression bugs:

# Find which commit introduced the bug
git bisect start
git bisect bad                    # Current commit is broken
git bisect good <known-good-sha> # This commit worked
# Git will checkout midpoint commits; run your test at each
git bisect run npm test -- --grep "failing test"

Step 3: Reduce

Create the minimal failing case:

  • Remove unrelated code/config until only the bug remains
  • Simplify the input to the smallest example that triggers the failure
  • Strip the test to the bare minimum that reproduces the issue

A minimal reproduction makes the root cause obvious and prevents fixing symptoms instead of causes.

Step 4: Fix the Root Cause

Fix the underlying issue, not the symptom:

Symptom: "The user list shows duplicate entries"

Symptom fix (bad):
  → Deduplicate in the UI component: [...new Set(users)]

Root cause fix (good):
  → The API endpoint has a JOIN that produces duplicates
  → Fix the query, add a DISTINCT, or fix the data model

Ask: "Why does this happen?" until you reach the actual cause, not just where it manifests.

Step 5: Guard Against Recurrence

Write a test that catches this specific failure:

// The bug: task titles with special characters broke the search
it('finds tasks with special characters in title', async () => {

…
자주 묻는 질문

'증거 보존'은 무엇을 뜻하나요?

다른 변경을 하기 전에 오류 메시지, 로그, 문제를 일으킨 정확한 단계처럼 중요한 정보를 저장하는 것을 뜻합니다.

'이분법(bisection)'이란 무엇인가요?

오래된 버전과 새 버전의 코드를 비교하며 어떤 변경이 문제를 일으켰는지 좁혀 가는 기법입니다.

왜 증상만 고치면 안 되나요?

증상만 고치는 것은 원인을 해결하지 않고 물이 새는 곳을 막는 것과 같습니다. 문제가 다시 생기거나 다른 오류를 일으킬 수 있습니다. 원인을 찾아 고쳐야 영구적인 해결이 됩니다.

상세 정보

작성자의 원본 설명

Guides systematic root-cause debugging. Use when tests fail, builds break, behavior doesn't match expectations, or you encounter any unexpected error. Use when you need a systematic approach to finding and fixing the root cause rather than guessing.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4353
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬