skills/diagnose-first/SKILL.md
Methodology for debugging confusing, intermittent, or "magical" bugs. Forces observation before action. Invoke when symptoms have multiple plausible causes, when one or more speculative fixes have failed, or when the user pushes back with "stop guessing."
npx skillsauth add api-haus/my-claude-workflow diagnose-firstInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When you can't read the actual values flowing through the system, you are guessing. Make it observable before you make it work. One five-minute diagnostic dump eliminates more hypothesis space than one hour of theorizing — and far less than one wrong fix.
Invoke when any of these are true:
If you're already confidently iterating on a known-correct mental model, you don't need this skill. It's specifically for the moments when your model is wrong and you don't yet know it.
| Symptom shape | What to dump / probe |
|---|---|
| Stuck state, doesn't recover when inputs change | The intermediate data values that should change frame-to-frame. Are they actually updating? Hash or sample across frames. Identical = frozen upstream. |
| Random pattern that locks when motion stops | Sub-pixel / sub-texel alignment between producer write coords and consumer read coords. Off-by-half is common. |
| Works near, breaks far / works low, breaks high | Storage layout per range. Different mips, LODs, precision tiers, regions — dump each independently to find which bucket is corrupt. |
| Specific timing repeats per action (e.g., "exactly 3 s") | Pipeline depth or async warmup, not one-time compile. One-time events don't repeat per toggle. |
| Math looks right but values are wrong | Suspect API/hardware contracts: constant-buffer alignment, globallycoherent semantics, format reinterpretation, OOB writes silently dropped, sampler-state defaults. |
| Tile-aligned / texel-aligned artifact boundaries | Coordinate-system mismatch between producer and consumer. Or layout-stride mismatch in a flat buffer. |
| Intermittent crash / flicker tied to camera state | State leak across cameras / frames in shared resources (atomic counters, pool-aliased transients, persistent SamplerStates). |
min / max / mean / NaN / INF / negative / out-of-range counts per logical region. One log line per call. Reveals corruption, freezing, range violations, and layout bugs simultaneously.0.5, 0xDEADBEEF, etc.). If the consumer doesn't see the pattern, the bug is in the path, not in the math. If it sees a shifted pattern, you have an offset bug.Before generating a fix:
If yes to all three, fix. If not, sharpen the probe.
If you answer any of these unfavorably, stop and instrument.
Symptom: HiZ occlusion culling over-culls foreground tiles intermittently. Symptoms shifted with each fix attempt:
The user said: "we don't have to guess, we can literally DIAGNOSE THIS BY RUNNING SPECIFIC TESTS."
Five-minute fix: a buffer-scan diagnostic logging min/max/mean/NaN/INF/... per mip on every readback. First run output:
m0=128² min=0 max=2.0e-4 mean=1.8e-4
m1=64² min=0 max=0 mean=0 ← all zero
m2=32² min=0 max=0 mean=0 ← all zero
m3=16² min=0 max=0 mean=0 ← all zero
m4=8² min=1.7e-4 max=1.9e-4 ← values resemble m0
Mip 1/2/3 all-zero, mip 4–7 carrying mip-0-magnitude values. Layout bug, not a math bug. Root cause: HLSL uint _HiZFlatOffsets[12] packs each scalar at 16-byte stride; SetComputeIntParams writes at 4-byte stride. Shader read garbage offsets for mips 1+, sending mip-1 writes into mip-4's region. Every prior symptom — close-up working, far culling, "tiles stay culled," "exactly 3 seconds" — fell out of this one cause.
Lesson: the diagnostic should have been the first action, not the seventh. Total wall-clock cost of fix-first detours: hours. Total cost of the diagnostic: ~5 minutes of code, ~5 seconds to read.
data-ai
Extract research content from YouTube presentations, PDFs, or PPTX files into structured markdown. Dispatches each pass to a dedicated sub-agent (research-extractor / research-vision / research-refiner) so per-deck vision passes scale to hundreds of slides without bloating the parent context.
development
Build, run, and analyze Unity profiler data with perf-report-style call-stack attribution
documentation
Write a handoff prompt for a future session. A handoff is a continuation-link — minimal context plus a kickoff line the user can copy-paste. Never a diagnosis, never an investigation script, never a prescribed deliverable.
testing
Multi-agent orchestration mode. The orchestrator never reads, edits, runs, or tests directly — it scopes work, runs a re-implementation audit, presents a freeform method brief with grounded recommendations, then dispatches every step to sub-agents through shared context files at `docs/orchestrate/<topic>/`. Use when invoked via /delegate, when the user asks to orchestrate or coordinate multi-agent work, or when the task explicitly calls for delegation.