agentleFS
Mingo07-devMingo07-dev/claude_skills/code-optimizer/SKILL.md

code-optimizer

Skill2 starsChanged 7 months agoApache-2.0View on GitHub

Deep code optimization and bug hunting. Use when the user asks to optimize performance, find bugs, analyze edge cases, detect memory leaks, or review code quality. Runs a three-subagent pipeline: analyzer -> planner -> executor with explicit user confirmation before changes.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run baseline tests if present

    line 35
  2. Very specific:

    Use the analysis checklist and output format in references/analysis-checklist.md.

    line 40
  3. Very specific:

    Use the plan template in references/plan-format.md.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Code optimizer (three subagents)

When to use

  • Performance problems or slow code
  • Suspected memory leaks or resource misuse
  • Silent bugs or edge cases
  • Deep code review before release

Goal

Identify and fix bugs, inefficiencies, and resource issues using a three-stage pipeline with required user confirmation before applying changes.

Pipeline overview

Parent Agent
  -> Subagent 1: Analyzer (write /tmp/code-analysis.md)
  -> Subagent 2: Planner (write /tmp/optimization-plan.md)
  -> Pause for user approval
  -> Subagent 3: Executor (apply fixes, write OPTIMIZATION_REPORT.md)

Phase 1: Parent reconnaissance

  1. Determine scope (files, directory, or full codebase)
  2. Collect context (CLAUDE.md, package.json, requirements.txt, etc.)
  3. Run baseline tests if present
  4. Pass scope and context to Subagent 1

Phase 2: Subagent 1 (Analyzer)

Use the analysis checklist and output format in references/analysis-checklist.md. Write /tmp/code-analysis.md.

Phase 3: Subagent 2 (Planner)

Use the plan template in references/plan-format.md. Write /tmp/optimization-plan.md.

Phase 4: Pause and confirm

Present the plan summary and ask the user whether to apply all fixes, only critical/high, or a subset. Do not continue without explicit confirmation.

Phase 5: Subagent 3 (Executor)

Apply only approved fixes, run tests for high-risk changes, and write OPTIMIZATION_REPORT.md.

Notes

  • Subagents 1 and 2 never modify files.
  • The pause before execution is mandatory.
  • This skill complements refactoring (structure/readability) with correctness and performance focus.

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.