diagnosing-bugs

Diagnose hard bugs and performance regressions through a six-phase feedback-loop workflow.

Updated Aug 19, 2026
One-click install
npx skills add https://github.com/PVMalove/claude-agent-harness --skill diagnosing-bugs-pvmalove
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/PVMalove/claude-agent-harness/tree/main/skills/vendor/mattpocock/engineering/diagnosing-bugs
Command: npx skills add https://github.com/PVMalove/claude-agent-harness --skill diagnosing-bugs-pvmalove

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and flaky performance regressions resist casual code reading; without a tight, reproducible pass/fail signal, debugging devolves into guessing. This Skill enforces a disciplined diagnosis loop so the root cause is found and locked down with a regression test. ## Core Features & Use Cases - Feedback-loop construction: Builds a tight, deterministic, red-capable reproduction command using failing tests, curl scripts, headless browsers, replayed traces, fuzz loops, or git bisect harnesses. - Structured six-phase process: Reproduce and minimise, generate 3-5 ranked falsifiable hypotheses, instrument with tagged debug logs, fix with a regression test, then clean up and post-mortem. - Human-in-the-loop fallback: Ships a bash template (scripts/hitl-loop.template.sh) that drives a human through manual reproduction steps and captures observations for the agent. - Use Case: A user reports that the export endpoint intermittently returns empty files. The Skill builds a curl-based loop that reproduces the failure, minimises the scenario, tests ranked hypotheses one variable at a time, and lands a fix guarded by a regression test. ## Quick Start Ask the agent to diagnose the bug where the export button intermittently throws an error, and have it build a reproduction loop before proposing any fix.

Frequently Asked Questions about diagnosing-bugs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a bug that only happens sometimes?▼

For non-deterministic bugs, raise the reproduction rate instead of chasing a clean repro: loop the trigger 100 times, parallelise, add stress, and narrow timing windows. A 50%-flake bug is debuggable; keep increasing the rate until the feedback loop reliably goes red.

How to reproduce a bug before fixing it?▼

Build one tight command — a failing test, curl script, CLI invocation, or headless browser script — that drives the actual bug code path and asserts the user's exact symptom. It must be deterministic, fast, and runnable unattended before any hypothesis work begins.

What should I do when a bug cannot be reproduced locally?▼

Stop and say so explicitly rather than guessing. Ask the user for environment access, a redacted captured artifact such as a HAR file or log dump, or permission to add temporary production instrumentation.

Can I debug a bug that requires manual UI interaction?▼

Yes, as a last resort use the human-in-the-loop bash template, which prompts a person through reproduction steps and captures their observations as structured output the agent can parse. Prefer automated loops like Playwright scripts first.

Why write the regression test before the fix?▼

Writing the test first confirms it actually catches the bug by watching it fail, then pass after the fix. If no correct test seam exists, that absence is itself a finding about the codebase architecture worth flagging.