agentleFS
viknesh20-20viknesh20-20/claude-code-tool-kit/.claude/skills/optimize/SKILL.md

optimize

Skill7 starsChanged 6 months agoMITView on GitHub

Analyzes code for performance bottlenecks and produces prioritized, actionable optimization recommendations with before/after code. Use before shipping performance-critical features or when code feels slow.

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

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 73 edited versions we read keep these.

  • 1

    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:

    Not using generators for large sequences

    line 61

“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 Optimization Analysis

Project Context

!ls package.json requirements.txt go.mod Cargo.toml *.csproj pom.xml 2>/dev/null !wc -l $(find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.cs" -o -name "*.rb" \) -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/vendor/*" 2>/dev/null | head -5) 2>/dev/null | tail -1


Analysis Categories

Examine the specified code for issues in each category. For every issue found:

  1. Show the problematic code snippet (with file:line)
  2. Explain why it's a problem with complexity analysis
  3. Show the optimized version
  4. Rate impact: High / Medium / Low

1. Algorithmic Complexity

  • O(n²) or worse loops that can be reduced
  • Redundant iterations over the same data
  • Sorting in loops (sort once, iterate many)
  • Nested loops that can be replaced with hash maps/sets
  • Unnecessary full-collection scans when early exit is possible

2. Database & I/O

  • N+1 query patterns (loop of individual queries instead of batch)
  • Missing database indexes for frequent queries
  • Unbounded queries without LIMIT/pagination
  • Sequential I/O that could be parallelized
  • Missing connection pooling
  • Redundant file reads (read once, use many)

3. Memory & Allocation

  • Large object copies that could use references/pointers
  • String concatenation in loops (use builder/buffer)
  • Accumulating data in memory that could be streamed
  • Memory leaks: event listeners not removed, subscriptions not cancelled
  • Caching opportunities for expensive computations

4. Concurrency & Async

  • Sequential await calls that could use Promise.all / asyncio.gather / goroutines
  • Blocking the main thread/event loop with CPU-heavy work
  • Missing cancellation for abandoned async operations
  • Thread-safety issues with shared mutable state

5. Language-Specific

JavaScript/TypeScript:

  • Unnecessary re-renders (missing React.memo, useMemo, useCallback)
  • Barrel imports pulling in entire modules
  • Missing tree-shaking opportunities
  • Synchronous operations that should be async

Python:

  • Using lists where sets/dicts provide O(1) lookup
  • Not using generators for large sequences
  • Global interpreter lock (GIL) bottlenecks
  • Missing __slots__ for memory-heavy classes

Go:

  • Unnecessary goroutine creation
  • Unbuffered channels causing blocking
  • Excessive garbage collection from short-lived allocations

General:

  • Missing HTTP caching headers
  • Uncompressed API responses
  • Missing lazy loading for heavy resources

Output Format

Findings Table

#File:LineIssueImpactCategory
1......High...

Detailed Findings

For each finding, show before/after code.

Top 3 Priority Actions

Rank the three most impactful optimizations to implement first, with estimated effort (S/M/L) and expected improvement.

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.