Agent skill

Performance Optimizer

by einverne in einverne/dotfiles

Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems.

GPL-3.0Auto-check passedDevelopment

Install Performance Optimizer

skills CLI
$ npx skills add einverne/dotfiles --skill performance-optimizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install einverne/dotfiles performance-optimizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/einverne/dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/skills/performance-optimizer .claude/skills/performance-optimizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
performance-optimizer
GitHub stars
121
Token cost
~1.8k tokens
SKILL.md length
388 words
Files
1
Skills in repo
39
Repo updated
First seen
Licence
GPL-3.0

At a glance

Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems.

  • Works in 9 steps: Measure First → Find the Bottleneck → Optimize Strategically → …
  • The user needs to improve performance
  • SKILL.md covers Performance Analysis Process, Profiling Tools, Common Performance Issues and Optimization Techniques, plus 3 more sections
  • Calls python, pip and node

What it does

Performance Optimizer is an agent skill from einverne/dotfiles. Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems. Use when the user needs to improve performance, reduce resource usage, or identify and fix performance bottlenecks.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Performance optimization and Shell scripting. The repository describes itself as: my personal dotfiles managed by dotbot, zinit. The licence is GPL-3.0.

When your agent uses it

  • The user needs to improve performance
  • Reduce resource usage
  • Identify and fix performance bottlenecks

Example prompts

  • “/performance-optimizer”

Requirements

  • Python 3
  • Node.js

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Measure First
  2. Find the Bottleneck
  3. Optimize Strategically
  4. Verify Improvements
  5. Algorithm Complexity
  6. Unnecessary Loops
  7. I/O Bottlenecks
  8. Memory Issues
  9. Database Queries

What it can do on your machine

Read from SKILL.md and the folder at commit c6c0686. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pip
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Performance Optimizer loads about 1.8k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 388 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from einverne/dotfiles at commit c6c0686, republished under its GPL-3.0 licence (© einverne). 388 words, ~1,822 tokens.

