.claude/skills/review-test-quality/SKILL.md
Audit AHK test suite for drifted copies, dead tests, and design issues
npx skillsauth add cwilliams5/Alt-Tabby review-test-qualityInstall 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. Audit the AHK test suite for quality issues. Use maximum parallelism — spawn explore agents for independent test files.
Scope: AHK tests only — unit tests, GUI tests, live tests, lifecycle tests in tests/. NOT static analysis checks, NOT query tools, NOT test coverage (this is about quality of existing tests, not finding gaps).
This is the highest-priority defect. Past reviews have found tests that copy-paste production logic into the test file instead of #Include-ing the production file. These tests always pass because they test the copy, not production. When production changes, the copy doesn't update — the test is useless.
Detection pattern: A test file that defines a function with the same name as a production function, but does NOT #Include the production file containing it. The test's "function" is a frozen copy.
For each test file, check:
#Include?query_function_visibility.ps1 to find the real definition)A test that defines mocks (GUI rendering, IPC sends, DWM calls) is fine — that's intentional shadowing per testing.md. The problem is when business logic is copied instead of included.
Tests that can never fail regardless of production behavior:
Multiple tests verifying the exact same behavior:
Tests that appear to assert but don't actually fail on wrong values:
TestErrors++ after a failed comparisonFAIL but don't increment the error counterTests for features or code paths that no longer exist:
The test suite is designed for automated agentic execution — no user interaction. Any suggested modifications must follow existing patterns from test_utils.ahk and respect the parallel, timing-critical design. See testing.md for the full pattern guide.
After explore agents report back, validate every finding yourself. Test quality issues are subtle — what looks like a copy may actually be an intentional mock, and what looks dead may test an edge case.
For each candidate:
test_file.ahk lines X–Y and production_file.ahk lines A–B" — show both sides.query_function_visibility.ps1 to confirm where the function is defined.#Include?Section 1 — Production code copies (highest priority):
| Test File | Lines | Function Copied | Production Source | Fix |
|-----------|-------|----------------|------------------|-----|
| test_foo.ahk | 10–25 | CalculateScore() | src/shared/scoring.ahk:42 | Replace copy with #Include, add mock for GUI dependency |
Section 2 — Dead/broken tests:
| Test File | Lines | Issue | Evidence | Fix |
|-----------|-------|-------|----------|-----|
| test_bar.ahk | 88–95 | Asserts setup value, not production output | Expected value is hardcoded 3, same as setup | Rewrite to call production function and assert result |
Section 3 — Duplicative tests:
| Test A | Test B | Overlap | Recommendation |
|--------|--------|---------|---------------|
| test_unit_x.ahk:30 | test_live_y.ahk:55 | Both test ParseConfig() with same inputs | Keep unit test, refocus live test on integration behavior |
Section 4 — Stale tests (testing removed features):
| Test File | Lines | What It Tests | Status | Fix |
|-----------|-------|--------------|--------|-----|
| test_old.ahk | 1–50 | LegacyFormat() — removed in v0.7 | Always passes (tests own copy) | Delete |
Order by impact: production copies first (actively hiding bugs), then dead tests, then duplicative, then stale.
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