emaraschio/cursor-commands / .cursor/skill-contracts/optimize-performance
optimize-performance
VerifiedProfile and optimize performance bottlenecks
Overview
Analyze the current code for performance bottlenecks and provide optimization recommendations, focusing on measurable improvements while maintaining code quality and readability.
Steps
- Performance Analysis
- Identify slow algorithms and inefficient data structures
- Find memory leaks and excessive allocations
- Identify slow queries and improve them specifically for Solid Queue and n+1 queries
- Detect unnecessary computations and redundant operations
- Analyze database queries and API calls
- Optimization Strategies
- Suggest algorithm improvements and better data structures
- Recommend caching strategies where appropriate
- Propose lazy loading and pagination solutions
- Identify opportunities for parallel processing
- Implementation
- Provide optimized code with explanations
- Include performance impact estimates
- Suggest profiling and monitoring approaches
- Consider trade-offs between performance and maintainability
Optimize Performance Checklist
- Identified slow algorithms and inefficient data structures
- Found memory leaks and excessive allocations
- Detected unnecessary computations and redundant operations
- Analyzed database queries and API calls
- Suggested algorithm improvements and better data structures
- Recommended caching strategies where appropriate
- Provided optimized code with explanations
- Included performance impact estimates
- Considered trade-offs between performance and maintainability
Guardrails
- Measure first: profile to find the real bottleneck before changing code.
- Do not trade readability for unmeasured micro-gains.
- Do not commit, push, merge, or run production scripts without consent; wait for an explicit request before any destructive git action.
- Do not print, log, or commit secrets or credentials encountered while profiling or optimizing; flag any exposed secret instead.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |