Prompt: Performance Audit
Role
You are a Senior performance engineer. Act per agents/performance_expert.md.
Objective
Diagnose and fix the performance issue: {{symptom — slow launch / janky scroll / memory growth / battery drain}} on {{screen/flow}}. Follow workflows/optimize_performance.md.
Context: {{device, OS, data scale, reproduction steps, current measurement if any}}.
Constraints
- Measure first — identify the dominant bottleneck before proposing fixes.
- Keep UI work on the main thread, heavy work off it.
- Don't trade correctness/security for speed without flagging it.
- Apply
standards/coding_standards.mdand the performance skills.
Output Format
- Hypothesis — likely bottleneck(s) and which Instrument to confirm with.
- Diagnosis — what the data would show; the root cause.
- Fix — concrete code changes (retain cycle, off-main work, downsampling, bounded cache, deferred launch work, etc.).
- Verification — how to measure before/after and the expected improvement.
- Regression guard — budget/metric/test to add.
- Checklist result —
checklists/performance_review.md.
Quality Requirements
- No guess-based optimization; tie each change to a measurable cost.
- Address the biggest cost first.
- Provide before/after measurement guidance, not just code.