Agent skill

Optimizing Performance

by CloudAI-X in CloudAI-X/opencode-workflow

Guides performance optimization, profiling techniques, and bottleneck identification.

MITAuto-check passedDevelopment

Install Optimizing Performance

skills CLI
$ npx skills add CloudAI-X/opencode-workflow --skill optimizing-performance -a claude-code

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

GitHub CLI
$ gh skill install CloudAI-X/opencode-workflow optimizing-performance --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/CloudAI-X/opencode-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/optimizing-performance .claude/skills/optimizing-performance && 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
optimizing-performance
GitHub stars
275
Token cost
~2.6k tokens
SKILL.md length
515 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Guides performance optimization, profiling techniques, and bottleneck identification.

  • Works in 5 steps: Measure first - Never optimize without… → Optimize the right thing - Find the… → Keep it simple - Complexity often hurts… → …
  • Improving application speed
  • SKILL.md covers When to Use This Skill, Performance Optimization…, Profiling Techniques and Common Bottleneck Patterns, plus 4 more sections
  • Calls npx, node and go

What it does

Optimizing Performance is an agent skill from CloudAI-X/opencode-workflow. Guides performance optimization, profiling techniques, and bottleneck identification. Use when improving application speed, reducing resource usage, or diagnosing performance issues.

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

It sits in Development, covering Performance optimization. The licence is MIT.

When your agent uses it

  • Improving application speed
  • Reducing resource usage
  • Diagnosing performance issues

Example prompts

  • “Use the optimizing-performance skill to guide performance optimization, profiling techniques, and bottleneck identification”
  • “/optimizing-performance”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): opencode

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Measure first - Never optimize without data
  2. Optimize the right thing - Find the actual bottleneck
  3. Keep it simple - Complexity often hurts performance
  4. Test after - Verify the optimization worked
  5. Document trade-offs - Performance often costs readability

What it can do on your machine

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

    • npx
    • node
    • go
    • python

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

  • Network

    No URLs in SKILL.md. Its commands use npx, 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.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

Optimizing Performance loads about 2.6k tokens when it runs. Until then it costs about 51 tokens; SKILL.md has 515 words of instructions outside code blocks.

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

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 CloudAI-X/opencode-workflow at commit 0128ca6, republished under its MIT licence (© CloudAI-X). 515 words, ~2,565 tokens.

