axiom-accessibility
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when the user mentions battery drain, energy optimization, power consumption audit, or pre-release energy check — timer abuse, polling patterns, continuous location, animation leaks, and background mode misuse.
$ npx -y skills add charleswiltgen/axiom --skill axiom-audit-energy --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/axiom-audit-energyContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when the user mentions battery drain, energy optimization, power consumption audit, or pre-release energy check — timer abuse, polling patterns, continuous location, animation leaks, and background mode misuse.
name: axiom-audit-energy description: Use when the user mentions battery drain, energy optimization, power consumption audit, or pre-release energy check — timer abuse, polling patterns, continuous location, animation leaks, and background mode misuse. license: MIT
You are an expert at detecting energy anti-patterns — both known battery-draining patterns AND unnecessary background work that wastes power when the feature isn't actively needed.
Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.
Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`
Glob: **/*.swift, **/Info.plist (excluding test/vendor paths) Grep for: - `UIBackgroundModes`, `BGTaskScheduler`, `BGAppRefreshTask`, `BGProcessingTask` — background task registration - `beginBackgroundTask` — legacy background execution - `startUpdatingLocation`, `allowsBackgroundLocationUpdates` — background location - `AVAudioSession`, `setActive(true)` — audio session - `URLSessionConfiguration.*background` — background downloads
Grep for: - `Timer.scheduledTimer`, `Timer.publish`, `Timer(timeInterval:` — timers - `CADisplayLink` — display-linked updates - `DispatchSourceTimer` — GCD timers - Polling keywords: `refreshInterval`, `pollInterval`, `checkInterval`, `syncInterval`
Read 2-3 key files to understand:
Write a brief **Energy Profile Map** (8-10 lines) summarizing:
Present this map in the output before proceeding.
Run all 8 existing detection categories. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.
**Search**: `Timer.scheduledTimer`, `Timer.publish`, `Timer(timeInterval:` **Verify**: Check for `.tolerance` (should match timer count); `timeInterval:\s*0\.` (high-frequency); `repeats:\s*true` without invalidate in same class **Issue**: Timers without tolerance, high-frequency timers, repeating timers that don't stop **Impact**: CPU stays awake, 10-30% battery drain/hour **Fix**: Add 10% tolerance minimum, stop timers when not needed
**Search**: `refreshInterval`, `pollInterval`, `checkInterval` — timer combined with URLSession/dataTask/fetch; missing `isDiscretionary` for background **Issue**: URLSession requests on timer, periodic refresh without user action **Impact**: 15-40% battery drain/hour **Fix**: Convert to push notifications or use discretionary URLSession
**Search**: `startUpdatingLocation` vs `stopUpdatingLocation` (count mismatch); `kCLLocationAccuracyBest` when not needed; `allowsBackgroundLocationUpdates` without clear need **Issue**: Location tracking that never stops, unnecessarily high accuracy **Impact**: 10-25% battery drain/hour **Fix**: Use significant-change monitoring, reduce accuracy, stop when done
**Search**: `CADisplayLink`, `CABasicAnimation`, `withAnimation`, `UIView.animate` — check for stop in `viewWillDisappear`/`onDisappear`; `preferredFrameRateRange` set to 120 **Issue**: Animations continue when view not visible, 120fps when 60fps sufficient **Impact**: 5-15% battery drain/hour **Fix**: Stop animations in viewWillDisappear/onDisappear, use appropriate frame rate
**Search**: `UIBackgroundModes` in plist without matching usage; `setActive(true)` without `setActive(false)`; `BGTaskScheduler` without `setTaskCompleted` **Issue**: Background modes enabled but not used, audio session always active **Impact**: Background CPU heavily penalized by system **Fix**: Remove unused background modes, deactivate audio session when not playing
**Search**: `URLSession.shared` without configuration; missing `waitsForConnectivity`, `allowsExpensiveNetworkAccess`; high count of separate `dataTask(with:` calls **Issue**: Many small requests, no connectivity waiting, cellular without constraints **Impact**: 5-15% additional drain on cellular (radio stays awake 20-30s per request) **Fix**: Batch requests, use discretionary downloads, set network constraints
**Search**: `UIBlurEffect`, `.blur(`, `Material.` over dynamic content; heavy `.shadow(`, `.mask(` usage; missing `shouldRasterize` for static layers **Issue**: Blur over dynamic content, excessive shadows/masks, unnecessary 120fps **Impact**: 5-10% battery drain/hour **Fix**: Simplify effects, cache rendered content, use shouldRasterize for static layers
**Search**: `write(to:`, `Data.write` in loops; SQLite without WAL (`journal_mode`); frequent `UserDefaults.set(` **Issue**: Frequent small write
Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.
Repo: charleswiltgen/axiom
Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance, App Store accessibility review.
Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation Models, @Generable,…
Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs analysis.
Use when the user mentions Swift performance audit, code optimization, or performance review — ARC issues, allocation patterns, and generic specialization.
Use when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues — expensive bodies, formatters, whole-collection…
Use when the user mentions flaky tests, tests that pass locally but fail in CI, race conditions in tests, or needs to diagnose WHY a specific test fails.