agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/optimize/SKILL.md

optimize

Skill2 starsChanged 5 months agoMITView on GitHub

Find and fix performance bottlenecks in a function, file, or hot path — slow loops, N+1 queries, redundant work, bad complexity, excess allocations. Use when the user says "optimize this", "this is slow", "improve performance", "speed this up", "why is this slow", or "reduce latency/memory".

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use arrange, overdrive 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.
  • nikafastovets-langSkill

    arrange

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy to create intentional compositions.

    Also in 6 projects that use this

  • nikafastovets-langSkill

    overdrive

    Push interfaces past conventional limits with technically ambitious implementations. Whether that's a shader, a 60fps virtual table, spring physics on a dialog, or scroll-driven reveals — make users ask "how did they do that?

    Also in 10 projects that use this

  • mtctSkill

    quieter

    Tone down overly bold or visually aggressive designs. Reduces intensity while maintaining design quality and impact.

    Also in 14 projects that use this

  • mtctSkill

    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 10 projects that use this

  • zwy123zwySkill

    normalize

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

    Also in 10 projects that use this

  • mickeylorenziniSkill

    harden

    Audits any substantial deliverable — documents, grant sections, strategies, protocols, skills, configs, roadmaps, plans — against domain-specific quality criteria before delivery. Searches the web for best practices, runs dual-pass thematic and structural audit with severity classification, fixes all issues, and iterates until convergence. Activates when producing deliverables exceeding 4 paragraphs or 20 lines, or when the user says "harden", "audit", "stress test", or "review before delivering", or when re-auditing a modified deliverable for regressions. Does not activate for conversational responses, brainstorming, web search summaries, or rough drafts.

    Also in 14 projects that use this

  • +4 more from mtct
  • +1 more from nikafastovets-lang

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 3

    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:

    Verify: Run the tests to confirm correctness.

    line 23
  2. Distinctive:

    Never trade correctness for speed.

    line 27
  3. Distinctive:

    Don't micro-optimize readable code for negligible gains — call it out if the bottleneck is elsewhere (or not worth fixing).

    line 28

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

Test setup (used to confirm behavior is preserved after optimizing)

!ls package.json pyproject.toml Cargo.toml go.mod Makefile 2>/dev/null

Instructions

Optimize the target in $ARGUMENTS. If no target is given, ask what's slow and how it's measured (input size, latency observed, profiler output).

Method — measure, don't guess

  1. Establish the cost. Identify what "slow" means here: time complexity, query count, allocations, I/O, or wall-clock. Use any profiler output, benchmark, or timing the user has. If none exists, reason explicitly about the dominant cost — and say it's an estimate.
  2. Find the real bottleneck. Read the hot path and locate where the time/memory actually goes. Common culprits: nested loops (O(n²)), N+1 queries, repeated work that could be hoisted or memoized, unnecessary copies/allocations, sync I/O in a loop, missing indexes, reprocessing unchanged data.
  3. Optimize the dominant cost first. A 10× win on 5% of runtime is noise. Target the part that actually dominates. Prefer algorithmic/structural wins (better data structure, batching, caching) over micro-tuning.
  4. Preserve behavior. The optimized code must produce identical results. Keep the public interface stable.
  5. Verify. Run the tests to confirm correctness. If a benchmark exists, run it before and after and report the delta; otherwise explain the expected improvement (e.g. "O(n²) → O(n log n)").

Rules

  1. Never trade correctness for speed. Flag any change that alters edge-case behavior.
  2. Don't micro-optimize readable code for negligible gains — call it out if the bottleneck is elsewhere (or not worth fixing).
  3. Note any trade-offs introduced (added memory for caching, added complexity, eventual consistency).
  4. End with: what was slow, what you changed, and the measured or expected impact.

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.