performance-optimization-skill

performance-optimization-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 39 tokens per session (4,248 once invoked), scanned C, original, Apache-2.0.

A performance review and fixing guide for applications across the frontend, backend, and database. It covers ways to measure slow work and reduce its cost.

In plain words
What is it for?
Use it for profiling CPU, memory, or input/output; adding caching; reducing JavaScript bundle size; lazy loading; finding N+1 queries; and investigating memory leaks.
Why use it?
It helps diagnose slow pages, API responses, database queries, and long-running processes instead of relying on guesswork.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions OpenCode.

Good fit Use it for profiling CPU, memory, or input/output; adding caching; reducing JavaScript bundle size; lazy loading; finding N+1 queries; and investigating memory leaks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/performance-optimization-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add darellchua2/opencode-config-template --skill performance-optimization-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for performance-optimization-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/performance-optimization-skill.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/performance-optimization-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/performance-optimization-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/performance-optimization-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.04248
Opus 5 $0.00019 $0.02124
Sonnet 5 $0.00008 $0.00850
Haiku 4.5 $0.00004 $0.00425

Measured 4d ago against content hash 345e897556e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

performance-optimization-skill scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

When protocol is enabled, this skill defaults to `Iterations: 10` (sufficient for typical single-pass workflows). Override with `Iterations: N` for specific tasks. Safety blocks: `.env`, `node_modules/`, `rm -rf`, `git p
opencode_app/.opencode/skills/performance-optimization-skill/SKILL.md · 565 lines

How it starts

The opening of the file, as written. The whole thing — 565 lines — stays where its author put it; the contents beside it link to each section on GitHub.

What I do

I help you identify and resolve performance bottlenecks across the full stack:

  1. Profiling: CPU, memory, and I/O profiling for Python and Node.js
  2. Caching: Redis, memoization, HTTP caching, and CDN strategies
  3. Bundle Optimization: JavaScript bundle analysis and reduction
  4. Lazy Loading: Code splitting and on-demand resource loading
  5. Database Query Optimization: N+1 detection, query analysis, indexing
  6. Memory Leaks: Detection and resolution patterns

When to use me

Use this skill when:

  • Investigating slow API responses or page loads
  • Setting up caching layers (Redis, memoization)
  • Analyzing and reducing JavaScript bundle size
  • Detecting and fixing N+1 query problems
  • Profiling CPU or memory usage
  • Implementing lazy loading or code splitting
  • Optimizing database query performance
  • Diagnosing memory leaks in long-running processes
  • database-migration-skill: Handles schema lifecycle (creating indexes in migrations). This skill handles runtime query optimization and profiling.
  • frontend-design-skill: UI creation. This skill handles rendering performance optimization.
  • docker-containerization-skill: Container resource limits and configuration.

Step 1: Profiling

Python (cProfile)

python -m cProfile -s cumtime app.py
python -m cProfile -o profile.stats app.py
import cProfile
import pstats

def profile_function(func, *args):
    profiler = cProfile.Profile()
    result = profiler.runcall(func, *args)
    stats = pstats.Stats(profiler)
    stats.sort_stats('cumulative')
    stats.print_stats(20)
    return result

Python (line_profiler)

from line_profiler import profile

@profile
def slow_function(data):
    result = []
    for item in data:
        processed = expensive_operation(item)
        result.append(processed)
    return result

Node.js

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

NODE_OPTIONS="--inspect" node app.js
# Open chrome://inspect → CPU Profile

Read the full file on GitHub · 565 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 565 lines · 39 tokens per session scan C 345e897556e5

Subscribe to this mod's changes

performance-optimization-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 39 tokens to every session and 4,248 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

om-data-model-design

Design or change standalone module entities, relations, encryption maps, migrations, snapshots, locking, and atomic writes. Use for "add entity", "database model", "migration", "encrypt this field", "optimistic locking", "model danych", or persistence bugs.

open-mercato/open-mercato · 58 tokens

qdrant-monitoring-debugging

Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high', 'OOM crash', 'queries are slow', 'latency spike', or 'search was fast now it's slow'. Also use when performance degrades without obvious config changes.

qdrant/skills · 75 tokens

performance

Use when optimizing application performance — caching strategies, eager loading, query optimization, Redis patterns, or background job design.

event4u-app/agent-config · 25 tokens

kora-aop-caching

Kora caching via compile-time AOP — @Cacheable/@CachePut/@CacheInvalidate over Caffeine (in-process) or Redis (distributed). Use when adding caching, choosing Caffeine vs Redis, or fixing "required keyPrefix" graph errors.

kora-projects/kora-skills · 58 tokens

perf-engineering

A guide to finding and fixing slow code, excessive memory use, slow startup, repeated database queries, and inefficient caching.

cass-2003/local-workflow-skill · 79 tokens

stale-derived-state

Diagnose a change that does not take effect until a reload, a logout or a navigation away and back, because a cache or a piece of derived state has no invalidation hook on write. Use when a save appears to work but the screen keeps showing the old value. Names the Crumbtrail queries that prove the write landed, and…

CrumbtrailDev/crumbtrail-cli · 85 tokens