Performance Optimization

Performance Optimization is a skill for Claude Code, Codex from Xiaowen-Jiang/agent-enterprise. It costs 14 tokens per session (488 once invoked), scanned A, original, MIT.

A method for finding code that uses too much time, memory, database work, or input/output and recommending specific improvements.

In plain words
What is it for?
Use it to inspect frequently run code, analyze algorithm and query costs, find caching or lazy-loading opportunities, and rank optimizations by impact and effort.
Why use it?
It exposes common causes of slow software, such as repeated database queries, inefficient loops, missing indexes, unnecessary copies, and avoidable waiting.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/xiaowen-jiang/agent-enterprise/performance_optimization
Any agent
npx skills add Xiaowen-Jiang/agent-enterprise --skill performance_optimization
Clone the repo
git clone --depth 1 https://github.com/Xiaowen-Jiang/agent-enterprise

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/xiaowen-jiang/agent-enterprise/performance_optimization.svg)](https://agentmods.dev/skills/xiaowen-jiang/agent-enterprise/performance_optimization)
Your own site
<a href="https://agentmods.dev/skills/xiaowen-jiang/agent-enterprise/performance_optimization"><img src="https://agentmods.dev/badge/skills/xiaowen-jiang/agent-enterprise/performance_optimization.svg" alt="Measured on agentmods" height="20"></a>
Per session 14 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 488 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00014 $0.00488
Opus 5 $0.00007 $0.00244
Sonnet 5 $0.00003 $0.00098
Haiku 4.5 $0.00001 $0.00049

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

Security

Grade A, and why

Performance Optimization scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agent_enterprise/skills_data/performance_optimization/SKILL.md · 61 lines

What it actually says

Process

  1. Identify hot paths — Which code runs most frequently or handles the most data?
  2. Check algorithmic complexity — Look for O(n^2) or worse in loops, searches, sorts
  3. Database query analysis:
    • N+1 queries (loop making individual queries instead of batch)
    • Missing indexes on WHERE/JOIN/ORDER BY columns
    • SELECT * when only specific columns needed
    • Unnecessary subqueries that could be JOINs
  4. Caching opportunities:
    • Repeated expensive computations
    • Frequently read, rarely updated data
    • API responses that can be cached
  5. Memory usage — Large objects in memory, memory leaks, unnecessary copies
  6. I/O optimization — Batch operations, connection pooling, async I/O
  7. Lazy loading — Defer expensive operations until actually needed

Output Format

## Performance Analysis: [Component/Module]

### Bottlenecks Found (Impact Order)

#### 1. [Bottleneck Title]
- **Location**: file:line
- **Type**: Algorithm / Database / Memory / I/O
- **Current**: O(n^2) nested loop over all users
- **Proposed**: Use a hash map for O(n) lookup
- **Expected Impact**: High / Medium / Low
- **Effort**: Small / Medium / Large

### Quick Wins
- [Changes that are easy to implement with high impact]

### Long-Term Improvements
- [Larger refactors for sustained performance gains]

### Metrics to Track
- [What to measure to verify improvements]

Guidelines

  • Profile before optimizing — don't guess where bottlenecks are
  • Fix the biggest bottleneck first (Amdahl's law)
  • Prefer algorithmic improvements over micro-optimizations
  • Consider caching only when data is read-heavy and stale data is acceptable
  • Database indexes have write overhead — only add for proven query patterns
  • Measure before and after every change
  • Don't sacrifice readability for marginal performance gains
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 · 61 lines · 14 tokens per session scan A 5bb0ab7170e0

Subscribe to this mod's changes

Performance Optimization is a skill published in the GitHub repository Xiaowen-Jiang/agent-enterprise (52 stars, last pushed 5mo ago), licensed MIT. It adds 14 tokens to every session and 488 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

code-review

Performs thorough code reviews with focus on best practices, security, performance, and maintainability. Use this skill when reviewing pull requests, auditing code quality, or getting feedback on implementations.

femto/minion · 40 tokens

compound-engineering

Orchestration layer that coordinates Debt-Sentinel, Red Team Tribunal, and Spec-Lock into unified workflows. Use when you need comprehensive quality assurance with multiple validation stages. Provides safe-edit workflows, CI pipelines, enhancement pipelines, and engineering metrics dashboard.

aegntic/cldcde · 54 tokens

tsq-product-audit

통합 제품 감사 스킬. 7개 영역(Security, Performance, SEO, Accessibility, UI/UX, Architecture, Functional)을 정량 스코어링으로 평가하고, 6단계 사이클(Plan→Audit→Report→Remediation Plan→Fix→Re-audit)로 운영한다. Use when: Phase gate 전 품질 확인, 보안 감사, 성능 리뷰, 접근성 점검, 릴리스 전 최종 검증, 코드 감사 요청 시.

sonature-lab/timsquad · 108 tokens

code-review-and-quality

Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a human. Use when you need to assess code quality across multiple dimensions before it enters the main branch.

vanja-emichi/a0_agent_skills · 51 tokens

Code Review Sensei

Expert code reviewer that catches bugs, security issues, performance problems, and design flaws with actionable fix suggestions.

demo112/yunqu-ai-skills · 26 tokens

Verification Before Completion

Mandatory empirical verification suite execution before declaring task completion.

ankur-gaurav161418/omniforge · 14 tokens