Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Deep code optimization audit using parallel specialist agents. Each agent hunts for performance anti-patterns, inefficiencies, and suboptimal code using pattern-based detection (Grep/Glob) WITHOUT reading the full source code first — avoiding anchoring bias on existing implementations. Covers ALL optimization domains: database queries, memory leaks, algorithmic complexity, concurrency, bundle size, dead code, I/O & network, rendering/UI, data structures, error handling, caching, build config, se
.claude/skills/mkurman-code-optimizer/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -21% | 0% |
| case-08 | ✗→✓ | ▲ Improved | -9% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 41% | 0% |
--------|----------------|-------| | 1 | Database & Queries | references/database-queries.md | N+1 queries, SELECT , missing indexes, ORM misuse, connection pooling | | 2 | Memory & Resources | references/memory-resources.md | Memory leaks, unclosed resources, large allocations, string concat in loops | | 3 | Algorithmic Complexity | references/algorithmic-complexity.md | O(n^2) patterns, unnecessary iterations, wrong data structures for lookups | | 4 | Concurrency & Async | references/concurrency-async.md | Sequential awaits, blocking in async, race conditions, unbounded concurrency | | 5 | Bundle & Dependencies | references/bundle-dependencies.md | Heavy imports, unused deps, duplicate libs, missing lazy loading | | 6 | Dead Code & Redundancy | references/dead-code-redundancy.md | Unused exports, commented code, dead branches, duplicate logic | | 7 | I/O & Network | references/io-network.md | Sequential requests, missing batching, no dedup, missing compression | | 8 | Rendering & UI | references/rendering-ui.md | Re-renders, missing virtualization, layout thrashing, animation perf | | 9 | Data Structures | references/data-structures.md | Wrong structures, unnecessary copies, inefficient serialization | | 10 | Error & Resilience | references/error-resilience.md | Missing timeouts, swallowed errors, no retries, no circuit breakers | | 11 | Caching & Memoization | references/caching-memoization.md | Missing memoization, cache without invalidation, redundant API calls | | 12 | Build & Compilation | references/build-compilation.md | Dev code in prod, missing optimization flags, slow tests, Docker issues | | 13 | Security-Performance | references/security-performance.md | Crypto misuse, missing rate limiting, ReDoS, SQL injection vectors |
Optional agents (spawn if relevant to detected stack):
references/logging-observability.md) — if logging framework detectedreferences/config-infra.md) — if Docker/deployment config detectedEach agent MUST receive this prompt structure:
You are a {DOMAIN_NAME} optimization specialist. Your job is to find performance
anti-patterns in the codebase at {PROJECT_ROOT}.
CRITICAL RULES:
1. DO NOT read source code files before searching. This avoids anchoring bias.
2. First, read your reference file: {SKILL_DIR}/references/{REFERENCE_FILE}
3. Use Grep and Glob to search for the patterns described in the reference file.
4. Only read 5-10 lines of context around each finding to confirm it's a real issue.
5. Skip patterns that don't match the project's stack: {DETECTED_STACK}
Tech stack detected: {DETECTED_STACK}
Project root: {PROJECT_ROOT}
For each finding, report:
- **File**: path:line_number
- **Pattern**: what anti-pattern was detected
- **Severity**: CRITICAL / HIGH / MEDIUM / LOW
- **Current code**: the problematic snippet (keep short)
- **Why it's slow**: brief explanation of the performance impact
- **Optimal fix**: the recommended solution (code snippet or approach)
- **Estimated impact**: qualitative improvement expected (e.g., "10x faster for large lists")
If you find 0 issues in your domain, report "No issues found" — this is a valid outcome.
Sort findings by severity (CRITICAL first).After all agents complete, consolidate their findings into a single prioritized report:
markdown# Code Optimization Audit Report ## Executive Summary - **X** critical issues, **Y** high, **Z** medium, **W** low - Top 3 highest-impact fixes: 1. [brief description] — [estimated impact] 2. [brief description] — [estimated impact] 3. [brief description] — [estimated impact] ## Findings by File ### `path/to/file.ts` | # | Severity | Domain | Pattern | Fix | Impact | |---|----------|--------|---------|-----|--------| | 1 | CRITICAL | Database | N+1 query in loop | Use prefetch_related | 50x fewer queries | | 2 | HIGH | Async | Sequential awaits | Use Promise.all | 3x faster | [... for each file with findings ...] ## Improvement Plan Priority-ordered steps to implement the fixes: 1. **[CRITICAL] Fix N+1 queries in `api/users.py`** - Current: loop queries user.posts for each user - Fix: add prefetch_related('posts') to queryset - Impact: reduces N+1 to 2 queries 2. **[HIGH] Parallelize API calls in `services/sync.ts`** - Current: 5 sequential await fetch() calls - Fix: Promise.all([fetch1, fetch2, ...]) - Impact: ~5x faster sync operation [... continue for all findings ...]
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 8,161 | 3,286 | -60% | 1 | 1 | 0% | 1,266 | 1,520 | +20% | 0 | 0 | — |
case-02 | fail→fail | 31,258 | 3,813 | -88% | 1 | 1 | 0% | 6,205 | 1,642 | -74% | 0 | 0 | — |
case-03 | fail→fail | 35,468 | 4,282 | -88% | 1 | 1 | 0% | 6,200 | 1,484 | -76% | 0 | 0 | — |
case-04 | fail→pass | 12,793 | 10,346 | -19% | 1 | 1 | 0% | 1,965 | 2,873 | +46% | 0 | 0 | — |
case-05 | fail→pass | 72,416 | 5,247 | -93% | 1 | 1 | 0% | 1,967 | 2,081 | +6% | 0 | 0 | — |
case-06 | pass→pass | 11,564 | 5,624 | -51% | 1 | 1 | 0% | 1,792 | 2,166 | +21% | 0 | 0 | — |
case-07 | fail→pass | 12,899 | 1,688 | -87% | 1 | 1 | 0% | 1,872 | 1,485 | -21% | 0 | 0 | — |
case-08 | fail→pass | 15,846 | 5,521 | -65% | 1 | 1 | 0% | 2,361 | 2,139 | -9% | 0 | 0 | — |
case-09 | fail→pass | 10,307 | 7,257 | -30% | 1 | 1 | 0% | 1,687 | 2,387 | +41% | 0 | 0 | — |
case-10 | fail→pass | 9,676 | 1,771 | -82% | 1 | 1 | 0% | 1,507 | 1,465 | -3% | 0 | 0 | — |
case-11 | fail→pass | 11,459 | 2,489 | -78% | 1 | 1 | 0% | 1,803 | 1,651 | -8% | 0 | 0 | — |
case-12 | fail→pass | 18,140 | 2,519 | -86% | 1 | 1 | 0% | 2,126 | 1,786 | -16% | 0 | 0 | — |
case-13 | fail→pass | 13,359 | 2,793 | -79% | 1 | 1 | 0% | 2,297 | 1,558 | -32% | 0 | 0 | — |
case-14 | fail→pass | 10,970 | 2,598 | -76% | 1 | 1 | 0% | 1,687 | 1,709 | +1% | 0 | 0 | — |
case-15 | fail→pass | 7,620 | 2,183 | -71% | 1 | 1 | 0% | 1,191 | 1,643 | +38% | 0 | 0 | — |
case-16 | fail→pass | 16,406 | 3,009 | -82% | 1 | 1 | 0% | 2,713 | 1,754 | -35% | 0 | 0 | — |
case-17 | fail→pass | 15,198 | 2,043 | -87% | 1 | 1 | 0% | 2,197 | 1,522 | -31% | 0 | 0 | — |
case-18 | fail→pass | 11,966 | 2,479 | -79% | 1 | 1 | 0% | 1,703 | 1,624 | -5% | 0 | 0 | — |
case-19 | fail→pass | 13,040 | 2,172 | -83% | 1 | 1 | 0% | 1,948 | 1,583 | -19% | 0 | 0 | — |
case-20 | fail→pass | 12,072 | 2,453 | -80% | 1 | 1 | 0% | 1,683 | 1,599 | -5% | 0 | 0 | — |
case-21 | fail→pass | 14,788 | 2,695 | -82% | 1 | 1 | 0% | 2,349 | 1,718 | -27% | 0 | 0 | — |
case-22 | fail→pass | 13,562 | 3,641 | -73% | 1 | 1 | 0% | 2,066 | 1,708 | -17% | 0 | 0 | — |
case-23 | pass→pass | 8,304 | 6,490 | -22% | 1 | 1 | 0% | 1,088 | 2,352 | +116% | 0 | 0 | — |
case-24 | pass→pass | 11,026 | 9,144 | -17% | 1 | 1 | 0% | 2,219 | 3,000 | +35% | 0 | 0 | — |
case-25 | pass→pass | 4,939 | 3,247 | -34% | 1 | 1 | 0% | 787 | 1,802 | +129% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 22 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +72 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.