/clautohotkey:ahk-audit-errorsfrom clautohotkey
Audits AHK v2 code for silent failures and inadequate error handling. Flags empty catch blocks, swallowed errors, broad bare-catches, and fallbacks that mask problems from the user.
Ships in clautohotkey. 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.
You are auditing AHK v2 code with zero tolerance for silent failures. The CLAUDE.md project standard is "Comprehensive error handling (no empty catch blocks)" — your job is to enforce it.
catch { ... } that swallows every error class — type the catch unless you genuinely want everythingA swallowed error in a hotkey handler is worse than a crash — the user doesn't know why their script stopped working.
Default: scan unstaged .ahk changes (git diff if available) plus any files the user names.
If the user says "audit the whole project" or names a directory, walk that scope. Skip Lib/.history/, archive/, and other vendored paths.
try {
risky()
} catch {
} ; ✗ silent
} catch Error as e {
} ; ✗ silent
} catch {
; ignore ; ✗ comment-only
}
Action: flag each.
} catch Error as e {
OutputDebug(e.Message) ; ✗ user never sees OutputDebug unless DebugView is open
}
Action: flag unless the surrounding context shows the error is non-fatal AND a higher level handles it. If the catch is at the top of a hotkey/event handler, OutputDebug-only is always wrong.
catch that swallows unrelated errorstry {
foo()
} catch { ; ✗ catches everything: TypeError, OSError, MemberError...
return false
}
Action: flag. Recommend catch Error as e or a specific class (catch OSError, catch TypeError).
try {
n := Integer(input)
} catch {
n := 0 ; ✗ user thinks parsing succeeded
}
Action: flag. Either tell the user the input was invalid, or document intent: ; intentional: empty input means 0.
try {
api.Get(url)
} catch {
return Map() ; ✗ caller can't distinguish "no data" from "failed"
}
Action: flag.
grep -nE 'catch[[:space:]]*(\\(|\\{|[A-Z])' <files> — list every catch block with line number.file:line, what's wrong, and the concrete fix.Group findings by severity. Use clickable file:line paths.
─ AHK ERROR HANDLING AUDIT ───────────────────────────
CRITICAL (silent failures)
Lib/Foo.ahk:42 empty catch
fix: re-throw, log to user-visible file, or MsgBox
ContentEditor.ahk:118 bare catch swallows TypeError
fix: catch Error as e, or specific subclass
WARNINGS (likely silent)
ClipFluent.ahk:203 OutputDebug-only catch in hotkey handler
fix: surface to user via TrayTip or status text
PASSED
Win3.ahk:55 catch OSError, re-thrown ✓
HoverScreenshot.ahk:88 catch with TrayTip ✓
─ SUMMARY ─────────────────────────────────────────
scanned: 14 files, 27 catch blocks
critical: 2 | warnings: 3 | passed: 22
If everything passes, say so plainly: All N catch blocks reviewed. No silent failures found.
; intentional: <reason> comments — trust documented intent.catch Error as e { throw e } — that's a re-throw, fine.__Delete() destructors — destructors must not throw, swallowing is required.If the user asks you to fix the findings, fix them in place — but ask first if there are >5 critical issues. A bulk silent-failure rewrite is the kind of change worth confirming.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub truecrimedev/clautohotkey --plugin clautohotkey19 skills in this plugin
/ahk-comCOM automation and interop for AHK v2 — driving Excel / Word / WMI / Internet Explorer via IDispatch, COM events, ComValue / SafeArrays, and direct vtable ComCall. Use when automating another application, wiring COM events, or calling a COM interface. TRIGGER when: user says "automate Excel/Word", "COM object", "ComObject", "ComCall", "WMI query", "COM event", "IDispatch", "SafeArray", "ComValue", "VARIANT". Examples: "automate Excel from AHK", "query WMI for processes", "hook IE navigation events"
/ahk-convertConvert AHK v1 code to AHK v2. Applies comprehensive v1-to-v2 conversion rules including command syntax, expression changes, GUI rewrites, and object model updates. TRIGGER when: user says "convert to v2", "v1 to v2", "upgrade script", "migrate from v1", "convert this old script", "make this v2".
/ahk-debug-dashboardShow a compact debug state dashboard during an active debugging session. Queries MCP resources for connection status, breakpoints, variables, and call stack. TRIGGER when: user says "debug dashboard", "show debug state", "debug status", "what's the debugger showing", "debug overview".
/ahk-dllcallNative calls and raw memory for AHK v2 — DllCall to Windows/native APIs, Buffer + NumGet/NumPut for structs, StrPut/StrGet, CallbackCreate, and the alpha.30 typed Struct. Use when calling a DLL/WinAPI function, building or reading a struct, or passing a callback to native code. TRIGGER when: user says "DllCall", "call a Windows API", "Buffer", "NumPut/NumGet", "struct", "pointer", "CallbackCreate", "StrGet/StrPut", "marshal", "user32/kernel32". Examples: "call GetCursorPos", "build a RECT struct", "pass a callback to EnumWindows"
/ahk-docsSearch AHK v2 documentation for a function, method, directive, or concept. Returns relevant documentation excerpts with syntax and examples. TRIGGER when: user says "docs for", "how does X work in AHK", "AHK docs", "look up", "what is the syntax for", "documentation".
/ahk-evalLive AHK v2 REPL backed by the fork's native repl subcommand. Execute AHK expressions and get immediate results without writing a multi-line script. Use when testing snippets, checking syntax, or evaluating expressions without creating files. TRIGGER when: user says "eval", "try this expression", "what does X return", "test this snippet", "run this AHK code", "check if this works". Examples: "/ahk-eval StrSplit('a,b,c', ',').Length" returns "3"
Other plugins' skills for the same job