Agent skill · software engineering · sickn33
lemmaly
Algorithm-first discipline: state Big-O, data structure, and algorithm family BEFORE writing loops, queries, or recursion. Catches O(n^2), N+1, and brute-force defaults.
Why this skill is useful
Adds a structured approach to algorithm analysis and complexity evaluation that the AI wouldn't reliably generate on its own.
What it needs
About 9k tokens when loaded. Last updated 2026-08-07. 44,571 stars on the source repository.
What this skill does
lemmaly — Algorithm-First Proof The model already knows Big-O, hash tables, divide-and-conquer, dynamic programming, sorting, graph algorithms, and amortized analysis. It just does not apply them spontaneously. lemmaly fixes the behavior, not the knowledge. This skill is the gateway for an algorithm-discipline suite of four skills (lemmaly, mathguard, invariant-guard, complexity-cuts). It enforces the hard rules that every other guard in the suite assumes. Violating the letter of these rules is violating the spirit of the skill. "Just this once" is how O(n²) ships to production. When to Use This Skill Use lemmaly when: Writing, editing, or reviewing code that involves loops, collections, lookups, searches, joins, recursion, graphs, queries, or any computation over more than a handful of items. About to write a for inside a for, .find / .includes / .indexOf inside a loop, await inside for / map / forEach over independent items, or one query per item in a collection. Auditing a codebase / PR for known anti-patterns (await-in-loop, .includes inside .filter, string-concat in loop, SELECT , N+1, etc.). Reviewing AI-generated code that "looks idiomatic" but might hide O(n²) or N+1. When in doubt, start at lemmaly — it is the gateway and will tell you when to escalate to its three sibling skills. If you are about to… Use Why --- --- --- Write new code that loops, queries, joins, recurses, or processes a collection lemmaly Forces complexity + data structure + algorithm family before code is written. Refactor existing code that is already slow, OOMs, times out, or has nested loops / N+1 / repeated work complexity-cuts Corrective playbook for code that already shipped with bad Big-O. Implement an algorithm where the obvious version is subtly wrong (binary search variants, in-place dedup, Boyer–Moore, QuickSelect partition, recursion with accumulators, fixed-point / termination concerns) invariant-guard Forces writing the function contract + loop invariant before code. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills sickn33/lemmaly