본문으로 건너뛰기
cccskills
무료GitHub에 공개

systematic-debugging

Systematic approach to diagnosing and fixing errors

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Systematic Debugging

A structured approach to finding and fixing bugs.

The Debugging Loop

1. REPRODUCE → 2. ISOLATE → 3. DIAGNOSE → 4. FIX → 5. VERIFY

Never skip steps. Never guess-and-check repeatedly.

Step 1: Reproduce

  • Run the exact command that fails
  • Capture FULL output (stdout AND stderr)
  • Note: exit code, error message, stack trace
  • If intermittent, identify what changes between runs

Step 2: Isolate

  • What's the MINIMAL input that triggers the error?
  • Which specific line/function fails? (read the traceback bottom-up)
  • Is it a compile error, runtime error, or wrong output?
  • Does it fail on all inputs or specific ones?

Step 3: Diagnose

Read the error message carefully

Error typeWhere to look
Compile errorThe FIRST error (later ones are often cascading)
SegfaultLast function in the stack trace, check array bounds and null pointers
Python tracebackThe innermost frame (bottom), but also check the middle for context
Wrong outputDiff expected vs actual: diff <(expected) <(actual)
Timeout/hangIs it an infinite loop? Deadlock? I/O bound? Add a timer or counter

Add minimal instrumentation

  • C: fprintf(stderr, "reached checkpoint %d\n", __LINE__);
  • Python: print(f"DEBUG: {var=}", file=sys.stderr)
  • Check intermediate values, not just final output
  • Remove debug prints after fixing

Step 4: Fix

  • Change ONE thing at a time
  • If the same approach fails 3 times → completely different strategy
  • Don't add workarounds — fix the root cause
  • Common root causes:
    • Off-by-one errors (loop bounds, array indexing)
    • Type mismatches (int vs float, signed vs unsigned)
    • Encoding issues (UTF-8 vs bytes)
    • Path errors (relative vs absolute, missing trailing slash)
    • Race conditions (file not written yet, process not started)

Step 5: Verify

  • Run the same command that failed before
  • Test with multiple inputs, not just the one that was failing
  • Check edge cases: empty input, single element, very large input
  • Run any existing test suite

Common Failure Patterns

"It compiles but gives wrong output"

  1. Print all intermediate values
  2. Compare with a known-correct reference implementation
  3. Check: integer overflow, floating point precision, endianness

"It works on small input but times out on large"

  1. Check algorithm complexity — O(n²) on 1M items = timeout
  2. Profile: which loop/function takes the most time?
  3. Restructure: hash maps, sorting, streaming

"It works locally but fails in the test"

  1. Check: absolute vs relative paths
  2. Check: different working directory
  3. Check: different input format than expected
  4. Read the test script to understand what it actually checks

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Building, compiling, and resolving dependency issues across languages

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

Systematic code review for bugs, security, style, and performance

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

Review Python code for quality, security, and best practices

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

Comprehensive data analysis skill for CSV files using Python and pandas

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

Working with diverse data formats: binary, text, structured, and custom

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

Best practices for creating research diagrams with Excalidraw MCP tools

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

vstorm-co/pydantic-deepagents1.1천2026년 10월 19일 업데이트

vstorm-co의 스킬 모두 보기

이 스킬의 문제 신고