diagnose

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

Updated May 28, 2026
One-click install
npx skills add https://github.com/changfengpro/agent-skills --skill diagnose-changfengpro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diagnose
Source: https://github.com/changfengpro/agent-skills/tree/main/skills/diagnose
Command: npx skills add https://github.com/changfengpro/agent-skills --skill diagnose-changfengpro

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Hard bugs and performance regressions stall when developers stare at code without a reproducible signal. This Skill enforces a disciplined diagnosis loop — build a feedback loop, reproduce, hypothesise, instrument, fix, and regression-test — so root causes are found systematically instead of by guesswork. ## Core Features & Use Cases - Feedback loop construction: Builds a fast, deterministic pass/fail signal using failing tests, curl scripts, CLI fixtures, headless browsers, trace replay, fuzz loops, or git bisect harnesses. - Ranked hypothesis testing: Generates 3-5 falsifiable hypotheses with explicit predictions, then instruments one variable at a time with tagged debug logs for clean removal. - Regression locking and post-mortem: Writes the regression test before the fix at a correct seam, verifies the original repro is gone, and documents the confirmed root cause. - Use Case: A user reports that the export endpoint intermittently returns empty files. The Skill builds a loop replaying the failing request 100 times, ranks hypotheses, instruments the boundary, fixes the race condition, and locks it with a regression test. ## Quick Start Ask the agent to diagnose the bug where the export endpoint intermittently returns empty files and follow the structured diagnosis loop.

Frequently Asked Questions about diagnose

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

FAQPage Schema
How do I debug a bug that cannot be reproduced consistently?

Non-deterministic bugs are handled by raising the reproduction rate rather than seeking a clean repro. Loop the trigger 100 times, parallelise, 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 code?

Performance regressions use a measurement-first branch instead of logs. Establish a baseline with a timing harness, performance.now(), a profiler, or query plans, then bisect between states to isolate the cause before fixing.

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.

Why write the regression test before the fix?

Writing the test first confirms it actually captures the bug by watching it fail, then pass after the fix. If no correct test seam exists, that absence is itself a finding about the codebase architecture.

When should this diagnosis workflow not be used?

Phases can only be skipped with explicit justification, and hypothesising must never begin without a working feedback loop. Simple obvious bugs with an immediate fix do not need the full six-phase process.