diagnosing-bugs

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

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/sanjanb/my-agent-harness --skill diagnosing-bugs-sanjanb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/sanjanb/my-agent-harness/tree/main/skills/mp-diagnosing-bugs
Command: npx skills add https://github.com/sanjanb/my-agent-harness --skill diagnosing-bugs-sanjanb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and performance regressions resist casual debugging: staring at code rarely finds the cause. This Skill enforces a disciplined six-phase diagnosis loop that builds a tight, deterministic pass/fail signal first, then reproduces, minimizes, hypothesizes, instruments, fixes, and cleans up. ## Core Features & Use Cases - Feedback Loop Construction: Ten ranked strategies for building a red-capable reproduction command, from failing tests and curl scripts to Playwright traces, fuzz loops, and git bisect harnesses. - Structured Hypothesis Testing: Generates 3-5 ranked, falsifiable hypotheses before testing, then instruments with tagged debug logs and one-variable-at-a-time probes. - Regression Test Discipline: Writes the regression test before the fix at a correct seam, and flags architectural problems when no valid seam exists. - Use Case: A user reports that an export endpoint intermittently returns corrupted data. The Skill guides building a deterministic replay loop from a captured request, minimizing the failing scenario, ranking hypotheses, and landing a fix with a regression test. ## Quick Start Use the diagnosing-bugs skill to diagnose why the checkout endpoint intermittently returns a 500 error in production.

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?

For non-deterministic bugs, 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 50% flake rate is debuggable; keep increasing the rate until the failure is observable.

How to reproduce a bug before fixing it?

Build a tight feedback loop first: a failing test, curl script, CLI invocation, headless browser script, or replayed trace that goes red on the exact symptom. Then minimize the scenario by removing inputs and steps one at a time until every remaining element is load-bearing.

What is the best way to debug performance regressions?

For performance regressions, avoid log-based debugging. Establish a baseline measurement with a timing harness, performance.now(), a profiler, or a query plan, then bisect between known states. Measure first, fix second.

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, document that finding as an architectural issue rather than writing a shallow test.

What should I do if I cannot reproduce a bug at all?

Stop and say so explicitly, listing what you tried. Ask the user for environment access, a captured artifact such as a HAR file, log dump, or screen recording, or permission to add temporary production instrumentation. Do not hypothesize without a feedback loop.