termio-device
See and drive the sibling agent sessions running alongside you on this machine via the `termio session` CLI — list them and their…
Use when investigating measured Swift or Apple-platform regressions in CPU, memory, launch, scrolling, animation hitches, image processing, energy, networking, or concurrency, or when designing performance tests and Instruments experiments. Do not use for speculative
Claude Code
$ npx -y skills add termio-sh/termio --skill swift-performance-optimization-skill --agent claude-code
Codex
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a codex -y
Cursor
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a cursor -y
Gemini CLI
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a gemini-cli -y
GitHub Copilot
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a github-copilot -y
OpenCode
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a opencode -y
Windsurf
$ npx skills add termio-sh/termio --skill swift-performance-optimization-skill -a windsurf -y
name: Swift Performance Optimization Skill description: Use when investigating measured Swift or Apple-platform regressions in CPU, memory, launch, scrolling, animation hitches, image processing, energy, networking, or concurrency, or when designing performance tests and Instruments experiments. Do not use for speculative micro-optimization, ordinary refactoring, or a functional bug without performance evidence.
Optimize from evidence. Preserve behavior, accessibility, data correctness, and lifecycle safety while changing performance characteristics.
The copy-ready examples use Xcode 16, Swift 6 language mode with strict concurrency, and iOS 17. Most principles apply to older targets; verify each API against the app's actual minimum. Material from the OS 27 development cycle is beta relative to stable Xcode 26.6 and requires an explicit request, beta labeling, stable fallback, and availability gate.
1. Define a user-visible symptom and a reproducible scenario. 2. Record device, OS, build configuration, dataset, thermal state, and network conditions. 3. Measure an optimized Release build on representative hardware. Simulator-only timing is not release evidence. 4. Select the instrument that answers the hypothesis. 5. Save a baseline trace or metric, change one variable, then repeat the same scenario. 6. Confirm that the bottleneck moved and no memory, energy, correctness, or accessibility regression appeared. 7. Add a regression threshold where the workload is stable enough to automate.
Useful tools include:
| Symptom | First evidence source | |---|---| | CPU-bound work | Time Profiler; inspect heavy stacks and self time | | SwiftUI update cost | SwiftUI instrument plus Time Profiler | | Scroll or animation stalls | Animation Hitches, Core Animation, signposts | | Growth or leaks | Allocations, Leaks, Memory Graph, memgraphs | | Slow launch | App Launch template and launch signposts | | Battery or thermal issues | Energy Log and device testing | | Field regressions | MetricKit payloads and app-specific telemetry |
Use `os_signpost` or signposter intervals around important operations so traces answer product questions rather than only showing raw symbols.
import Foundation
@MainActor
final class PollingModel {
private var task: Task<Void, Never>?
private(set) var tickCount = 0
func start() {
stop()
task = Task { [weak self] in
while !Task.isCancelled {
do {
try await Task.sleep(for: .seconds(1))
} catch {
return
}
guard let self else { return }
tickCount += 1
}
}
}
func stop() {
task?.cancel()
task = nil
}
deinit {
task?.cancel()
}
}If a Foundation `Timer` is required, capture its owner weakly, store the timer, invalidate the old instance before starting another, and invalidate it on stop/deinit.
See [the lifecycle-safe example](examples/example_memory_management.swift).
See [the list identity example](examples/example_list_optimization.swift).
A terminal-first agentic development environment for agentic coding. Build for CLI/TUI agent. Runtime for Coding Agent, Tmux alternative
See and drive the sibling agent sessions running alongside you on this machine via the `termio session` CLI — list them and their…
See and drive the sibling agent sessions running alongside you in this Termio project via the `termio session` CLI — list and…
Reverse-lookup glossary that turns a vague description of a web animation or motion effect into its exact term ("the bouncy thing…
Drive the running termio app via AppleScript / System Events to reach a UI state (focus the window, click a sidebar project, a…
Apple's approach to interface design and fluid, physical motion, translated for the web. Use when building or reviewing…
Drive App Store Connect from the terminal with the `asc` CLI — TestFlight builds, groups, testers and What to Test notes; App…
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
Create a new Architecture Decision Record with sequential numbering and AgentDB registration