Skip to content

nickleefly/complexity-optimizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Complexity Optimizer

Agent skill for analyzing a software codebase, finding algorithmic complexity and performance hotspots, and producing safe optimization reports.

Works with Claude Code, Codex, Cursor, and 50+ other AI coding agents.

Install

npx skills add nickleefly/complexity-optimizer

Options

# Install to specific agents
npx skills add nickleefly/complexity-optimizer -a claude-code -a codex

# Install globally (available across all projects)
npx skills add nickleefly/complexity-optimizer -g

# List available skills before installing
npx skills add nickleefly/complexity-optimizer --list

# Install a specific skill
npx skills add nickleefly/complexity-optimizer -s complexity-optimizer

For more installation options, see the skills CLI documentation.

Verification

# Verify the skill is available in the repository
npx skills add nickleefly/complexity-optimizer --list

# List installed skills
npx skills list

Use

In your AI coding agent:

Use $complexity-optimizer to analyze this codebase and give me a report.

By default, report-only prompts do not modify files. The skill reports:

  • File and line for each finding
  • Current pattern and why it may be costly
  • Estimated current complexity
  • Recommended change
  • Estimated complexity after the change
  • Risk level
  • Tests, benchmarks, or manual checks needed
  • Clear statement that no files were modified

To apply a change, ask explicitly:

Use $complexity-optimizer to implement the lowest-risk optimization from the report and run the relevant tests.

Features

  • Multi-language support: Python, JavaScript, TypeScript, JSX/TSX, Java, Go, C, C++, C#, Ruby, PHP, and Swift
  • Safe optimization: Preserves behavior, tests, APIs, outputs, and maintainability
  • Risk assessment: Each optimization includes risk level and verification requirements
  • First-pass scanner: Bundled analyze_complexity.py script for initial hotspot detection

How It Works

  1. Establish baseline: Identifies language, framework, test commands, and performance-sensitive paths
  2. Rank opportunities: Prioritizes hot paths, large input paths, rendering loops, and database/API loops
  3. Prove behavior: Locates or adds focused tests before changing code
  4. Optimize conservatively: Applies proven improvements over broad rewrites
  5. Verify: Runs tests and benchmarks to confirm correctness

License

MIT

About

Agent skill for analyzing codebase complexity hotspots and safe performance optimizations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages