diagnosing-bugs

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

6|2|Updated May 6, 2026
One-click install
npx skills add https://github.com/sek788432/Stock-Back-Test-System --skill diagnosing-bugs-sek788432
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/sek788432/Stock-Back-Test-System/tree/main/.agents/skills/diagnosing-bugs
Command: npx skills add https://github.com/sek788432/Stock-Back-Test-System --skill diagnosing-bugs-sek788432

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hard bugs and performance regressions resist casual code reading; without a tight, deterministic pass/fail signal, debugging devolves into guessing. This Skill enforces a disciplined six-phase diagnosis loop so the root cause is found, fixed, and protected by a regression test. ## Core Features & Use Cases - Feedback-loop construction: Builds a tight, red-capable, deterministic, fast signal via failing tests, focused CTest/Qt tests, replayed traces, throwaway harnesses, fuzz loops, git bisect in isolated worktrees, or differential runs. - Structured hypothesis testing: Generates 3-5 ranked falsifiable hypotheses, then instruments with tagged debug logs or debugger breakpoints, changing one variable at a time. - Fix with regression protection: Writes the regression test before the fix at a seam exercising the real bug pattern, then cleans up instrumentation and records the confirmed hypothesis. - Use Case: A C++ Qt application intermittently produces wrong indicator values. Use this Skill to build a fixed-seed property loop that reproduces the failure at high rate, minimize the repro, test ranked hypotheses, and land a fix guarded by a regression test. ## Quick Start Ask the agent to diagnose the reported bug or performance regression and follow the phased feedback-loop workflow until a regression-tested fix is in place.

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?▼

Non-deterministic bugs need a higher reproduction rate, not a clean repro. Loop the trigger 100 times, parallelize, add stress, narrow timing windows, or inject sleeps until the failure rate is high enough to debug against.

How to diagnose a performance regression in C++ code?▼

Establish a baseline with the repository's benchmark, or build a repeatable harness using std::chrono::steady_clock. Use a profiler when available, and bisect through an isolated git worktree rather than adding logs.

What should I do before forming a hypothesis about a bug?▼

Build a tight feedback loop first: one red-capable, deterministic, fast command that asserts the user's exact symptom and that you have already run. Reading code to build a theory before this loop exists is the failure mode this workflow prevents.

Can git bisect be used safely with uncommitted changes?▼

Yes, by creating an isolated worktree so the active checkout and user changes are preserved. Verify the historical command before running git bisect run, and finish with git bisect reset before removing the worktree.

When should a regression test be written during a bug fix?▼

Write the regression test before the fix, at a seam that exercises the real bug pattern as it occurs at the call site. Watch it fail, apply the fix, watch it pass, then re-run the original un-minimized scenario.

What if no automated reproduction of the bug is possible?▼

Stop and say so explicitly, listing what was tried. Ask the user for environment access, a captured log or core dump, an input fixture, or permission to add temporary instrumentation rather than hypothesizing without a loop.