performance-audit
Skill7 starsChanged 27 days agoMITView on GitHub
Full-stack performance health check across 12 dimensions. Rendering, bundles, assets, API/network, algorithms, memory, database, caching, Web Vitals, backend runtime, concurrency, and framework-specific pathologies. Evidence-based Impact Models with confidence tiers and a prioritized optimization roadmap. Switches: zuvo:performance-audit full | [path] | [file] | --frontend | --backend | --db | --bundle
20 other projects use a version of this.
Adopted by
Most recently taken up by
- LeonardoEnnes/ai-engineering-toolkittheir own version, first seen Nov 8, 2026
- nseney1/Soma-Governancetheir own version, first seen Nov 1, 2026
- RBraga01/a-teamtheir own version, first seen Nov 1, 2026
- nseney1/Aegis-Guardrailstheir own version, first seen Oct 25, 2026
- arndvs/ctrlshfttheir own version, first seen Oct 15, 2026
- 26zl/universal-agent-skillstheir own version, first seen Oct 13, 2026
Used with
Projects with it also use incident-response, threat-model and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AnthropicSkillincident-response
Run an incident response workflow — triage, communicate, and write postmortem. Trigger with "we have an incident", "production is down", an alert that needs severity assessment, a status update mid-incident, or when writing a blameless postmortem after resolution.
Also in 4 projects that use this
OpenAISkillthreat-model
Use when Codex is already in the threat-modeling phase of a security scan, the user explicitly invokes $threat-model, or the user explicitly asks to create, update, or persist a repository threat model. Do not use as the primary trigger for full PR, commit, branch, patch, or repository scans.
Also in 3 projects that use this
MicrosoftSkillapi-design
Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.
Also in 3 projects that use this
SentrySkillsecurity-review
Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.
Also in 4 projects that use this
Microsoft AzureSkillrelease-notes
Author and update release notes for Azure App Configuration libraries and providers. USE FOR: write release notes, add release note entry, update release notes, draft release notes, new version release notes, format release notes. DO NOT USE FOR: generating changelogs from git history, writing internal engineering notes.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 5 projects that use this
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- octanejs/octane★ 1.5ksame name
- gwdevhub/GWToolboxpp★ 1.1ksame name
- termio-sh/termio★ 787same name
- me2resh/apexyard★ 542same name
- wallstop/unity-helpers★ 176same name
- RBraga01/a-team★ 24same name
- patrickserrano/skills★ 13same name
- fritzprix/libr-agent★ 11same name
- nseney1/Aegis-Guardrails★ 4same name
- nseney1/Soma-Governance★ 4same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository58 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- a11y-auditSkill
- agent-benchmarkSkill
- api-auditSkill
- architectureSkill
- backlogSkill
- benchmarkSkill
- brainstormSkill
- buildSkill
- canarySkill
- ci-auditSkill
- code-auditSkill
- container-auditSkill
- content-auditSkill
- content-expandSkill
- content-fixSkill
- content-migrationSkill
- context-auditSkill
- db-auditSkill
- debugSkill
- dependency-auditSkill
- deploySkill
- design-reviewSkill
- designSkill
- docsSkill
- env-auditSkill
- executeSkill
- fix-testsSkill
- geo-auditSkill
- geo-fixSkill
- incidentSkill
- infra-auditSkill
- leadsSkill
- mutation-testSkill
- pentestSkill
- planSkill
- presentationSkill
- profile-sessionSkill
- receive-reviewSkill
- refactor-radarSkill
- refactorSkill
- release-docsSkill
- retroSkill
- reviewSkill
- security-auditSkill
- seo-auditSkill
- seo-fixSkill
- shipSkill
- skill-evalSkill
- structure-auditSkill
- test-auditSkill
- tests-performanceSkill
- ui-design-teamSkill
- using-zuvoSkill
- worktreeSkill
- write-articleSkill
- write-e2eSkill
- write-testsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 10 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 17 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 70
When evidence is absent, report INSUFFICIENT DATA -- never guess.
- Distinctive: line 74
Read every file below before starting.
- Distinctive: line 86
If any file is MISSING, STOP.
- Very specific: line 145
Use the deterministic preload helper FIRST: Run ~/.zuvo/compute-preload performance-audit "$PWD" before any ToolSearch.
- Distinctive: line 229
Check which measurement tools are available before declaring audit confidence.
- Distinctive: line 296
Search for synchronous operations on the event loop:
- Very specific: line 349
If bundle analyzer is available, parse the output for precise measurements.
- Distinctive: line 432
If Lighthouse is available, run it and extract scores.
- Distinctive: line 471
Every finding above LOW severity must include an Impact Model:
- Very specific: line 612
Every HIGH+ finding goes through backlog-add, one call per finding (../../shared/includes/backlog-protocol.md "Filing from a skill".
- Distinctive: line 642
Before printing the final output block, verify every item.
- Very specific: line 683
If gate_status = FAIL → VERDICT = INCOMPLETE.
- Distinctive: line 691
Run: <ISO-8601-Z> performance-audit <project> <N-critical> <N-total> <VERDICT> - <N>-dimensions <NOTES> <BRANCH> <SHA7> <INCLUDES> <TIER>
- Very specific: line 696
Follow the retrospective protocol from retrospective.md.
- Distinctive: line 698
If gate check skips: print "RETRO: skipped (trivial session)" and proceed.
- Very specific: line 700
After printing this block, append the Run: line value (without the Run: prefix) to the log file path resolved per run-logger.md.
- Very specific: line 708
All commands use the resolved TARGET_ROOT from argument parsing
“Common” is measured: kept by at least 6 in 10 of the 17 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
zuvo:performance-audit
Measure, score, and prioritize performance across the entire stack. Every finding carries an Impact Model (estimated savings, blast radius, confidence level) so the team can act on data instead of hunches.
When to use: Periodic health check, before major release, after heavy feature
work, when users report slowness, before scaling infrastructure.
When NOT to use: Code quality (zuvo:review), security (/security-audit),
test quality (/test-audit).
Guiding Principles
- Performance claims without measurement are opinions, not findings.
- "Slow" without a baseline and a target is meaningless.
- Optimization without profiling is premature optimization.
- When evidence is absent, report INSUFFICIENT DATA -- never guess.
Mandatory File Loading
Read every file below before starting. Print the checklist.
CORE FILES LOADED:
1. ../../shared/includes/codesift-setup.md -- [READ | MISSING -> STOP]
2. ../../shared/includes/env-compat.md -- [READ | MISSING -> STOP]
3. ../../rules/cq-patterns.md -- [READ | MISSING -> STOP]
4. ../../shared/includes/run-logger.md -- [READ | MISSING -> STOP]
5. ../../shared/includes/retrospective.md -- [READ | MISSING -> STOP]
6. ../../shared/includes/backlog-protocol.md -- [READ | MISSING -> STOP] (Filing findings through backlog-add)If any file is MISSING, STOP. Do not proceed from memory.
Conditional Files
| File | Load when |
../../rules/cq-checklist.md | Scoring cross-cutting CQ overlap (CQ6 resources, CQ7 unbounded, CQ17 N+1) |
Argument Parsing
| Token | Behavior |
(empty) or full | All applicable dimensions across the entire project |
[path] | Scope to a directory or module |
[file] | Deep single-file audit (algorithms, memory, complexity) |
--frontend | D1-D3, D10 only |
--backend | D4-D5, D7-D8, D11-D12 only |
--db | D7 only (database queries and schema) |
--bundle | D2 only (bundle weight analysis) |
Safety Gate
This audit is read-only against production code. The only write targets are zuvo/audits/ and, through backlog-add, memory/backlog.md and memory/findings/. Do not modify
source files, configs, build output, or runtime environments. Tooling probes
(bundle analysis, Lighthouse) may be invoked but must not alter the build.
MANDATORY TOOL CALLS — Performance Audit Validity Gate
This audit is INVALID if any tool below is skipped when its trigger condition holds. "DEFERRED", "N/A", "--frontend only" are NOT valid reasons for tools relevant to the scoped scope.
| Tool | Trigger | Reason | Skip allowed? |
analyze_complexity | Always | KEY — algorithmic hot spots, CC distribution, outliers | NO |
analyze_hotspots | Always | KEY — git-churn × complexity (last 90d) | NO |
audit_scan | Always | Compound including find_perf_hotspots-equivalent | NO |
search_patterns(n-plus-one-django|await-in-loop|sync-fs) | Always | D-dim anti-patterns | NO |
find_clones | Always | Repeated-work patterns | NO |
trace_call_chain | Any HIGH/MEDIUM finding cites a function | Waterfall + downstream impact | NO when condition holds |
analyze_renders + analyze_hooks | React detected | D-frontend gates | NO when React |
| Stack-specific (analyze_prisma_schema/explain_query/python_audit/etc.) | Framework/ORM detected | Stack-specific perf gates | NO when matches |
Forbidden escape hatches: analyze_complexity: skipped, analyze_hotspots: N/A, codesift: unavailable (when deferred), retrospective: skipped — all REJECTED.
Required POSTAMBLE: report on disk → retro appended → ~/.zuvo/append-runlog exit 0. Every HIGH/MEDIUM finding needs path/to/file.ext:LINE (verify-audit gate).
Mandatory acknowledgment (REQUIRED — print verbatim before Phase 0)
Mandatory-tools-acknowledgment: I will run analyze_complexity + analyze_hotspots + audit_scan + search_patterns(n+1, await-in-loop) + find_clones + trace_call_chain (on cited functions) + analyze_renders/analyze_hooks (when React) + stack-specific tools for this performance audit. Every HIGH/MEDIUM finding will cite a `path/to/file.ext:LINE` resolving in the current tree.CodeSift preload
Use the deterministic preload helper FIRST. Run ~/.zuvo/compute-preload performance-audit "$PWD" before any ToolSearch. Copy [CodeSift matching trace] verbatim, issue printed ToolSearch(query="select:..."). Math gate enforced.
Phase 0: Detect and Prepare
0.1 Technology Stack Detection
Detect framework, bundler, backend, ORM, and deployment model before analysis. Different stacks exhibit different pathologies.
Frontend signals:
next.config.*-- Next.js (SSR + RSC + client)vite.config.*-- Vite (SPA or SSR)webpack.config.*-- Webpacksvelte.config.*-- SvelteKit- React / Vue / Angular in dependencies
Dormant-frontend detection: flag as a D2 finding (unused deps) + D9 finding (architectural debt) when any of these are true:
webpack.config.*returns[]or{}(empty entry)package.jsondeclares React/Vue/Webpack but the source tree has zero*.tsx/*.jsx/*.vuefilesassets/directory is empty and referenced only by dead build scripts
Dormant frontends are a silent cost: install weight, lockfile churn, and CI time for code that never ships. Call them out even when the profile is backend-heavy.
Backend signals:
@nestjs/coreornest-cli.json-- NestJSexpressin deps -- Expressfastifyin deps -- FastifyFastAPIorAPIRouterin Python files -- FastAPIgin-gonicin Go files -- Gincomposer.jsonhasyiisoft/yii2-- Yii2 (PHP)composer.jsonhaslaravel/framework-- Laravel (PHP)composer.jsonhassymfony/framework-bundle-- Symfony (PHP)
ORM / database signals:
prisma/schema.prisma-- Prisma@Entitydecorators -- TypeORMfrom sqlalchemy-- SQLAlchemymongoose/mongodb-- MongoDB
Deployment signals:
vercel.json,netlify.toml-- Serverless edgewrangler.toml-- Cloudflare WorkersDockerfile-- Containerizedserverless.yml-- AWS Lambda
Print detection results:
PERFORMANCE STACK
------------------------------------
Frontend: [React / Next.js / Vue / SvelteKit / none]
Bundler: [Vite / Webpack / Turbopack / none]
Backend: [NestJS / Express / FastAPI / Gin / none]
ORM: [Prisma / TypeORM / SQLAlchemy / none]
Deploy: [Serverless / Container / Traditional]
------------------------------------0.2 Profile Selection
| Profile | Stack | Active Dimensions |
| A | Full-stack JS/TS (Next.js + Node + DB) | D1-D12 |
| B | Backend-only (Python/Go + DB) | D4-D9, D11-D12 |
| C | Frontend SPA (React/Vue + API calls) | D1-D3, D9-D10 |
| D | Static / JAMstack | D1-D3, D10 |
| E | Monorepo | Per-package profile, weighted merge |
| F | PHP full-stack (Yii2/Laravel/Symfony + MySQL/Postgres) | D2, D4-D9, D11-D12 (D11 = opcache, JIT, FPM tuning) |
Profile E: detect workspace packages, assign profile per package, audit individually, merge into a weighted final report.
Profile F: load rules/yii2.md (if Yii2 detected) for framework-specific
performance checks. D11 Runtime pivots from Node.js event-loop checks to
opcache/JIT/FPM pool tuning. Apply rules/php.md for general PHP patterns.
0.3 Tooling Probe
Check which measurement tools are available before declaring audit confidence.
Frontend tools:
- Build output with source maps (
dist/,.next/,build/) - Bundle analyzer (
source-map-explorer,vite-bundle-visualizer,@next/bundle-analyzer) - Lighthouse CLI
Backend tools:
- Node.js profiler (
clinic,0x) - Python profiler (
py-spy,cProfile) - Go profiler (
pprof) - Load tester (
autocannon,wrk,k6)
Database tools:
psqlfor EXPLAIN ANALYZE (PostgreSQL)mongoshfor explain plans (MongoDB)
Print the checklist with installed/missing status and install commands for anything missing.
0.4 Audit Confidence Tier
| Tools Available | Tier | Max Confidence |
| Profiler + bundle analyzer + Lighthouse | FULL | HIGH |
| Bundle analyzer OR Lighthouse (not both) | STANDARD | MEDIUM |
| Code inspection only | PARTIAL | LOW |
| No tools, no build output | MINIMAL | LOW |
For PARTIAL/MINIMAL audits, include a Prerequisites section in the report listing what is needed to upgrade to FULL.
Phase 1: Hot Path Identification
Performance audits focus on hot paths, not the entire codebase. Identify them before dimension analysis.
1.1 Entry Points
Discover API handlers, page components, middleware, cron jobs, and queue
workers. Use CodeSift (search_symbols, trace_route) when available,
otherwise grep for framework-specific decorators and route patterns.
1.2 Traffic Estimation
Rank entry points by expected traffic:
| Signal | Weight |
| Public-facing page / API route | HIGH |
| Authenticated user route | MEDIUM |
| Admin-only route | LOW |
| Cron / queue worker | BY FREQUENCY |
1.3 Call Depth Scan
For each high-traffic entry point, trace the call chain (CodeSift
trace_call_chain or grep-based import tracing) to find:
- Database queries (N+1, unbounded, missing index)
- External API calls (no timeout, no retry)
- Heavy computation (nested loops, serialization, regex)
- Memory accumulation (unbounded arrays, no streaming)
1.4 Sync I/O Scan
Search for synchronous operations on the event loop:
readFileSync, writeFileSync, execSync, crypto.pbkdf2SyncThese block the thread and are CRITICAL in request handlers, LOW in build scripts or CLI tools.
Phase 2: Dimension Analysis (D1-D12)
Agent Dispatch
Dispatch follows ../../shared/includes/execution-policy.md through env-compat. Reuse existing
authorization within that policy; session restrictions take precedence. Run each required gate
and report its actual independence or an unmet requirement.
Refer to env-compat.md for the dispatch pattern.
When parallel dispatch is available:
| Agent | Dimensions | Focus |
| Frontend Analyst | D1, D2, D3, D10 | Rendering, bundles, assets, Web Vitals |
| Backend Analyst | D4, D5, D11, D12 | API, algorithms, runtime, concurrency |
| Data Layer Analyst | D6, D7, D8, D9 | Memory, database, caching, framework |
Without parallel dispatch: Execute all dimensions sequentially.
Each agent receives the detected stack, hot path list, and tooling checklist.
D1: Rendering Performance -- Weight 12, Max 12
| Check | Good | Bad | Severity |
| Unnecessary re-renders | Components memoized where needed, deps arrays correct | Parent re-render cascades through deep tree | HIGH |
| Virtualization | Large lists use windowing (react-window, tanstack-virtual) | 1000+ items rendered to DOM | HIGH |
| Lazy loading | Route-level code splitting, dynamic imports for heavy modules | Entire app in one bundle | MEDIUM |
| Server components | Data-fetching components are server-side (Next.js RSC) | Client components fetch everything | MEDIUM |
Score 0-12 based on evidence.
D2: Bundle Size -- Weight 12, Max 12
| Check | Good | Bad | Severity |
| Total JS size | < 200 KB gzipped main bundle | > 500 KB gzipped | CRITICAL |
| Tree shaking | sideEffects: false, named imports from large libs | import _ from 'lodash' (full lib) | HIGH |
| Duplicate dependencies | Single version of each library in bundle | Multiple React/moment copies | MEDIUM |
| Dynamic imports | Heavy features loaded on demand | Everything in initial chunk | MEDIUM |
If bundle analyzer is available, parse the output for precise measurements.
Otherwise score from package.json dependency analysis and import patterns.
D3: Asset Optimization -- Weight 8, Max 8
| Check | Good | Bad | Severity |
| Image format | WebP/AVIF with fallbacks, next/image or equivalent | Unoptimized PNG/JPG served directly | HIGH |
| Font loading | font-display: swap, subset fonts, preload critical | Flash of invisible text, full font files | MEDIUM |
| Compression | Brotli/gzip on all text assets | No compression configured | MEDIUM |
| Preloading | Critical resources preloaded, non-critical deferred | Everything loaded eagerly | LOW |
D4: API and Network -- Weight 10, Max 10
| Check | Good | Bad | Severity |
| Request waterfall | Parallel fetches, batched queries | Sequential requests that could be parallel | HIGH |
| Payload size | Selective fields, pagination, gzip | Full objects returned, no pagination | HIGH |
| Timeout + retry | AbortSignal on every outbound call, exponential backoff | No timeout, infinite hang on failure | CRITICAL |
| Cache headers | Cache-Control, ETag, stale-while-revalidate | No caching headers on stable resources | MEDIUM |
D5: Algorithm Complexity -- Weight 10, Max 10
| Check | Good | Bad | Severity |
| Loop complexity | O(n) or O(n log n) for hot paths | O(n^2) find() inside loop, nested iterations | HIGH |
| Data structures | Map/Set for lookups, indexed access | Array.find() in loops (O(n^2)) | HIGH |
| Regex safety | Anchored patterns, no catastrophic backtracking | User input in unanchored regex | CRITICAL |
| String concatenation | Template literals or array join | Repeated += in loops | LOW |
D6: Memory Management -- Weight 10, Max 10
| Check | Good | Bad | Severity |
| Leak prevention | useEffect cleanup, removeEventListener, clearInterval | Missing cleanup in components/services | CRITICAL |
| Accumulation bounds | Arrays capped, streams used for large data | Unbounded push() in loops | HIGH |
| Closure capture | Refs for mutable values in callbacks, weak references | Stale closure over entire component state | MEDIUM |
| GC pressure | Object pooling for hot paths, avoid allocations in tight loops | New object per iteration | LOW |
D7: Database Performance -- Weight 12, Max 12, Critical Gate
| Check | Good | Bad | Severity |
| N+1 queries | Eager loading (include), batched IDs (where: { id: { in } }) | Query inside loop | CRITICAL |
| Unbounded queries | take/LIMIT on every query, pagination | findMany() without limit | CRITICAL |
| Index coverage | Indexes on filter/sort columns, composite indexes for common queries | Sequential scan on large tables | HIGH |
| Connection pooling | Configured pool with limits, singleton client | New client per request, no pool | HIGH |
Critical gate: N+1 in hot path → triggers FAIL. The gate fires on that FINDING; a D7 score of 0 also fires it but is not required.
D8: Caching Strategy -- Weight 8, Max 8
| Check | Good | Bad | Severity |
| Application cache | Redis/Memcached for expensive queries, TTL configured | No caching, every request hits DB | HIGH |
| HTTP cache | Immutable assets with hash, revalidation for dynamic | No cache headers anywhere | MEDIUM |
| Memoization | useMemo/useCallback for expensive computations, correct deps | Memoize everything (or nothing) | MEDIUM |
| Cache invalidation | Event-driven or TTL with jitter, no stale-forever | Manual cache clear, no strategy | MEDIUM |
D9: Framework-Specific -- Weight 8, Max 8
Patterns depend on detected stack. Examples:
Next.js: missing loading.tsx, client components fetching data, no
generateStaticParams, ISR not configured.
NestJS: missing interceptors for response transform, no request scoping for heavy services, guards running expensive queries.
FastAPI: sync endpoint handlers, missing async def, no connection pooling
in Depends.
React: prop drilling causing re-renders, context value unstable reference, uncontrolled form re-renders.
D10: Web Vitals / Core Metrics -- Weight 10, Max 10
| Metric | Good | Needs Improvement | Poor |
| LCP | < 2.5s | 2.5-4.0s | > 4.0s |
| INP | < 200ms | 200-500ms | > 500ms |
| CLS | < 0.1 | 0.1-0.25 | > 0.25 |
If Lighthouse is available, run it and extract scores. Otherwise evaluate from code patterns:
- LCP: largest visible element loading strategy, image optimization, font loading
- INP: event handler complexity, main thread blocking
- CLS: explicit dimensions on images/embeds, font swap strategy
D11: Backend Runtime -- Weight 6, Max 6
| Check | Good | Bad | Severity |
| Sync I/O on event loop | All I/O async in request handlers | readFileSync in API handler | CRITICAL |
| Worker threads | CPU-heavy tasks offloaded to workers or queues | Crypto/PDF in main thread | HIGH |
| Startup time | Lazy module loading, minimal bootstrap | Heavy initialization blocks first request | MEDIUM |
D12: Concurrency and Throughput -- Weight 6, Max 6
| Check | Good | Bad | Severity |
| Fan-out limiting | pLimit or similar for parallel external calls | Unbounded Promise.all on user-sized input | CRITICAL |
| Queue usage | Background jobs for heavy work (email, PDF, analytics) | Synchronous heavy work in request handler | HIGH |
| Connection limits | Pool sizes configured per downstream service | Default unlimited connections | MEDIUM |
Phase 3: Verification and Impact Models
3.1 False Positive Filters
| Pattern | Skip When |
| Missing memo | Component renders once (no parent re-render path) |
| Large bundle | Dev-only dependency (devDependencies) |
| No cache | Data changes on every request (real-time feed) |
| Sync I/O | Build script, CLI tool, or migration (not request handler) |
| N+1 query | Loop is bounded AND documented as intentional |
| Missing index | Table known to be small (< 1000 rows) |
3.2 Impact Model Format
Every finding above LOW severity must include an Impact Model:
FINDING: [ID] [SEVERITY] [dimension] -- [description]
File: [path:line]
Impact Model:
Estimated savings: [X ms / X KB / X% CPU -- with reasoning]
Blast radius: [N requests/sec affected | N page loads/day]
Effort: [S/M/L -- with specific change description]
Confidence: [HIGH (measured) | MEDIUM (heuristic) | LOW (estimate)]
Priority score: Impact / Effort = [N]3.3 Severity Classification
| Level | Criteria |
| CRITICAL | User-visible latency > 3s, OOM risk, thread blocking, data loss |
| HIGH | Measurable degradation (> 500ms), scalability wall, resource waste |
| MEDIUM | Suboptimal pattern, future scaling concern, missed optimization |
| LOW | Best practice gap, marginal improvement, future-proofing |
Phase 4: Cross-Cutting Analysis
Flag compound patterns that are worse than individual findings:
| Pattern | Dimensions | Impact |
| N+1 on unindexed column | D5+D7 | Exponential degradation under load |
| Unbounded query result accumulated in memory | D6+D7 | OOM on production data volumes |
| External API in transaction without timeout | D4+D7+D12 | Connection pool exhaustion |
| Barrel re-exports defeating tree shaking | D2+D9 | Bundle bloat from dead code |
| Missing cleanup + missing virtualization | D1+D6 | Memory leak on long-lived pages |
| Sync I/O + no worker threads | D11+D12 | Event loop blocked, throughput collapse |
Phase 5: Report
Save to: zuvo/audits/performance-audit-[YYYY-MM-DD].md — at the project root (zuvo/ resolves via git rev-parse --show-toplevel; override $ZUVO_OUTPUT_DIR. See ../../shared/includes/report-output-location.md).
REQUIRED: emit the Tool Availability Block (template in ../../shared/includes/codesift-setup.md) at the top of the report, after the title and before findings. Auditing degraded runs depends on this — do NOT skip it.
Report Structure
# Performance Audit Report
## Metadata
| Field | Value |
|-------|-------|
| Project | [name] |
| Date | [YYYY-MM-DD] |
| Profile | [A/B/C/D/E] |
| Stack | [detected stack] |
| Audit tier | [FULL / STANDARD / PARTIAL / MINIMAL] |
| Scope | [full / path] |
## Executive Summary
**Score: [N] / [MAX]** -- [grade]
| Metric | Count |
|--------|-------|
| CRITICAL findings | N |
| HIGH findings | N |
| MEDIUM findings | N |
| LOW findings | N |
[2-3 sentence summary with top optimization opportunity and estimated savings]
## Dimension Scores
| # | Dimension | Score | Max | Confidence | Key Finding |
|---|-----------|-------|-----|------------|-------------|
| D1 | Rendering | [N] | 12 | [H/M/L] | |
| D2 | Bundle Size | [N] | 12 | | |
| D3 | Assets | [N] | 8 | | |
| D4 | API/Network | [N] | 10 | | |
| D5 | Algorithms | [N] | 10 | | |
| D6 | Memory | [N] | 10 | | |
| D7 | Database | [N] | 12 | | |
| D8 | Caching | [N] | 8 | | |
| D9 | Framework | [N] | 8 | | |
| D10 | Web Vitals | [N] | 10 | | |
| D11 | Runtime | [N] | 6 | | |
| D12 | Concurrency | [N] | 6 | | |
| **Total** | | **[N]** | **[M]** | | |
N/A dimensions excluded from both score and max.
## Critical Gates
[D7=0 triggers FAIL. List gate status.]
## Findings (sorted by priority score)
[Per finding: ID, severity, dimension, description, Impact Model, fix]
## Cross-Cutting Patterns
[Compound patterns found]
## Optimization Roadmap
### Quick Wins (< 1 hour, high impact)
[Items with highest Priority score = Impact / Effort]
### Short-term (1 day)
[Moderate effort, measurable gains]
### Medium-term (1 week)
[Architectural improvements, caching infrastructure]
### Long-term (1 month+)
[Infrastructure changes, major refactors]
## Prerequisites for Higher Confidence
[If PARTIAL/MINIMAL: what tools to install, what data to collect]Scoring
Weighted total across active dimensions. N/A dimensions excluded from both numerator and denominator.
| Grade | Percentage |
| A | >= 85% |
| B | >= 70% and < 85% |
| C | >= 50% and < 70% |
| D | < 50% |
Critical gate: an N+1 query in a hot path overrides to FAIL regardless of total. The gate fires on that FINDING, not on D7 scoring 0 — D7 spreads several checks over its weight, so a real N+1 alongside passing checks scores well above zero and would otherwise never block the audit. A D7 score of 0 still fires it; it is simply not necessary.
Backlog Integration
Every HIGH+ finding goes through backlog-add, one call per finding (../../shared/includes/backlog-protocol.md "Filing from a skill"; the bars and the dedupe are the protocol's, so compute no fingerprint and restate nothing). <level> is critical or high.
A Generic write per finding. The class is PERF, and no anchor: ~/.zuvo/backlog-add --repo "$R" --class PERF --conf <N> --source performance-audit --file "$F" --line <n> --evidence "$E" --severity <level> --title "$T". T is stable, D7: <problem> in <symbol> (D7: N+1 in OrderService.list()), and E carries the proposed fix (eager load with include, or batch with where { id: { in: ids } }). A finding that names the input and the wrong result is a BUG instead, filed at the line that shows the defect with an anchor, never at line 1, even when it concerns the whole file: ~/.zuvo/backlog-add --repo "$R" --class BUG --conf <N> --source performance-audit --file "$F" --line <n> --anchor "$A" --evidence "$E" --severity <level> --title "$T", with A copied from that line and E the input, the wrong result, and the proposed fix. A PERF finding that holds for the whole file is a whole-file finding (--line 1, a "Whole file: ..." title).
A finding measured on a URL or by a tool (Lighthouse, bundle analysis) with no repository line causing it is a target record, with no anchor: ~/.zuvo/backlog-add --repo "$R" --class PERF --conf <N> --source performance-audit --target "$U" --evidence "$E" --severity <level> --title "$T", U the page URL (no query string) and E the measurement and the proposed fix. A secret or user data is never copied into a record (backlog-protocol.md "Filing from a skill", "The location rule", the secrets sentence).
Assign "$R", "$T" and "$E" before each call, "$F" only for a file finding, "$A" only for a BUG, "$U" only for a target finding, as "Free text goes through a variable" in that section says; an empty value you pass is a bug, and backlog-add refuses a missing required field (REFUSED missing-field:<f>). Report the B- or F-id each call prints and Recorded: N (backlog: a, ledger: b) ("The report line" in backlog-protocol.md), plus each NOT PERSISTED (<reason>) by name; on a non-zero exit act on the protocol's exit table, and never append by hand.
This audit does not commit: it stages nothing. It lists the wrote= paths backlog-add printed as Backlog writes: <path>, ... (Backlog writes: none when there are none), in its report for the user when it runs standalone, and in its report for the calling skill's closing commit to carry when another skill runs it (backlog-protocol.md "Filing from a skill", Committing what backlog-add wrote).
Phase 6: Next-Step Routing
RECOMMENDED NEXT ACTION
------------------------------------
D7 CRITICAL (N+1) -> zuvo:refactor [service file]
D2 > 500 KB bundle -> tree-shake + code-split (direct fix)
D11 sync I/O on event loop -> zuvo:refactor [handler file]
D4 no timeouts -> direct fix (add AbortSignal)
Score < 60% -> prioritize quick wins, re-audit in 2 weeks
Score >= 85% -> schedule next audit in 3 months
------------------------------------Completion Gate Check
Before printing the final output block, verify every item. Unfinished items = pipeline incomplete.
COMPLETION GATE CHECK
[ ] Profile selected and printed (A/B/C/D/E) with active dimensions
[ ] Audit confidence tier declared (FULL/STANDARD/PARTIAL/MINIMAL)
[ ] Hot path identification ran
[ ] Every HIGH+ finding has Impact Model with estimated savings
[ ] D7 critical gate printed (N+1 in hot path)
[ ] Report saved to zuvo/audits/ with optimization roadmap
[ ] Run: line printed and appended to logPERFORMANCE-AUDIT COMPLETE
Score: [N] / [MAX] -- [grade] Profile: [A/B/C/D/E] | Audit tier: [FULL/STANDARD/PARTIAL/MINIMAL] Dimensions: [N scored] | Critical gates: [PASS/FAIL] Findings: [N critical] / [N total]
Validity Gate (REQUIRED — print BEFORE Run line, AFTER retro append + append-runlog)
VALIDITY GATE
triggers_held: language=<X> framework=<X> react=<yes|no> orm=<prisma|drizzle|none>
required_tool_calls:
analyze_complexity: [<max_cc> max | NOT_CALLED — VIOLATES_TRIGGER]
analyze_hotspots: [<top_N> hotspots | NOT_CALLED — VIOLATES_TRIGGER]
audit_scan: [<N> findings | NOT_CALLED — VIOLATES_TRIGGER]
search_patterns: [<N> hits | NOT_CALLED — VIOLATES_TRIGGER]
find_clones: [<N> clusters | NOT_CALLED — VIOLATES_TRIGGER]
trace_call_chain: [<N> chains | not_required | NOT_CALLED — VIOLATES_TRIGGER]
analyze_renders/analyze_hooks: [<N> | not_required (no React) | NOT_CALLED — VIOLATES_TRIGGER]
stack_specific: [<result> | not_required | NOT_CALLED — VIOLATES_TRIGGER]
postamble:
retros_log_appended: [yes(bytes_added=N) | NOT_APPENDED]
retros_md_appended: [yes(entry_count=N) | NOT_APPENDED]
verify_audit_pass: [yes(<verified>/<total>) | NOT_RUN | REJECTED]
gate_status: [PASS | FAIL — <which gates missing>]If gate_status = FAIL → VERDICT = INCOMPLETE.
Append the Run line via the retro-gated wrapper (NOT direct >> runs.log):
printf '%b\n' "$RUN_LINE" | ~/.zuvo/append-runlogRun: <ISO-8601-Z> performance-audit <project> <N-critical> <N-total> <VERDICT> - <N>-dimensions <NOTES> <BRANCH> <SHA7> <INCLUDES> <TIER>
Retrospective (REQUIRED)
Follow the retrospective protocol from retrospective.md.
Gate check → structured questions → TSV emit → markdown append.
If gate check skips: print "RETRO: skipped (trivial session)" and proceed.
After printing this block, append the Run: line value (without the Run: prefix) to the log file path resolved per run-logger.md.
VERDICT: PASS (0 critical findings), WARN (1-3 critical), FAIL (4+ critical).
Execution Notes
- All commands use the resolved
TARGET_ROOTfrom argument parsing - CodeSift integration follows
codesift-setup.md-- use indexed search when available, fall back to Grep/Read/Glob when not - Agent dispatch follows
env-compat.md-- parallel when supported, sequential otherwise - Impact Models are the primary decision tool -- findings without an Impact Model are informational only
- Confidence levels are strict: only profiler/Lighthouse/EXPLAIN output earns HIGH confidence; code inspection maxes out at MEDIUM
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

