ablevarghese/ios-claude-toolkit/prometheus-performance
Claude Code and agent skill by ablevarghese/ios-claude-toolkit
- community
Checking that the SKILL.md file is still in the repository.
App is slow, takes too long to load, freezing, laggy, battery drain, memory leak. iOS performance profiling and optimization — launch time, memory analysis, retain cycles, CPU profiling, frame rate. Trigger on: 'why is this screen slow', 'app uses too much memory', 'scrolling is janky', 'UI is unresponsive', 'profile with Instruments', 'energy usage is high', 'app got killed in background', or any complaint about speed, responsiveness, or resource usage. For performance crashes (OOM, watchdog) appearing in Sentry, start with sentry-find-bugs.
Install
npx vskill@latest install ablevarghese/ios-claude-toolkit/prometheus-performanceSKILL.md
The same SKILL.md was published earlier as ablevarghese/ios-claude-toolkit/prometheus-performance.
Performance Optimization & Profiling
Iron Law: "Measure before optimizing. Premature optimization without profiling data is guessing."
Project Discovery: Before executing, determine project-specific values (project name, scheme, bundle ID, target) from project configuration files (CLAUDE.md, project.yml, .xcodeproj, Package.swift).
Profile app launch time, analyze memory usage, detect retain cycles, optimize CPU and main thread performance, and enforce performance thresholds. Target: sub-second response times, < 3s cold launch, < 100MB memory footprint.
Rationalizations (Do Not Skip)
| Rationalization | Why It's Wrong | Required Action | |
|---|---|---|---|
| "The app feels fast enough" | Human perception adapts. Users notice degradation relative to other apps, not absolute speed. A 200ms delay feels fine until a competitor does it in 50ms. | Measure with Instruments. Compare against thresholds, not feelings. | |
| "Users won't notice" | Users notice 100ms+ delays subconsciously. Apple reports that every 100ms of launch time improvement increases user retention. | Profile the actual user-facing latency. Even "unnoticeable" delays compound. | |
| "We'll optimize later" | Performance debt compounds faster than tech debt. A slow screen with 3 callers becomes a slow screen with 30 callers, and now the fix requires rearchitecting. | Set performance budgets at feature inception. Measure during development, not after. | |
| "It's only slow on old devices" | Old devices are real users' devices. iPhone SE, iPad Air 2, and 3-year-old phones are a significant portion of the install base. | Test on the oldest supported device. Optimize for the floor, not the ceiling. | |
| "The profiler is too complex to learn" | Instruments has steep learning curve but is the only way to identify real bottlenecks. Guessing which code is slow is wrong more often than right. | See references/instruments-guide.md for step-by-step workflows. Start with Time Profiler. | |
| "It's a debug build, of course it's slow" | Debug builds have different characteristics but can still reveal algorithmic problems, N+1 queries, and main thread violations. | Profile release builds for final measurements. Use debug builds to find structural issues. | |
| "Adding a cache will fix it" | Caches add complexity, stale data bugs, and memory pressure. The real question is: why is the operation slow in the first place? | Profile first. Fix the root cause. Add caching only if the operation is inherently expensive AND frequently repeated. |
Red Flags -- HARD STOP
These are not warnings. Each is a BLOCKING condition that prevents further progress until addressed.
- BLOCKED: Optimizing without profiling data -- if you haven't run Instruments or measured with concrete numbers, you're guessing. STOP. The bottleneck is rarely where you think it is. Run Instruments first (see references/instruments-guide.md).
- BLOCKED: Optimizing the wrong layer -- CPU optimization when the bottleneck is network latency. Memory optimization when the bottleneck is main thread blocking. STOP. Match the solution to the MEASURED problem, not the assumed one.
- BLOCKED: Ignoring memory growth over time -- a 10MB/minute memory leak is invisible in a 2-minute test session but crashes the app after 20 minutes of real usage. STOP. Profile memory over an extended session.
- BLOCKED: Main thread blocking for any I/O, network, or crypto operation -- this causes visible UI freezes and watchdog kills. There are zero acceptable exceptions. STOP. Move to background immediately.
- BLOCKED: Adding `DispatchQueue.main.async` without understanding why -- this is often a band-aid for a deeper architectural problem. STOP. Understand the threading model before dispatching. Document why the dispatch is needed.
- BLOCKED: Cargo-culting `.lazy` or `LazyVStack` without measuring -- lazy views add complexity and can cause their own performance issues (cell reuse bugs, state management). STOP. Measure BEFORE and AFTER to confirm they help.
When NOT to Use This Skill
- The performance issue is actually a crash -- if the app crashes from OOM or watchdog timeout and appears in Sentry, start with
sentry-find-bugsto analyze the crash, then return here for optimization. - Security review of performance-related code -- if the concern is whether a caching layer introduces security issues, use
cipher-securityortrailofbits-differential-review. - The code hasn't been written yet -- performance optimization applies to existing code. For new features, design with performance budgets in mind but don't optimize prematurely.
- The bottleneck is server-side -- if profiling shows the client is waiting on API responses, the optimization needs to happen on the backend, not in the iOS app.
Behavioral Enforcement
Phase Gate: MEASUREMENT (Before ANY Optimization)
Cannot propose ANY optimization until:
- [ ] Current performance MEASURED (not assumed)
- [ ] Bottleneck IDENTIFIED with profiling data (not guessed)
- [ ] Baseline metrics recorded (so improvement can be verified)
Hard Stop: If about to optimize without profiling data -- STOP. You are guessing. Premature optimization based on intuition wastes time optimizing the wrong thing. Run Instruments (see references/instruments-guide.md) first.
Counter: Optimization #1 didn't improve the metric? Understand why before #2. At #3 -- question whether you identified the right bottleneck. Re-profile.
Phase Gate: VERIFICATION (After Optimization)
Cannot declare optimization complete until:
- [ ] Performance re-measured with same methodology as baseline
- [ ] Improvement quantified: "Before: X, After: Y, Delta: Z"
- [ ] No regressions in other metrics (faster but uses 10x memory = not an optimization)
Required evidence: Before/after numbers. "It feels faster" is not evidence.
Counter-Based Escalation
- Optimization #1: Normal. Implement, measure, verify.
- Optimization #2: Pause. Why didn't #1 achieve the target? Write down what you learned. Is the bottleneck where you think it is?
- Optimization #3: STOP. Re-profile from scratch. You may be optimizing the wrong thing. Consider: is this an architectural issue that can't be solved with local optimization?
- Still not meeting target after #3: ESCALATE to human partner with: baseline measurements, optimizations tried, measurements after each attempt, current profile data.
Decision Framework
Performance Thresholds
| Metric | Target | Acceptable | Critical | How to Measure | |
|---|---|---|---|---|---|
| Cold Launch | < 2s | < 3s | > 5s | Instruments App Launch template | |
| Warm Launch | < 500ms | < 1s | > 2s | Instruments App Launch template | |
| Screen Load | < 300ms | < 500ms | > 1s | Time Profiler + signpost markers | |
| API Response | < 200ms | < 500ms | > 1s | Network template + URLSession metrics | |
| Memory Usage | < 80MB | < 100MB | > 200MB | Allocations template | |
| Frame Rate | 60 FPS | 45 FPS | < 30 FPS | Core Animation template | |
| Time to Interactive | < 1s | < 2s | > 3s | Custom signpost markers | |
| Image Load | < 100ms | < 200ms | > 500ms | Time Profiler | |
| Energy Impact | Low | Medium | High | Energy Log template |
Setting Performance Budgets
For each screen, define a budget BEFORE development:
Standard Operating Procedures
SOP-1: Profile App Launch
See references/instruments-guide.md for detailed step-by-step Instruments workflows.
SOP-2: Memory Analysis
SOP-3: Detect Retain Cycles
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/prometheus-performance/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ablevarghese/ios-claude-toolkit/prometheus-performance)