investigate-bug
Skill288 starsChanged 6 days agoMITView on GitHub
Investigate a bug or issue by exploring the codebase to find root cause, then write a TDD-based fix plan to specs/bugs/BUG-*.md. Use when user reports a bug, wants to investigate a problem, mentions "triage", or wants to plan a fix.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- Esri/calcite-design-systemtheir own version, first seen Nov 2, 2026
- lvndry/skillstheir own version, first seen Nov 1, 2026
- dativo-io/talontheir own version, first seen Oct 25, 2026
- BuilderIO/agent-nativetheir own version, first seen Oct 17, 2026
- tejastn10/workbenchtheir own version, first seen Oct 13, 2026
- jasonhulbert/skillstheir own version, first seen Oct 9, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- BuilderIO/agent-native★ 7.6ksame name
- Esri/calcite-design-system★ 385same name
- dativo-io/talon★ 18same name
- hamakyo/okf-skills★ 2same name
- jasonhulbert/skills★ 1same name
- napnap11/claude-skills★ 1same name
- tejastn10/workbench★ 1same name
- lvndry/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository162 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- website/AGENTS.mdAGENTS.md
- .cursor/rules/align-grid.mdcCursor rule
- .cursor/rules/assess-impact.mdcCursor rule
- .cursor/rules/audit-code.mdcCursor rule
- .cursor/rules/audit-plan.mdcCursor rule
- .cursor/rules/build-epic.mdcCursor rule
- .cursor/rules/change-request.mdcCursor rule
- .cursor/rules/commit-message.mdcCursor rule
- .cursor/rules/compose-workflow.mdcCursor rule
- .cursor/rules/craft-skill.mdcCursor rule
- .cursor/rules/deepen-architecture.mdcCursor rule
- .cursor/rules/define-language.mdcCursor rule
- .cursor/rules/define-success.mdcCursor rule
- .cursor/rules/delegate-task.mdcCursor rule
- .cursor/rules/deploy.mdcCursor rule
- .cursor/rules/design-interface.mdcCursor rule
- .cursor/rules/develop-tdd.mdcCursor rule
- .cursor/rules/diagnose-root.mdcCursor rule
- .cursor/rules/diagnose-stall.mdcCursor rule
- .cursor/rules/dispatch-agents.mdcCursor rule
- .cursor/rules/edit-document.mdcCursor rule
- .cursor/rules/elaborate-spec.mdcCursor rule
- .cursor/rules/enforce-first.mdcCursor rule
- .cursor/rules/evolve-skill.mdcCursor rule
- .cursor/rules/execute-plan.mdcCursor rule
- .cursor/rules/extract-design.mdcCursor rule
- .cursor/rules/find-way.mdcCursor rule
- .cursor/rules/fix-bug.mdcCursor rule
- .cursor/rules/gate-trace.mdcCursor rule
- .cursor/rules/generate-allure-report.mdcCursor rule
- .cursor/rules/grill-me.mdcCursor rule
- .cursor/rules/grill-with-docs.mdcCursor rule
- .cursor/rules/guard-git.mdcCursor rule
- .cursor/rules/harden-vps.mdcCursor rule
- .cursor/rules/hook-commits.mdcCursor rule
- .cursor/rules/inspect-quality.mdcCursor rule
- .cursor/rules/investigate-bug.mdcCursor rule
- .cursor/rules/kickoff-branch.mdcCursor rule
- .cursor/rules/maintain-wiki.mdcCursor rule
- .cursor/rules/map-codebase.mdcCursor rule
- .cursor/rules/migrate-spec.mdcCursor rule
- .cursor/rules/model-domain.mdcCursor rule
- .cursor/rules/orchestrate-project.mdcCursor rule
- .cursor/rules/organize-workspace.mdcCursor rule
- .cursor/rules/plan-refactor.mdcCursor rule
- .cursor/rules/plan-release.mdcCursor rule
- .cursor/rules/plan-tests.mdcCursor rule
- .cursor/rules/plan-work.mdcCursor rule
- .cursor/rules/publish-package.mdcCursor rule
- .cursor/rules/quick-fix.mdcCursor rule
- .cursor/rules/release-branch.mdcCursor rule
- .cursor/rules/request-review.mdcCursor rule
- .cursor/rules/research-first.mdcCursor rule
- .cursor/rules/reset-baseline.mdcCursor rule
- .cursor/rules/respond-review.mdcCursor rule
- .cursor/rules/run-benchmark.mdcCursor rule
- .cursor/rules/run-evals.mdcCursor rule
- .cursor/rules/run-planning.mdcCursor rule
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
Read specs/bugs/registry.yaml (if it exists) — check for prior bugs in the same scope or with similar symptoms.
- Very specific: line 21
If a relevant prior bug is found, read the corresponding specs/bugs/BUG-*.md file to understand previous root cause analysis and fix …
- Distinctive: line 28
Do NOT ask follow-up questions yet.
- Very specific: line 34
Run the 4-phase root-cause analysis via the diagnose-root skill (Reproduce → Isolate → Hypothesize → Verify).
- Distinctive: line 55
Create a concrete, ordered list of RED-GREEN cycles.
- Distinctive: line 65
Durability: Only suggest fixes that would survive radical codebase changes.
- Very specific: line 71
After writing, append a row to specs/bugs/registry.yaml with: bug_id (same timestamp), date, severity, priority, scope, summary, and file …
- Distinctive: line 92
Do NOT include specific file paths, line numbers, or implementation details that couple to current code layout.
- Distinctive: line 98
RED: Write a test that [describes expected behavior]
- Distinctive: line 102
RED: Write a test that [describes next behavior]
- Very specific: line 121
After writing the bug file, print a one-line summary of the root cause and suggest running kickoff-branch next to create a fix branch.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Investigate Bug
Boundary: End-to-end bug entry point — history check → RCA (via diagnose-root) → fix approach → TDD plan → bug file. Delegates the 4-phase RCA to diagnose-root; does not re-implement it.
Investigate a reported problem, find its root cause, and write a TDD fix plan to specs/bugs/BUG-*.md. This is a mostly hands-off workflow — minimize questions to the user.
Process
0. Read previous bug history
Before starting diagnosis:
- Read
specs/bugs/registry.yaml(if it exists) — check for prior bugs in the samescopeor with similar symptoms. - If a relevant prior bug is found, read the corresponding
specs/bugs/BUG-*.mdfile to understand previous root cause analysis and fix approach. - Note in your investigation whether this is a recurrence, a related issue, or novel.
1. Capture the problem
Get a brief description of the issue from the user. If they haven't provided one, ask ONE question: "What's the problem you're seeing?"
Do NOT ask follow-up questions yet. Start investigating immediately.
Security-impact assessment — After capturing the problem, assess and document:
Security impact: NONE / LOW / MEDIUM / HIGH / CRITICAL. If HIGH or CRITICAL, assign bug severity HIGH and document the exploit path in findings. If MEDIUM+, include exploit path in the bug file. Document "no security exploit path identified" for NONE/LOW.
2. Explore and diagnose (4-phase RCA)
Run the 4-phase root-cause analysis via the diagnose-root skill (Reproduce → Isolate → Hypothesize → Verify). That skill is the canonical RCA engine — do not re-implement the phases here.
Also look at:
- Recent changes to affected files (
git log --oneline <file>) - Existing tests (what's tested, what's missing)
- Similar patterns elsewhere in the codebase that work correctly
HARD GATE — Do NOT proceed to Step 3 (Fix Approach) until
diagnose-rootPhase 4 produces a verified root cause. "It probably is X" is not verified.
3. Identify the fix approach
Based on your investigation, determine:
- The minimal change needed to fix the root cause
- Which modules/interfaces are affected
- What behaviors need to be verified via tests
- Whether this is a regression, missing feature, or design flaw
- Risk level: Low / Medium / High
4. Design TDD fix plan
Create a concrete, ordered list of RED-GREEN cycles. Each cycle is one vertical slice:
- RED: Describe a specific test that captures the broken/missing behavior
- GREEN: Describe the minimal code change to make that test pass
Rules:
- Tests verify behavior through public interfaces, not implementation details
- One test at a time, vertical slices (NOT all tests first, then all code)
- Each test should survive internal refactors
- Include a final refactor step if needed
- Durability: Only suggest fixes that would survive radical codebase changes. Tests assert on observable outcomes (API responses, UI state, user-visible effects), not internal state.
5. Write the bug file
Save the investigation and fix plan to specs/bugs/BUG-NNN-slug.md. Create the specs/bugs/ directory if it doesn't exist.
After writing, append a row to specs/bugs/registry.yaml with: bug_id (same timestamp), date, severity, priority, scope, summary, and file path. Create specs/bugs/registry.yaml if it doesn't exist.
<diagnosis-template>BUG-YYYY-MM-DDTHHMMSS: [short title]
Problem
A clear description of the bug or issue, including:
- What happens (actual behavior)
- What should happen (expected behavior)
- How to reproduce (if applicable)
Root Cause Analysis
Describe what you found during investigation:
- The code path involved
- Why the current code fails
- Any contributing factors
- Risk level: Low / Medium / High
Do NOT include specific file paths, line numbers, or implementation details that couple to current code layout. Describe modules, behaviors, and contracts instead.
TDD Fix Plan
A numbered list of RED-GREEN cycles:
- RED: Write a test that [describes expected behavior] GREEN: [Minimal change to make it pass] verify: [runnable command]
- RED: Write a test that [describes next behavior] GREEN: [Minimal change to make it pass] verify: [runnable command]
REFACTOR: [Any cleanup needed after all tests pass]
Acceptance Criteria
- Criterion 1
- Criterion 2
- All new tests pass
- Existing tests still pass
Resolution
<!-- filled in by validate-fix --></diagnosis-template>After writing the bug file, print a one-line summary of the root cause and suggest running kickoff-branch next to create a fix branch.
References
<!-- story: e35s10 -->- Feathers' Seams & Characterization Tests — seam types, characterization tests, and the legacy code change algorithm
- Fowler's Code Smells — identifying structural problems by smell before investigating
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

