accountable-engineerin…
Use explicit human checkpoints for architecture, security, rollout, or operational decisions.
Build a tight, red-capable feedback loop before diagnosing failures, then minimize, test ranked hypotheses, and lock the fix with a regression test.
$ npx -y skills add jellydn/my-ai-tools --skill diagnosing-bugs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/diagnosing-bugsContext preview
The summary Claude sees to decide when to auto-load this skill.
Build a tight, red-capable feedback loop before diagnosing failures, then minimize, test ranked hypotheses, and lock the fix with a regression test.
name: diagnosing-bugs description: "Build a tight, red-capable feedback loop before diagnosing failures, then minimize, test ranked hypotheses, and lock the fix with a regression test." license: MIT compatibility: cline, claude, opencode, amp, codex, gemini, cursor, pi hint: Use when a bug is failing, flaky, incorrect, slow, or difficult to reproduce user-invocable: true metadata: audience: all workflow: debugging source: mattpocock/skills@6fd947921b935b7e1e69293a200400f0fdd5c15f source_path: skills/engineering/diagnosing-bugs/SKILL.md
Use this workflow for bugs, flaky failures, and performance regressions. The central rule is simple: do not start with a theory. First build a feedback loop that can go red on the user's actual symptom.
Use when:
Do not claim a diagnosis from code inspection alone when the symptom has not been reproduced or captured.
Redact secrets from commands, logs, screenshots, traces, and environment output before showing or storing them. Read the relevant project instructions, glossary, ADRs, issue, and recent changes. Record the exact user-visible symptom, not a nearby error.
Prefer the smallest unattended command that exercises the real path and asserts the symptom:
1. A failing unit, integration, or end-to-end test at the correct public seam. 2. A curl or HTTP script against a running service. 3. A CLI fixture and expected-output comparison. 4. A browser script asserting DOM, console, or network behavior. 5. A replay of a captured request, event, or trace. 6. A minimal harness with real collaborators at the failing boundary. 7. A property or fuzz loop for input-dependent failures. 8. A bisection or differential loop when the regression has a known range.
Tighten the loop: cache setup, narrow assertions to the exact symptom, pin time and randomness, isolate the filesystem, and remove unnecessary network work. A slow or flaky loop is not a sufficient feedback loop until it is made deterministic or its reproduction rate is high enough to debug.
If no red-capable loop can be built, stop and report what was tried. Ask for a redacted trace, log, HAR, core dump, screen recording with timestamps, or access to the reproducing environment rather than guessing.
Run the loop and confirm it fails for the reported reason. For intermittent bugs, repeat or stress the trigger until its reproduction rate is useful. Minimize one input, caller, configuration, or step at a time; keep only elements that are load-bearing for the failure.
Completion condition: removing any remaining element makes the loop pass.
Write 3–5 ranked hypotheses. Each must predict an observable result:
> If `<cause>` is responsible, changing `<variable>` should make the symptom disappear or become worse.
Show the ranked list to the user before testing so they can supply domain evidence or identify hypotheses already ruled out. This is not an approval gate: proceed with the ranking while the user is unavailable.
Probe one prediction at a time. Prefer a debugger or REPL, then targeted logs at boundaries that distinguish hypotheses. Tag temporary logs with a unique prefix such as `[DEBUG-1234]` so cleanup is mechanical. For performance issues, measure a baseline and use a profiler or timing harness instead of logging everything.
When a correct seam exists:
1. Convert the minimized reproduction into a test at the highest interface that exposes the real bug. 2. Run it and observe the expected failure. 3. Apply the smallest fix. 4. Run the test and the original, unminimized loop again.
Do not add a shallow test that cannot reproduce the call chain or interaction that caused the bug. If no correct seam exists, document that architectural gap and make it a follow-up improvement rather than claiming strong regression coverage.
Before declaring the bug fixed:
Portable, source-controlled configuration for AI coding assistants. my-ai-tools installs one consistent set of agent guidelines, skills, commands, hooks, MCP servers, and tool settings across supported AI coding assistants.
Use explicit human checkpoints for architecture, security, rollout, or operational decisions.
Record architecture decisions with ADRs — captures why, alternatives considered, and consequences
Use when monitoring an open GitHub PR for CI failures, review feedback, mergeability, and safe retries or fixes.
Inspect history and architecture for hidden constraints before risky cross-cutting changes.
Build an interactive report or experiment when the user asks to explore model capabilities.
Audit a diff for structural maintainability and unnecessary complexity.