complexity-check

Analyze code for time and space complexity and identify scaling bottlenecks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/thisguymartin/ai-native-dev --skill complexity-check-thisguymartin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: complexity-check
Source: https://github.com/thisguymartin/ai-native-dev/tree/main/.gemini/skills/complexity-check
Command: npx skills add https://github.com/thisguymartin/ai-native-dev --skill complexity-check-thisguymartin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers and reviewers understand the time and space cost of code by producing clear Big-O analyses, concrete operation estimates for given input sizes, and identifying scaling bottlenecks that lead to slowdowns in production.

Core Features & Use Cases

  • Detailed Complexity Breakdowns: Breaks code into operations (loops, recursion, data-structure ops, I/O) and reports best/average/worst-case time and space complexity.
  • Concrete Scaling Estimates: Translates Big-O into real operation counts and approximate timing for example input sizes so teams can judge practical impact.
  • Bottleneck Identification & Patterns: Flags N+1 queries, hidden O(n^2) patterns, excessive copying, and I/O-heavy loops; useful during code review, performance audits, and pre-deployment checks.

Quick Start

Analyze the specified file or function for time and space complexity and explain the practical impact at the stated input scale.

Frequently Asked Questions about complexity-check

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze code for time and space complexity?

Analyzing code for time and space complexity involves breaking functions into loops, recursion, and data-structure operations to estimate Big-O scaling and identify performance bottlenecks. The analysis reports best, average, and worst-case complexity for individual functions or entire files.

What is hidden quadratic behavior and how do I detect it in my code?

Hidden quadratic behavior occurs when algorithms appear linear but execute with O(n^2) complexity due to nested data-structure operations or excessive copying. Detection involves analyzing I/O patterns and operation counts to flag high-risk scaling bottlenecks during code review.

How do I identify N+1 queries and scaling bottlenecks during code review?

Identifying N+1 queries and scaling bottlenecks requires detecting I/O-heavy loops and hidden quadratic patterns within functions. Code analysis flags these high-risk patterns and translates Big-O estimates into concrete operation counts for example input sizes to show practical impact.

Can I estimate concrete operation counts for example input sizes in Big-O analysis?

Estimating concrete operation counts for example input sizes translates Big-O notation into real numbers and approximate timing. This helps teams judge the practical impact of algorithm complexity and understand scaling costs for specific data volumes during performance audits.

Does code complexity analysis work for entire files or only single functions?

Code complexity analysis works for single functions, modules, and entire files. It estimates Big-O time and space complexity across the specified scope, detecting I/O patterns and providing developer-facing performance explanations for any level of code granularity.