Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Optimize

ASecurity

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.

7 stars
0 votes
0 copies
0 views
Added 5/28/2026
ai-agentsjavascripttypescriptpythongojavabashreactnodegitapi

Works with

api

Security Analysis

A100/100

Scanned 5/28/2026

$npx -y skills add viknesh20-20/claude-code-tool-kit --skill optimize --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Optimize?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Optimize
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/viknesh20-20-optimize/badge)](https://www.skillsdirectory.com/skills/viknesh20-20-optimize)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: optimize
description: "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."
argument-hint: "[file, function, or 'all' for project-wide scan]"
allowed-tools: Read, Grep, Glob, Bash
---

# 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:Line | Issue | Impact | Category |
|---|-----------|-------|--------|----------|
| 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.

Attribution

viknesh20-20viknesh20-20
View sourceSee grades on GitHubMore from viknesh20-20 →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698461 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →