Skip to content

frizynn/code-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Code Optimizer

Deep code optimization audit using parallel specialist agents. Each agent hunts for performance anti-patterns, inefficiencies, duplication, and suboptimal code using pattern-based detection (Grep/Glob) without reading the full source code first — avoiding anchoring bias.

With the --fix flag, it automatically implements fixes as parallel PRs in isolated git worktrees.

Install

npx skills add frizynn/code-optimizer

What it does

Spawns 14+ specialist agents simultaneously, each scanning your codebase for a different class of problem:

Agent Focus
Database & Queries N+1 queries, SELECT *, missing indexes, ORM misuse
Memory & Resources Memory leaks, unclosed resources, large allocations
Algorithmic Complexity O(n^2) patterns, unnecessary iterations, wrong data structures
Concurrency & Async Sequential awaits, blocking in async, race conditions
Bundle & Dependencies Heavy imports, unused deps, duplicate libs
Dead Code & Redundancy Unused exports, commented code, dead branches
I/O & Network Sequential requests, missing batching, no dedup
Rendering & UI React re-renders, missing virtualization, layout thrashing
Data Structures Wrong structures, unnecessary copies, inefficient serialization
Error & Resilience Missing timeouts, swallowed errors, no retries
Caching & Memoization Missing memoization, cache without invalidation
Build & Compilation Dev code in prod, missing optimization flags
Security-Performance Crypto misuse, missing rate limiting, ReDoS
Simplification & Dedup Duplicated functions, inline boilerplate, verbose patterns

Optional agents (spawned when relevant): Logging & Observability, Config & Infrastructure.

Usage

/code-optimizer              # Audit only — report findings
/code-optimizer --fix        # Audit + implement all fixes as PRs
/code-optimizer --fix-critical  # Only fix CRITICAL and HIGH severity
/code-optimizer --simplify   # Only run simplification/dedup agent
/code-optimizer src/         # Limit scope to a specific directory

Supported stacks

Node.js/TypeScript, Python, Go, Rust, Java, Ruby, and any project with Docker, SQL, or standard build tools (Webpack, Vite, etc.).

How it works

  1. Detect stack — scans for package.json, requirements.txt, go.mod, Cargo.toml, etc.
  2. Spawn agents — launches all specialist agents in parallel
  3. Pattern-based detection — each agent Greps/Globs for anti-patterns from its reference file, only reading code context to confirm findings
  4. Consolidate report — deduplicates, sorts by severity, groups by file
  5. Execute fixes (with --fix) — groups findings into independent units, spawns fix agents in isolated worktrees, each opens a PR

Output

A prioritized report with:

  • Executive summary (findings by severity, top 3 highest-impact fixes)
  • Detailed findings table grouped by file
  • Improvement plan ordered from highest to lowest impact

License

MIT

About

Deep code optimization audit using 14+ parallel specialist agents. Pattern-based detection of performance anti-patterns, inefficiencies, and duplication. Auto-fix with PRs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors