agentleFS
greglas75greglas75/zuvo/skills/performance-audit/SKILL.md

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

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.
  • AnthropicSkill

    incident-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

  • OpenAISkill

    threat-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

  • MicrosoftSkill

    api-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

  • SentrySkill

    security-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 AzureSkill

    release-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

  • GoogleSkill

    code-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

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
  1. Distinctive:

    When evidence is absent, report INSUFFICIENT DATA -- never guess.

    line 70
  2. Distinctive:

    Read every file below before starting.

    line 74
  3. Distinctive:

    If any file is MISSING, STOP.

    line 86
  4. Very specific:

    Use the deterministic preload helper FIRST: Run ~/.zuvo/compute-preload performance-audit "$PWD" before any ToolSearch.

    line 145
  5. Distinctive:

    Check which measurement tools are available before declaring audit confidence.

    line 229
  6. Distinctive:

    Search for synchronous operations on the event loop:

    line 296
  7. Very specific:

    If bundle analyzer is available, parse the output for precise measurements.

    line 349
  8. Distinctive:

    If Lighthouse is available, run it and extract scores.

    line 432
  9. Distinctive:

    Every finding above LOW severity must include an Impact Model:

    line 471
  10. Very specific:

    Every HIGH+ finding goes through backlog-add, one call per finding (../../shared/includes/backlog-protocol.md "Filing from a skill".

    line 612
  11. Distinctive:

    Before printing the final output block, verify every item.

    line 642
  12. Very specific:

    If gate_status = FAIL → VERDICT = INCOMPLETE.

    line 683
  13. Distinctive:

    Run: <ISO-8601-Z> performance-audit <project> <N-critical> <N-total> <VERDICT> - <N>-dimensions <NOTES> <BRANCH> <SHA7> <INCLUDES> <TIER>

    line 691
  14. Very specific:

    Follow the retrospective protocol from retrospective.md.

    line 696
  15. Distinctive:

    If gate check skips: print "RETRO: skipped (trivial session)" and proceed.

    line 698
  16. Very specific:

    After printing this block, append the Run: line value (without the Run: prefix) to the log file path resolved per run-logger.md.

    line 700
  17. Very specific:

    All commands use the resolved TARGET_ROOT from argument parsing

    line 708

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Performance claims without measurement are opinions, not findings.
  2. "Slow" without a baseline and a target is meaningless.
  3. Optimization without profiling is premature optimization.
  4. 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

FileLoad when
../../rules/cq-checklist.mdScoring cross-cutting CQ overlap (CQ6 resources, CQ7 unbounded, CQ17 N+1)

Argument Parsing

TokenBehavior
(empty) or fullAll applicable dimensions across the entire project
[path]Scope to a directory or module
[file]Deep single-file audit (algorithms, memory, complexity)
--frontendD1-D3, D10 only
--backendD4-D5, D7-D8, D11-D12 only
--dbD7 only (database queries and schema)
--bundleD2 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.

ToolTriggerReasonSkip allowed?
analyze_complexityAlwaysKEY — algorithmic hot spots, CC distribution, outliersNO
analyze_hotspotsAlwaysKEY — git-churn × complexity (last 90d)NO
audit_scanAlwaysCompound including find_perf_hotspots-equivalentNO
search_patterns(n-plus-one-django|await-in-loop|sync-fs)AlwaysD-dim anti-patternsNO
find_clonesAlwaysRepeated-work patternsNO
trace_call_chainAny HIGH/MEDIUM finding cites a functionWaterfall + downstream impactNO when condition holds
analyze_renders + analyze_hooksReact detectedD-frontend gatesNO when React
Stack-specific (analyze_prisma_schema/explain_query/python_audit/etc.)Framework/ORM detectedStack-specific perf gatesNO 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.* -- Webpack
  • svelte.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.json declares React/Vue/Webpack but the source tree has zero *.tsx/*.jsx/*.vue files
  • assets/ 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/core or nest-cli.json -- NestJS
  • express in deps -- Express
  • fastify in deps -- Fastify
  • FastAPI or APIRouter in Python files -- FastAPI
  • gin-gonic in Go files -- Gin
  • composer.json has yiisoft/yii2 -- Yii2 (PHP)
  • composer.json has laravel/framework -- Laravel (PHP)
  • composer.json has symfony/framework-bundle -- Symfony (PHP)

ORM / database signals:

  • prisma/schema.prisma -- Prisma
  • @Entity decorators -- TypeORM
  • from sqlalchemy -- SQLAlchemy
  • mongoose / mongodb -- MongoDB

Deployment signals:

  • vercel.json, netlify.toml -- Serverless edge
  • wrangler.toml -- Cloudflare Workers
  • Dockerfile -- Containerized
  • serverless.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

ProfileStackActive Dimensions
AFull-stack JS/TS (Next.js + Node + DB)D1-D12
BBackend-only (Python/Go + DB)D4-D9, D11-D12
CFrontend SPA (React/Vue + API calls)D1-D3, D9-D10
DStatic / JAMstackD1-D3, D10
EMonorepoPer-package profile, weighted merge
FPHP 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:

  • psql for EXPLAIN ANALYZE (PostgreSQL)
  • mongosh for explain plans (MongoDB)

Print the checklist with installed/missing status and install commands for anything missing.

0.4 Audit Confidence Tier

Tools AvailableTierMax Confidence
Profiler + bundle analyzer + LighthouseFULLHIGH
Bundle analyzer OR Lighthouse (not both)STANDARDMEDIUM
Code inspection onlyPARTIALLOW
No tools, no build outputMINIMALLOW

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:

SignalWeight
Public-facing page / API routeHIGH
Authenticated user routeMEDIUM
Admin-only routeLOW
Cron / queue workerBY 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.pbkdf2Sync

These 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:

AgentDimensionsFocus
Frontend AnalystD1, D2, D3, D10Rendering, bundles, assets, Web Vitals
Backend AnalystD4, D5, D11, D12API, algorithms, runtime, concurrency
Data Layer AnalystD6, D7, D8, D9Memory, 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

CheckGoodBadSeverity
Unnecessary re-rendersComponents memoized where needed, deps arrays correctParent re-render cascades through deep treeHIGH
VirtualizationLarge lists use windowing (react-window, tanstack-virtual)1000+ items rendered to DOMHIGH
Lazy loadingRoute-level code splitting, dynamic imports for heavy modulesEntire app in one bundleMEDIUM
Server componentsData-fetching components are server-side (Next.js RSC)Client components fetch everythingMEDIUM

Score 0-12 based on evidence.

D2: Bundle Size -- Weight 12, Max 12

CheckGoodBadSeverity
Total JS size< 200 KB gzipped main bundle> 500 KB gzippedCRITICAL
Tree shakingsideEffects: false, named imports from large libsimport _ from 'lodash' (full lib)HIGH
Duplicate dependenciesSingle version of each library in bundleMultiple React/moment copiesMEDIUM
Dynamic importsHeavy features loaded on demandEverything in initial chunkMEDIUM

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

CheckGoodBadSeverity
Image formatWebP/AVIF with fallbacks, next/image or equivalentUnoptimized PNG/JPG served directlyHIGH
Font loadingfont-display: swap, subset fonts, preload criticalFlash of invisible text, full font filesMEDIUM
CompressionBrotli/gzip on all text assetsNo compression configuredMEDIUM
PreloadingCritical resources preloaded, non-critical deferredEverything loaded eagerlyLOW

D4: API and Network -- Weight 10, Max 10

CheckGoodBadSeverity
Request waterfallParallel fetches, batched queriesSequential requests that could be parallelHIGH
Payload sizeSelective fields, pagination, gzipFull objects returned, no paginationHIGH
Timeout + retryAbortSignal on every outbound call, exponential backoffNo timeout, infinite hang on failureCRITICAL
Cache headersCache-Control, ETag, stale-while-revalidateNo caching headers on stable resourcesMEDIUM

D5: Algorithm Complexity -- Weight 10, Max 10

CheckGoodBadSeverity
Loop complexityO(n) or O(n log n) for hot pathsO(n^2) find() inside loop, nested iterationsHIGH
Data structuresMap/Set for lookups, indexed accessArray.find() in loops (O(n^2))HIGH
Regex safetyAnchored patterns, no catastrophic backtrackingUser input in unanchored regexCRITICAL
String concatenationTemplate literals or array joinRepeated += in loopsLOW

D6: Memory Management -- Weight 10, Max 10

CheckGoodBadSeverity
Leak preventionuseEffect cleanup, removeEventListener, clearIntervalMissing cleanup in components/servicesCRITICAL
Accumulation boundsArrays capped, streams used for large dataUnbounded push() in loopsHIGH
Closure captureRefs for mutable values in callbacks, weak referencesStale closure over entire component stateMEDIUM
GC pressureObject pooling for hot paths, avoid allocations in tight loopsNew object per iterationLOW

D7: Database Performance -- Weight 12, Max 12, Critical Gate

CheckGoodBadSeverity
N+1 queriesEager loading (include), batched IDs (where: { id: { in } })Query inside loopCRITICAL
Unbounded queriestake/LIMIT on every query, paginationfindMany() without limitCRITICAL
Index coverageIndexes on filter/sort columns, composite indexes for common queriesSequential scan on large tablesHIGH
Connection poolingConfigured pool with limits, singleton clientNew client per request, no poolHIGH

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

CheckGoodBadSeverity
Application cacheRedis/Memcached for expensive queries, TTL configuredNo caching, every request hits DBHIGH
HTTP cacheImmutable assets with hash, revalidation for dynamicNo cache headers anywhereMEDIUM
MemoizationuseMemo/useCallback for expensive computations, correct depsMemoize everything (or nothing)MEDIUM
Cache invalidationEvent-driven or TTL with jitter, no stale-foreverManual cache clear, no strategyMEDIUM

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

MetricGoodNeeds ImprovementPoor
LCP< 2.5s2.5-4.0s> 4.0s
INP< 200ms200-500ms> 500ms
CLS< 0.10.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

CheckGoodBadSeverity
Sync I/O on event loopAll I/O async in request handlersreadFileSync in API handlerCRITICAL
Worker threadsCPU-heavy tasks offloaded to workers or queuesCrypto/PDF in main threadHIGH
Startup timeLazy module loading, minimal bootstrapHeavy initialization blocks first requestMEDIUM

D12: Concurrency and Throughput -- Weight 6, Max 6

CheckGoodBadSeverity
Fan-out limitingpLimit or similar for parallel external callsUnbounded Promise.all on user-sized inputCRITICAL
Queue usageBackground jobs for heavy work (email, PDF, analytics)Synchronous heavy work in request handlerHIGH
Connection limitsPool sizes configured per downstream serviceDefault unlimited connectionsMEDIUM

Phase 3: Verification and Impact Models

3.1 False Positive Filters

PatternSkip When
Missing memoComponent renders once (no parent re-render path)
Large bundleDev-only dependency (devDependencies)
No cacheData changes on every request (real-time feed)
Sync I/OBuild script, CLI tool, or migration (not request handler)
N+1 queryLoop is bounded AND documented as intentional
Missing indexTable 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

LevelCriteria
CRITICALUser-visible latency > 3s, OOM risk, thread blocking, data loss
HIGHMeasurable degradation (> 500ms), scalability wall, resource waste
MEDIUMSuboptimal pattern, future scaling concern, missed optimization
LOWBest practice gap, marginal improvement, future-proofing

Phase 4: Cross-Cutting Analysis

Flag compound patterns that are worse than individual findings:

PatternDimensionsImpact
N+1 on unindexed columnD5+D7Exponential degradation under load
Unbounded query result accumulated in memoryD6+D7OOM on production data volumes
External API in transaction without timeoutD4+D7+D12Connection pool exhaustion
Barrel re-exports defeating tree shakingD2+D9Bundle bloat from dead code
Missing cleanup + missing virtualizationD1+D6Memory leak on long-lived pages
Sync I/O + no worker threadsD11+D12Event 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.

GradePercentage
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 log

PERFORMANCE-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-runlog

Run: <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_ROOT from 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.