.claude/skills/review-test-speed/SKILL.md
Optimize AHK test suite speed without sacrificing reliability
npx skillsauth add cwilliams5/Alt-Tabby review-test-speedInstall 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. Analyze AHK test suite performance and find speed optimizations. Use parallelism where possible.
Scope: AHK tests only — unit tests, GUI tests, live tests, lifecycle tests. NOT static analysis checks (review-static-speed covers those) and NOT query tools (review-tool-speed covers those).
Run .\tests\test.ps1 --live --timing to get the hierarchical timing report. This is the ground truth for where time is spent.
The test suite is heavily parallelized into phases. Within a parallel phase, the slowest test determines the phase duration. Look for:
Launching AHK processes and compiled exes is expensive (~1–2s each). Look for:
The test suite uses WaitForFlag(&flag) for adaptive polling (see testing.md). Look for:
Sleep() calls that could be converted to polling with WaitForFlag or similarLive tests depend on compilation. Check:
testing.md pipeline model)For any test file that is a phase bottleneck, check whether it can be logically split:
tests/bench_unit_split.ps1 to measure AHK startup overhead vs per-file test timeThis suite is designed for automated agentic execution — no user interaction, no prompts, cursor suppression, icon suppression. Any new or modified tests MUST follow existing patterns in test_utils.ahk:
_Test_RunSilent(cmdLine) for process launchingWaitForFlag(&flag) for adaptive pollingAfter explore agents report back, validate every finding yourself.
For each candidate optimization:
file.ahk lines X–Y" with actual code quoted. Include the --timing numbers that make this a bottleneck.--timing output, or infer it from code structure?Every optimization MUST pass a stability gate before inclusion in the plan. After implementing a change, run the full test suite 5 times consecutively:
.\tests\test.ps1 --live
.\tests\test.ps1 --live
.\tests\test.ps1 --live
.\tests\test.ps1 --live
.\tests\test.ps1 --live
All 5 runs must pass. A single failure means the optimization introduced flakiness and must be reverted or reworked. We are optimizing speed AND stability, not speed at the cost of reliability.
Section 1 — Phase bottlenecks (timing data from --timing):
| Phase | Bottleneck Test | Duration | Next Slowest | Gap | Splittable? |
|-------|----------------|----------|-------------|-----|-------------|
| Phase 2 | test_live_core.ahk | 8.2s | test_live_features.ahk 3.1s | 5.1s | Yes — groups A and B are independent |
Section 2 — Process reuse opportunities:
| File | Lines | Current | Optimization | Estimated Savings |
|------|-------|---------|-------------|-------------------|
| test_foo.ahk | 42–60 | Launches own store | Reuse store from test_bar | ~1.5s |
Section 3 — Sleep-to-polling conversions:
| File | Line | Current | Replacement | Risk |
|------|------|---------|-------------|------|
| test_foo.ahk | 88 | Sleep(500) | WaitForFlag(&ready) | Low — flag already exists |
Order by estimated time savings (largest first). Note cumulative impact on total suite duration.
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