complexity-cuts
Lower Big-O on existing code via a one-transformation-at-a-time playbook with verify-revert-stop. For new code use lemmaly; for math-level wins escalate to mathguard.
npx skills add sickn33/agentic-awesome-skills --skill complexity-cuts --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# complexity-cuts — Lower Big-O on Existing Code `lemmaly` prevents bad complexity before code is written. **complexity-cuts** fixes it after the fact: code already exists, it works, but its time or space complexity is worse than necessary. **Violating the letter of these rules is violating the spirit of the skill.** Adapting "just a little" is how a faster-but-wrong rewrite ships. ## When to Use This Skill Use **complexity-cuts** when refactoring existing code that has poor Big-O: - Nested loops, `O(n²)` or worse scans, repeated work, redundant allocations, blown memory. - Stated symptoms: "this is slow on large inputs", "times out", "OOM", "too much memory", "reduce complexity", "optimize this algorithm". - N+1 query patterns in ORMs (Prisma, Drizzle, SQLAlchemy, Django, ActiveRecord). - `await` inside `for` over independent items causing serial latency. For *preventing* bad complexity before code is written, use **`lemmaly`**. For math-level optimizations (Bloom, HLL, FFT, JL projection), escalate to **`mathguard`**. ## The Iron Law ```text NO TRANSFORMATION WITHOUT EXISTING TESTS GREEN BEFORE AND AFTER ``` If the code has no tests, you write a characterization test first (golde
- When to Use This Skill
- The Iron Law
- Non-negotiable rules
- The transformation playbook
- Time-complexity reductions
- Space-complexity reductions
- When you cannot lower asymptotic Big-O
- Required workflow
- Canonical example — workflow vs no-workflow
- Without the workflow — changes semantics AND patches the test
- With the workflow — one transformation, semantics preserved
- Output discipline
- Stop conditions — do not optimize further when
- Rationalizations to watch for
What does the complexity-cuts skill do?
Lower Big-O on existing code via a one-transformation-at-a-time playbook with verify-revert-stop. For new code use lemmaly; for math-level wins escalate to mathguard.
How do I install it?
Run `npx skills add sickn33/agentic-awesome-skills --skill complexity-cuts --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From sickn33/agentic-awesome-skills, a repository with 44,414 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.