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

investigate

Investigate bugs by tracing symptoms through code and recent changes, reproducing failures, and testing a specific cause before fixing it. Produce a focused correction, a regression test to catch recurrence, and an evidence-based debugging report.

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

원문원문 설명 보기

Systematic root-cause debugging: find the cause before writing any fix

설치 방법 보기

이럴 때 유용합니다

  • Investigate errors that keep returning after fixes
  • Trace a regression through recent changes
  • Analyze failures that occur only in certain environments
  • Add a regression test and document the verified fix

포함된 파일(1)

  • SKILL.md8.1 KB

SKILL.md(원문)

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

Investigate: Root-Cause debugging

Systematic debugging with mandatory root cause investigation before any code changes.

Iron Law: NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.

Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find.

Instructions

Phase 1: Collect symptoms

Gather all available context before forming any hypothesis.

  1. Read the error messages, stack traces, and reproduction steps in full
  2. Ask ONE targeted question if the user hasn't provided enough context:
    • "What exact error message do you see?"
    • "Can you reproduce this consistently?"
    • "When did this start happening?"
  3. Identify the affected component and its boundaries

Output: A precise symptom statement: what fails, when, with what error.


Phase 2: Read the code

Trace the code path from symptom back to potential causes. Do not guess.

# Find all references to the failing component
grep -rn "ComponentName\|function_name\|error_string" src/ --include="*.{ts,js,py,rb,go}" | head -30

# Check recent changes to affected files
git log --oneline -15 -- <affected-file>

# Read the actual diff for each recent commit
git show <commit-hash> -- <affected-file>

Use Grep to find all references, Read to understand the logic. Never skip reading the code.


Phase 3: Check recent changes

# What changed recently across the whole repo
git log --oneline -20

# Changes to files related to the symptom
git log --oneline -20 -- <affected-files>

# Full diff of the last N commits
git diff HEAD~3..HEAD -- <affected-directory>

Key question: Was this working before? If yes, the root cause is in the recent diff.

  • Regression = root cause is in the changes, not the original code
  • Always-broken = architectural issue or incorrect assumption

Phase 4: Reproduce

Before fixing anything, confirm you can trigger the bug deterministically.

# Run the test suite targeting the affected area
npm test -- --testPathPattern="affected-module" 2>/dev/null || \
pnpm test -- --testPathPattern="affected-module" 2>/dev/null || \
pytest tests/test_affected.py -v 2>/dev/null

# Check logs if available
tail -50 logs/error.log 2>/dev/null || \
journalctl -u app-service --lines=50 2>/dev/null

If you cannot reproduce: gather more evidence. Do not fix what you cannot verify is broken.


Phase 5: Pattern analysis

Match the symptom against known bug patterns:

PatternSignatureWhere to look
Race conditionIntermittent, timing-dependent failuresConcurrent access to shared state, async/await ordering
Null propagationTypeError, undefined is not a functionMissing guards on optional values, unchecked API responses
State corruptionInconsistent data, partial updatesTransactions, callbacks, mutation of shared objects
Integration failureTimeout, unexpected response shapeExternal API calls, service boundaries, schema changes
Configuration driftWorks locally, fails in staging/prodEnv vars, feature flags, database state, missing secrets
Stale cacheShows old data, fixes on restart/clearRedis, CDN, browser cache, memoization
Import/module error"Cannot find module", "is not a function"Package versions, circular imports, build artifacts

Also check:

  • TODOS.md or issue tracker for known issues in the same area
  • git log for prior fixes in the same files; recurring bugs in the same location are an architectural smell

External search: If the pattern doesn't match, search for: {framework} {sanitized-error-type} (strip hostnames, file paths, internal data). Search the error category, not the raw message.

Form a hypothesis: "Root cause hypothesis: [specific, testable claim about what is wrong and why]"


Phase 6: Hypothesis testing

Before writing any fix, verify your hypothesis.

  1. Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match?
// Example: temporary diagnostic
console.log('[DEBUG investigate]', { value, expected, type: typeof value });
# Example: temporary diagnostic
import sys; print(f'[DEBUG investigate] value={value!r} type={type(value)}', file=sys.stderr)
  1. If hypothesis is wrong: Gather more evidence. Return to Phase 2. Do not guess.

  2. 3-strike rule: If 3 hypotheses fail, STOP. This may be an architectural issue.

    Present this to the user:

    3 hypotheses tested, none confirmed. This likely requires deeper investigation.
    
    Options:
    A) I have a new hypothesis: [describe], continue investigating
    B) Add instrumentation and wait: capture the bug in the act next time
    C) Escalate: this needs someone with deeper system knowledge
    