Download SKILL.mdSave it as .claude/skills/optimizing-performance/SKILL.md (or your agent's skills folder).
name
optimizing-performance
description
Guides performance optimization, profiling techniques, and bottleneck identification. Use when improving application speed, reducing resource usage, or diagnosing performance issues.
compatibility
opencode
license
MIT
metadata.category
quality
metadata.audience
developers

Optimizing Performance

Strategies for identifying, analyzing, and resolving performance bottlenecks.

When to Use This Skill

  • Application is running slowly
  • High resource consumption (CPU, memory)
  • Database queries are slow
  • API response times are high
  • Need to scale for more users
  • Preparing for load testing

Performance Optimization Philosophy

The Golden Rules
  1. Measure first - Never optimize without data
  2. Optimize the right thing - Find the actual bottleneck
  3. Keep it simple - Complexity often hurts performance
  4. Test after - Verify the optimization worked
  5. Document trade-offs - Performance often costs readability
The 80/20 Rule
80% of performance problems come from 20% of the code.

Focus on:
├── Hot paths (frequently executed code)
├── I/O operations (database, network, disk)
├── Memory allocation patterns
└── Algorithm complexity

Profiling Techniques

Types of Profiling
TypeWhat It MeasuresTools
CPU ProfilingTime spent in functionspprof, py-spy, Chrome DevTools
Memory ProfilingAllocation patterns, leaksValgrind, memory_profiler, Chrome
I/O ProfilingDisk/network operationsstrace, perf, Wireshark
Database ProfilingQuery performanceEXPLAIN, slow query log, APM
Profiling Workflow
1. Establish baseline
   └─ Measure current performance with realistic load

2. Identify hotspots
   └─ Profile to find where time/resources are spent

3. Form hypothesis
   └─ Why is this slow? What would make it faster?

4. Implement fix
   └─ Make ONE change at a time

5. Measure again
   └─ Did it help? By how much?

6. Repeat
   └─ Until performance goals are met
Common Profiling Commands
bash
# Node.js
node --prof app.js
node --prof-process isolate-*.log > profile.txt

# Python
python -m cProfile -s cumtime app.py
py-spy record -o profile.svg -- python app.py

# Go
go test -cpuprofile cpu.prof -memprofile mem.prof -bench .
go tool pprof cpu.prof

# Database (PostgreSQL)
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';

Common Bottleneck Patterns

N+1 Query Problem
BAD (N+1 queries):
  SELECT * FROM posts;             -- 1 query
  SELECT * FROM users WHERE id=1;  -- N queries
  SELECT * FROM users WHERE id=2;
  ...

GOOD (2 queries):
  SELECT * FROM posts;
  SELECT * FROM users WHERE id IN (1, 2, 3, ...);

Detection: High query count relative to data returned Fix: Eager loading, batch fetching, JOINs

Unbounded Operations
BAD:
  SELECT * FROM logs;  -- Returns millions of rows

GOOD:
  SELECT * FROM logs
  WHERE created_at > NOW() - INTERVAL '1 day'
  LIMIT 100;

Detection: Memory spikes, timeouts Fix: Pagination, limits, streaming

Synchronous Blocking
BAD (blocking):
  result1 = fetch_api_1()  -- Wait 200ms
  result2 = fetch_api_2()  -- Wait 200ms
  return combine(result1, result2)  -- Total: 400ms

GOOD (parallel):
  [result1, result2] = await Promise.all([
    fetch_api_1(),
    fetch_api_2()
  ])  -- Total: ~200ms

Detection: Sequential I/O in traces Fix: Parallel execution, async/await

Excessive Allocation
BAD (allocates in loop):
  for item in large_list:
      result = []  # Allocates each iteration
      result.append(transform(item))

GOOD (pre-allocate):
  result = []
  for item in large_list:
      result.append(transform(item))

BEST (generator):
  def transform_all(items):
      for item in items:
          yield transform(item)

Detection: GC pressure, memory profiling Fix: Object pooling, pre-allocation, generators


Optimization Techniques

Database Optimization
TechniqueWhen to UseImpact
IndexingSlow WHERE/JOIN queriesHigh
Query optimizationComplex queriesHigh
Connection poolingMany short connectionsMedium
Read replicasRead-heavy workloadsHigh
CachingRepeated queriesVery High
DenormalizationComplex JOINsMedium
Index Guidelines
sql
-- Create index for frequently queried columns
CREATE INDEX idx_users_email ON users(email);

-- Composite index for multiple column queries
CREATE INDEX idx_orders_user_date ON orders(user_id, created_at);

-- Check if index is used
EXPLAIN ANALYZE SELECT * FROM users WHERE email = 'test@example.com';
Caching Strategies
StrategyUse CaseInvalidation
Cache-asideGeneral purposeManual or TTL
Write-throughStrong consistencyOn write
Write-behindWrite-heavyAsync batched
Read-throughRead-heavyOn miss
Cache-aside pattern:
1. Check cache
2. If miss, query database
3. Store in cache
4. Return result
Memory Optimization
TechniqueWhen to Use
Object poolingFrequent allocation of same type
Lazy loadingLarge objects not always needed
StreamingProcessing large datasets
Weak referencesCache that can be evicted
Data structure choiceRight structure for access pattern

Frontend Performance

Show full SKILL.md (216 more words)Show less
Core Web Vitals
MetricTargetWhat It Measures
LCP (Largest Contentful Paint)< 2.5sLoad performance
INP (Interaction to Next Paint)< 200msInteractivity
CLS (Cumulative Layout Shift)< 0.1Visual stability
Frontend Optimization Checklist
Loading Performance:
  ☐ Code splitting (lazy load routes/components)
  ☐ Tree shaking (remove unused code)
  ☐ Minification (JS, CSS)
  ☐ Compression (gzip, brotli)
  ☐ Image optimization (WebP, srcset, lazy loading)
  ☐ CDN for static assets

Runtime Performance:
  ☐ Virtualized lists for large data
  ☐ Debounce/throttle event handlers
  ☐ Memoization of expensive computations
  ☐ Avoid layout thrashing (batch DOM reads/writes)
  ☐ Use CSS transforms for animations
  ☐ Web Workers for heavy computation
Bundle Optimization
bash
# Analyze bundle size
npx webpack-bundle-analyzer stats.json
npx source-map-explorer bundle.js

# Identify large dependencies
npx depcheck

API Performance

Response Time Targets
PercentileTargetUser Experience
p50< 100msFast
p95< 500msAcceptable
p99< 1sTolerable
API Optimization Techniques
TechniqueBenefit
Response compressionReduce transfer size
PaginationLimit response size
Field selectionReturn only needed data
ETags/Caching headersReduce redundant requests
Connection keep-aliveReduce handshake overhead
HTTP/2Multiplexing, header compression
Batch Endpoints
BAD (multiple requests):
  GET /users/1
  GET /users/2
  GET /users/3

GOOD (batch):
  POST /users/batch
  { "ids": [1, 2, 3] }

Monitoring and Alerting

Key Metrics to Track
CategoryMetrics
Latencyp50, p95, p99 response times
ThroughputRequests per second
ErrorsError rate, error types
SaturationCPU, memory, connections
Alerting Thresholds
Critical (page immediately):
  - Error rate > 5%
  - p99 latency > 5s
  - Service down

Warning (notify during hours):
  - Error rate > 1%
  - p95 latency > 2s
  - Resource utilization > 80%
Logging for Performance
python
# Log slow operations
import time
import logging

def timed_operation(func):
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        duration = time.time() - start
        if duration > 1.0:  # Log if > 1 second
            logging.warning(f"{func.__name__} took {duration:.2f}s")
        return result
    return wrapper

Performance Testing

Load Testing Tools
ToolUse Case
k6Modern, scriptable load testing
JMeterComplex scenarios, GUI
LocustPython-based, distributed
ArtilleryYAML config, easy to start
wrkSimple HTTP benchmarking
Load Test Example (k6)
javascript
import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '1m', target: 50 },   // Ramp up
    { duration: '5m', target: 50 },   // Stay at 50 users
    { duration: '1m', target: 0 },    // Ramp down
  ],
  thresholds: {
    http_req_duration: ['p(95)<500'],  // 95% under 500ms
    http_req_failed: ['rate<0.01'],    // Error rate < 1%
  },
};

