Performance & Resource Usage Audit
A structured, evidence-based check of a project's backend, frontend, database, and
infrastructure/deployment configuration for performance, scalability, and resource-cost issues —
not a benchmark run and not a substitute for an actual profiler, load test, or Lighthouse run. It
investigates the codebase and configuration for the patterns that cause slowness, excess
resource use, or wasted cost, and reports one table the user can act on.
Out of scope, by design: application security (SSRF, injection, auth, secrets — use
cybersecurity-check) and general code correctness/readability/maintainability (use
code-review). A finding belongs here only if its primary consequence is latency, throughput,
memory/CPU usage, or infrastructure cost.
Ground rules
- Evidence or it didn't happen. Every row needs a concrete pointer — a
file:line, a grep
match, an actual config value, or a command's real output. Never write "looks fine," "should be
fast enough," or "probably scales" — either you found the pattern (good or bad) in the
code/config, or you say plainly that you couldn't check it.
- Be explicit about what kind of check each row is. Most of this skill is static investigation:
reading code and config to spot patterns known to cause performance/resource problems (N+1
queries, missing indexes, unbounded caches, missing resource limits). That tells you a problem
is likely, not its actual magnitude — code review cannot tell you a page's real LCP in
milliseconds, a query's real execution time, or a service's real p99 latency under load. Where a
finding genuinely needs a profiler, an
EXPLAIN ANALYZE run, a load-testing tool (k6, Locust,
JMeter), or a Lighthouse/WebPageTest run to confirm magnitude or severity, say so explicitly and
mark it ⚠️ rather than guessing a number. If you can run something read-only and safe
yourself (e.g. EXPLAIN on a query against a non-production database, a bundle-size command,
npm run build -- --analyze), do it and report the actual output instead of leaving it as a
guess.
- Don't invent scope you can't check, and don't silently drop scope either. If the project has
no frontend, or isn't deployed to any container/serverless platform, say so — mark the row
➖ N/A with a one-line reason. Every check in the applicable reference file(s) gets a row in the
output; none are quietly skipped.
- Never run a real load test or benchmark against a live/production system as part of this
skill. Read-only investigation of code and config, plus safe, local, non-destructive commands
(a local build, a static
EXPLAIN, an npm run build bundle report). If a load test is genuinely
warranted, say so as a recommendation — don't fire one yourself against something you don't
control.
- Be genuinely thorough. Don't stop at the first few checks in each file because the table is
getting long, and don't skip a whole reference file because the stack "probably doesn't have that
problem" — verify it, even briefly, rather than assuming.
Workflow
- Map the surface. Identify: backend language/framework, database(s) and ORM/query layer,
frontend framework (if any — web, mobile, or none), deployment target (container/Kubernetes,
serverless/FaaS, VM, PaaS), and whether an APM/profiler/metrics setup already exists (Datadog,
New Relic, Prometheus/Grafana,
dotnet-trace, Chrome DevTools performance recordings, existing
Lighthouse CI). An existing metrics setup changes what you should ask the user for (real numbers)
versus what you have to infer from code alone. Skim README.md/deployment docs first — most
projects already document the stack and deployment target, which saves a lot of exploration.
- Work through the applicable reference file(s) — every check in each one gets a row in the
final table, marked ✅/❌/⚠️/➖ as appropriate:
references/backend-performance.md — algorithmic hot loops, N+1 queries, missing indexes,
connection pooling, caching correctness, blocking I/O in async code, missing timeouts,
unbounded pagination, serialization overhead, hot-path logging
references/frontend-performance.md — bundle size/code-splitting, re-render patterns, image
optimization, render-blocking resources, network-request efficiency, Core Web Vitals-relevant
code smells (➖ N/A this whole file if there's genuinely no frontend/UI layer)
references/infra-resources.md — container/pod resource requests & limits, autoscaling
config, database sizing, connection-pool-vs-max-connections, CDN/caching-layer usage,
serverless cold starts, queue backpressure, cost-relevant misconfiguration (➖ N/A the
items that don't apply to this deployment target, e.g. HPA checks for a project with no
Kubernetes deployment)
- Investigate, don't assume. Use Grep/Read/Bash freely: search for the actual query-building
code, the actual HTTP client instantiation site, the actual resource-limit YAML, rather than
inferring from framework defaults or a well-organized-looking codebase. An ORM that supports
eager loading doesn't mean this project uses it everywhere it should; a
Dockerfile existing
doesn't mean the k8s manifest that deploys it sets resource limits — check that file too.
- Report as one table in the format below, most severe/impactful failures first within each
area, followed by a prioritized punch list and a separate needs-review list.
Output format
Start with 3-4 sentences: what was checked (confirm which reference files applied and which were
marked N/A at the file level, e.g. no frontend), what couldn't be reached (no access to a
staging/production environment to profile, no load-testing tool run, no visibility into real
traffic patterns), and the caveat from Ground rules that this is static investigation of
causative patterns, not a measured benchmark.
Then ALWAYS use this exact table — one row per check across all applicable reference files, none
omitted:
| # |
Check |
Bereich/Area |
Status |
Befund/Evidence |
Empfehlung/Recommendation |
| 1 |
... |
Backend/Frontend/DB/Infra |
✅/❌/⚠️/➖ |
file:line, command output, or config value |
only if not ✅ |
(Match the table's actual language to the conversation's language — the column names above are
illustrative, not a fixed vocabulary. Keep "Befund"/"Evidence" concrete: a path+line, a command and
its actual output, or "not found — searched X, Y, Z". Group rows by area with a subheading or an
"Area" column, whichever reads more clearly for the number of rows involved.)
Status legend:
- ✅ Pass — good pattern found and verified in code/config (e.g. eager loading used, resource
limits set at a sane multiple of observed usage, cache has an explicit TTL/eviction policy)
- ❌ Fail — checked, and the anti-pattern/missing safeguard is present (e.g. confirmed N+1 query,
missing index on a filtered column, no resource limits set, unbounded in-memory cache)
- ⚠️ Needs profiler/load-test/measurement to confirm — code review found a plausible risk (a loop
that looks O(n²), a component that looks like it re-renders often) but confirming actual
magnitude/impact requires running a profiler,
EXPLAIN ANALYZE, a load test, or a Lighthouse/
WebPageTest pass that this skill did not (and should not, per Ground rules) run itself
- ➖ N/A — this check's surface doesn't exist in this project (state why in one clause — e.g. "no
frontend in this repo", "not deployed to Kubernetes, no HPA to check")
End with a prioritized punch list: every ❌, ordered by likely impact on latency/throughput/
resource cost if left unfixed, each with the one-line fix. Follow it with a needs-review list:
every ⚠️, naming the specific tool/run (profiler, EXPLAIN ANALYZE, k6/Locust load test, Lighthouse)
that would confirm or dismiss it — don't let these get lost at the bottom of a long table.
1---2name: performance-audit3description: Runs a structured performance and resource-usage audit across a project's backend, frontend, database, and infrastructure/deployment configuration, then reports the results as one table (check, area, status, evidence, recommendation). Covers backend hot-path efficiency (algorithmic complexity, N+1 queries, missing indexes, connection pooling, caching, blocking I/O, missing timeouts, unbounded pagination, serialization overhead, hot-path logging), frontend performance (bundle size/code-splitting, unnecessary re-renders, image optimization, render-blocking resources, duplicate/unparallelized network requests, Core Web Vitals-relevant patterns), and infrastructure/cost (container resource requests & limits, autoscaling/HPA config, database sizing, connection-pool-vs-max-connections mismatches, CDN/caching-layer usage, serverless cold starts, queue backpressure, always-on cost waste). This is a performance/throughput/latency/memory/CPU/cost review, not a security review and not a general code-quality/readability 4---56# Performance & Resource Usage Audit78A structured, evidence-based check of a project's backend, frontend, database, and9infrastructure/deployment configuration for performance, scalability, and resource-cost issues —10not a benchmark run and not a substitute for an actual profiler, load test, or Lighthouse run. It11investigates the codebase and configuration for the patterns that *cause* slowness, excess12resource use, or wasted cost, and reports one table the user can act on.1314Out of scope, by design: application security (SSRF, injection, auth, secrets — use15`cybersecurity-check`) and general code correctness/readability/maintainability (use16`code-review`). A finding belongs here only if its primary consequence is latency, throughput,17memory/CPU usage, or infrastructure cost.1819## Ground rules2021- **Evidence or it didn't happen.** Every row needs a concrete pointer — a `file:line`, a grep22 match, an actual config value, or a command's real output. Never write "looks fine," "should be23 fast enough," or "probably scales" — either you found the pattern (good or bad) in the24 code/config, or you say plainly that you couldn't check it.25- **Be explicit about what kind of check each row is.** Most of this skill is static investigation:26 reading code and config to spot patterns known to cause performance/resource problems (N+127 queries, missing indexes, unbounded caches, missing resource limits). That tells you a problem28 is *likely*, not its actual magnitude — code review cannot tell you a page's real LCP in29 milliseconds, a query's real execution time, or a service's real p99 latency under load. Where a30 finding genuinely needs a profiler, an `EXPLAIN ANALYZE` run, a load-testing tool (k6, Locust,31 JMeter), or a Lighthouse/WebPageTest run to confirm magnitude or severity, say so explicitly and32 mark it `⚠️` rather than guessing a number. If you *can* run something read-only and safe33 yourself (e.g. `EXPLAIN` on a query against a non-production database, a bundle-size command,34 `npm run build -- --analyze`), do it and report the actual output instead of leaving it as a35 guess.36- **Don't invent scope you can't check, and don't silently drop scope either.** If the project has37 no frontend, or isn't deployed to any container/serverless platform, say so — mark the row38 `➖ N/A` with a one-line reason. Every check in the applicable reference file(s) gets a row in the39 output; none are quietly skipped.40- **Never run a real load test or benchmark against a live/production system as part of this41 skill.** Read-only investigation of code and config, plus safe, local, non-destructive commands42 (a local build, a static `EXPLAIN`, an `npm run build` bundle report). If a load test is genuinely43 warranted, say so as a recommendation — don't fire one yourself against something you don't44 control.45- **Be genuinely thorough.** Don't stop at the first few checks in each file because the table is46 getting long, and don't skip a whole reference file because the stack "probably doesn't have that47 problem" — verify it, even briefly, rather than assuming.4849## Workflow50511. **Map the surface.** Identify: backend language/framework, database(s) and ORM/query layer,52 frontend framework (if any — web, mobile, or none), deployment target (container/Kubernetes,53 serverless/FaaS, VM, PaaS), and whether an APM/profiler/metrics setup already exists (Datadog,54 New Relic, Prometheus/Grafana, `dotnet-trace`, Chrome DevTools performance recordings, existing55 Lighthouse CI). An existing metrics setup changes what you should ask the user for (real numbers)56 versus what you have to infer from code alone. Skim `README.md`/deployment docs first — most57 projects already document the stack and deployment target, which saves a lot of exploration.582. **Work through the applicable reference file(s)** — every check in each one gets a row in the59 final table, marked ✅/❌/⚠️/➖ as appropriate:60 - `references/backend-performance.md` — algorithmic hot loops, N+1 queries, missing indexes,61 connection pooling, caching correctness, blocking I/O in async code, missing timeouts,62 unbounded pagination, serialization overhead, hot-path logging63 - `references/frontend-performance.md` — bundle size/code-splitting, re-render patterns, image64 optimization, render-blocking resources, network-request efficiency, Core Web Vitals-relevant65 code smells (`➖ N/A` this whole file if there's genuinely no frontend/UI layer)66 - `references/infra-resources.md` — container/pod resource requests & limits, autoscaling67 config, database sizing, connection-pool-vs-max-connections, CDN/caching-layer usage,68 serverless cold starts, queue backpressure, cost-relevant misconfiguration (`➖ N/A` the69 items that don't apply to this deployment target, e.g. HPA checks for a project with no70 Kubernetes deployment)713. **Investigate, don't assume.** Use Grep/Read/Bash freely: search for the actual query-building72 code, the actual HTTP client instantiation site, the actual resource-limit YAML, rather than73 inferring from framework defaults or a well-organized-looking codebase. An ORM that supports74 eager loading doesn't mean this project uses it everywhere it should; a `Dockerfile` existing75 doesn't mean the k8s manifest that deploys it sets resource limits — check that file too.764. **Report as one table** in the format below, most severe/impactful failures first within each77 area, followed by a prioritized punch list and a separate needs-review list.7879## Output format8081Start with 3-4 sentences: what was checked (confirm which reference files applied and which were82marked N/A at the file level, e.g. no frontend), what couldn't be reached (no access to a83staging/production environment to profile, no load-testing tool run, no visibility into real84traffic patterns), and the caveat from Ground rules that this is static investigation of85causative patterns, not a measured benchmark.8687Then ALWAYS use this exact table — one row per check across all applicable reference files, none88omitted:8990| # | Check | Bereich/Area | Status | Befund/Evidence | Empfehlung/Recommendation |91|---|---|---|---|---|---|92| 1 | ... | Backend/Frontend/DB/Infra | ✅/❌/⚠️/➖ | file:line, command output, or config value | only if not ✅ |9394(Match the table's actual language to the conversation's language — the column names above are95illustrative, not a fixed vocabulary. Keep "Befund"/"Evidence" concrete: a path+line, a command and96its actual output, or "not found — searched X, Y, Z". Group rows by area with a subheading or an97"Area" column, whichever reads more clearly for the number of rows involved.)9899Status legend:100- ✅ Pass — good pattern found and verified in code/config (e.g. eager loading used, resource101 limits set at a sane multiple of observed usage, cache has an explicit TTL/eviction policy)102- ❌ Fail — checked, and the anti-pattern/missing safeguard is present (e.g. confirmed N+1 query,103 missing index on a filtered column, no resource limits set, unbounded in-memory cache)104- ⚠️ Needs profiler/load-test/measurement to confirm — code review found a plausible risk (a loop105 that looks O(n²), a component that looks like it re-renders often) but confirming actual106 magnitude/impact requires running a profiler, `EXPLAIN ANALYZE`, a load test, or a Lighthouse/107 WebPageTest pass that this skill did not (and should not, per Ground rules) run itself108- ➖ N/A — this check's surface doesn't exist in this project (state why in one clause — e.g. "no109 frontend in this repo", "not deployed to Kubernetes, no HPA to check")110111End with a **prioritized punch list**: every ❌, ordered by likely impact on latency/throughput/112resource cost if left unfixed, each with the one-line fix. Follow it with a **needs-review list**:113every ⚠️, naming the specific tool/run (profiler, `EXPLAIN ANALYZE`, k6/Locust load test, Lighthouse)114that would confirm or dismiss it — don't let these get lost at the bottom of a long table.