Skip to content
Development
Skill

/debug-investigator

Use when investigating non-obvious bugs, intermittent failures, regressions requiring bisection, or whether a regression test reaches the real shared failure boundary. Not for abstract trade-offs, feature design, or an error whose message already supplies the fix.

From plugin
armory
33998 skills2 agents1 command

Claude Code

$ npx -y skills add Mathews-Tom/armory --skill debug-investigator --agent claude-code

SKILL.md

debug-investigator.SKILL.md
name: debug-investigator
description: 'Use when investigating non-obvious bugs, intermittent failures, regressions requiring bisection, or whether a regression test reaches the real shared failure boundary. Not for abstract trade-offs, feature design, or an error whose message already supplies the fix.'
metadata:
  version: 1.2.0
  category: development
  tags: [debugging, root-cause, hypothesis, bisect]
  difficulty: intermediate
  phase: build

Debug Investigator

Structured debugging methodology that replaces ad-hoc exploration with hypothesis-driven investigation. Captures symptoms, builds a deterministic feedback loop, analyzes evidence (stacktraces, logs, state), generates ranked hypotheses, designs bisection strategies, identifies instrumentation points, and produces minimal reproductions — documenting every step so dead ends are never revisited.

> **When to use this skill vs native debugging:** The base model handles straightforward > debugging (clear stacktraces, obvious errors) natively. Use this skill for non-obvious bugs > requiring systematic investigation: intermittent failures, bugs with no clear stacktrace, > performance regressions, or issues requiring git bisection and hypothesis ranking.

Reference Files

| File | Contents | Load When | | -------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------- | | `references/stacktrace-patterns.md` | Exception taxonomy, traceback reading, common Python/JS error signatures | Stacktrace or exception present | | `references/hypothesis-templates.md` | Bug category catalog, probability ranking, confirmation/refutation tests | Always | | `references/bisection-guide.md` | git bisect workflow, binary search debugging, narrowing techniques | Bug appeared after a change | | `references/log-analysis.md` | Log pattern extraction, anomaly detection, timeline correlation | Log output available | | `references/instrumentation-points.md` | Strategic logging placement, breakpoint strategy, state inspection techniques | Investigation plan needed | | `references/upstream/provenance.md` | Source pin, adaptation boundaries, MIT notice and manual resync policy | Attribution/license review or deliberate upstream resync |

Prerequisites

  • **git** — for bisection and history analysis
  • **Access to source code** — cannot debug opaque binaries
  • **Reproducible environment** — or at minimum, error output (stacktrace, logs)

Discover reproduction and test commands from project scripts, test configuration, and installed tool help before selecting invocations; record their source and relevant environment settings. Run only checks and mutations authorized by the task. If access, tools, or execution authority are missing, record the affected evidence as unobserved and complete independent analysis.

Project Context

Before deep investigation, check for repo-local agent context:

  • `docs/agents/domain.md` for `CONTEXT.md`, `CONTEXT-MAP.md`, and ADR lookup rules
  • `CONTEXT.md` or relevant context-local glossary for domain vocabulary
  • `docs/adr/` and context-local ADRs for decisions near the failing area

Use the project glossary in hypotheses, repro names, and prevention recommendations. If the repo lacks these files, continue normally; do not block debugging on context setup.

Workflow

Phase 1: Symptom Capture

Before touching code, document the observable problem:

1. **What is happening?** — Describe the observed behavior precisely. "It crashes" is insufficient. "Raises `KeyError('user_id')` on line 42 of `auth.py` when calling `get_current_user()` with a valid session token" is actionable. 2. **What should happen?** — Define the expected behavior. If unknown, state that. 3. **Reproducibility** — Always, intermittent (with frequency), or one-time? Intermittent bugs require different strategies than deterministic ones. 4. **Recency** — When did this start? Correlate with recent changes: `git log --oneline -20`. If the bug appeared after a specific commit, bisection is the fastest path. 5. **Environment** — Python version, OS, dependency versions, configuration differences between working and broken environments.

Keep the original input, setup, caller sequence, and expected outcome available separately from any later minimized reproduction; these define the final original-scenario check.

Phase 2: Build a Feedback Loop

Create a fast, deterministic pass/fail signal for the reported bug before ranking hypotheses or changing production code. The loop must reproduce the user's symptom, not a nearby failure.

Try these seams in order:

1. Failing test at the smallest public interface that reaches the complete bug pattern, including interactions between callers when relevant. 2. CLI or script invocation with fixture input and asserted output. 3. Curl or HTTP request against a local server with asserted response, logs, or state. 4. Browser automation for UI bugs with DOM, console, and network assertions. 5. Replayed trace, event payload, HAR, or log fixture through the real code path. 6. Throwaway harness that boots the minimal subsystem needed to trigger the path. 7. Property, fuzz, or stress loop for intermittent failures. 8. `git bisect run` harness when the bug appeared between known good and bad revisions.

Improve the loop before moving on:

  • Make it faster by narrowing setup and caching expensive fixtures.
  • Make it sharper by asserting the exact symptom.
  • Make it more deterministic by pinning time, seeds, filesystem paths, and network access.
  • For intermittent bugs, raise reproduction rate with repeated runs, concurrency, stress, or

timing probes until the failure is frequent en

Read more
@mathews-tom
Ships witharmory

Curated, production-grade skills, agents, hooks, rules, commands, utilities, and presets for AI coding agents. No magic, no demos — battle-tested workflows built for developers who use AI seriously.

33998 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
339
Star history of Mathews-Tom/armory on GitHub, a chart by star-history.com

Other skills on armory.

doc-condenser

doc-condenser

**DEPRECATED** — Modern Claude models condense and summarize technical documentation natively with comparable quality. The output…

@mathews-tom@mathews-tomInstall Skill
opus-4-7-migration

opus-4-7-migration

DEPRECATED: The Opus 4.7 migration scanner is retired from the active skill catalog. Retained for archival reference only; not…

@mathews-tom@mathews-tomInstall Skill
regex-builder

regex-builder

**DEPRECATED** — Modern Claude models produce accurate, well-explained regex patterns with edge-case test suites natively,…

@mathews-tom@mathews-tomInstall Skill
sequential-thinking

sequential-thinking

**DEPRECATED** — Opus 4.7 uses adaptive thinking (optional at each step) and Sonnet 4.6 handles structured chain-of-thought…

@mathews-tom@mathews-tomInstall Skill
adr-writer

adr-writer

Generates Architecture Decision Records capturing context, rationale, alternatives, and consequences in numbered status-tracked…

@mathews-tom@mathews-tomInstall Skill
agent-builder

agent-builder

Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK,…

@mathews-tom@mathews-tomInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about debug-investigator.

Which coding agents can use debug-investigator?
debug-investigator 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.