code-optimizer
21
总安装量
6
周安装量
#17480
全站排名
安装命令
npx skills add https://github.com/luongnv89/skills --skill code-optimizer
Agent 安装分布
claude-code
6
codex
6
opencode
6
openclaw
3
windsurf
3
Skill 文档
Code Optimization
Analyze code for performance issues following this priority order:
Analysis Priorities
- Performance bottlenecks – O(n²) operations, inefficient loops, unnecessary iterations
- Memory leaks – unreleased resources, circular references, growing collections
- Algorithm improvements – better algorithms or data structures for the use case
- Caching opportunities – repeated computations, redundant I/O, memoization candidates
- Concurrency issues – race conditions, deadlocks, thread safety problems
Workflow
- Read the target code file(s)
- Identify language and framework context
- Analyze for each priority category
- Report findings with severity and fixes
Response Format
For each issue found:
### [Severity] Issue Title
**Location**: file:line_number
**Category**: Performance | Memory | Algorithm | Caching | Concurrency
**Problem**: Brief explanation of the issue
**Impact**: Why this matters (performance cost, resource usage, etc.)
**Fix**:
[Code example showing the optimized version]
Severity Levels
- Critical: Causes crashes, severe memory leaks, or O(n³)+ complexity
- High: Significant performance impact (O(n²), blocking operations, resource exhaustion)
- Medium: Noticeable impact under load (redundant operations, suboptimal algorithms)
- Low: Minor improvements (micro-optimizations, style improvements with perf benefit)
Language-Specific Checks
JavaScript/TypeScript
- Array methods inside loops (map/filter/find in forEach)
- Missing async/await causing blocking
- Event listener leaks
- Unbounded arrays/objects
Python
- List comprehensions vs generator expressions for large data
- Global interpreter lock considerations
- Context manager usage for resources
- N+1 query patterns
General
- Premature optimization warnings (only flag if genuinely impactful)
- Database query patterns (N+1, missing indexes)
- I/O in hot paths