用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cwilliams5/Alt-Tabby --skill review-race-conditions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Audit all lint-ignore suppressions for appropriateness and overuse
Pre-flight checklist — run high-signal review skills before a release
Discover functions that block the main thread, then micro-audit each for internal optimization opportunities
基于 SOC 职业分类
正在显示 SKILL.md
| name | review-race-conditions |
| description | Audit for race conditions in timers, hotkeys, callbacks, and shared state |
| user-invocable | true |
| disable-model-invocation | true |
Enter planning mode. Systematically audit the codebase for race conditions. Use maximum parallelism — spawn explore agents for independent areas.
AHK v2 is single-threaded but not atomic — timers, hotkeys, and callbacks CAN interrupt each other mid-execution. Critical "On" prevents interruption for the current thread. This is the only synchronization primitive available. See .claude/rules/ahk-patterns.md (Race Conditions section) and .claude/rules/keyboard-hooks.md for established patterns.
Globals modified inside timer callbacks, hotkey handlers, or event callbacks without Critical "On":
gRev += 1if (!map.Has(k)) { map[k] := v }gGUI_State or similar)Critical "On" present but:
Critical "Off" missing on an early return or continue pathkeyboard-hooks.md "Do NOT Release Critical Before Rendering")A SetTimer callback modifying state that a hotkey handler also reads/writes. Both can fire in the same thread context. Use query_timers.ps1 to inventory all timers and their callbacks, then cross-reference with hotkey handlers.
Named pipe reads processed via timer while the state machine is mid-transition. Check that IPC handlers either defer during transitions or are properly guarded.
Producers (WinEventHook, Komorebi subscription) firing callbacks that modify gGUI_LiveItems, window store data, or MRU order while the GUI is painting or the state machine is processing input.
These have been deliberately designed and tested — flagging them wastes time:
Critical "On" held through the entire GUI_OnInterceptorEvent handler including rendering (~16ms). This is intentional — releasing early causes corruption.SendMode("Event") instead of SendInput — prevents hook uninstall during sends.gGUI_EventBuffer — events buffered while gGUI_Pending.phase != "".ALT_DN + ALT_UP without TAB).FR_Record() — pre-allocated ring buffer, writes are inherently safe._GUI_LogError() — always-on by design.Split by concurrency boundary, not just file location:
gui_input.ahk, gui_interceptor.ahk: all INT_* functionsquery_timers.ps1 to find all SetTimer targets, then read each callbackquery_messages.ps1 to map WM_ handlers and senders (interrupt sources)winevent_hook.ahk: _WEH_* callback functionskomorebi_sub.ahk, komorebi_lite.ahk: subscription event handlersipc_pipe.ahk, pump files: pipe read/write pathsquery_state.ps1 to extract specific branches from GUI_OnInterceptorEvent without loading the full functionquery_function_visibility.ps1 to map which interrupt sources can reach vulnerable code (e.g., "is this function called from both timer callbacks and hotkey handlers?")query_mutations.ps1 <globalName> to see per-function mutation sites with assignment operators and assigned values — reveals unguarded writes without reading full filesAfter explore agents report back, validate every finding yourself. Race conditions are easy to hypothesize and hard to confirm. Many "races" identified by exploration are actually guarded by Critical sections or by AHK's threading model (only one pseudo-thread runs at a time; interruption only happens at specific yield points).
For each candidate:
file.ahk lines X–Y" with actual code quoted. Vague line references are not sufficient.Group by severity (data corruption > logic error > cosmetic):
| File | Lines | Race Description | Interrupt Source | Severity | Fix |
|---|---|---|---|---|---|
file.ahk | 42–58 | gFoo read-then-write without Critical | Timer _HeartbeatTick | Data corruption | Wrap in Critical "On" / Critical "Off" |
For each fix, note:
Ignore any existing plans — create a fresh one.