diagnose

Diagnose bugs and performance regressions through a structured reproduce-hypothesise-fix workflow.

Updated May 23, 2026
One-click install
npx skills add https://github.com/Oatse/CWE-Automation --skill diagnose-oatse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnose
Source: https://github.com/Oatse/CWE-Automation/tree/main/.agents/skills/diagnose
Command: npx skills add https://github.com/Oatse/CWE-Automation --skill diagnose-oatse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and performance regressions stall when developers guess at causes without a reliable reproduction. This Skill enforces a disciplined loop — build a feedback signal, reproduce, hypothesise, instrument, fix, regression-test — so root causes are found systematically instead of by staring at code. ## Core Features & Use Cases - Feedback loop construction: Ten ranked strategies for building a deterministic pass/fail signal, from failing tests and curl scripts to headless browser runs, trace replay, fuzz loops, and git bisect harnesses. - Ranked hypothesis testing: Generates 3-5 falsifiable hypotheses with explicit predictions before testing, avoiding single-hypothesis anchoring. - Tagged instrumentation and cleanup: Every debug log gets a unique [DEBUG-xxxx] prefix so cleanup is a single grep, plus a post-mortem checklist covering regression tests and architectural findings. - Use Case: A user reports "the export button throws intermittently." The Skill builds a loop that raises the reproduction rate, bisects the cause, writes a regression test at the correct seam, and verifies the fix against the original scenario. ## Quick Start Ask the agent to diagnose the bug where the export button intermittently throws an error and have it build a reproduction loop first.

Frequently Asked Questions about diagnose

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug an intermittent or flaky bug?

Raise the reproduction rate instead of chasing a clean repro: loop the trigger 100 times, parallelise, add stress, narrow timing windows, or inject sleeps. A 50%-flake bug is debuggable; keep increasing the rate until your feedback loop fires reliably.

How to reproduce a bug before fixing it?

Build a fast, deterministic pass/fail signal first: a failing test, a curl script against a dev server, a CLI invocation with fixture input, or a headless browser script. Confirm the loop reproduces the exact symptom the user described before hypothesising causes.

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

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

How do I debug a performance regression?

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

When should I write a regression test for a bug fix?

Write the regression test before the fix, but only at a correct seam that exercises the real bug pattern as it occurs at the call site. If no correct seam exists, document that as an architectural finding rather than writing a shallow test.