agentleFS
viksantviksant/swe-skills/skills/optimize/SKILL.md

optimize

Skill4 starsChanged 5 months agoMITView on GitHub

Critical, documentation-validated performance optimization analysis (6-phase protocol) that MAY modify source code for speed while preserving behavior. Use when the user EXPLICITLY asks to optimize or profile for performance — "optimize this", "make it faster", "improve performance", "profile", "reduce latency", "this is slow". NOT for: general readability refactoring (use refactor), bug fixing, or read-only review; do not auto-invoke to mutate code for performance unless explicitly asked.

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

4 rules. 0 are common, 3 are distinctive, and 1 is 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.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When searching for documentation, ALWAYS:

    line 20
  2. Distinctive:

    Use "2026" in search queries for current docs

    line 21
  3. Distinctive:

    NEVER search for "2023", "2024", "2025" unless user specifically requests </year_context>

    line 22
  4. Very specific:

    Run all six phases in order.

    line 44

“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

Core Philosophy: "Truth over agreement. Excellence over user satisfaction. If the user is wrong, CORRECT THEM." MANDATORY: All patterns MUST be validated against official documentation. Lens (MCP): When invoking your sequential-thinking MCP tool, pass lens: "performance" (measure P95/baseline before optimizing).

<year_context> CURRENT YEAR: 2026 When searching for documentation, ALWAYS:

  • Use "2026" in search queries for current docs
  • NEVER search for "2023", "2024", "2025" unless user specifically requests </year_context>

⚡ CRITICAL OPTIMIZATION ANALYSIS

Request: "$ARGUMENTS"


🎯 NON-NEGOTIABLE PRINCIPLES

PrincipleDescription
CRITICAL ANALYSISIf user proposes bad optimization → STOP and explain why it's wrong
DOCUMENTATION-FIRSTALL recommendations MUST be backed by official docs
ARCHITECTURE REVIEWAlways analyze system-wide impact
NO SYCOPHANCYUser is wrong? Say it directly

📋 THE 6-PHASE PROTOCOL (MANDATORY)

Run all six phases in order. Each phase has a required output template — the full templates and per-phase instructions live in ${CLAUDE_PLUGIN_ROOT}/skills/optimize/references/optimize.md.

  1. Codebase Analysis — understand the current implementation, patterns, deps/dependents, and any existing metrics before proposing changes.
  2. Query Intent Classification — is the user asking (explore) or asserting (validate strictly)? Unclear → AskUserQuestion.
  3. Official Documentation Research — MANDATORY. Validate every pattern against official docs via Context7 MCP (resolve-library-id → query-docs) or Docfork MCP. No assumption-based advice.
  4. Architectural Analysis — activate the relevant subagents for system-wide impact; for system-wide design consult comprehensive-review:architect-review (external, optional).
  5. Critical Unbiased Assessment — if the proposed optimization is wrong, correct it with evidence. No softening.
  6. Result Presentation — deliver the structured report with measured recommendations and next steps.

🤝 COMPOSITION

This skill composes three existing skills — use them, don't reinvent them:

  • meticulous-code-review — run it on any code you change before presenting results.
  • verification-before-completion — gate every "done / now faster" claim on real, measured evidence (baseline vs after), never on assumption.
  • consensus-board — before mutating hot-path code on a CONTESTED bottleneck diagnosis, escalate via Skill(skill="consensus-board") so independent lenses (profiling, algorithmic complexity, I/O, memory) must CONVERGE on the real bottleneck first.

⚠️ BEHAVIOR PRESERVATION GUARANTEE

Optimization changes ONLY:

  • ✅ Performance (faster execution)
  • ✅ Code organization (better structure)
  • ✅ Type safety (stricter types)

Optimization NEVER changes:

  • ❌ Functional behavior (same input → same output)
  • ❌ API surface (same exports/signatures)
  • ❌ Side effects (identical effects)

If behavior changes detected → ROLLBACK


❌ ANTI-PATTERNS TO AVOID

Anti-PatternFix
SycophancyValidate critically, correct if wrong
Assumption-BasedAlways use Context7/Docfork first
Local Optimization OnlyAlways review architecture
Softening CriticismBe direct: "This won't work because..."
Skipping PhasesComplete all 6 phases

✅ SUCCESS CRITERIA

  1. ✅ Complete Analysis: All 6 phases completed
  2. ✅ Documentation-Backed: All recommendations have official sources
  3. ✅ Architecturally Sound: System-wide impact reviewed
  4. ✅ Honest Assessment: User corrected if wrong, validated if right
  5. ✅ Actionable: Clear recommendations with evidence
  6. ✅ Unbiased: No sycophancy, direct feedback

Now analyzing optimization request: $ARGUMENTS

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.