optimize

Scans the repository for optimization opportunities — complexity, performance issues, large files, and maintainability problems — and fixes them one at a time with user confirmation. Use only when the user explicitly invokes this skill.

9 stars

Best use case

optimize is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Scans the repository for optimization opportunities — complexity, performance issues, large files, and maintainability problems — and fixes them one at a time with user confirmation. Use only when the user explicitly invokes this skill.

Teams using optimize should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/optimize/SKILL.md --create-dirs "https://raw.githubusercontent.com/Fyzz-Chat/fyzz-chat/main/.agents/skills/optimize/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/optimize/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How optimize Compares

Feature / AgentoptimizeStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Scans the repository for optimization opportunities — complexity, performance issues, large files, and maintainability problems — and fixes them one at a time with user confirmation. Use only when the user explicitly invokes this skill.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Optimize

When this skill is invoked, the agent should do the following:

## What to look for

Scan the full codebase (`src/`) for the following categories of issues, ordered from easiest wins to bigger refactors:

- **File size / split candidates** — files over ~300 lines that contain multiple distinct responsibilities; components that mix data-fetching with presentation; large utility files where functions could be grouped by domain.
- **Component complexity** — components with too many props, deeply nested JSX, or logic that belongs in a custom hook.
- **Duplicate / near-duplicate logic** — repeated patterns across files that could be extracted into a shared hook, util, or DAO function.
- **Unnecessary re-renders** — missing `memo`, missing `useCallback`/`useMemo`, derived state computed in render body instead of memoized, objects/arrays created inline as props.
- **Performance bottlenecks** — N+1 queries in DAOs, missing `Promise.all` for independent async calls in server components, expensive operations not cached.
- **Dead code** — unused exports, unreachable branches, commented-out code blocks.
- **Trivial readability** — deeply nested ternaries that could be a variable or early return; magic numbers/strings without a named constant.

## Workflow

1. **Scan first.** Read the relevant files — do not guess. Prioritize files flagged as large or complex by the file listing.

2. **Rank by effort vs. impact.** Pick the single highest-impact, lowest-effort issue (the "lowest hanging fruit").

3. **Present the finding** in this format:

```
📁 File: <path>
🔍 Issue: <one-sentence description>
💡 Fix: <one-sentence plan>

Write 'go' to apply this fix, or 'skip' to find the next one.
```

4. **Wait for the user to write `go`.** Do not make any edits until the user confirms.

5. **Apply the fix.** Make the smallest, most focused change that addresses the issue.

6. **After the fix**, immediately find the next lowest-hanging-fruit issue and present it in the same format. Return to step 4.

7. **If the user writes `skip`**, find the next issue without making changes.

8. **Keep looping** until the user says `stop`, `done`, or `exit`, or there are no more issues to report.

## Constraints

- **One change at a time.** Never batch multiple fixes into a single edit.
- **No speculative changes.** Only fix things you can see are actually a problem after reading the code.
- **Preserve behavior.** Refactors must not change observable behavior. If unsure, note the risk in the finding.
- **Respect AGENTS.md rules.** All existing architecture rules (data flow layers, critical file patterns, etc.) apply.

Related Skills

remember

9
from Fyzz-Chat/fyzz-chat

When the user invokes this skill, the agent reflects on the most important lessons learned recently and suggests adding a new rule to AGENTS.md to prevent the same issue from recurring. Use when the user explicitly invokes the remember skill.

lint

9
from Fyzz-Chat/fyzz-chat

Contains commands to lint, format, type check, test, and build the project. Use when the user explicitly invokes the lint skill.

ai-sdk

9
from Fyzz-Chat/fyzz-chat

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

twitter-algorithm-optimizer

15
from Zerone-Agent/agent-use-skills

Analyze and optimize tweets for maximum reach using Twitter's open-source algorithm insights. Rewrite and edit user tweets to improve engagement and visibility based on how the recommendation system ranks content.

performance-optimizer

14
from nguyenthienthanh/aura-frog

Identifies and resolves performance bottlenecks across frontend (Core Web Vitals, code splitting, lazy loading), backend (N+1 queries, async processing), and database (EXPLAIN ANALYZE, indexing strategies) layers. Use when the user reports slow code, latency issues, memory leaks, needs to speed up an application, or wants to benchmark and profile performance.

evaluator-optimizer

13
from NickCrew/Claude-Cortex

Iterative refinement workflow for polishing code, documentation, or designs through systematic evaluation and improvement cycles. Use when refining drafts into production-grade quality.

rdc-optimizer

12
from haolange/RDC-Agent-Frameworks

Public main skill for the incubating optimizer framework. Use when the user wants to analyze performance, identify bottlenecks, design experiments, or validate optimization gains from captures, traces, or profiling evidence. This skill is the future optimizer entry and currently provides the minimum intake contract only.

optimize

12
from lionbenjamin/agent-templates

Analyze and improve performance metrics.

twitter-algorithm-optimizer

11
from EricGrill/agents-skills-plugins

Analyze and optimize tweets for maximum reach using Twitter's open-source algorithm insights. Rewrite and edit user tweets to improve engagement and visibility based on how the recommendation system ranks content.

spend-optimizer

10
from cathrynlavery/spend-optimizer

Audit subscriptions AND optimize credit card rewards. Analyzes bank CSVs to find recurring charges, categorize spend, identify which card each charge should be on, and calculate potential rewards. Use when user says "audit subscriptions", "optimize my cards", "maximize rewards", or "analyze my spending". Outputs interactive HTML with subscription management and card optimization.

optimize-prompt

9
from exiao/skills

Iteratively optimize an AI agent's system prompt using a keep/revert autoresearch loop. Use when asked to optimize, improve, or tune a system prompt, run prompt optimization, or do a Karpathy-style autoresearch loop on an agent prompt. Also use when asked to run evals and improve the prompt based on results.

optimize

9
from exiao/skills

Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.