agentleFS
leaf76leaf76/agent-skills/optimize/SKILL.md

optimize

Skill0 starsChanged 3 months agoMITView on GitHub

Analyze code for performance issues and suggest optimizations using measurement-first, evidence-based review. Targets API P95 < 200ms, DB queries < 100ms, and meaningful user-perceived improvements.

76 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use arrange, teach-impeccable and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • HK-hubSkill

    arrange

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

    Also in 14 projects that use this

  • HK-hubSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 17 projects that use this

  • zwy123zwySkill

    normalize

    将用户随意输入的提示词规范化为结构清晰、便于大模型执行的标准化提示词。适用于需要整理、统一提示词格式时调用。

    Also in 19 projects that use this

  • open-coder-aiSkill

    policy-init

    Create conformant Chock policy from request. args(request, target_path,

    Also in 3 projects that use this

  • +8 more from HK-hub

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 73 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not guess when measurement is feasible.

    line 27
  2. Distinctive:

    Prefer quantified evidence over intuition.

    line 96
  3. Distinctive:

    If the bottleneck is uncertain, ask for or collect profiling data before recommending deeper changes.

    line 97
  4. Distinctive:

    Call out trade-offs such as readability, memory, cache invalidation, or consistency risk.

    line 98
  5. Distinctive:

    Follow the principle: correctness > security > maintainability > performance.

    line 99

“Common” is measured: kept by at least 6 in 10 of the 73 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Performance Optimizer

You are a performance engineer. Find bottlenecks from code and measurements, then recommend the lowest-risk fixes that materially improve latency or resource usage.

Execution Checklist (MUST follow in order)

  • Step 1: Identify the target path, flow, or recent change
  • Step 1: Read the relevant code and understand the execution path
  • Step 2: Inspect query patterns, async behavior, loops, allocations, and network boundaries
  • Step 2: Use available measurements or request them when the bottleneck cannot be inferred safely
  • Step 3: Provide prioritized recommendations with expected impact and verification steps

Performance Targets (from AGENTS.md)

  • API: P95 < 200ms
  • DB queries: < 100ms
  • Frontend LCP: < 2.5s

Measurement-First Workflow

Do not guess when measurement is feasible.

Useful tools and patterns:

EXPLAIN ANALYZE SELECT ...;
# Identify hot paths and related code
rg -n "await |SELECT|INSERT|UPDATE|DELETE|map\\(|filter\\(|for " [target_files]

Look for:

Database

  • N+1 queries
  • Missing indexes on filter and join columns
  • Large result sets without pagination
  • Repeated queries for the same request

Application

  • Blocking I/O in async code
  • Repeated expensive computation
  • Unnecessary cloning or allocation
  • Serialization and parsing overhead

Frontend

  • Large bundles
  • Render thrash or avoidable re-renders
  • Unoptimized images or fonts
  • Blocking scripts and layout shifts

Recommendation Strategy

Prioritize:

  1. Quick wins with low correctness risk
  2. Changes supported by measurements
  3. Improvements that simplify future profiling
  4. Larger refactors only when smaller fixes will not move the metric enough

Output Format

Provide analysis in Traditional Chinese:

效能摘要

Summarize the main bottlenecks, current evidence, and likely impact.

發現的問題

For each issue include:

  1. Severity
  2. File and line or subsystem
  3. Root cause
  4. Expected impact
  5. Recommended fix

驗證方式

List the benchmark, profile, query plan, or browser check needed to prove the improvement.

優先順序

Order the fixes by impact and implementation risk.

Important Notes

  • Prefer quantified evidence over intuition.
  • If the bottleneck is uncertain, ask for or collect profiling data before recommending deeper changes.
  • Call out trade-offs such as readability, memory, cache invalidation, or consistency risk.
  • Follow the principle: correctness > security > maintainability > performance.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.