performance-audit-static

Analyze code for N+1 queries, over-fetching, missing indexes, and caching gaps without running tests.

579|76|Updated Oct 29, 2026
Ready to run
npx skills add https://github.com/phuryn/product-engineering --skill performance-audit-static-phuryn
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: performance-audit-static
Source: https://github.com/phuryn/product-engineering/tree/main/ai-shipping/skills/performance-audit-static
Command: npx skills add https://github.com/phuryn/product-engineering --skill performance-audit-static-phuryn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI-generated code optimizes for initial functionality but often contains performance defects that only emerge at scale: N+1 queries in loops, over-fetching unused fields, missing database indexes, and absent caching strategies. This Skill identifies these failures in static code review so they don't reach production. ## Core Features & Use Cases - N+1 Query Detection: Find loops that repeat database queries per row and sequential awaits that should be parallelized or batched. - Over-Fetch Auditing: Identify SELECT * statements, unused fields, missing pagination, and redundant loads in list and dashboard views. - Index & Caching Analysis: Recommend specific index definitions for hot queries and propose caching only with invalidation rules attached. - Use Case: Before releasing a new user dashboard, audit the recent changes to catch the pagination query running per user row and the missing index on the frequently-filtered status column. ## Quick Start Ask your agent to audit performance issues in the recent code changes by specifying the scope: run a static performance audit on the last three commits, the src/views directory, or just the uncommitted changes.

Frequently Asked Questions about performance-audit-static

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

FAQPage Schema
How does static performance auditing find N+1 query problems?▼

Static audit reviews loops and per-item rendering logic to spot queries repeated per row and sequential fetch chains that could batch or parallelize. Evidence is cited at specific file lines where the loop or await chain appears.

What is the difference between auditing the whole repository and auditing changes?▼

Auditing changes (a git range or uncommitted files) focuses only on what was modified and what they newly affect: callers, dependent queries, and consumers. Whole-repository audits prioritize high-traffic views and large tables. Use change audits for releases, whole-repo audits for initial setup or major refactors.

Can static audit recommend specific index definitions?▼

Yes. The audit reviews query filters, sorts, and joins to recommend exact index definitions checked against the existing schema. It does not flag indexes that already exist as primary keys or unique constraints.

Why does the audit require an invalidation rule for every cache proposal?▼

Caching without invalidation risks stale data bugs. Each cache proposal must cite why the path is hot (rendered per load, called in a loop, hit by bots) and define when and how the cache expires or invalidates.

What happens if the audit scope is too large for one agent?▼

When scope exceeds roughly 30 files or 5,000 lines, the audit fans out to parallel subagents per module or view cluster. Each returns findings with evidence; the main agent merges results and runs the refutation pass to filter false positives.

Does static audit replace load testing?▼

No. Static audit catches structural defects (missing indexes, N+1 patterns) that static code review alone misses. Load testing confirms real-world impact and uncovers runtime issues static analysis cannot detect.