Skip to content
Agentmart
Submit a tool

investigate

Systematically diagnose a bug via structured root cause analysis

Skill by Hbin77

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/hbin77-investigate

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Systematically diagnose a bug via structured root cause analysis

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/investigate

What's inside

Skill name
investigate
Description
Systematically diagnose a bug via structured root cause analysis
License
MIT
Instructions
60 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

Systematically investigate and diagnose a bug or issue using structured root cause analysis.

Issue: the task/scope the user described when invoking this skill (if none given, ask or infer from context)

## Phase 1: Gather Evidence
- Grep for error messages, stack traces, related keywords in the codebase.
- Check recent git history for related changes. Clamp N to available history so this doesn't fail on repos with fewer than 5 commits: `N=$(( $(git rev-list --count HEAD) - 1 )); [ $N -gt 5 ] && N=5`; if `N` is 0 (single commit), fall back to inspecting `git log --oneline` / `git show`. Then `git log --oneline -$N` and `git diff HEAD~$N`.
- Read log files, error outputs, or console messages if provided.

## Phase 2: Reproduce
1. Identify the reproduction path from gathered evidence.
2. Runtime error → find the entry point (test, script, URL), run it, capture full output.
3. Build error → run the build, capture output.
4. Logic error → write a minimal failing test that demonstrates the bug.
5. Document: **Expected behavior** vs **Actual behavior**.

## Phase 3: Root Cause Analysis
Apply the **5 Whys**:
```
Why did [symptom] happen? → Because [cause 1]
  → Why? Because [cause 2] → ... → Because [root cause]
```
Identify: **Root cause**, **Contributing factors**, **Blast radius** (what else the same root cause affects).

## Phase 4: Fix
1. Implement the fix targeting the root cause (not symptoms).
2. If it touches multiple files, apply in dependency order.
3. Run the Phase 2 reproduction → verify it passes.
4. Run the full test suite → verify no regressions.

## Phase 5: Prevent
1. If no test existed for this case, write one.
2. Check for similar patterns elsewhere: `grep -rn "similar_pattern"`.
3. If systemic, suggest a lint rule or architectural change.

## Phase 6: Report
```
## Investigation Report
### Issue
[one-line description]
### Reproduction
[steps]
### Root Cause
[5 Whys result]
### Fix Applied
- [file:line] — [what changed and why]
### Tests Added
- [test file] — [what it covers]
### Prevention
- [recommendations]
```

## Rules
- NEVER guess. Every conclusion must be backed by evidence (log output, grep result, test failure).
- Reproduce FIRST, then diagnose. No fix without reproduction.
- Fix the root cause, not the symptom.
- Always add a test that would have caught this bug.
- If you can't reproduce, say so clearly and list what you tried.

From Hbin77/codex-kit, MIT.

More from Hbin77/codex-kit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 7, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Hbin77

Cite this page

investigate skill. Agent Mart. https://agentmart.dev/skills/hbin77-investigate (last updated 2026-10-24)