diagnosing-bugs

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

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill diagnosing-bugs-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/rockcookies/skills/tree/main/skills/mattpocock/diagnosing-bugs
Command: npx skills add https://github.com/rockcookies/skills --skill diagnosing-bugs-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and performance regressions resist casual code reading; without a reproducible signal, debugging devolves into guessing. This Skill enforces a disciplined diagnosis loop that builds a tight pass/fail feedback signal first, then reproduces, minimizes, hypothesizes, instruments, fixes, and cleans up. ## Core Features & Use Cases - Feedback loop construction: Builds a red-capable, deterministic, fast command (failing test, curl script, headless browser, replayed trace, fuzz loop, or bisection harness) that catches the exact reported symptom. - Structured hypothesis testing: Generates 3-5 ranked falsifiable hypotheses, then instruments with tagged debug logs or profilers, changing one variable at a time. - Regression test and post-mortem: Writes the regression test before the fix at a correct seam, removes all debug instrumentation, and records the confirmed root cause in the commit message. - Use Case: A user reports that the export endpoint intermittently returns empty files in production. The Skill guides building a replay loop from a captured request, minimizing the repro, testing ranked hypotheses, and landing a fix with 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 reproducible feedback 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 intermittently?▼

Raise the reproduction rate instead of chasing a clean repro: loop the trigger 100 times, parallelize, add stress, narrow timing windows, or inject sleeps. A bug reproducible 50% of the time is debuggable; at 1% it is not, so keep increasing the rate before hypothesizing.

How do I diagnose a performance regression in my code?▼

Establish a baseline measurement first using a timing harness, performance.now(), a profiler, or a query plan, then bisect between known states. Measure first and fix second; scattered log statements are usually the wrong tool for performance work.

What is a feedback loop in debugging and why build one first?▼

A feedback loop is a single command, such as a failing test, curl script, or headless browser run, that goes red on the specific bug and green once fixed. Building it first matters because bisection, hypothesis testing, and instrumentation all consume that signal; without it, code reading rarely finds the cause.

When should I write a regression test for a bug fix?▼

Write the regression test before the fix, but only at a correct seam where the test exercises the real bug pattern as it occurs at the call site. If no correct seam exists, that absence is itself a finding about the codebase architecture and should be flagged.

What should I do when I cannot reproduce a bug at all?▼

Stop and say so explicitly rather than guessing. List what you tried, then 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.