Optimize

From x-cmd/x-cmd · View interactive version

Optimize is an AI agent skill from the GitHub repository x-cmd/x-cmd. Review code for efficiency and performance. Triggered by "/optimize" when user wants to identify bottlenecks or improve performance.

How to use this skill

Skill file

Performance Optimizer

Trigger

Use when:

Do NOT use when:

Steps

Step 1: Profile (if applicable)

If user provides runtime data or if profiling is straightforward:

# Examples by platform/language
/usr/bin/time -v ./script.sh        # Linux
python -m cProfile -s cumtime script.py
node --prof script.js

If no runtime data, skip to Step 2 with static analysis.

Step 2: Identify Bottlenecks

Analyze for:

Step 3: Generate Report

Use the output format below.

Output Format

## Performance Review

### Bottlenecks Found

#### šŸ”“ [Severity] [Category]
**File**: `path:line`
**Issue**: [Description]
**Impact**: [Quantify if possible]
**Fix**: [Recommendation]

#### 🟠 ...

### Recommendations (Priority Order)
1. [Highest impact fix]
2. [Next fix]

Constraints

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.