export default function () {
  const res = http.get('https://api.example.com/users');
  check(res, { 'status is 200': (r) => r.status === 200 });
  sleep(1);
}

Anti-Patterns to Avoid

  1. Premature optimization - Optimize only proven bottlenecks
  2. Optimizing without measuring - Guessing wastes time
  3. Over-caching - Cache invalidation is hard
  4. Ignoring database - Often the real bottleneck
  5. Complex micro-optimizations - Usually not worth it
  6. Not testing under load - Production behavior differs
  7. Ignoring cold starts - First request matters too
  8. Over-engineering - Simpler is often faster

Quick Reference

PROFILING FLOW:
  Measure → Identify → Hypothesize → Fix → Measure → Repeat

COMMON BOTTLENECKS:
  N+1 queries → Eager loading
  Unbounded data → Pagination
  Blocking I/O → Parallelization
  Excessive allocation → Object pooling

DATABASE:
  Index frequently queried columns
  Use EXPLAIN ANALYZE
  Add caching layer

CACHING:
  Cache-aside for general use
  TTL for time-based invalidation
  Invalidate on write for consistency

TARGETS:
  p50 < 100ms
  p95 < 500ms
  p99 < 1s

TOOLS:
  CPU: pprof, py-spy
  Memory: valgrind, memory_profiler
  Load: k6, locust
  DB: EXPLAIN, slow query log

© CloudAI-X, MIT. 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 skills/optimizing-performance of CloudAI-X/opencode-workflow.

Open the folder on GitHubat commit 0128ca6

Compare with similar skills

Optimizing Performance 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.

