swiftui-performance-macos
OfficialPrevent SwiftUI performance regressions on macOS
Authorsmykla-skalski
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill codifies hard performance rules and audit practices to prevent costly SwiftUI regressions in the Harness Monitor macOS app, such as unexpected CPU use from allocator churn, animation feedback loops, and silent perf-test instrumentation failures.
Core Features & Use Cases
- Body allocation elimination: Guidance to avoid DateFormatter, JSONEncoder, NumberFormatter and other expensive allocations on every view render by using @MainActor cached static lets.
- Animation and geometry safety: Rules to scope animations narrowly, avoid .repeatForever on always-visible views, and suppress geometry writes during transitions to prevent 60fps feedback loops.
- Startup and persistence hygiene: Best practices to avoid persisted-state churn on first frame, prevent mirror-state loops for store-backed selection, and hydrate persisted values safely.
- Instrumentation and testing: Enforces the OSSignposter signpost contract, required perf env vars (HARNESS_MONITOR_KEEP_ANIMATIONS), isolated git worktree audit runs, and xctrace extractor test guidance for reliable Instruments/XCTest perf results.
- Use cases: Code reviews of SwiftUI views and animations, writing XCTest perf tests, running Instruments audits, and validating startup/restoration flows.
Quick Start
Run the Harness Monitor Instruments audit from an isolated worktree with HARNESS_MONITOR_KEEP_ANIMATIONS=1 to confirm no formatter allocations, geometry feedback loops, or unintended repeatForever animations occur.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: swiftui-performance-macos Download link: https://github.com/smykla-skalski/harness/archive/main.zip#swiftui-performance-macos Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.