Individual skill
algorithmic-complexity-review
Algorithmic complexity (Big-O) review — finding nested loops, N+1 queries, exponential recursion, quadratic string builds, and other accidental complexity blowups. Covers Python, JavaScript/TypeScript, Java, Go, and similar languages. Use whenever writing, reviewing, or refactoring code where Big-O matters. Trigger even when the user doesn't mention "Big-O" explicitly — if they're reviewing code for performance, refactoring a hot path, asking "why is this slow," or working with data that scales (loops, recursions, collections, ORM access), apply this skill to classify the time/space complexity and suggest the fix. Especially trigger on tasks like "review for performance," "find slow code," "make this faster," "this code is O(n²)," or when reading code that processes collections.
skills/.experimental/algorithmic-complexity-review/SKILL.md
Source commit cf93c57cac89d6fc3e4194686000411567f5caf3
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- Yes
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Network or broad shell
- Last checked
- Nov 11, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 224
- Repository last updated
- Aug 15, 2026
- License
- MIT
Observed agent integration: codex
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
AGENTS.mddoc · 10,627 bytesREADME.mddoc · 7,684 bytesSKILL.mdcore · 12,212 bytesSKILL.mdcore · 12,212 bytesassets/templates/_template.mddoc · 2,694 bytesmetadata.jsonasset · 1,447 bytesreferences/_sections.mddoc · 3,831 bytesreferences/build-avoid-immutable-object-spread.mddoc · 1,972 bytesreferences/build-avoid-quadratic-string-concat.mddoc · 2,170 bytesreferences/build-avoid-spread-in-reducer.mddoc · 1,966 bytesreferences/build-presize-when-length-known.mddoc · 2,549 bytesreferences/compute-cache-expensive-pure-results.mddoc · 2,606 bytesreferences/compute-cache-property-lookup.mddoc · 2,271 bytesreferences/compute-defer-or-short-circuit.mddoc · 2,258 bytesreferences/compute-hoist-loop-invariants.mddoc · 2,469 bytesreferences/compute-precompile-regex.mddoc · 2,232 bytesreferences/ds-counter-for-histograms.mddoc · 1,935 bytesreferences/ds-deque-for-front-operations.mddoc · 2,029 bytesreferences/ds-hashmap-for-keyed-access.mddoc · 2,197 bytesreferences/ds-heap-for-top-k.mddoc · 1,593 bytesreferences/ds-sorted-structure-for-range-queries.mddoc · 2,245 bytesreferences/ds-trie-for-prefix-search.mddoc · 2,482 bytesreferences/io-batch-instead-of-per-item.mddoc · 2,182 bytesreferences/io-file-read-in-loop.mddoc · 2,072 bytesreferences/io-missing-eager-load.mddoc · 2,207 bytesreferences/io-n-plus-one-query.mddoc · 2,012 bytesreferences/io-sequential-await-in-loop.mddoc · 2,039 bytesreferences/nested-cartesian-comparison.mddoc · 1,885 bytesreferences/nested-explicit-quadratic-loops.mddoc · 1,634 bytesreferences/nested-find-in-loop.mddoc · 1,694 bytesreferences/nested-includes-in-loop.mddoc · 1,817 bytesreferences/nested-set-operations-on-arrays.mddoc · 1,792 bytesreferences/nested-substring-search-in-loop.mddoc · 2,541 bytesreferences/rec-iterative-for-deep-recursion.mddoc · 2,084 bytesreferences/rec-memoize-overlapping-subproblems.mddoc · 2,129 bytesreferences/rec-prune-with-bounds.mddoc · 3,068 bytesreferences/rec-share-memo-across-top-level-calls.mddoc · 2,444 bytesreferences/rec-tabulate-bottom-up.mddoc · 2,287 bytesreferences/search-binary-search-on-sorted.mddoc · 1,994 bytesreferences/search-build-index-once-amortize.mddoc · 2,251 bytesreferences/search-quickselect-not-full-sort.mddoc · 2,139 bytesreferences/search-sort-once-outside-loop.mddoc · 2,127 bytesreferences/space-generators-over-intermediate-lists.mddoc · 2,182 bytesreferences/space-release-retained-references.mddoc · 2,765 bytesreferences/space-shallow-not-deep-copy.mddoc · 2,225 bytesreferences/space-stream-dont-load.mddoc · 2,474 bytes
Read excerpt
# dot-skills Algorithmic Complexity (Big-O) Best Practices
Find, classify, and fix algorithmic complexity (Big-O) problems in code — language-agnostic. The 39 rules across 8 categories cover the patterns responsible for the vast majority of accidental quadratic, exponential, and N+1 blowups in production code: nested iteration, loop-invariant I/O, data-structure mismatch, recursion explosions, redundant computation, collection-building anti-patterns, search/sort selection, and space traps.
## When to Apply
Use this skill when:
- Reviewing a pull request or function for performance regressions
- Asked "why is this slow?" or "can we make this faster?"
- Refactoring a hot path or a function that handles user-scaled input
- Reading code that contains: nested loops, `.includes`/`.find`/`x in list` inside iteration, ORM access in a loop, recursion without memoization, string/array building via `+=` or spread, file/database I/O inside iteration
- Reviewing code that processes lists, trees, or streams whose size will grow
## Workflow: Find, Classify, Fix