Complexity Guard Lite: Big-O Review With Few False Alarms
Linters mostly catch one-language micro-optimisations.
$1
Complexity Guard Lite: Big-O Review With Few False Alarms
Example session with this skill installed
Review this for complexity problems: orders.map(o => ({ ...o, user: users.find(u => u.id === o.userId) })) and items.reduce((acc, it) => ({ ...acc, [it.id]: it }), {})
- Read your context and instructions
- Compiled the complexity guard lite
attachUsers: lookup by scan in a loop. O(orders × users): `users.find` runs once per order. Fix: build `const byId = new Map(users.map(u => [u.id, u]))` once and use `byId.get(o.userId)`.
byId: accumulating copy. O(n²): `{...acc}` copies the whole accumulator on every step. Fix: mutate one object, or `Object.fromEntries(items.map(it => [it.id, it]))`.
Connects securely to your tools. The creator never sees your data.
About this skill
Studies of AI-written code keep finding the same thing: it usually works, but it often runs far slower than it should, with nested loops, lookups by scan, a query per row, and copies made inside loops. Linters mostly catch one-language micro-optimisations. This skill reviews for how cost grows with the input, in any language, and stays quiet when code only looks slow.
What it catches
- Nested loops over the same data, and joins: two data collections matched on a key (
orders × customers) - Lookups by scan in a loop:
inon a list,.find,.filter,.includes,count,index - N+1 queries and network calls per item, after checking for
select_related,prefetch_related,includeorJOIN FETCHfirst - Accumulating copies (
{...acc}inreduce,pd.concatin a loop), front removal (pop(0),shift), slice copies per call - Sorting or string building in loops, recursion with no memo, unbounded caches on methods, regexes compiled on every call, layout thrashing in the DOM, and work that never changes inside a loop
What it leaves alone: set and dict lookups, len(), fixed dimensions like months or retries, windows that move by their own width, pagination loops, memoized recursion, Python's cached re patterns, Go reslicing, small constant arrays. Every finding names its evidence and gives a concrete fix in the code's own language. pandas row loops are reported separately, as a constant factor rather than a Big-O problem.
Advisory only: it reports, and changes code only if you ask. Works in any agent. Instructions only: nothing to install.
It reads code; it doesn't run or profile it, so estimates are heuristics with named evidence, not measurements. When it can't see a type or an input size, it says so under "Worth a look" instead of guessing. It doesn't cover database indexes or query plans.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 15 days ago
- Software
Python
Permissions
Reads the files or diff you ask it to review. Changes no code unless you ask.
What's inside
Frequently Asked Questions
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.