Red flags, slow down immediately:

  • "Quick fix for now": there is no "for now"
  • Proposing a fix before tracing data flow: that's guessing
  • Each fix reveals a new problem elsewhere: wrong layer, not wrong code

Phase 7: Implementation

Once root cause is confirmed:

  1. Fix the root cause, not the symptom. The smallest change that eliminates the actual problem.

  2. Minimal diff: Fewest files touched, fewest lines changed. Resist refactoring adjacent code.

  3. Write a regression test that:

    • Fails without the fix (proves the test is meaningful)
    • Passes with the fix (proves the fix works)
  4. Run the full test suite and paste the output. No regressions allowed.

  5. Blast radius check: If the fix touches more than 5 files, stop and confirm:

    This fix touches N files. That's a large blast radius for a bug fix.
    
    A) Proceed: the root cause genuinely spans these files
    B) Split: fix the critical path now, defer the broader cleanup
    C) Rethink: there may be a more targeted approach
    

Output format

DEBUG REPORT
════════════════════════════════════════════════════
Symptom:          [what the user observed]
Root cause:       [what was actually wrong, specific not vague]
Fix:              [what was changed, with file:line references]
Evidence:         [test output or reproduction showing fix works]
Regression test:  [file:line of the new test]
Related:          [known issues, prior bugs in same area, architectural notes]
Status:           DONE | DONE_WITH_CONCERNS | BLOCKED
════════════════════════════════════════════════════

Status definitions:

  • DONE: root cause found, fix applied, regression test written, all tests pass
  • DONE_WITH_CONCERNS: fixed but cannot fully verify (intermittent, requires staging)
  • BLOCKED: root cause unclear after full investigation

Escalation format (when BLOCKED):

STATUS: BLOCKED
REASON: [1-2 sentences explaining what was tried and why it failed]
ATTEMPTED: [list of hypotheses tested]
RECOMMENDATION: [what the user should do next: add logging, escalate, or request an architectural review]

Important rules

  • Never apply a fix you cannot verify. If you can't reproduce and confirm, don't ship it.
  • Never say "this should fix it." Verify and prove it. Run the tests.
  • Never fix >3 unrelated things in one investigation. If you find other bugs, note them but stay focused.
  • Remove all debug log statements before committing the fix.
  • 3+ failed hypotheses → question the architecture, not your hypothesis skills.

Usage

/investigate TypeError: Cannot read properties of undefined (reading 'map')
/investigate the payment flow is silently dropping some transactions
/investigate

Related commands

  • /review-pr: review the fix before merging
  • /qa: run browser QA on the affected feature after fixing
  • /ship: pre-deploy checklist after investigation is complete

$ARGUMENTS

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Evaluate Claude Code agents, skills, and commands with weighted quality criteria. Get scores, readiness grades, template comparisons, and practical improvement suggestions in Markdown or JSON reports to guide reviews before release.

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

  • Review skills before release
  • Compare agent definitions with reference templates
  • Quickly check critical quality criteria
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

Assess a codebase across seven areas, including exposed credentials, security, dependencies, structure, and tests. Receive category scores, findings tied to file locations, and a prioritized improvement plan with smaller tasks that can be completed quickly.

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

  • Assessing the overall health of an inherited project
  • Reviewing exposed credentials and security risks
  • Identifying dependency and test coverage gaps
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

Measure code patterns such as casts to any or disabled lint rules, then run repeated, targeted edits. Keep changes that improve the chosen metric, revert unsuccessful changes, and track results for each improvement loop.

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

  • Finding code patterns to prioritize for cleanup
  • Preparing measurement files for an improvement loop
  • Repeating targeted edits to reduce casts to any
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

best-of-n

무료

Generate several separate solutions, compare them against criteria fixed in advance, and verify the selected result through executable checks or an independent reviewer. Keep a proof log documenting candidates, evidence, failures, and remaining limits.

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

  • Comparing implementation options before choosing one
  • Verifying a solution when a wrong choice would be costly
  • Keeping evaluation evidence for delivery or audit
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

canary

무료

Monitor a live application after deployment and compare it with a saved baseline, a record of its earlier state. Check page responses, loading times, and new errors, flag persistent changes, and produce a per-page health report.

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

  • Recording a healthy baseline before deployment
  • Monitoring production immediately after deployment
  • Checking key pages for slower responses or failures
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

catchup

무료

Rebuild project context after clearing a conversation or returning to work. Review recent Git history, uncommitted changes, and TODO markers to get a structured summary of project status and suggested next steps.

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

  • Restoring project context after /clear
  • Reviewing recent changes after a long break
  • Checking unfinished work before choosing the next task
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 18일 업데이트

FlorianBruniaux의 스킬 모두 보기

이 스킬의 문제 신고