Agent skill

Performance Optimizer

by davila7 in davila7/claude-code-templates

Identifies and fixes performance bottlenecks in code, databases, and APIs.

MITAuto-check passed

Install Performance Optimizer

skills CLI
$ npx skills add davila7/claude-code-templates --skill performance-optimizer -a claude-code

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

GitHub CLI
$ gh skill install davila7/claude-code-templates 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/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/productivity/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
32k
Used in
3 other repos
Token cost
~2.1k tokens
SKILL.md length
376 words
Files
2
Skills in repo
477
Repo updated
First seen
Licence
MIT

At a glance

Identifies and fixes performance bottlenecks in code, databases, and APIs.

  • Works in 3 steps: Measure First → Find the Bottleneck → Optimize
  • SKILL.md covers When to Use This Skill, The Optimization Process, Common Optimizations and Measuring Impact, plus 7 more sections
  • Calls node and bundle

What it does

Performance Optimizer is an agent skill from davila7/claude-code-templates. Identifies and fixes performance bottlenecks in code, databases, and APIs. Measures before and after to prove improvements.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).

The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

Example prompts

  • “Use the performance-optimizer skill to identify and fixes performance bottlenecks in code, databases, and APIs”
  • “/performance-optimizer”

Requirements

  • Node.js

Workflow steps

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

  1. Measure First
  2. Find the Bottleneck
  3. Optimize

What it can do on your machine

Read from SKILL.md and the folder at commit 4c82aba. 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:

    • node
    • bundle

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

  • Network

    No URLs in SKILL.md.

    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 2.1k tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 376 words of instructions outside code blocks.

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

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 davila7/claude-code-templates at commit 4c82aba, republished under its MIT licence (© davila7). 376 words, ~2,129 tokens.

Download SKILL.mdSave it as .claude/skills/performance-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
performance-optimizer
description
Identifies and fixes performance bottlenecks in code, databases, and APIs. Measures before and after to prove improvements.
category
development
risk
safe
source
community
date_added
2026-03-05

Performance Optimizer

Find and fix performance bottlenecks. Measure, optimize, verify. Make it fast.

When to Use This Skill

  • App is slow or laggy
  • User complains about performance
  • Page load times are high
  • API responses are slow
  • Database queries take too long
  • User mentions "slow", "lag", "performance", or "optimize"

The Optimization Process

1. Measure First

Never optimize without measuring:

javascript
// Measure execution time
console.time('operation');
await slowOperation();
console.timeEnd('operation'); // operation: 2341ms

What to measure:

  • Page load time
  • API response time
  • Database query time
  • Function execution time
  • Memory usage
  • Network requests
2. Find the Bottleneck

Use profiling tools to find the slow parts:

Browser:

DevTools → Performance tab → Record → Stop
Look for long tasks (red bars)

Node.js:

bash
node --prof app.js
node --prof-process isolate-*.log > profile.txt

Database:

sql
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
3. Optimize

Fix the slowest thing first (biggest impact).

Common Optimizations

Database Queries

Problem: N+1 Queries

javascript
// Bad: N+1 queries
const users = await db.users.find();
for (const user of users) {
  user.posts = await db.posts.find({ userId: user.id }); // N queries
}

// Good: Single query with JOIN
const users = await db.users.find()
  .populate('posts'); // 1 query

Problem: Missing Index

sql
-- Check slow query
EXPLAIN SELECT * FROM users WHERE email = 'test@example.com';
-- Shows: Seq Scan (bad)

-- Add index
CREATE INDEX idx_users_email ON users(email);

-- Check again
EXPLAIN SELECT * FROM users WHERE email = 'test@example.com';
-- Shows: Index Scan (good)

**Problem: SELECT ***

javascript
// Bad: Fetches all columns
const users = await db.query('SELECT * FROM users');

// Good: Only needed columns
const users = await db.query('SELECT id, name, email FROM users');

Problem: No Pagination

javascript
// Bad: Returns all records
const users = await db.users.find();

// Good: Paginated
const users = await db.users.find()
  .limit(20)
  .skip((page - 1) * 20);
API Performance

Problem: No Caching

javascript
// Bad: Hits database every time
app.get('/api/stats', async (req, res) => {
  const stats = await db.stats.calculate(); // Slow
  res.json(stats);
});

// Good: Cache for 5 minutes
const cache = new Map();
app.get('/api/stats', async (req, res) => {
  const cached = cache.get('stats');
  if (cached && Date.now() - cached.time < 300000) {
    return res.json(cached.data);
  }
  
  const stats = await db.stats.calculate();
  cache.set('stats', { data: stats, time: Date.now() });
  res.json(stats);
});

