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.
npx skills add nickleefly/complexity-optimizer# 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-optimizerFor more installation options, see the skills CLI documentation.
# Verify the skill is available in the repository
npx skills add nickleefly/complexity-optimizer --list
# List installed skills
npx skills listIn 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.
- 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.pyscript for initial hotspot detection
- Establish baseline: Identifies language, framework, test commands, and performance-sensitive paths
- Rank opportunities: Prioritizes hot paths, large input paths, rendering loops, and database/API loops
- Prove behavior: Locates or adds focused tests before changing code
- Optimize conservatively: Applies proven improvements over broad rewrites
- Verify: Runs tests and benchmarks to confirm correctness
MIT