Skip to content
Agent Orchestration
Skill

/investigate-bug

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.

From plugin
bigpowers
29280 skills1 hook1 MCP

Claude Code

$ npx -y skills add danielvm-git/bigpowers --skill investigate-bug --agent claude-code

SKILL.md

investigate-bug.SKILL.md
name: investigate-bug
model: sonnet
effort: standard
description: 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.

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:

1. Read `specs/bugs/registry.yaml` (if it exists) — check for prior bugs in the same `scope` or with similar symptoms. 2. If a relevant prior bug is found, read the corresponding `specs/bugs/BUG-*.md` file to understand previous root cause analysis and fix approach. 3. 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-root` Phase 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:

1. **RED**: Write a test that [describes expected behavior] **GREEN**: [Minimal change to make it pass] **verify**: [runnable command]

2. **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](../../docs/references/feathers.md) — seam types, characterization tests, and the legacy code change algorithm
  • [Fowler's Code Smells](../../docs/references/fowler.md) — identifying structural problems by smell before investigating
Read more
@danielvm-git
Ships withbigpowers

Agent skills synthesizing 17 years of software engineering discipline — from Clean Code to AI-native architecture — into a single, prescriptive methodology for solo developers.

29280 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
292
Star history of danielvm-git/bigpowers on GitHub, a chart by star-history.com

Other skills on bigpowers.

align-grid

align-grid

Build editorial/magazine/report webpages on a GENUINE Müller-Brockmann modular grid (International Typographic Style) — not a…

assess-impact

assess-impact

Analyze the blast radius of a proposed change before any code is written. Maps dependents, affected stories, and test coverage.…

audit-code

audit-code

Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout…

audit-plan

audit-plan

Evaluate an incoming project plan against bigpowers principles and conventions, surface gaps, and produce a READY/NOT READY…

build-epic

build-epic

Eight-step epic build cycle — reads state.yaml, execution-status.yaml, and one epic capsule; updates status via bp-yaml-set or…

change-request

change-request

Add a new requirement or reorder epics by WSJF against specs/release-plan.yaml and epic capsule directories. Modes Add and…

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw5d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca3d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip4d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about investigate-bug.

Which coding agents can use investigate-bug?
investigate-bug installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.