diagnose

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

3|Updated Jan 9, 2026
One-click install
npx skills add https://github.com/craft-ts/craft-ts --skill diagnose-craft-ts
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: diagnose
Source: https://github.com/craft-ts/craft-ts/tree/main/.agents/skills/diagnose
Command: npx skills add https://github.com/craft-ts/craft-ts --skill diagnose-craft-ts

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, and regression-test — so root causes are found systematically instead of by luck. ## Core Features & Use Cases - Feedback loop construction: Ten ranked strategies for building an agent-runnable pass/fail signal, from failing tests and curl scripts to headless browser runs, trace replay, fuzz loops, and git bisect harnesses. - Falsifiable hypothesis ranking: Generates 3-5 ranked hypotheses with explicit predictions before any testing, avoiding single-hypothesis anchoring. - Tagged instrumentation and cleanup: Every debug log gets a unique [DEBUG-...] prefix so cleanup is a single grep, and a post-mortem checklist captures the confirmed root cause. - Use Case: A user reports that an export button intermittently throws in production. The Skill guides building a high-rate reproduction loop, ranking hypotheses, instrumenting the failing boundary, writing a regression test at the correct seam, and verifying the fix against the original scenario. ## Quick Start Ask the agent to diagnose the bug where the export button intermittently throws an error in production.

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 non-deterministic 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 bug that fails 50% of the time is debuggable; one at 1% is not, so keep increasing the rate until hypotheses can be tested against it.

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 moving on to hypotheses.

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

Stop and say so explicitly rather than guessing. List what you tried, then ask for environment access, a captured artifact such as a HAR file or log dump, or permission to add temporary production instrumentation. Do not hypothesise without a feedback loop.

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 and fix second.

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

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