<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AI Debugging on Top AI Skills</title><link>https://topaiskills.com/tags/ai-debugging/</link><description>Recent content in AI Debugging on Top AI Skills</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 22 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://topaiskills.com/tags/ai-debugging/index.xml" rel="self" type="application/rss+xml"/><item><title>Diagnosing Bugs Skill FAQ: The Feedback Loop Comes First</title><link>https://topaiskills.com/tutorials/guides/diagnosing-bugs-skill-faq/</link><pubDate>Sat, 22 Aug 2026 00:00:00 +0000</pubDate><guid>https://topaiskills.com/tutorials/guides/diagnosing-bugs-skill-faq/</guid><description>&lt;script type="application/ld+json"&gt;{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"It runs a six-phase discipline for hard bugs and performance regressions: redact secrets, build a feedback loop, reproduce and minimise, rank hypotheses, instrument, then fix with a regression test and clean up. The skill triggers whenever you say 'diagnose' or 'debug this', or report something broken, throwing, failing, or slow. Phases can be skipped only with explicit justification — the whole point is stopping the agent from guessing."},"name":"What does the diagnosing-bugs skill actually do?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"Because that phase is the skill — everything else is mechanical. A tight pass/fail signal that goes red on the actual bug makes the cause findable through bisection, hypothesis-testing, and instrumentation. Without that signal, no amount of staring at code saves you. The SKILL.md is blunt: if you catch yourself reading code to build a theory before a red-capable command exists, stop — jumping straight to a hypothesis is the exact failure this skill prevents."},"name":"Why does it demand a feedback loop before any hypothesis?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"One command you have already run at least once — a test invocation, script path, or curl — that drives the real bug code path and asserts the user's exact symptom, so it can go red on this bug and green once fixed. It must be deterministic (same verdict every run), fast (seconds, not minutes), and agent-runnable without a human. A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is a debugging superpower."},"name":"What counts as a tight, red-capable loop?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"You don't chase a clean repro — you raise the reproduction rate. Loop the trigger a hundred times, parallelise, add stress, narrow timing windows, inject sleeps. The skill's rule of thumb: a 50%-flake bug is debuggable, a 1% bug is not. Keep raising the rate until the bug is debuggable, then proceed."},"name":"How do you handle flaky, non-deterministic bugs?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"The agent stops and says so explicitly, listing what it tried, then asks for one of three things: access to the environment that reproduces it, a redacted captured artifact (HAR file, log dump, core dump, timestamped screen recording), or permission to add temporary production instrumentation. The rule is absolute: without a loop, no hypothesising."},"name":"What happens when a loop genuinely can't be built?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"The skill generates 3–5 falsifiable hypotheses before testing any of them, because single-hypothesis generation anchors on the first plausible idea. Each must state a prediction — if X is the cause, changing Y makes the bug disappear or worse. Showing the ranked list before testing costs little and saves hours, since users often re-rank instantly with domain knowledge like 'we just deployed a change to number three'."},"name":"Why show the ranked hypotheses to the user?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"Change one variable at a time, and prefer a debugger or REPL inspection over logs — one breakpoint beats ten log statements. Targeted logs go only at the boundaries that distinguish hypotheses, never 'log everything and grep'. Every debug log gets a unique prefix like [DEBUG-a4f2], so cleanup at the end is a single grep. For performance regressions, logs are usually wrong: establish a baseline measurement first, then bisect."},"name":"How does the skill keep instrumentation honest?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"Before the fix, but only if a correct seam exists — one where the test exercises the real bug pattern as it occurs at the call site. If the only available seam is too shallow, a regression test there gives false confidence. Crucially, if no correct seam exists, that itself is the finding: the codebase architecture is preventing the bug from being locked down, and that gets flagged."},"name":"When should the regression test actually be written?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"Six things: the original repro no longer reproduces (re-run the Phase 1 loop), the regression test passes, all [DEBUG-...] instrumentation is removed by grepping its prefix, throwaway prototypes are deleted or moved to a marked location, and the hypothesis that turned out correct is stated in the commit or PR message so the next debugger learns from it."},"name":"What does the completion checklist look like?"},{"@type":"Question","acceptedAnswer":{"@type":"Answer","text":"The skill has the agent show commands, outputs, and captured artifacts, so secrets get redacted first — written as \u003cREDACTED\u003e — and loops are built against environment variables so credentials stay in the environment, not the transcript. Captured artifacts carry auth headers, so only the lines carrying the signal get quoted. If redacted output isn't enough to diagnose, the agent says so and asks for more."},"name":"Why the redaction step at the very start?"}]}&lt;/script&gt;
&lt;div class="space-y-6 mt-8"&gt;
 &lt;h2 class="text-xl font-bold text-foreground mb-6"&gt;Frequently Asked Questions&lt;/h2&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;What does the diagnosing-bugs skill actually do?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 It runs a six-phase discipline for hard bugs and performance regressions: redact secrets, build a feedback loop, reproduce and minimise, rank hypotheses, instrument, then fix with a regression test and clean up. The skill triggers whenever you say &amp;lsquo;diagnose&amp;rsquo; or &amp;lsquo;debug this&amp;rsquo;, or report something broken, throwing, failing, or slow. Phases can be skipped only with explicit justification — the whole point is stopping the agent from guessing.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;Why does it demand a feedback loop before any hypothesis?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 Because that phase is the skill — everything else is mechanical. A tight pass/fail signal that goes red on the actual bug makes the cause findable through bisection, hypothesis-testing, and instrumentation. Without that signal, no amount of staring at code saves you. The SKILL.md is blunt: if you catch yourself reading code to build a theory before a red-capable command exists, stop — jumping straight to a hypothesis is the exact failure this skill prevents.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;What counts as a tight, red-capable loop?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 One command you have already run at least once — a test invocation, script path, or curl — that drives the real bug code path and asserts the user&amp;rsquo;s exact symptom, so it can go red on this bug and green once fixed. It must be deterministic (same verdict every run), fast (seconds, not minutes), and agent-runnable without a human. A 30-second flaky loop is barely better than no loop; a 2-second deterministic one is a debugging superpower.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;How do you handle flaky, non-deterministic bugs?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 You don&amp;rsquo;t chase a clean repro — you raise the reproduction rate. Loop the trigger a hundred times, parallelise, add stress, narrow timing windows, inject sleeps. The skill&amp;rsquo;s rule of thumb: a 50%-flake bug is debuggable, a 1% bug is not. Keep raising the rate until the bug is debuggable, then proceed.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;What happens when a loop genuinely can&amp;#39;t be built?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 The agent stops and says so explicitly, listing what it tried, then asks for one of three things: access to the environment that reproduces it, a redacted captured artifact (HAR file, log dump, core dump, timestamped screen recording), or permission to add temporary production instrumentation. The rule is absolute: without a loop, no hypothesising.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;Why show the ranked hypotheses to the user?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 The skill generates 3–5 falsifiable hypotheses before testing any of them, because single-hypothesis generation anchors on the first plausible idea. Each must state a prediction — if X is the cause, changing Y makes the bug disappear or worse. Showing the ranked list before testing costs little and saves hours, since users often re-rank instantly with domain knowledge like &amp;lsquo;we just deployed a change to number three&amp;rsquo;.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;How does the skill keep instrumentation honest?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 Change one variable at a time, and prefer a debugger or REPL inspection over logs — one breakpoint beats ten log statements. Targeted logs go only at the boundaries that distinguish hypotheses, never &amp;rsquo;log everything and grep&amp;rsquo;. Every debug log gets a unique prefix like [DEBUG-a4f2], so cleanup at the end is a single grep. For performance regressions, logs are usually wrong: establish a baseline measurement first, then bisect.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;When should the regression test actually be written?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 Before the fix, but only if a correct seam exists — one where the test exercises the real bug pattern as it occurs at the call site. If the only available seam is too shallow, a regression test there gives false confidence. Crucially, if no correct seam exists, that itself is the finding: the codebase architecture is preventing the bug from being locked down, and that gets flagged.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;What does the completion checklist look like?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 Six things: the original repro no longer reproduces (re-run the Phase 1 loop), the regression test passes, all [DEBUG-&amp;hellip;] instrumentation is removed by grepping its prefix, throwaway prototypes are deleted or moved to a marked location, and the hypothesis that turned out correct is stated in the commit or PR message so the next debugger learns from it.
 &lt;/div&gt;
 &lt;/details&gt;&lt;details class="group rounded-xl border border-border/40 bg-card/30 backdrop-blur-sm transition-all duration-200 hover:border-primary/30 hover:bg-card/40"&gt;
 &lt;summary class="flex cursor-pointer items-center justify-between gap-4 px-5 py-4 text-sm font-semibold text-foreground"&gt;
 &lt;span&gt;Why the redaction step at the very start?&lt;/span&gt;
 &lt;svg class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200 group-open:rotate-45" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"&gt;&lt;line x1="12" y1="5" x2="12" y2="19"&gt;&lt;/line&gt;&lt;line x1="5" y1="12" x2="19" y2="12"&gt;&lt;/line&gt;&lt;/svg&gt;
 &lt;/summary&gt;
 &lt;div class="px-5 pb-5 pt-0 text-sm leading-relaxed text-muted-foreground border-t border-border/30 mt-0 pt-4"&gt;
 The skill has the agent show commands, outputs, and captured artifacts, so secrets get redacted first — written as &lt;REDACTED&gt; — and loops are built against environment variables so credentials stay in the environment, not the transcript. Captured artifacts carry auth headers, so only the lines carrying the signal get quoted. If redacted output isn&amp;rsquo;t enough to diagnose, the agent says so and asks for more.
 &lt;/div&gt;
 &lt;/details&gt;&lt;/div&gt;
&lt;h2 id="why-a-diagnosing-bugs-faq-exists"&gt;Why a Diagnosing Bugs FAQ Exists&lt;/h2&gt;
&lt;p&gt;Matt Pocock&amp;rsquo;s diagnosing-bugs skill is the least visible member of the &lt;a href="https://github.com/mattpocock/skills" rel="nofollow" target="_blank"&gt;mattpocock/skills&lt;/a&gt; engineering family — it lives in the same folder as tdd, prototype, and code-review but rarely gets written about on its own. That&amp;rsquo;s a gap, because it&amp;rsquo;s the one skill in the family built for the moment everything else fails: a bug that survives your normal routine.&lt;/p&gt;</description></item></channel></rss>