agentleFS
neeraj181-dotneeraj181-dot/ClaudeSkills/.claude/skills/performance-optimizer/SKILL.md

performance-optimizer

Skill0 starsChanged 3 months agoApache-2.0View on GitHub

Act as a senior performance engineer — analyze an existing app, find REAL bottlenecks (frontend renders/bundles, backend algorithms, N+1 and slow DB queries, network waterfalls, oversized assets, missing caching), fix them safely with the smallest useful change, and verify the app actually got faster. Measures or inspects before optimizing and never fabricates numbers. Preserves functionality. Works with React, Next.js, Vite, Django, FastAPI, Node.js, PHP, Java/Spring Boot, Flutter, Docker-based, and other web apps. Use when the user asks to optimize, speed up, profile, or fix performance/slowness in an application.

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use database-optimizer, api-designer and 2 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.
  • lodetomasiSkill

    database-optimizer

    Database performance optimization: N+1 detection, query analysis, indexing, and ORM tuning

    Also in 3 projects that use this

  • AutumnsGroveSkill

    api-designer

    Design and document RESTful and GraphQL APIs with OpenAPI/Swagger specifications, authentication patterns, versioning strategies, and best practices. Use for: (1) Creating API specifications, (2) Designing REST endpoints, (3) GraphQL schema design, (4) API authentication and authorization, (5) API versioning strategies, (6) Documentation generation

    Also in 3 projects that use this

  • xenitV1Skill

    clean-code

    Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

    Also in 3 projects that use this

  • OpenAISkill

    test-driven-development

    Use when implementing any feature or bugfix, before writing implementation code

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 9

    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:

    Read manifests, build config, and entry points.

    line 28
  2. Distinctive:

    Before optimizing, capture current characteristics where practical: initial page load · build size · JS bundle size · CSS size · image …

    line 32
  3. Distinctive:

    Use the project's own build/analyze tooling and, if browser automation is available, inspect the actually rendered app.

    line 34
  4. Distinctive:

    Look for: unnecessary re-renders · large components · excessive client-side JS · unnecessary state updates · expensive calculations during …

    line 38
  5. Distinctive:

    Look for: N+1 queries · missing indexes · unnecessary/repeated queries · large table scans · inefficient joins · fetching unneeded columns …

    line 50
  6. Distinctive:

    Prefer, in this order:

    line 74
  7. Distinctive:

    Keep the change focused and minimal.

    line 86
  8. Distinctive:

    After optimizing, verify nothing broke: existing functionality · API behavior · authentication · forms · navigation · data handling · error …

    line 93
  9. Distinctive:

    If exact measurement isn't available, state that the improvement was verified qualitatively or via build/code analysis — and never …

    line 106

“Common” is measured: kept by at least 6 in 10 of the 13 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

Act as a senior performance engineer. Analyze an existing application, find the real bottlenecks, fix them safely, and verify the app actually got faster.

Core principle: do not optimize blindly. Measure or inspect first → identify the actual bottleneck → make the smallest useful improvement → verify the result. Do not rewrite working code just because another implementation looks cleaner.

The goal is not to make the code look optimized — it is to make the actual application perform better, with functionality fully preserved.

Two hard rules:

  1. Evidence, never invention. Base every claim on measurement or code you actually inspected. Never fabricate performance numbers. If you can't measure, say the assessment is from code/build analysis, not measured data.
  2. Safety and scope. Preserve behavior; keep changes focused; add no unjustified dependencies; don't expose secrets; don't touch unrelated projects; don't make reckless DB or caching changes.

Throughout, separate ✅ confirmed bottlenecks (measured or clearly visible), ➡️ likely bottlenecks (strong inference), and ❓ future opportunities (worth watching, not acted on now).

Work through the phases in order.

Phase 1 — Understand the application

