florianbruniaux/claude-code-ultimate-guide/investigate
Claude Code and agent skill by florianbruniaux/claude-code-ultimate-guide
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Systematic root-cause debugging: find the cause before writing any fix
Install
npx vskill@latest install florianbruniaux/claude-code-ultimate-guide/investigateSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as florianbruniaux/claude-code-ultimate-guide/investigate.
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.
- Read the error messages, stack traces, and reproduction steps in full
- 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?"
- 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.
Use Grep to find all references, Read to understand the logic. Never skip reading the code.
Phase 3: Check recent changes
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.
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:
| Pattern | Signature | Where to look | |
|---|---|---|---|
| Race condition | Intermittent, timing-dependent failures | Concurrent access to shared state, async/await ordering | |
| Null propagation | TypeError, undefined is not a function | Missing guards on optional values, unchecked API responses | |
| State corruption | Inconsistent data, partial updates | Transactions, callbacks, mutation of shared objects | |
| Integration failure | Timeout, unexpected response shape | External API calls, service boundaries, schema changes | |
| Configuration drift | Works locally, fails in staging/prod | Env vars, feature flags, database state, missing secrets | |
| Stale cache | Shows old data, fixes on restart/clear | Redis, CDN, browser cache, memoization | |
| Import/module error | "Cannot find module", "is not a function" | Package versions, circular imports, build artifacts |
Also check:
TODOS.mdor issue tracker for known issues in the same areagit logfor 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.
- Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match?
- If hypothesis is wrong: Gather more evidence. Return to Phase 2. Do not guess.
- 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:
- Fix the root cause, not the symptom. The smallest change that eliminates the actual problem.
- Minimal diff: Fewest files touched, fewest lines changed. Resist refactoring adjacent code.
- Write a regression test that:
- Fails without the fix (proves the test is meaningful)
- Passes with the fix (proves the fix works)
- Run the full test suite and paste the output. No regressions allowed.
- 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
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):
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
Related skills
/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
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingexamples/skills/investigate/SKILL.md
Popularity
- Repository stars
- 5,719
- Repository forks
- 749
- 7-day trend score
- 43
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/florianbruniaux/claude-code-ultimate-guide/investigate)