CG

    Complexity Guard Lite: Big-O Review With Few False Alarms

    by Aishwarya Rai

    1

    Linters mostly catch one-language micro-optimisations.

    $1

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    CG

    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: in on a list, .find, .filter, .includes, count, index
    • N+1 queries and network calls per item, after checking for select_related, prefetch_related, include or JOIN FETCH first
    • Accumulating copies ({...acc} in reduce, pd.concat in 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Read Files

    Reads the files or diff you ask it to review. Changes no code unless you ask.

    Listed15 days ago

    What's inside

    Frequently Asked Questions

    Reviews code for algorithmic slowdowns: nested loops over the same data, list lookups, queries per item (N+1), sorting or string building in loops, recursion with no memo, and repeated work in a loop. Checks for prefetching and memo first to avoid false positives; gives evidence and a fix.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Complexity Guard Lite: Big-O Review With Few False Alarms on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.