$npx -y skills add girijashankarj/cursor-handbook --skill optimize-performanceWorkflow for identifying and applying backend performance improvements. Use when the user asks to optimize, speed up, or reduce latency.
| 1 | # Skill: Optimize performance |
| 2 | |
| 3 | ## Trigger |
| 4 | When the user asks to optimize, speed up, or reduce latency of an endpoint or function. |
| 5 | |
| 6 | ## Steps |
| 7 | |
| 8 | 1. **Measure** — Identify the slow path (endpoint, query, or function); use existing metrics or add a quick timing log. |
| 9 | 2. **Profile** — Pinpoint bottleneck (DB query, N+1, CPU, I/O); avoid guessing. |
| 10 | 3. **Design** — Propose 1–2 concrete changes (index, batch, cache, algorithm); prefer smallest change first. |
| 11 | 4. **Implement** — Apply the change; keep the same behavior. |
| 12 | 5. **Verify** — Re-run the scenario and confirm improvement; run existing tests. |
| 13 | |
| 14 | ## Rules |
| 15 | - Do not optimize without measuring first. |
| 16 | - Prefer indexing and query changes over application-level hacks. |
| 17 | - Follow project query patterns (parameterized, soft delete, pagination). |