optimize
/optimize - Performance Optimization Command
Section titled “/optimize - Performance Optimization Command”Purpose
Section titled “Purpose”Analyze and optimize code performance.
/optimize [file or function]Optimize: $ARGUMENTS
Workflow
Section titled “Workflow”-
Analyze Current Performance
- Identify bottlenecks
- Check complexity
- Profile if possible
-
Identify Opportunities
- Algorithm improvements
- Caching opportunities
- Async optimizations
-
Implement Optimizations
- Make targeted changes
- Verify improvements
- Ensure correctness
Output
Section titled “Output”## Optimization Report
### Before- Time complexity: O(n²)- Estimated time: 500ms
### After- Time complexity: O(n log n)- Estimated time: 50ms
### Changes Made- [Description of optimizations]Gap Analysis Rule
Section titled “Gap Analysis Rule”Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.