.claude/skills/review-debug/SKILL.md
Audit debug logging and diagnostics for ungated disk writes, missing coverage, and overhead
npx skillsauth add cwilliams5/Alt-Tabby review-debugInstall 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.
Enter planning mode. Systematically audit all debug logging, tooltips, and diagnostic output across the codebase. Use maximum parallelism — spawn explore agents for independent areas.
1. Are any debug outputs ungated? — Every FileAppend, FileOpen, Tooltip, or diagnostic write must be wrapped in a config check (cfg.DiagXxx, cfg.DebugXxx, etc.). With all debug config options OFF, the app should have zero disk thrashing and zero unnecessary logging overhead. The only exception is _GUI_LogError() which always logs (by design — see debugging.md).
2. Are there important gaps? — Are there failure paths, error conditions, or diagnostic-worthy events that have no logging at all, where a log would save significant debugging time?
Ungated outputs (problem):
FileAppend / FileOpen for log files without a config guardTooltip calls outside of cfg.DiagAltTabTooltips guardOutputDebug calls left in production paths (acceptable in dev-only or rarely-hit error paths)ahk-patterns.md caller-side log guards rule)Correctly gated (not a problem):
if (cfg.DiagChurnLog) → FileAppend ...if (cfg.DiagAltTabTooltips) → Tooltip ..._GUI_LogError() — always-on by design, only for actual errorsFR_Record() — near-zero cost by design (pre-allocated ring buffer)Coverage gaps (potential improvement):
See .claude/rules/debugging.md for the full list of diagnostic config flags and their log file paths. All diagnostic options live in the [Diagnostics] config section.
Use query_timers.ps1 to identify timer callbacks — these often contain diagnostic writes for heartbeat, stats, or producer health checks. Use query_callchain.ps1 <logFunc> -Reverse to trace all callers of logging functions and verify gate coverage. Use query_function_visibility.ps1 <logFunc> to find all call sites of diagnostic output functions.
Split into independent zones and explore in parallel:
src/gui/ — Overlay rendering, state machine, flight recordersrc/core/ — Producers (WinEventHook, Komorebi, pumps)src/shared/ — IPC, config, blacklist, window list, statssrc/editors/ — Config/blacklist editors, WebView2src/pump/ — EnrichmentPump subprocesssrc/ files — Launcher, installation, updateAfter explore agents report back, validate every finding yourself. Explore agents sometimes flag code that is actually gated by a check further up the call chain.
For each candidate:
file.ahk lines X–Y" with the actual code quoted.Section 1 — Ungated outputs (table, grouped by file):
| File | Lines | What | Guard Needed | Counter-argument |
|------|-------|------|-------------|-----------------|
| file.ahk | 42–45 | FileAppend to error log | cfg.DiagStoreLog | None — pure debug output |
Section 2 — Caller-side log guard violations (expensive string built before check):
| File | Lines | What | Fix |
|------|-------|------|-----|
| file.ahk | 100 | String concat before if (cfg.DiagX) | Move concat inside guard |
Section 3 — Coverage gaps (suggested additions, lower priority):
| File | Area | What's Missing | Suggested Config Flag |
|------|------|---------------|----------------------|
| file.ahk | IPC reconnect | Silent reconnection | cfg.DiagIPCLog (existing) |
Order fixes by impact: ungated disk writes first, then log guard violations, then coverage gaps.
Ignore any existing plans — create a fresh one.
tools
Create a new git worktree and switch the session into it
tools
Spawn agent to trace code flow via query tools — answer only, no context cost
tools
Commit, push, and create a PR for the current branch
tools
Retire a shader by moving its files to legacy/shaders_retired