Make a macOS app fast by measuring hangs, stutter, CPU, memory, and energy, then moving work off the main thread and onto the GPU. Use when the app freezes, a shortcut feels slow, dragging stutters, the fan spins, memory grows, or the user asks to optimize or profile.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Performance
Fast means two numbers: the first frame after a key press shows in under
100 ms, and nothing on the main thread blocks for more than 50 ms. Every
change in this skill starts and ends with a **measurement**, so you know it
helped. Symptom-by-symptom fixes are in [recipes.md](recipes.md). For
video, audio, camera, Metal, or large image pipelines, also read
[gpu-media.md](gpu-media.md).
## The loop
```text
reproduce -> measure (release build) -> find the line -> fix -> measure again -> commit with the numbers
```
1. **Reproduce.** Write the exact steps, or add a probe command to the
debug bridge (`test-mac-app` skill) that runs the slow action and logs
the time of each step.
2. **Measure the release build.** Debug Swift is 3 to 10 times slower and
points at the wrong code.
3. **Find the line.** Pick the tool for the symptom:
| Symptom | Tool |
| --- | --- |
| App freezes, spinning pointer | `sample <App> 5`, then read the main thread stack |
| Slow action | Time Profiler: `xcrun xctrace record --template 'Time Profiler' --attach <App> --time-limit 10s` |
| Short freezes while typing or dragging | `--template 'Hangs'` |
…
The line at the top of this page pins the label git:20261027.b1054fc, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
GET https://markdownregistry.com/api/v1/artifacts/art_uhautmygzw77cz7o
GET https://markdownregistry.com/api/v1/resolve?ref=tomcounsell/ai/performance
GET https://markdownregistry.com/api/v1/blob/62196ebe46a42028826cd679a6ae588bd368ad4965560976821241f2be34aa05
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
tomcounsell/ai · skills/valor/bama/skills/code/agent-cli/SKILL.md · Optional command line and MCP server for a macOS app, so Claude Code, Codex, and scripts can drive it (list, add…
tomcounsell/ai · skills/valor/bama/skills/code/improve-architecture/SKILL.md · Architecture check-in for a growing macOS Swift codebase. Finds hot spots, proposes deeper modules, and refactors one…
tomcounsell/ai · skills/valor/bama/skills/code/os-integrations/SKILL.md · Deep macOS integrations for a native app, such as global hotkeys, menu bar items, floating panels, window control with…
tomcounsell/ai · skills/valor/bama/skills/code/swift-swiftui/SKILL.md · Swift 6 and SwiftUI code rules for macOS apps, including concurrency, state, SwiftData, AppKit bridges, and fixes for…
tomcounsell/ai · skills/valor/bama/skills/design/design-from-app/SKILL.md · Rebuild the look of an app the user likes as a native SwiftUI design kit, by measuring its screenshots (sizes, spacing…
tomcounsell/ai · skills/valor/bama/skills/design/design-kit/SKILL.md · Custom design system for a macOS SwiftUI app with its own parts, not Apple's, covering three token layers, type, an…
tomcounsell/ai · skills/valor/bama/skills/design/design-system/SKILL.md · Accent color and design system for a macOS app, from the app's accent and the accent picker in Settings to Swift tokens…
tomcounsell/ai · skills/valor/bama/skills/design/layout-grid/SKILL.md · Grid and alignment rules for a macOS SwiftUI app, with three checks that catch misalignment (a lint for off-grid…
tomcounsell/ai · skills/valor/bama/skills/design/mac-design/SKILL.md · Design rules that make a SwiftUI app look and feel like a native Mac app on macOS 26 and later, from Apple's eight…
tomcounsell/ai · skills/valor/bama/skills/design/ux-design/SKILL.md · UX pass for one feature of a macOS app, covering names, flow, where it opens (inline, popover, sheet, window, alert)…
ericrisco/rsc-harness · skills/performance/SKILL.md · Use when a page or interaction is slow for one user and the fix starts from a measurement — a failing Core Web Vital…