Download SKILL.mdSave it as .claude/skills/performance-optimizer/SKILL.md (or your agent's skills folder).
name
performance-optimizer
description
Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems. Use when the user needs to improve performance, reduce resource usage, or identify and fix performance bottlenecks.

You are a performance optimization expert. Your role is to help users identify bottlenecks, optimize code, and improve system performance.

Performance Analysis Process

1. Measure First
  • Never optimize without profiling
  • Establish baseline metrics
  • Identify actual bottlenecks
  • Use proper profiling tools
  • Measure improvement after changes
2. Find the Bottleneck
  • 80/20 rule: 80% of time spent in 20% of code
  • Profile to find hot paths
  • Look for algorithmic issues
  • Check I/O operations
  • Examine memory usage
3. Optimize Strategically
  • Fix the biggest bottleneck first
  • Consider algorithmic improvements
  • Optimize hot paths only
  • Balance readability vs performance
  • Document optimizations
4. Verify Improvements
  • Measure performance gain
  • Run benchmarks
  • Test edge cases
  • Ensure correctness maintained
  • Check for regressions

Profiling Tools

Python
bash
# CPU profiling
python -m cProfile -o output.prof script.py
python -m cProfile -s cumtime script.py

# Visualize with snakeviz
pip install snakeviz
snakeviz output.prof

# Line profiler
pip install line-profiler
kernprof -l -v script.py

# Memory profiling
pip install memory-profiler
python -m memory_profiler script.py
JavaScript/Node.js
bash
# Node.js profiling
node --prof app.js
node --prof-process isolate-*.log

# Chrome DevTools
# Run with --inspect flag
node --inspect app.js
Shell Scripts
bash
# Time execution
time script.sh

# Detailed timing
hyperfine 'command1' 'command2'

# Profile with bash
PS4='+ $(date "+%s.%N")\011 ' bash -x script.sh
System-Level
bash
# CPU usage
top
htop
mpstat 1

# I/O profiling
iotop
iostat -x 1

# System calls
strace -c command

Common Performance Issues

1. Algorithm Complexity

Problem: Using O(n²) when O(n) or O(n log n) exists

python
# Bad: O(n²)
for item in list1:
    if item in list2:  # O(n) lookup
        process(item)

# Good: O(n)
set2 = set(list2)  # O(n) conversion
for item in list1:
    if item in set2:  # O(1) lookup
        process(item)
2. Unnecessary Loops

Problem: Nested loops, redundant iterations

python
# Bad: Multiple passes
result = [x for x in data if condition1(x)]
result = [x for x in result if condition2(x)]
result = [transform(x) for x in result]

# Good: Single pass
result = [
    transform(x)
    for x in data
    if condition1(x) and condition2(x)
]
3. I/O Bottlenecks

Problem: Too many small reads/writes

python
# Bad: Many small writes
for line in data:
    file.write(line + '\n')

# Good: Batch writes
file.writelines(f'{line}\n' for line in data)

# Better: Buffer writes
with open('file.txt', 'w', buffering=1024*1024) as f:
    f.writelines(f'{line}\n' for line in data)
4. Memory Issues

Problem: Loading everything into memory

python
# Bad: Load entire file
with open('huge.txt') as f:
    data = f.read()
    process(data)

# Good: Stream/iterate
with open('huge.txt') as f:
    for line in f:
        process(line)
5. Database Queries

Problem: N+1 queries, missing indexes

sql
-- Bad: N+1 problem
SELECT * FROM users;
-- Then for each user:
SELECT * FROM posts WHERE user_id = ?;

-- Good: JOIN
SELECT users.*, posts.*
FROM users
LEFT JOIN posts ON users.id = posts.user_id;

-- Also add indexes
CREATE INDEX idx_posts_user_id ON posts(user_id);

Optimization Techniques

Caching
python
from functools import lru_cache

@lru_cache(maxsize=128)
def expensive_function(n):
    # Computed result cached
    return complex_calculation(n)
Lazy Evaluation
python
# Bad: Creates full list
squares = [x**2 for x in range(1000000)]

# Good: Generator (lazy)
squares = (x**2 for x in range(1000000))
Vectorization (NumPy)
python
import numpy as np

# Bad: Python loop
result = [x * 2 + 1 for x in data]

# Good: Vectorized
result = np.array(data) * 2 + 1
Parallel Processing
python
from multiprocessing import Pool

# Process in parallel
with Pool(4) as p:
    results = p.map(process_item, items)
Compile with Cython/Numba
python
from numba import jit

@jit
def fast_function(x, y):
    # Compiled to machine code
    return x ** 2 + y ** 2

Database Optimization

Query Optimization
  • Use EXPLAIN to analyze queries
  • Add indexes on WHERE/JOIN columns
  • Avoid SELECT *, fetch only needed columns
  • Use LIMIT for pagination
  • Batch inserts/updates
Connection Pooling
python
# Reuse connections
pool = ConnectionPool(min=5, max=20)
Caching Layer
  • Redis/Memcached for frequently accessed data
  • Cache query results
  • Set appropriate TTL

Web Performance

Frontend
  • Minimize HTTP requests
  • Compress assets (gzip/brotli)
  • Lazy load images
  • Code splitting
  • Use CDN
  • Browser caching
Show full SKILL.md (151 more words)Show less
Backend
  • Use reverse proxy (nginx)
  • Enable HTTP/2
  • Implement rate limiting
  • Async processing for slow tasks
  • Connection keep-alive

Benchmarking Best Practices

Write Good Benchmarks
python
import timeit

# Run multiple times
time = timeit.timeit(
    'function()',
    setup='from __main__ import function',
    number=1000
)

# Compare alternatives
times = {
    'method1': timeit.timeit('method1()', ...),
    'method2': timeit.timeit('method2()', ...),
}
Benchmark Checklist
  • Run on representative data
  • Include warm-up iterations
  • Run multiple times
  • Calculate mean and std dev
  • Test on target hardware
  • Consider different data sizes

Memory Optimization

Reduce Memory Usage
python
# Use generators instead of lists
def read_large_file(file):
    for line in file:
        yield process(line)

# Use __slots__ for classes
class Point:
    __slots__ = ['x', 'y']
    def __init__(self, x, y):
        self.x = x
        self.y = y
Find Memory Leaks
bash
# Python memory profiler
@profile
def my_function():
    pass

# Check reference counts
import sys
sys.getrefcount(object)

Shell Script Optimization

bash
# Avoid unnecessary commands
# Bad
cat file | grep pattern

# Good
grep pattern file

# Use built-ins when possible
# Bad
result=$(date +%s)

# Good (in bash)
printf -v result '%(%s)T' -1

# Parallel execution
# Process files in parallel
find . -name "*.txt" | xargs -P 4 -I {} process {}

When NOT to Optimize

  • Code is fast enough for requirements
  • Optimization reduces readability significantly
  • Maintenance cost outweighs performance gain
  • Premature optimization (no profiling data)
  • Micro-optimizations with negligible impact

Performance Budgets

Set clear targets:

  • Response time: < 200ms
  • Page load: < 3s
  • API latency: < 100ms
  • Memory usage: < 500MB
  • CPU usage: < 50%

Monitoring and Alerts

  • Set up performance monitoring
  • Track key metrics over time
  • Alert on regressions
  • Profile in production (carefully)
  • Use APM tools (New Relic, DataDog, etc.)

Remember: Premature optimization is the root of all evil. Always profile first, optimize the bottleneck, then measure improvement.

© einverne, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in claude/skills/performance-optimizer of einverne/dotfiles.

Open the folder on GitHubat commit c6c0686

Compare with similar skills

Performance Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Performance Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Performance Optimizer this skilleinverne/dotfiles121—~1.8kAutomated safety check: PassGPL-3.0
Cppcrazyguitar/cppcheatsheet290—~1.8kAutomated safety check: PassMIT
Swiftdata ArchitectureKartikLabhshetwar/better-shot2.4k2 repos~1.2kAutomated safety check: PassCustom licence
Performance OptimizationThibautBaissac/rails_ai_agents665—~1.2kAutomated safety check: NotesMIT
Mz ProfileMaterializeInc/materialize6.4k—~480Automated safety check: PassCustom licence
Android Profilerarindamxd/camerax-android1322 repos~493Automated safety check: PassApache-2.0

Similar skills

  • Cpp

    crazyguitar/cppcheatsheet

    Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.

    290 GitHub stars~1.8k tokensUpdated 6 days ago
    DevelopmentAuto-check passed
  • Swiftdata Architecture

    KartikLabhshetwar/better-shot

    Deep dive into SwiftData design patterns and best practices.

    2.4k GitHub starsUsed in 2 repos~1.2k tokens
    DevelopmentAuto-check passed
  • Performance Optimization

    ThibautBaissac/rails_ai_agents

    Identifies and fixes Rails performance issues including N+1 queries, slow queries, and memory problems.

    665 GitHub stars~1.2k tokensUpdated 4 mo ago
    DevelopmentAuto-check: notes
  • Mz Profile

    MaterializeInc/materialize

    Trigger: "profile Materialize", "check memory usage", "analyze binary size", "debug performance", or mentions profiling, samply, heaptrack, flame graphs, memory checking, binary size, slow queries…

    6.4k GitHub stars~480 tokensUpdated today
    DevelopmentAuto-check passed
  • Android Profiler

    arindamxd/camerax-android

    Manages Android performance profiling and debugging. An agent skill from arindamxd/camerax-android.

    132 GitHub starsUsed in 2 repos~493 tokens
    DevelopmentAuto-check passed
  • Dax

    data-goblin/power-bi-agentic-development

    DAX performance optimization for semantic models. An agent skill from data-goblin/power-bi-agentic-development.

    1k GitHub stars~593 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from einverne/dotfiles

All 39 skills in this repo
  • DOCX

    einverne/dotfiles

    Comprehensive document creation, editing, and analysis with support for tracked changes, comments, formatting preservation, and text extraction.

    121 GitHub starsUsed in 34 repos~2.5k tokens
    Auto-check: notes
  • Chrome Devtools

    einverne/dotfiles

    Browser automation, debugging, and performance analysis using Puppeteer CLI scripts.

    121 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check: notes
  • PDF

    einverne/dotfiles

    Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms.

    121 GitHub starsUsed in 46 repos~1.8k tokens
    Auto-check passed
  • Gemini Audio

    einverne/dotfiles

    Guide for implementing Google Gemini API audio capabilities - analyze audio with transcription, summarization, and understanding (up to 9.5 hours), plus generate speech with controllable TTS.

    121 GitHub starsUsed in 1 repo~2k tokens
    Auto-check: notes
  • Gemini Image Gen

    einverne/dotfiles

    Guide for implementing Google Gemini API image generation - create high-quality images from text prompts using gemini-2.5-flash-image model.

    121 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check: notes
  • Gemini Vision

    einverne/dotfiles

    Guide for implementing Google Gemini API image understanding - analyze images with captioning, classification, visual QA, object detection, segmentation, and multi-image comparison.

    121 GitHub starsUsed in 1 repo~1.6k tokens
    Auto-check: notes

Questions about Performance Optimizer

What does Performance Optimizer do?

Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems. Performance Optimizer is an agent skill from einverne/dotfiles. Performance analysis, profiling techniques, bottleneck identification, and optimization strategies for code and systems.

When should I use Performance Optimizer?

Performance Optimizer fits situations like: the user needs to improve performance; reduce resource usage; identify and fix performance bottlenecks.

How do I install Performance Optimizer in Claude Code?

Run `npx skills add einverne/dotfiles --skill performance-optimizer -a claude-code`. Or copy the skill folder (claude/skills/performance-optimizer in einverne/dotfiles) into .claude/skills/performance-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Performance Optimizer in Codex?

Run `npx skills add einverne/dotfiles --skill performance-optimizer -a codex`. Or copy the skill folder (claude/skills/performance-optimizer in einverne/dotfiles) into .agents/skills/performance-optimizer in your project. Codex loads it when a task matches its description.

Can I use Performance Optimizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add einverne/dotfiles --skill performance-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/performance-optimizer, .gemini/skills/performance-optimizer, .github/skills/performance-optimizer and .opencode/skills/performance-optimizer in your project.

What does Performance Optimizer need to run?

Going by SKILL.md and its folder, Performance Optimizer needs the command-line tools its instructions call (python, pip and node). Our summary lists: Python 3; Node.js.

Does Performance Optimizer access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Performance Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Performance Optimizer use?

Performance Optimizer is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Performance Optimizer use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Performance Optimizer?

Skills that share tags, products or a category with Performance Optimizer: Cpp (crazyguitar/cppcheatsheet, 290 stars), Swiftdata Architecture (KartikLabhshetwar/better-shot, 2.4k stars), Performance Optimization (ThibautBaissac/rails_ai_agents, 665 stars) and Mz Profile (MaterializeInc/materialize, 6.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Performance Optimizer?

einverne (a GitHub user) maintains it in einverne/dotfiles, which has 121 GitHub stars. The repository holds 39 skills in this directory. The repository was last updated on September 9, 2026.

Source: einverne/dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.