diagnosing-bugs

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

Updated May 9, 2024
One-click install
npx skills add https://github.com/AceCodePt/dotfiles --skill diagnosing-bugs-acecodept
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/AceCodePt/dotfiles/tree/main/.config/opencode/skills/diagnosing-bugs
Command: npx skills add https://github.com/AceCodePt/dotfiles --skill diagnosing-bugs-acecodept

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 six-phase diagnosis loop that builds a tight pass/fail feedback loop 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 repro, from failing tests and curl scripts to headless browser runs, trace replay, fuzz loops, and git bisect harnesses. - Structured hypothesis testing: Generates 3-5 ranked falsifiable hypotheses, then instruments with tagged debug logs or debugger breakpoints, changing one variable at a time. - Regression testing 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 an export endpoint intermittently returns stale data in production. The Skill guides building a replay harness from a captured request, minimizing the repro, ranking hypotheses, and landing a fix with a regression test. ## Quick Start Ask the agent to diagnose the bug where the export endpoint intermittently returns stale data and have it build a reproducible failing test 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 50%-flake bug is debuggable; keep increasing the rate until your 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 between known states. Logs are usually the wrong tool for perf work; measure first and fix second.

What should I do when I cannot reproduce a bug locally?▼

Stop and say so explicitly rather than hypothesizing without a loop. 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.

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 as an architectural finding instead of writing a shallow test.

Why does single-hypothesis debugging fail on hard bugs?▼

Anchoring on the first plausible idea wastes time when it is wrong. Generating 3-5 ranked falsifiable hypotheses with explicit predictions before testing any of them prevents anchoring and lets domain knowledge re-rank the list cheaply.