diagnosing-bugs

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

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/ninthday/skills-base --skill diagnosing-bugs-ninthday
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/ninthday/skills-base/tree/main/skills/diagnosing-bugs
Command: npx skills add https://github.com/ninthday/skills-base --skill diagnosing-bugs-ninthday

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, red-capable feedback signal first, then reproduces, minimizes, hypothesizes, instruments, fixes, and cleans up. ## Core Features & Use Cases - Feedback Loop Construction: Builds a deterministic pass/fail signal via failing tests, curl scripts, CLI fixtures, headless browser scripts, trace replay, fuzz loops, bisection harnesses, or differential runs. - Structured Hypothesis Testing: Generates 3-5 ranked, falsifiable hypotheses and instruments one variable at a time with tagged debug logs for easy cleanup. - Regression Lockdown: Converts the minimized repro into a regression test at a correct seam, or flags missing seams as an architecture finding. - Use Case: A user reports an intermittent export failure. The Skill drives a headless browser loop to reproduce it at a high rate, narrows the cause through ranked hypotheses, and lands a fix with a regression test. ## Quick Start Ask the agent to diagnose the failing export button by building a reproduction loop and following the diagnosis phases.

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 seeking a clean repro: loop the trigger 100 times, parallelize, add stress, and narrow timing windows. A 50%-flake bug is debuggable, so keep increasing the rate until the feedback loop reliably goes red.

How to diagnose a performance regression in code?

Establish a baseline measurement first using a timing harness, performance.now(), a profiler, or a query plan, then bisect to find the regression. Logs are usually the wrong tool for performance work; measure first and fix second.

What should I do when I cannot reproduce a bug?

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

Why write a failing test before fixing a bug?

A failing regression test written before the fix proves the test actually catches the bug pattern at a correct seam. If no correct seam exists, that absence is itself a finding about the codebase architecture and should be flagged.

Can this debugging workflow handle bugs that need human interaction?

Yes, as a last resort it uses a human-in-the-loop bash script template that prompts the user through manual steps and captures their observations as structured output. The agent then parses the captured values to continue the diagnosis loop.