/armory:debug-investigatorfrom armory
Structured, hypothesis-driven debugging methodology for non-obvious bugs, intermittent failures, and regressions. Replaces ad-hoc exploration with systematic bisection, evidence analysis, and minimal reproduction.
Ships in armory. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
| 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 |
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.
Before deep investigation, check for repo-local agent context:
docs/agents/domain.md for CONTEXT.md, CONTEXT-MAP.md, and ADR lookup rulesCONTEXT.md or relevant context-local glossary for domain vocabularydocs/adr/ and context-local ADRs for decisions near the failing areaUse 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.
Before touching code, document the observable problem:
KeyError('user_id') on line 42 of auth.py when calling
get_current_user() with a valid session token" is actionable.git log --oneline -20.
If the bug appeared after a specific commit, bisection is the fastest path.Keep the original input, setup, caller sequence, and expected outcome available separately from any later minimized reproduction; these define the final original-scenario check.
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:
git bisect run harness when the bug appeared between known good and bad revisions.Improve the loop before moving on:
If no credible loop can be built, stop and state what was tried. Request the missing artifact: environment access, captured payloads, logs, screen recording with timestamps, or permission for temporary instrumentation. Do not proceed to speculative fixes.
Examine all available evidence before forming hypotheses:
Stacktrace interpretation — If a traceback exists, read it bottom-up. The last frame is where the error manifested, but the cause is often several frames up. Identify:
references/stacktrace-patterns.md)Log pattern extraction — Search logs for:
State inspection — If the system is running, inspect:
Code diff analysis — If the bug is recent:
git diff HEAD~5 — what changed?Generate ranked hypotheses — never start fixing without a hypothesis:
List 3-5 hypotheses ranked by likelihood. Each hypothesis must include:
Rank by likelihood using:
Common bug categories (see references/hypothesis-templates.md):
Design specific steps to test each hypothesis:
git bisect start <bad> <good>references/bisection-guide.md for workflowreferences/instrumentation-points.mdExecute the investigation plan, updating hypotheses as evidence arrives:
Once evidence identifies the cause, select the regression boundary before the fix:
Conditional forced-red check: A natural pre-fix red needs no mutation. If intentionally reintroducing a defect or mutating a fixture to assess test sensitivity, preserve a pristine pre-mutation copy of the actual current source/fixture (including unrelated edits). Compare the mutated content against that copy before interpreting any test outcome, and identify the intended changed lines and exercised path. A no-op replacement, changed unused file, or unrelated difference is invalid mutation evidence, even when a test passes or fails. Repair the mutation and establish the comparison before retrying, or report sensitivity unproven. A valid mutation must fail on the defect-specific assertion, not a syntax/setup error. Restore the exact pre-mutation content afterward, including after interruption or failure; compare against the preserved copy and rerun the restored test. Report any restoration or execution block explicitly. Mutation supplements, rather than substitutes for, natural pre-fix red/green evidence; do not require it for every fix.
Before declaring the bug resolved:
## Debug Investigation: {Brief Description}
### Symptom
**Observed:** {What is happening — precise description}
**Expected:** {What should happen}
**Reproducibility:** {Always | Intermittent (~N% of attempts) | Once}
**First noticed:** {Date/time or triggering event}
**Environment:** {Relevant versions and configuration}
### Evidence Analysis
#### Stacktrace
- **Exception:** {type}: {message}
- **Origin:** {file}:{line} in {function}
- **Call chain:** {caller} → {caller} → {failure point}
- **Key insight:** {What the traceback reveals about the cause}
#### Logs
- **Anomaly:** {What is unusual}
- **Timeline:** {When the anomaly started}
- **Correlation:** {Related events}
#### Code Changes
- **Recent commits:** {relevant commits since last known-good state}
- **Files in error path:** {which changed files appear in the traceback}
### Hypotheses
| # | Hypothesis | Likelihood | Confirming Test | Refuting Test |
|---|------------|------------|-----------------|---------------|
| H1 | {Specific claim} | High | {What to check} | {What would disprove} |
| H2 | {Specific claim} | Medium | {What to check} | {What would disprove} |
| H3 | {Specific claim} | Low | {What to check} | {What would disprove} |
### Investigation Plan
#### Step 1: Test H1 — {action}
- **Command/action:** {specific step}
- **If confirmed:** {next action — fix}
- **If refuted:** proceed to Step 2
#### Step 2: Bisection
- **Good commit:** {hash}
- **Bad commit:** {hash}
- **Test:** {command to verify each commit}
- **Command:** `git bisect start {bad} {good}`
#### Step 3: Isolation
- **Remove:** {variable to eliminate}
- **Expected change:** {what should happen}
### Instrumentation Points
1. {file}:{line} — log {variable/state} to observe {what}
2. {file}:{line} — breakpoint to inspect {what}
### Minimal Reproduction
```{language}
# Minimal code that triggers the bug
{code}
```
### Resolution
**Root cause:** {What was wrong}
**Fix:** {What was changed — file:line, diff summary}
**Regression boundary:** {Callers, shared state, trigger sequence, and why this seam reaches them; or attempted seams and explicit limitation}
**Red / green:** {Observed defect-specific pre-fix failure and post-fix result; or blocked/unobserved}
**Forced mutation, if used:** {Pristine comparison, exercised change, assertion outcome, restoration comparison and restored result}
**Original scenario:** {Unminimized invocation, expected/actual outcome on final source; or missing prerequisite}
**Cleanup:** {Temporary instrumentation/harness removal and final-source rerun results}
**Prevention:** {Permanent regression coverage or documented no-seam limit}
**Lessons:** {What generalizes beyond this bug}
| Mode | Scope | Depth | When to Use |
|---|---|---|---|
quick | Single error | H1 test + fix | Clear stacktrace, obvious cause |
standard | Full investigation | 3 hypotheses + bisection plan | Default for non-obvious bugs |
deep | Systemic analysis | 5+ hypotheses + instrumentation + reproduction | Intermittent bugs, no stacktrace, production issues |
| Problem | Resolution |
|---|---|
| No stacktrace available | Focus on log analysis and state inspection. Use instrumentation to generate diagnostic output. |
| Bug is intermittent | Add persistent logging at key decision points. Run under stress (high load, concurrent requests) to increase reproduction rate. |
| Cannot reproduce locally | Compare environments systematically: versions, config, data, timing. Use docker or VM to mirror production. |
| Multiple hypotheses equally likely | Design a single test that distinguishes between them. Binary decision: "If X, then H1; if Y, then H2." |
| Fix attempted but bug persists | The hypothesis was wrong. Revert the fix, update hypothesis rankings, and proceed to the next hypothesis. Do not stack fixes. |
| Bug is in a dependency | Confirm with a minimal reproduction that uses only the dependency. Check issue trackers. Pin to last known-good version while awaiting upstream fix. |
Push back if:
CHANGELOG.md (opens in a new tab)LICENSE (opens in a new tab)evals/cases.yaml (opens in a new tab)references/bisection-guide.md (opens in a new tab)references/hypothesis-templates.md (opens in a new tab)references/instrumentation-points.md (opens in a new tab)references/log-analysis.md (opens in a new tab)references/stacktrace-patterns.md (opens in a new tab)references/upstream/provenance.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mathews-tom/armory --plugin armory94 skills in this plugin
/adr-writerGenerates Architecture Decision Records capturing context, rationale, alternatives, and consequences in numbered status-tracked format. Triggers on: "write an ADR", "document this decision", "architecture decision record", "decision record", "design decision", "ADR for"./agent-builderBuild AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK, claude -p, SDK MCP servers, hooks, sessions. Triggers on: "build an agent", "agent SDK", "headless mode", "automate Claude", "programmatic agent"./animateCreate Manim (Python) animated explainers: algorithm step-throughs, math and equation walkthroughs, pipeline and data-flow diagrams, comparisons and timelines, rendered to MP4, WebM or GIF with optional audio overlay. Includes a template path that renders validated config data with no model call, plus output checks (ffprobe duration, fps, dimensions, full decode, sampled-frame review receipt). Use when asked to "create a video", "animate this", "make an explainer", "manim animation", "animate this algorithm", or "motion graphic". NOT for HTML/CSS/GSAP or Hyperframes video, NOT for React or Remotion video, and NOT for a launch or promo video of the user's own project, use launch-video.Other plugins' skills for the same job