/clautohotkey:ahk-fixfrom clautohotkey
Loads AHK v2 error diagnosis, debugging, and fix knowledge. Guides through identifying error types, locating exact lines, diagnosing root causes, and applying fixes for AutoHotkey v2 scripts.
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.
When this skill is invoked, load the following module files:
${CLAUDE_PLUGIN_ROOT}/Modules/Module_Errors.md — the whole error domain: class hierarchy,
clause ordering, symptom triage, diagnostic instrumentation, anti-patterns, and the diagnostic checklist.
Start with TIER 9 — Symptom Triage and ERROR DIAGNOSTIC CHECKLIST, then the tier the error type points to.${CLAUDE_PLUGIN_ROOT}/Modules/Module_Versions.md when the symptom looks version-dependent — a
construct that works on one build and not another.Read a module by section, not whole. Every module opens with API QUICK-REFERENCE and
AHK V2 CONSTRAINTS and closes with ANTI-PATTERNS; read those, then only the TIER
sections the task needs. To find them, Grep the module for ^## with line numbers and
Read each section with offset at its heading and limit up to the next one.
A diagnosis built on a paraphrase is a guess. Before opening the module or the script, collect what the record actually shows, and ask for what it does not:
Specifically:
line and the call stack, or a screenshot of the dialog. If the user summarised it,
ask for the verbatim text; if the hook blocked an edit, the block message has it.A_AhkVersion for the interpreter that produced the error, and the
script's #Requires line. A construct that works on one build and not another is a
version question, not a code question.python "${CLAUDE_PLUGIN_ROOT}/Tools/lessons.py" propose --min 1 shows
whether this error has recurred in the project, and lessons/INDEX.md whether a
lesson already names its cause. Apply a matching lesson instead of rediscovering it.Skip a question only when its answer is already in front of you.
Follow this exact sequence for every error:
1. IDENTIFY → Determine error type (syntax / runtime / logic)
2. LOCATE → Find exact line and surrounding context
3. DIAGNOSE → Determine root cause using error type patterns below
4. FIX → Provide before/after code with explanation
5. PREVENT → Explain why it happened and how to avoid it
UnsetError → Variable used before assignment. Add initialization.
TypeError → Wrong type passed. Check object vs string vs number.
ValueError → Invalid value for operation. Validate inputs.
MemberError → Property/method doesn't exist. Check spelling and HasProp().
OSError → OS operation failed. Check DllCall types and file paths.
MethodError → Calling non-existent method. Verify method name and class.
PropertyError → Accessing non-existent property. Use HasProp() guard.
These v1 patterns cause errors in v2 — check for them:
WRONG (v1) RIGHT (v2)
─────────────────────────────────────────────────
x = value x := value
IfEqual, x, value if (x = value)
StringLeft, out, str, n out := SubStr(str, 1, n)
Gui, Add, Button, , OK gui.AddButton(, "OK")
MsgBox, text MsgBox("text")
new MyClass() MyClass()
ComObjCreate("...") ComObject("...")
When live debugging is available, use the MCP tools:
capture_error — wait for the exceptionanalyze_error — build analysisapply_fix — write the fixget_source_context — read code around error linesource "${CLAUDE_PLUGIN_ROOT}/hooks/_harness-env.sh" # sets AHK_EXE (and AHK_BIN_WSL, AHK_BIN_WIN)
JOB_DIR="${CLAUDE_JOB_DIR:-$(mktemp -d)}"
WIN_PATH=$(wslpath -w "script.ahk")
# Syntax check
"$AHK_EXE" check /Diag=json "$WIN_PATH"
# Runtime check (headless, 2s timeout)
timeout 2 "$AHK_EXE" /Headless /ErrorStdOut "$WIN_PATH"
# Capture stderr
"$AHK_EXE" /ErrorStdOut "$WIN_PATH" 2>"$JOB_DIR/ahk_fix_err.txt"
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ahk-v2, error-diagnosis, debugging, script-fixing, auto-hotkey
npx claudepluginhub truecrimedev/clautohotkey --plugin clautohotkey19 skills in this plugin
/ahk-audit-errorsAudit AHK v2 code for silent failures and inadequate error handling. Hunts for empty catch blocks, swallowed errors, broad bare-catches that hide unrelated failures, and fallbacks that mask problems from the user. TRIGGER when: user says "audit errors", "check error handling", "find silent failures", "review error handling", "scan for swallowed errors", "empty catch blocks", "/ahk-audit-errors".
/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".
Other plugins' skills for the same job