diagnosing-bugs

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

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/mikalv/pi-extensions --skill diagnosing-bugs-mikalv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnosing-bugs
Source: https://github.com/mikalv/pi-extensions/tree/main/packages/pi-atelier/.agents/skills/diagnosing-bugs
Command: npx skills add https://github.com/mikalv/pi-extensions --skill diagnosing-bugs-mikalv

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, replayed traces, fuzz loops, or bisection harnesses. - Structured Six-Phase Process: Guides reproduction and minimization, ranked falsifiable hypothesis generation, one-variable-at-a-time instrumentation, regression-test-first fixing, and cleanup with post-mortem. - Non-Deterministic Bug Handling: Raises reproduction rates for flaky bugs via looping, parallelization, and stress until they become debuggable. - Use Case: A user reports an intermittent export failure in production. The Skill drives creation of a replay harness from a captured request, minimizes the failing scenario, tests ranked hypotheses with tagged debug logs, and lands a fix with a regression test. ## Quick Start Ask the agent to diagnose the bug you are experiencing and describe the exact symptom, error message, or slowdown you observed.

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 rate is debuggable; keep increasing the rate until the failure is reliable enough to instrument.

How to reproduce a bug before fixing it?▼

Build a feedback loop first: a failing test, curl script, CLI invocation, headless browser script, or replayed trace that goes red on the exact symptom. Then minimize by removing inputs and steps one at a time until every remaining element is load-bearing for the failure.

What is a bisection harness for debugging?▼

A bisection harness automates booting the system at a given state and checking for the bug, so you can run git bisect run against it. It is used when a bug appeared between two known commits, versions, or datasets.

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 finding as an architectural issue rather than writing a shallow test.

Why does logging everything not help debug performance regressions?▼

For performance regressions, logs are usually the wrong tool. Instead establish a baseline measurement with a timing harness, profiler, or query plan, then bisect the regression. Measure first, fix second.

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

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