agentleFS
Domenico-Tenace-Open-LabsDomenico-Tenace-Open-Labs/web-dev-agent/skills/performance-optimizer/SKILL.md

performance-optimizer

Skill3 starsChanged 13 days agoMITView on GitHub

Analyze codebase for performance issues and code quality problems, then apply optimizations directly to code. Use when user asks to analyze performance, audit code quality, find bottlenecks, reduce bundle size, optimize images/assets, remove duplicated code, or "make the code faster/cleaner/lighter" — even if not named explicitly. Trigger on "check the performance of this project", "optimize my codebase", "find and fix inefficiencies", "reduce bundle size", "clean up duplicated code".

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use observability-engineer, security-auditor and 5 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.
  • xfstudioSkill

    observability-engineer

    Build production-ready monitoring, logging, and tracing systems.

    Also in 3 projects that use this

  • nahisahoSkill

    security-auditor

    security-auditor skill

    Also in 5 projects that use this

  • 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

  • GoogleSkill

    code-reviewer

    Also in 5 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

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask user which categories to act on if list long, unless already said "fix everything".

    line 21
  2. Distinctive:

    Dead code: remove after confirming no external references (grep whole repo first).

    line 31
  3. Very specific:

    After each category: run existing tests/build if project has them (npm test, npm run build, etc.) to confirm nothing broke.

    line 33
  4. Distinctive:

    Never guess at "optimized" behavior that changes program output — perf fixes must be behavior-preserving.

    line 37
  5. Distinctive:

    Don't install new deps for a fix if native/existing solution works.

    line 38
  6. Distinctive:

    No test suite → flag it, proceed more conservatively (smaller diffs, manual reasoning about correctness).

    line 39

“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

Codebase Performance Optimizer

Two phases: Analyze then Optimize. Always show findings before touching code, unless user says "just fix it".

Phase 1 — Analyze

  1. Map project: language(s), framework, build tool, package manager. view root dir, then relevant configs (package.json, webpack/vite config, tsconfig, etc).
  2. Scan issue categories (grep/find via shell, or language-specific tools when available):
    • Duplication: repeated logic/blocks across files (near-identical functions, copy-pasted components).
    • Bundle size: heavy/unused deps, missing tree-shaking, no code-splitting, large barrel imports.
    • Images/assets: uncompressed images, wrong format (PNG where WebP/AVIF fits), oversized dimensions, missing lazy-loading.
    • Runtime perf: N+1 queries, unnecessary re-renders (React: missing memo/useMemo/useCallback, inline object/function props), blocking sync I/O, unindexed DB queries, O(n²) loops on large data.
    • Dead code: unused exports, unreachable branches, commented-out blocks.
    • Build config: missing minification, no compression (gzip/brotli), dev-only code shipped to prod.
  3. Produce findings report (chat, concise): per issue — file:line, issue, impact (high/medium/low), proposed fix.
  4. Ask user which categories to act on if list long, unless already said "fix everything".

Phase 2 — Optimize

Apply fixes incrementally, one category at a time, so changes stay reviewable:

  • Dedup: extract shared logic into function/module/component; update call sites.
  • Bundle: replace heavy deps with lighter alternatives (only if drop-in compatible), add/adjust code-splitting or dynamic imports, fix barrel-import issues.
  • Images: recompress/convert via shell (cwebp, sharp, imagemin if available — check what's installed first), resize to actual display dimensions, add lazy-loading attributes.
  • Runtime: memoization, batch queries, replace O(n²) with efficient structures/algorithms.
  • Dead code: remove after confirming no external references (grep whole repo first).

After each category: run existing tests/build if project has them (npm test, npm run build, etc.) to confirm nothing broke. Report changes + why, file by file, short summary — not just "done".

Rules

  • Never guess at "optimized" behavior that changes program output — perf fixes must be behavior-preserving.
  • Don't install new deps for a fix if native/existing solution works.
  • No test suite → flag it, proceed more conservatively (smaller diffs, manual reasoning about correctness).
  • Very large repos → sample representative files/modules first, not blind full scan; ask user for subfolder if scope unclear.

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.

Reviews can't be read right now.

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.