CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

optimize

Review code for efficiency and performance. Triggered by "/optimize" when user wants to identify bottlenecks or improve performance.

Quality

80%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

Fix and improve this skill with Tessl

tessl review fix ./mod/slash/lib/preset/optimize/SKILL.md
SKILL.md
Quality
Evals
Security

Performance Optimizer

Trigger

Use when:

  • User says /optimize
  • User reports slowness or high resource usage
  • User asks for performance improvements

Do NOT use when:

  • User asks for readability improvements (use /simplify)
  • User asks for security audit (use /security-review)

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:

  • Algorithmic complexity (O(n²) → O(n log n))
  • Synchronous I/O in loops
  • N+1 query patterns
  • Missing database indexes
  • Unbounded memory growth
  • Repeated expensive computations without caching

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

  • Do NOT optimize without profiling data unless obvious algorithmic issue
  • Focus on the 20% causing 80% of slowdown (Pareto)
  • Verify each suggestion is measurable
  • Do NOT auto-apply changes
Repository

x-cmd/x-cmd

Path

mod/slash/lib/preset/optimize/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.