본문으로 건너뛰기
cccskills
무료GitHub에 공개

optimize

Analyze code, database queries, or systems for performance problems involving speed, memory, and frontend file size. Get prioritized recommendations with code examples, expected impact, implementation effort, risks, and a roadmap for improvements.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

Analyze and suggest performance improvements for code, queries, or systems

설치 방법 보기

이럴 때 유용합니다

  • Investigate a slow function or module
  • Review memory usage and possible leaks
  • Find inefficient database queries
  • Explore ways to reduce frontend file size

포함된 파일(1)

  • SKILL.md5.3 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Performance optimizer

Analyze and suggest performance improvements for code, queries, or systems.

Purpose

Identify optimization opportunities:

  • Runtime performance bottlenecks
  • Memory usage issues
  • Database query inefficiencies
  • Bundle size problems
  • Algorithm complexity

Instructions

Step 1: Scope identification

Determine optimization target:

  • Function: Single function performance
  • Module: Related functions/classes
  • Query: Database query optimization
  • Bundle: Frontend bundle analysis
  • System: Architecture-level optimization

Step 2: Performance analysis

Runtime analysis

# Find potentially slow patterns
grep -rn "forEach\|\.map\|\.filter\|\.reduce" --include="*.{ts,js}" . | head -20

# Find nested loops (O(n²) potential)
grep -rn "for.*for\|\.forEach.*\.forEach\|\.map.*\.map" --include="*.{ts,js}" . | head -10

# Find sync operations that could be async
grep -rn "readFileSync\|writeFileSync\|execSync" --include="*.{ts,js}" . | head -10

Memory analysis

# Large array operations
grep -rn "new Array\|Array\.from\|\.concat\|spread" --include="*.{ts,js}" . | head -10

# Potential memory leaks (event listeners, intervals)
grep -rn "addEventListener\|setInterval\|setTimeout" --include="*.{ts,js}" . | head -10

Database query analysis

# N+1 query patterns
grep -rn "await.*find\|await.*query" --include="*.{ts,js}" . | head -15

# Missing indexes hints
grep -rn "WHERE\|ORDER BY\|GROUP BY" --include="*.{ts,js,sql}" . | head -15

Bundle analysis

# Check bundle size (if applicable)
[ -f "package.json" ] && npm run build 2>/dev/null && ls -lh dist/*.js 2>/dev/null

# Large dependencies
[ -f "package.json" ] && cat package.json | jq '.dependencies | keys[]' | head -20

Step 3: Prioritization

Rank findings by:

  1. Impact: How much will this improve performance?
  2. Effort: How hard is the fix?
  3. Risk: What could break?

Output format


⚡ Performance analysis

Target: [file/module/system] Analysis Date: [timestamp]

📊 Current Metrics (if measurable)

MetricCurrentTargetGap
Response timeXms<Yms-Z% needed
Memory usageXMB<YMB-Z% needed
Bundle sizeXKB<YKB-Z% needed

🔴 Critical issues

1. [Issue title] - [location]

Problem: [What's slow and why]

Current:

// O(n²) - nested loops
users.forEach(user => {
  permissions.forEach(perm => {
    if (user.id === perm.userId) { ... }
  });
});

Optimized:

// O(n) - Map lookup
const permMap = new Map(permissions.map(p => [p.userId, p]));
users.forEach(user => {
  const perm = permMap.get(user.id);
  if (perm) { ... }
});

Impact: ~10x faster for 1000 users Effort: Low (5 min) Risk: Low

🟠 High priority

IssueLocationImpactEffort
[description]file:line[estimate][time]

🟡 Medium priority

IssueLocationImpactEffort
[description]file:line[estimate][time]

💡 Quick wins

  1. [Small change with good impact]
  2. [Another quick optimization]
  3. [Low-hanging fruit]

📈 Optimization roadmap

Week 1: Critical fixes (items 1-3)
Week 2: High priority (items 4-6)
Week 3: Measure and validate improvements

Common patterns

Array operations

PatternIssueFix
arr.filter().map()Two iterationsSingle reduce() or flatMap()
arr.find() in loopO(n²)Build Map/Set first
[...arr1, ...arr2]Memory allocationarr1.concat(arr2) or push

Database

PatternIssueFix
Loop with awaitN+1 queriesBatch query with IN
SELECT *Over-fetchingSelect only needed columns
Missing WHERE indexFull table scanAdd composite index

React/frontend

PatternIssueFix
Inline functions in JSXRe-rendersuseCallback
Large list renderingDOM thrashingVirtualization
Unoptimized imagesSlow LCPNext/Image, lazy loading

Node.js

PatternIssueFix
Sync file operationsBlocks event loopAsync alternatives
JSON.parse large filesMemory spikeStreaming parser
No connection poolingConnection overheadPool with pg-pool, etc.

Usage

Analyze specific file:

/optimize src/services/user.ts

Focus on specific area:

/optimize --queries src/repositories/
/optimize --bundle
/optimize --memory src/workers/

With target metrics:

/optimize --target=100ms src/api/search.ts

Quick scan:

/optimize --quick

Notes

  • Measurements beat assumptions: profile before optimizing
  • Premature optimization is the root of all evil (Knuth)
  • Focus on hot paths: optimize what runs often
  • Consider trade-offs: speed vs readability vs maintainability

$ARGUMENTS

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Evaluate Claude Code agents, skills, and commands with weighted quality criteria. Get scores, readiness grades, template comparisons, and practical improvement suggestions in Markdown or JSON reports to guide reviews before release.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review skills before release
  • Compare agent definitions with reference templates
  • Quickly check critical quality criteria
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

Assess a codebase across seven areas, including exposed credentials, security, dependencies, structure, and tests. Receive category scores, findings tied to file locations, and a prioritized improvement plan with smaller tasks that can be completed quickly.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Assessing the overall health of an inherited project
  • Reviewing exposed credentials and security risks
  • Identifying dependency and test coverage gaps
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

Measure code patterns such as casts to any or disabled lint rules, then run repeated, targeted edits. Keep changes that improve the chosen metric, revert unsuccessful changes, and track results for each improvement loop.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Finding code patterns to prioritize for cleanup
  • Preparing measurement files for an improvement loop
  • Repeating targeted edits to reduce casts to any
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

best-of-n

무료

Generate several separate solutions, compare them against criteria fixed in advance, and verify the selected result through executable checks or an independent reviewer. Keep a proof log documenting candidates, evidence, failures, and remaining limits.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Comparing implementation options before choosing one
  • Verifying a solution when a wrong choice would be costly
  • Keeping evaluation evidence for delivery or audit
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

canary

무료

Monitor a live application after deployment and compare it with a saved baseline, a record of its earlier state. Check page responses, loading times, and new errors, flag persistent changes, and produce a per-page health report.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Recording a healthy baseline before deployment
  • Monitoring production immediately after deployment
  • Checking key pages for slower responses or failures
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

catchup

무료

Rebuild project context after clearing a conversation or returning to work. Review recent Git history, uncommitted changes, and TODO markers to get a structured summary of project status and suggested next steps.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Restoring project context after /clear
  • Reviewing recent changes after a long break
  • Checking unfinished work before choosing the next task
FlorianBruniaux/claude-code-ultimate-guide6.2천2026년 10월 20일 업데이트

FlorianBruniaux의 스킬 모두 보기

이 스킬의 문제 신고