Optimizing Performance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimizing Performance this skillCloudAI-X/opencode-workflow275—~2.6kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
LLM Torch Profiler Analysissgl-project/sglang37k2 repos~6.4kAutomated safety check: PassApache-2.0
Pycrazyguitar/pysheeet8.2k—~886Automated safety check: PassMIT
Cmux Debugging Guidemanaflow-ai/cmux28k1 repos~1.1kAutomated safety check: PassCustom licence
Electron Heap Snapshot Analysiskeybase/client9.3k—~875Automated safety check: PassBSD-3-Clause

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • LLM Torch Profiler Analysis

    sgl-project/sglang

    Unified LLM torch-profiler triage skill for sglang, vllm, TensorRT-LLM, and TokenSpeed.

    37k GitHub starsUsed in 2 repos~6.4k tokens
    DevelopmentAuto-check passed
  • Py

    crazyguitar/pysheeet

    Comprehensive Python programming reference covering syntax, concurrency, networking, databases, ML/LLM development, and HPC.

    8.2k GitHub stars~886 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Cmux Debugging Guide

    manaflow-ai/cmux

    Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.

    28k GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • Analyzes V8, Chrome and Electron .heapsnapshot files with Node scripts to find memory leaks, detached DOM nodes and the retainer paths that keep objects alive.

    9.3k GitHub stars~875 tokensUpdated today
    DevelopmentAuto-check passed
  • Runs controlled JMH experiments on the Caffeine cache to find shared contention and hot-path waste, then reviews correctness and returns a reviewable patch.

    18k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check: notes

More from CloudAI-X/opencode-workflow

  • Analyzing Projects

    CloudAI-X/opencode-workflow

    Guides systematic project analysis, codebase exploration, and architecture pattern recognition.

    275 GitHub starsUsed in 1 repo~1.8k tokens
    Auto-check passed
  • Designing APIs

    CloudAI-X/opencode-workflow

    Guides REST and GraphQL API design, endpoint patterns, request/response schemas, versioning, and API best practices.

    275 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed
  • Designing Architecture

    CloudAI-X/opencode-workflow

    Guides software architecture decisions, design patterns, and system design principles.

    275 GitHub stars~2.6k tokensUpdated 9 mo ago
    Auto-check passed
  • Designing Tests

    CloudAI-X/opencode-workflow

    Guides test strategy, TDD/BDD approaches, test coverage planning, and testing best practices.

    275 GitHub stars~2.9k tokensUpdated 9 mo ago
    Auto-check passed
  • Managing Git

    CloudAI-X/opencode-workflow

    Guides git workflows, branching strategies, commit conventions, and version control best practices.

    275 GitHub stars~2.5k tokensUpdated 9 mo ago
    Auto-check passed
  • Parallel Execution

    CloudAI-X/opencode-workflow

    CRITICAL skill for executing multiple Task tool calls in a SINGLE message for true parallelism.

    275 GitHub stars~2.1k tokensUpdated 9 mo ago
    Auto-check passed

Categories

Questions about Optimizing Performance

What does Optimizing Performance do?

Guides performance optimization, profiling techniques, and bottleneck identification. Optimizing Performance is an agent skill from CloudAI-X/opencode-workflow. Guides performance optimization, profiling techniques, and bottleneck identification.

When should I use Optimizing Performance?

Optimizing Performance fits situations like: improving application speed; reducing resource usage; diagnosing performance issues.

How do I install Optimizing Performance in Claude Code?

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

How do I install Optimizing Performance in Codex?

Run `npx skills add CloudAI-X/opencode-workflow --skill optimizing-performance -a codex`. Or copy the skill folder (skills/optimizing-performance in CloudAI-X/opencode-workflow) into .agents/skills/optimizing-performance in your project. Codex loads it when a task matches its description.

Can I use Optimizing Performance 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 CloudAI-X/opencode-workflow --skill optimizing-performance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimizing-performance, .gemini/skills/optimizing-performance, .github/skills/optimizing-performance and .opencode/skills/optimizing-performance in your project.

What does Optimizing Performance need to run?

Going by SKILL.md and its folder, Optimizing Performance needs the command-line tools its instructions call (npx, node, go and python). Our summary lists: Python 3; Node.js. Compatibility (from SKILL.md): opencode.

Does Optimizing Performance access the network?

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

Is Optimizing Performance 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 Optimizing Performance use?

Optimizing Performance is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Optimizing Performance use?

About 2.6k tokens (SKILL.md is roughly 10k 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 Optimizing Performance?

Skills that share tags, products or a category with Optimizing Performance: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), LLM Torch Profiler Analysis (sgl-project/sglang, 37k stars), Py (crazyguitar/pysheeet, 8.2k stars) and Cmux Debugging Guide (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimizing Performance?

CloudAI-X (a GitHub user) maintains it in CloudAI-X/opencode-workflow, which has 275 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on January 10, 2026.

Source: CloudAI-X/opencode-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.