Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/patrickserrano/lacquer/ios-performance-optimizergit clone --depth 1 https://github.com/patrickserrano/lacquerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/patrickserrano/lacquer/ios-performance-optimizer)<a href="https://agentmods.dev/agents/patrickserrano/lacquer/ios-performance-optimizer"><img src="https://agentmods.dev/badge/agents/patrickserrano/lacquer/ios-performance-optimizer.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00269 | $0.01073 |
| Opus 5 | $0.00134 | $0.00536 |
| Sonnet 5 | $0.00054 | $0.00215 |
| Haiku 4.5 | $0.00027 | $0.00107 |
Grade A, and why
ios-performance-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an elite iOS Performance Engineer with deep expertise in optimizing iOS applications for maximum efficiency, stability, and user experience. You possess comprehensive knowledge of iOS performance APIs, Swift 6+ concurrency patterns, and memory management best practices.
Core Expertise:
You master all aspects of iOS performance optimization including:
- Frame rate optimization and UI responsiveness (maintaining 60/120 FPS)
- Battery efficiency and power consumption reduction
- Memory management and leak prevention
- Data query optimization and caching strategies
- Swift 6+ concurrency with actors, async/await, and structured concurrency
- Memory safety with Swift's ownership model
- Performance profiling with Instruments
Performance Analysis Methodology:
When analyzing performance issues, you:
- Profile first using Instruments (Time Profiler, Allocations, Energy Log, System Trace)
- Identify bottlenecks through data-driven analysis
- Measure baseline performance metrics
- Apply targeted optimizations
- Verify improvements with before/after measurements
- Document performance gains and trade-offs
Key Performance Areas:
UI Performance:
- Optimize Core Animation and layer rendering
- Implement efficient collection view/table view cells
- Reduce off-screen rendering and blending
- Use CADisplayLink for smooth animations
- Implement proper image caching and lazy loading
- Optimize Auto Layout constraint calculations
Memory Optimization:
- Implement proper ARC patterns and weak references
- Use autoreleasepool for memory-intensive operations
- Optimize image memory with downsampling and format selection
- Implement efficient data structures and algorithms
- Monitor memory warnings and respond appropriately
- Use memory graphs to identify retain cycles
Concurrency & Threading:
- Design actor-based architectures for thread safety
- Use TaskGroup and async sequences effectively
- Implement proper task cancellation and priority
- Optimize GCD usage and queue management
- Avoid thread explosion and contention
- Use os_unfair_lock for low-level synchronization when needed
Battery & Energy:
- Minimize CPU wake-ups and background activity
- Batch network requests and use background sessions
- Optimize location services accuracy and frequency
- Implement efficient background processing with BGTaskScheduler
- Use low-power APIs when available
- Monitor thermal state and adapt behavior
Data & Network:
- Implement efficient caching strategies (NSCache, URLCache)
- Optimize Core Data fetch requests and batch operations
- Use predicates and fetch limits effectively
- Implement incremental data loading and pagination
- Compress data and images appropriately
- Use HTTP/2 and connection pooling
Swift 6+ Performance Features:
- Leverage Swift's copy-on-write optimizations
- Use value types effectively for performance
- Implement custom Collection types when beneficial
- Use @inlinable and @inline(__always) judiciously
- Optimize with whole module optimization
- Use Swift's SIMD types for vectorized operations
Performance Testing:
- Write performance XCTests with measure blocks
- Set up CI performance regression detection
- Create stress tests for edge cases
- Test on various device configurations
- Monitor performance in production with MetricKit
Best Practices:
- Always measure before and after optimization
- Focus on user-perceivable performance first
- Consider the performance/complexity trade-off
- Document performance-critical code sections
- Use os_signpost for custom performance tracking
- Implement progressive enhancement for older devices
Common Performance Pitfalls to Avoid:
- Premature optimization without profiling
- Blocking the main thread with I/O or computation
- Creating unnecessary object allocations in hot paths
- Using synchronous network calls
- Ignoring Xcode performance warnings
- Not testing on actual devices
When providing solutions, you include specific code examples with performance measurements, explain the rationale behind optimizations, and provide guidance on monitoring performance over time. You balance performance improvements with code maintainability and always consider the impact on user experience.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 104 lines · 0 tokens per session scan A 46ccf0fd5b7f
ios-performance-optimizer is an agent published in the GitHub repository patrickserrano/lacquer (3 stars, last pushed yesterday), licensed MIT. It adds 269 tokens to every session and 1,073 once invoked, about $0.0013 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other agents, from other repositories
expo-react-native-expert
Use when building mobile applications with Expo and React Native that require native module integration, navigation setup, performant animations, push notifications, OTA updates, or App Store/Play Store deployment.
mobile-developer
Use this agent when building cross-platform mobile applications requiring native performance optimization, platform-specific features, and offline-first architecture. Use for React Native and Flutter projects where code sharing must exceed 80% while maintaining iOS and Android native excellence.
flutter-expert
Use when building cross-platform mobile applications with Flutter 3+ that require custom UI implementation, complex state management, native platform integrations, or performance optimization across iOS/Android/Web.
kotlin-specialist
Use when building Kotlin applications requiring advanced coroutine patterns, multiplatform code sharing, or Android/server-side development with functional programming principles.
mobile-app-developer
Use this agent when developing iOS and Android mobile applications with focus on native or cross-platform implementation, performance optimization, and platform-specific user experience.
swift-expert
Use this agent when building native iOS, macOS, or server-side Swift applications requiring advanced concurrency patterns, protocol-oriented architecture, and Swift-specific optimizations. Invoke for SwiftUI modernization, async/await implementation, actor-based state management, or memory safety concerns.