diagnosing-bugs

Diagnose hard-to-find bugs and performance regressions through a staged feedback-loop workflow.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/Suge8/skills --skill diagnosing-bugs-suge8
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/Suge8/skills/tree/main/development/diagnosing-bugs
Command: npx skills add https://github.com/Suge8/skills --skill diagnosing-bugs-suge8

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Debugging elusive bugs often devolves into guessing, random log-grepping, and unfounded hypotheses. This Skill enforces a disciplined six-phase diagnostic loop that starts by building a tight, deterministic pass/fail signal before any hypothesis is formed, so fixes are grounded in reproducible evidence. ## Core Features & Use Cases - Feedback Loop Construction: Ten ordered methods for building a red/green signal, from failing tests and curl scripts to headless browser automation, trace replay, fuzzing, git bisect fixtures, and differential runs. - Structured Diagnosis Phases: Reproduce and minimize, generate 3-5 ranked falsifiable hypotheses, instrument with tagged debug logs, fix with regression tests, and clean up with a postmortem. - Human-in-the-Loop Fallback: A bash template script guides users through manual reproduction steps when automation is impossible, capturing structured observations back to the agent. - Use Case: A user reports that the export button intermittently fails in production. The Skill builds a deterministic reproduction loop, minimizes the failing scenario, tests ranked hypotheses one variable at a time, and lands a fix with a regression test. ## Quick Start Use the diagnosing-bugs skill to diagnose why the checkout flow throws an intermittent error and build a failing test that reproduces it.

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 cannot be reproduced consistently?▼

Non-deterministic bugs are handled by raising the reproduction rate rather than seeking a clean repro: loop the trigger 100 times, run in parallel, add stress, narrow timing windows, or inject sleeps. A 50% reproduction rate is debuggable; 1% is not.

How to diagnose a performance regression in code?▼

Performance regressions use a dedicated branch of the workflow: establish baseline measurements first with timing fixtures, performance.now(), profilers, or query plans, then bisect. Logging is usually the wrong tool for performance issues; measure before fixing.

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

Stop and state it explicitly, listing the methods attempted. Request reproducible environment access, sanitized captures such as HAR files or log dumps, or permission to add temporary production instrumentation. Proposing hypotheses without a feedback loop is forbidden.

Why write a failing test before forming a bug hypothesis?▼

A tight pass/fail signal that goes red on the exact symptom is the foundation of the method; bisection, hypothesis testing, and instrumentation all consume that signal. Building hypotheses from reading code alone is the failure mode this discipline prevents.

Can debugging work when a human must perform the reproduction steps?▼

Yes, as a last resort the hitl-loop.template.sh script structures human-in-the-loop reproduction. The agent runs the script, the user follows prompted steps in their terminal, and captured observations are printed back as KEY=VALUE pairs for the agent to parse.

How are debug logs cleaned up after fixing a bug?▼

Every debug log line is tagged with a unique prefix like [DEBUG-a4f2] during instrumentation. Before completion, a single grep for that prefix confirms all instrumentation is removed, along with one-off prototypes, and the confirmed hypothesis is recorded in the commit message.