Problem: Sequential Operations

javascript
// Bad: Sequential (slow)
const user = await getUser(id);
const posts = await getPosts(id);
const comments = await getComments(id);
// Total: 300ms + 200ms + 150ms = 650ms

// Good: Parallel (fast)
const [user, posts, comments] = await Promise.all([
  getUser(id),
  getPosts(id),
  getComments(id)
]);
// Total: max(300ms, 200ms, 150ms) = 300ms

Problem: Large Payloads

javascript
// Bad: Returns everything
res.json(users); // 5MB response

// Good: Only needed fields
res.json(users.map(u => ({
  id: u.id,
  name: u.name,
  email: u.email
}))); // 500KB response
Frontend Performance

Problem: Unnecessary Re-renders

javascript
// Bad: Re-renders on every parent update
function UserList({ users }) {
  return users.map(user => <UserCard user={user} />);
}

// Good: Memoized
const UserCard = React.memo(({ user }) => {
  return <div>{user.name}</div>;
});

Problem: Large Bundle

javascript
// Bad: Imports entire library
import _ from 'lodash'; // 70KB

// Good: Import only what you need
import debounce from 'lodash/debounce'; // 2KB

Problem: No Code Splitting

javascript
// Bad: Everything in one bundle
import HeavyComponent from './HeavyComponent';

// Good: Lazy load
const HeavyComponent = React.lazy(() => import('./HeavyComponent'));

Problem: Unoptimized Images

html
<!-- Bad: Large image -->
<img src="photo.jpg" /> <!-- 5MB -->

<!-- Good: Optimized and responsive -->
<img 
  src="photo-small.webp" 
  srcset="photo-small.webp 400w, photo-large.webp 800w"
  loading="lazy"
  width="400"
  height="300"
/> <!-- 50KB -->
Algorithm Optimization

Problem: Inefficient Algorithm

javascript
// Bad: O(n²) - nested loops
function findDuplicates(arr) {
  const duplicates = [];
  for (let i = 0; i < arr.length; i++) {
    for (let j = i + 1; j < arr.length; j++) {
      if (arr[i] === arr[j]) duplicates.push(arr[i]);
    }
  }
  return duplicates;
}

// Good: O(n) - single pass with Set
function findDuplicates(arr) {
  const seen = new Set();
  const duplicates = new Set();
  for (const item of arr) {
    if (seen.has(item)) duplicates.add(item);
    seen.add(item);
  }
  return Array.from(duplicates);
}

Problem: Repeated Calculations

javascript
// Bad: Calculates every time
function getTotal(items) {
  return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}
// Called 100 times in render

// Good: Memoized
const getTotal = useMemo(() => {
  return items.reduce((sum, item) => sum + item.price * item.quantity, 0);
}, [items]);
Memory Optimization

Problem: Memory Leak

javascript
// Bad: Event listener not cleaned up
useEffect(() => {
  window.addEventListener('scroll', handleScroll);
  // Memory leak!
}, []);

// Good: Cleanup
useEffect(() => {
  window.addEventListener('scroll', handleScroll);
  return () => window.removeEventListener('scroll', handleScroll);
}, []);

Problem: Large Data in Memory

javascript
// Bad: Loads entire file into memory
const data = fs.readFileSync('huge-file.txt'); // 1GB

// Good: Stream it
const stream = fs.createReadStream('huge-file.txt');
stream.on('data', chunk => process(chunk));

Measuring Impact

Always measure before and after:

javascript
// Before optimization
console.time('query');
const users = await db.users.find();
console.timeEnd('query');
// query: 2341ms

// After optimization (added index)
console.time('query');
const users = await db.users.find();
console.timeEnd('query');
// query: 23ms

// Improvement: 100x faster!

Performance Budgets

Set targets:

Page Load: < 2 seconds
API Response: < 200ms
Database Query: < 50ms
Bundle Size: < 200KB
Time to Interactive: < 3 seconds

Tools

Browser:

  • Chrome DevTools Performance tab
  • Lighthouse (audit)
  • Network tab (waterfall)

Node.js:

  • node --prof (profiling)
  • clinic (diagnostics)
  • autocannon (load testing)

Database:

  • EXPLAIN ANALYZE (query plans)
  • Slow query log
  • Database profiler

Monitoring:

  • New Relic
  • Datadog
  • Sentry Performance
Show full SKILL.md (169 more words)Show less

Quick Wins

