/tslateman-skills:diagnose [the failing command, test, or symptom]from tslateman-skills
Find the cause of a failure by experiment rather than by guessing, applying Agans' nine indispensable rules and Zeller's scientific method for debugging. Use when something is broken and you do not know why — a red test, a wrong value, a flaky suite, a production incident, "why does this happen", "debug this", "it only fails in CI", "it works on my machine". Do NOT use to repair a bug whose cause you already know (that is test-first), to decide what telemetry to add (that is observe), or to check whether a finished change is safe (that is blast-radius).
Ships in tslateman-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A bug is a gap between what you believe the code does and what it does, and the belief is invisible. That is why the cheapest move is also the worst: change something, rerun, watch the symptom go, never learn which belief was false. The cause stays under a green build, and the next report comes from a user.
observe.blast-radius.doubt.test-first.An intermittent bug you cannot reproduce is not yet a bug you can fix. The first
artifact is a script that exits nonzero on the failure and zero otherwise —
./repro.sh, no human in the loop, because every later step runs it many times.
When it fails one run in fifty, do not chase it. Raise the rate by naming the variable you are not controlling and pinning it:
| Suspect | Move that raises the rate |
|---|---|
| Test order, state | pytest -p randomly --randomly-seed=1234, then reuse the seed |
| Concurrency | go test -race, shrink the pool, run it under load |
| Time and locale | Freeze the clock; run under TZ=Pacific/Kiritimati |
| Resource state | Cold cache, empty table, full disk, first request after boot |
Then count: for i in $(seq 200); do ./repro.sh || echo FAIL; done | wc -l.
Done when you can state the rate — 1 in 1, or 7 in 200 — and watch it move.
Write what you believe and what observation would kill it, then go look. Zeller's loop in Why Programs Fail is the scientific one: hypothesis, prediction, experiment, observation, refine.
SYMPTOM: GET /orders returns 500, 7 in 200 requests
BELIEF: the pool hands back a connection still inside a transaction
KILLED BY: a failure on a connection no rolled-back request touched
EXPERIMENT: log connection id and txn state at checkout; run repro.sh 200 times
The plausible story is the failure mode here: an explanation that fits every fact, is never tested, and no experiment separates it from three others. If no observation could kill it, it is not a hypothesis. Having no hypothesis means you are short an observation, not an idea: go print the value.
Guessing where the bug lives scales with the size of the system; halving does not. Cut whichever space is cheapest, and eliminate half of it per round.
git bisect start <bad> <good> && git bisect run ./repro.sh names
the commit unattended, in about log2(n) runs — reach for it as soon as the
repro is scripted and the range is more than a handful of commits.Done when the suspect is one commit, one input element, or one call.
One change per run, reverted before the next. Two changes and a passing run tells you neither which one mattered nor whether they cancel.
Keep Agans' audit trail as you go (Debugging: The 9 Indispensable Rules) — a line per run, and it is what stops you repeating an experiment from an hour ago:
r1 log conn id at checkout failures land on conn 3, 7, 11 — all reused
r2 pool size 1 0/200 fail <- boundary
Shotgun debugging is the failure mode: several edits at once, symptom gone, ship it. You now hold an unknown number of new behaviors and no cause. Its strongest form is fixed by rewriting it — the rewrite drops the defect with everything you could not see, so the cause stays a guess and the bug comes back.
Done when someone else could replay your runs from the trail.
Read the run in front of you, not the one you have seen before.
KeyError: 'user_id' and KeyError: 'userId' are
different bugs wearing one shape, and ECONNREFUSED reads as "the database is
down" when the socket path in the config was renamed.Done when you can quote the error and name the file, line, and values behind it.
The cause is found when you can make the bug appear and disappear on demand by toggling one thing. Undo the change, it comes back; reapply it, it goes; the trail shows nothing else moved. Short of that you have a correlation and a hope.
Then take it up exactly one level — the null got in because the constructor accepts a half-built object — and stop at the layer you can change. A symptom that stopped without a toggle you can name is not fixed. It is scheduled.
test-first: the repro from step 1 becomes the red test,
red for the reported symptom, and the fix follows it.observe.blast-radius before it merges.What SKILL.md sets; muted values are Claude Code's defaults
tslateman-skills@tslateman is listed by tslateman/claude-plugins — review the source before installing
npx claudepluginhub tslateman/claude-plugins --plugin tslateman-skills61 skills in this plugin
/adrGenerate Architecture Decision Records that capture the reasoning behind technical decisions. Use when the user asks to "create an ADR", "document a decision", "record why we chose X", or discusses architectural trade-offs worth preserving./arenaSpawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape./automagic-problem-discoveryAudit a workspace for recurring friction, pick the highest-leverage one, and build the automation that removes it. Use when the user asks "what should I automate", "what's wasting my time", "find the friction in my workflow", wants a self-improvement pass over their own tooling, or runs this on a recurring loop.