.claude/skills/review-function-visibility/SKILL.md
Audit function visibility boundaries and rename misclassified public/private functions
npx skillsauth add cwilliams5/Alt-Tabby review-function-visibilityInstall 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 function visibility boundaries for cleanup opportunities. Use parallelism where possible.
Primary — run this first to get the candidate list:
| Command | Purpose |
|---------|---------|
| query_visibility.ps1 | Public functions with 0 external callers (default) |
| query_visibility.ps1 -MinCallers 1 | Also include functions with exactly 1 external caller |
Verification — for investigating specific functions:
| Command | Purpose |
|---------|---------|
| query_function_visibility.ps1 <funcName> | Where defined, public/private, all callers |
| query_interface.ps1 <file> | Public/private function ratios for a file |
| query_impact.ps1 <funcName> | Blast radius of making a function public (downstream callers/readers) |
| query_includes.ps1 | Include tree — verify cross-file boundaries when assessing visibility |
These are private functions missing the _ prefix. Rename them.
Before renaming, verify:
SetTimer, Hotkey, OnEvent, OnExit, OnError, IPC function refs). Use query_function_visibility.ps1 to check — it detects indirect references, not just direct calls.Flag these but apply judgment. Only propose making private when:
Skip when the function is:
Never use replace_all when the function name is a substring of another function name. For example, renaming _Init would corrupt WL_Init.
Before every rename:
query_function_visibility.ps1 <funcName> to get all call sitesFoo, check for BarFoo, BazFoo)replace_allSection 1 — Zero-caller renames (high confidence):
| File | Function | Rename To | Verified No Callers | Substring Safe? |
|------|----------|----------|-------------------|-----------------|
| gui_paint.ahk | BuildLayout() | _BuildLayout() | query_visibility.ps1 — 0 callers | Yes — no XBuildLayout exists |
Section 2 — Single-caller candidates (needs judgment):
| File | Function | Caller | Same File? | Recommendation | Reason |
|------|----------|--------|-----------|---------------|--------|
| gui_data.ahk | FormatTitle() | gui_paint.ahk | No | Keep public | Cross-file caller, legitimate API |
Section 3 — Public/private ratio observations (informational):
| File | Public | Private | Notes |
|------|--------|---------|-------|
| gui_state.ahk | 12 | 3 | High public ratio — may warrant review |
Order section 1 by file for efficient batch renaming. Run tests after all renames: .\tests\test.ps1 --live
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