diagnosing-bugs

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

2|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/nseng-ai/ns --skill diagnosing-bugs-nseng-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/nseng-ai/ns/tree/main/.agents/skills/diagnosing-bugs
Command: npx skills add https://github.com/nseng-ai/ns --skill diagnosing-bugs-nseng-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and flaky failures resist casual code reading and single-hypothesis guessing. This Skill enforces a disciplined diagnosis loop that builds a tight, deterministic reproduction signal before any hypothesis is tested, preventing wasted effort on wrong fixes. ## Core Features & Use Cases - Feedback Loop Construction: Builds a red-capable, deterministic, fast reproduction command using failing tests, curl scripts, headless browsers, trace replay, fuzz loops, or bisection harnesses. - Structured Hypothesis Testing: Generates 3-5 ranked falsifiable hypotheses, then instruments code with tagged debug logs or profilers, changing one variable at a time. - Regression Lockdown: Writes a failing regression test at a correct seam before the fix, verifies the original repro, and runs cleanup plus a post-mortem. - Use Case: A user reports an intermittent export failure. The skill drives creation of a loop that reproduces it at high rate, minimises the scenario, isolates the cause via targeted instrumentation, and lands a fix guarded by a regression test. ## Quick Start Ask the agent to diagnose the bug where the export button 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 seeking 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 a tight feedback loop first: a failing test, curl script, CLI invocation, or headless browser script that asserts the user's exact symptom. The loop must be deterministic, fast, and runnable unattended before any hypothesis is tested.

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 captured artifact like a HAR file or log dump, or permission to add temporary production instrumentation.

How do I debug a performance regression?

For performance regressions, skip log-based probing and measure first: establish a baseline with a timing harness, profiler, or query plan, then bisect between known-good and known-bad states. Measure first, fix second.

When should a regression test be written during debugging?

Write the regression test before the fix, but only if a correct seam exists where the test exercises the real bug pattern as it occurs at the call site. If no correct seam exists, document that architectural gap as a finding itself.

Why does single-hypothesis debugging fail on hard bugs?

Single-hypothesis generation anchors on the first plausible idea and wastes effort. Generate 3-5 ranked, falsifiable hypotheses with explicit predictions, show them to the user for re-ranking, then test one variable at a time.