Easy optimizations with big impact:

  1. Add database indexes on frequently queried columns
  2. Enable gzip compression on server
  3. Add caching for expensive operations
  4. Lazy load images and heavy components
  5. Use CDN for static assets
  6. Minify and compress JavaScript/CSS
  7. Remove unused dependencies
  8. Use pagination instead of loading all data
  9. Optimize images (WebP, proper sizing)
  10. Enable HTTP/2 on server

Optimization Checklist

  • Measured current performance
  • Identified bottleneck
  • Applied optimization
  • Measured improvement
  • Verified functionality still works
  • No new bugs introduced
  • Documented the change

When NOT to Optimize

  • Premature optimization (optimize when it's actually slow)
  • Micro-optimizations (save 1ms when page takes 5 seconds)
  • Readable code is more important than tiny speed gains
  • If it's already fast enough

Key Principles

  • Measure before optimizing
  • Fix the biggest bottleneck first
  • Measure after to prove improvement
  • Don't sacrifice readability for tiny gains
  • Profile in production-like environment
  • Consider the 80/20 rule (20% of code causes 80% of slowness)
  • @database-design - Query optimization
  • @codebase-audit-pre-push - Code review
  • @bug-hunter - Debugging

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

Files

SKILL.md and 1 other file in cli-tool/components/skills/productivity/performance-optimizer of davila7/claude-code-templates.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit 4c82aba

Used in 3 other repositories

We found 12 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 3 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

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 skilldavila7/claude-code-templates32k3 repos~2.1kAutomated safety check: PassMIT
Measure Before You Fixgarrytan/gbrain31k—~2.5kAutomated safety check: PassMIT
Measured Optimization LoopEveryInc/compound-engineering-plugin25k—~2kAutomated safety check: PassMIT
SQL Optimizationgithub/awesome-copilot40k2 repos~2.3kAutomated safety check: PassMIT
Fixalirezarezvani/claude-skills28k1 repos~765Automated safety check: PassMIT
Agent Performance Optimizerruvnet/ruflo74k2 repos~3.6kAutomated safety check: PassMIT

Similar skills

  • Measure Before You Fix

    garrytan/gbrain

    Before fixing a slow/stale/timeout alert, measure the step yourself.

    31k GitHub stars~2.5k tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Measured Optimization Loop

    EveryInc/compound-engineering-plugin

    Optimizes a named target with a measured loop, attributing a workload's cost or scoring variants and keeping winners, on a dedicated branch with a disk log.

    25k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed
  • Fix

    alirezarezvani/claude-skills

    Fix failing or flaky Playwright tests. An agent skill from alirezarezvani/claude-skills.

    28k GitHub starsUsed in 1 repo~765 tokens
    Testing & QAAuto-check passed
  • Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

    74k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Prompt Optimizer

    affaan-m/ECC

    分析原始提示,识别意图和差距,匹配ECC组件(技能/命令/代理/钩子),并输出一个可直接粘贴的优化提示。仅提供咨询角色——绝不自行执行任务。触发时机:当用户说“优化提示”、“改进我的提示”、“如何编写提示”、“帮我优化这个指令”或明确要求提高提示质量时。中文等效表达同样触发:“优化prompt”、“改进prompt”、“怎么写prompt”、“帮我优化这个指令”。不触发时机:当用户希望直接执行任…

    274k GitHub starsUsed in 2 repos~2.4k tokens
    DevelopmentAuto-check passed

More from davila7/claude-code-templates

All 477 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    32k GitHub starsUsed in 12 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 10 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    32k GitHub starsUsed in 2 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    32k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    32k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Questions about Performance Optimizer

What does Performance Optimizer do?

Identifies and fixes performance bottlenecks in code, databases, and APIs. Performance Optimizer is an agent skill from davila7/claude-code-templates. Identifies and fixes performance bottlenecks in code, databases, and APIs.

How do I install Performance Optimizer in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill performance-optimizer -a claude-code`. Or copy the skill folder (cli-tool/components/skills/productivity/performance-optimizer in davila7/claude-code-templates) 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 davila7/claude-code-templates --skill performance-optimizer -a codex`. Or copy the skill folder (cli-tool/components/skills/productivity/performance-optimizer in davila7/claude-code-templates) 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 davila7/claude-code-templates --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 (node and bundle). Our summary lists: Node.js.

Does Performance Optimizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. 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 MIT 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 2.1k tokens (SKILL.md is roughly 8.5k 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: Measure Before You Fix (garrytan/gbrain, 31k stars), Measured Optimization Loop (EveryInc/compound-engineering-plugin, 25k stars), SQL Optimization (github/awesome-copilot, 40k stars) and Fix (alirezarezvani/claude-skills, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Performance Optimizer?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,432 GitHub stars. The repository holds 477 skills in this directory. The repository was last updated on October 7, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.