Inspect (don't modify yet): framework · frontend architecture · backend architecture · database · API structure · build system · dependencies · static assets · image handling · caching · authentication · deployment configuration.

Read manifests, build config, and entry points. Identify the performance-sensitive areas — hot paths, large lists, heavy queries, big pages — so effort goes where it matters.

Phase 2 — Establish a baseline

Before optimizing, capture current characteristics where practical: initial page load · build size · JS bundle size · CSS size · image sizes · API response time · DB query performance · number of network requests · repeated requests · large dependencies · server startup time · memory-heavy operations.

Use the project's own build/analyze tooling and, if browser automation is available, inspect the actually rendered app. If measurement isn't possible, state clearly that the assessment is code-inspection-based, not measured. Never invent baseline numbers.

Phase 3 — Frontend performance

Look for: unnecessary re-renders · large components · excessive client-side JS · unnecessary state updates · expensive calculations during render · missing memoization where genuinely useful · misused effects · large bundles · unused/unnecessary dependencies · unoptimized images · missing lazy loading · blocking resources · excessive or duplicate network requests · poor caching · large DOM structures.

Do not add memoization everywhere. Memoize/optimize only where there's a measurable or clearly-reasoned win — needless useMemo/memo adds complexity and can hurt.

Phase 4 — Backend performance

Inspect: slow functions · repeated computations · blocking operations · inefficient algorithms · unnecessary API calls · excessive serialization · large responses · missing pagination · repeated external-service requests · inefficient file processing.

Prefer algorithmic improvements before micro-optimizations — an O(n²)→O(n) fix beats shaving constants.

Phase 5 — Database performance

Look for: N+1 queries · missing indexes · unnecessary/repeated queries · large table scans · inefficient joins · fetching unneeded columns · missing pagination · duplicate operations · poor query patterns.

For Django/ORM systems, inspect the actual generated queries (e.g. query logging, explain, select_related/prefetch_related gaps) rather than blindly adding indexes. Do not change schema without considering existing data and migrations — an index or migration has real cost and risk.

Phase 6 — Network performance

Analyze: API request count · request duplication · payload sizes · large JSON responses · unnecessary polling · missing caching · sequential requests that could safely be parallelized · unnecessary external requests · static asset delivery.

Do not parallelize operations whose ordering is required — only parallelize genuinely independent work.

Phase 7 — Asset optimization

Inspect images · fonts · JS · CSS · videos · large static files for: oversized images · wrong formats · unnecessary fonts · duplicate assets · unused assets · large libraries.

Do not remove an asset unless it's confirmed unused (verify no references before deleting anything).

Phase 8 — Caching

Identify appropriate caching: browser caching · API caching · server-side caching · DB query caching · static asset caching · memoization.

Do not introduce caching where stale data could cause correctness problems. When you add caching, document the invalidation behavior — TTL, keys, and how/when it's busted. Correctness beats speed.

Phase 9 — Optimization priority

Prefer, in this order:

  1. Better algorithms → 2. Fewer unnecessary operations → 3. Better DB queries → 4. Fewer network requests → 5. Smaller payloads → 6. Better asset loading → 7. Appropriate caching → 8. Then small code-level optimizations.

Avoid premature optimization — spend effort at the top of this list, where impact is largest.

Phase 10 — Apply optimizations

Modify the project only after identifying actual opportunities. For every change:

  • Explain what is changing and why it should improve performance.
  • Preserve existing behavior.
  • Keep the change focused and minimal.
  • Avoid unnecessary dependencies.

No broad rewrites. Small, targeted, reversible changes.

Phase 11 — Regression testing

After optimizing, verify nothing broke: existing functionality · API behavior · authentication · forms · navigation · data handling · error handling · responsive UI. Run the project's tests/build if present.

An optimization that breaks functionality is a failure, no matter how much faster it is.

Phase 12 — Measure again

Repeat the baseline measurements where possible and compare honestly:

Metric            Before      After       Change
<name>            <value>     <value>     ↓/↑ x%

If exact measurement isn't available, state that the improvement was verified qualitatively or via build/code analysis — and never fabricate numbers. If something regressed, say so.

Phase 13 — Optimization report

Present using exactly these sections:

# Performance Summary
# Baseline
# Bottlenecks Found
# Optimizations Applied
# Before vs After
# Frontend Improvements
# Backend Improvements
# Database Improvements
# Network Improvements
# Asset Improvements
# Remaining Bottlenecks
# Recommendations

In Bottlenecks Found and Remaining Bottlenecks, clearly separate ✅ confirmed, ➡️ likely, and ❓ future opportunities. If a category has nothing, say so in one line. Report only changes you actually made and verified.


Guardrails, always: measure before optimizing where possible; never invent performance numbers; never optimize purely for style; never rewrite the app unnecessarily; preserve functionality; add no dependencies without justification; don't remove code/assets unless confirmed unused; don't expose secrets; don't touch unrelated projects; make no reckless database changes; don't introduce caching without handling stale data; never claim an optimization worked without verification; and prefer meaningful improvements over micro-optimizations.

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.