Best for
- Diagnose slow API responses, page loads, or jobs.
- Design and run load, stress, soak, or spike tests.
- Set and enforce performance budgets.
vasilyu1983/AI-Agents-public/frameworks/shared-skills/skills/software-performance/SKILL.md
Systematic profiling, load testing, performance budgets, and regression prevention. Use when diagnosing slow services, benchmarking systems, or preventing regressions.
Decision brief
Use this skill for systematic performance work across APIs, web apps, services, and release gates. It owns profiling, load and stress testing, performance budgets, and regression detection. It does not replace SQL tuning, observability setup, or system-architecture design.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Declared | Source record | Install path and trigger |
| Claude Code | Declared | Source record | Install path and trigger |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/software-performance"Inspect the Agent Skill "software-performance" from https://github.com/vasilyu1983/AI-Agents-public/blob/53f6cb73ea53a2646e3e7d4665062ad66f3683ac/frameworks/shared-skills/skills/software-performance/SKILL.md at commit 53f6cb73ea53a2646e3e7d4665062ad66f3683ac. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
1. Define the symptom, target metric, traffic shape, and acceptance threshold. 2. Choose the investigation path: latency, page load, scale behavior, memory growth, or cost efficiency. 3. Measure a baseline with the smallest tool that exposes the bottleneck. 4. Make the smallest…
Review the “Quick Reference” section in the pinned source before continuing.
Diagnose slow API responses, page loads, or jobs.
SQL query tuning and indexing: use data-sql-optimization.
Little's Law relates concurrency, throughput, and latency: L = λ × W (average number in the system = arrival rate × average time in the system). Use it to sanity-check load-test configuration and capacity plans before trusting a result.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 82 | Source | Repository attention, not individual Skill quality |
| Compatibility | 2 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Use this skill for systematic performance work across APIs, web apps, services, and release gates. It owns profiling, load and stress testing, performance budgets, and regression detection. It does not replace SQL tuning, observability setup, or system-architecture design.
| Task | Use |
|---|---|
| Profiling hot paths | flamegraph-first profiling with the right language toolchain |
| Load and stress testing | k6 by default; alternate tools only when the team has a clear reason |
| Frontend or backend budgets | CI thresholds plus representative benchmarks |
| Database-related slowdown | query and pool investigation first, then broader system review |
| Continuous regression detection | benchmark suites plus statistical comparison |
| CWV thresholds, k6 patterns, Lighthouse CI budget JSON, profiling tools | references/perf-budgets-and-cwv.md |
| assert CWV budgets from Lighthouse JSON | scripts/check_perf_budget.py |
Little's Law relates concurrency, throughput, and latency: L = λ × W (average number in the system = arrival rate × average time in the system). Use it to sanity-check load-test configuration and capacity plans before trusting a result.
Worked example: target throughput λ = 500 req/s, average request latency W = 300 ms = 0.3 s. Required steady-state concurrency: L = 500 × 0.3 = 150 requests in flight. If a k6 script is configured with only 50 VUs and no sleep, the achievable throughput is capped at L / W = 50 / 0.3 ≈ 166.7 req/s — the test will report clean p95s and "pass," but it never exercised the 500 req/s target and the result is a false negative on capacity. Always check VUs ≥ target_rps × expected_latency_s before trusting a load test's headline throughput.
The same relation explains connection-pool exhaustion: if a pool has 20 connections and each query holds a connection for 50 ms, the pool saturates at 20 / 0.05 = 400 req/s regardless of CPU headroom — no amount of caching or CPU optimization above the app layer will raise that ceiling.
Amdahl's Law bounds the speedup from adding parallelism: speedup = 1 / (s + (1 − s) / N), where s is the serial (non-parallelizable) fraction and N is the number of workers/cores. Worked example: if profiling shows 20% of a job's time is inherently serial (s = 0.2), the maximum speedup as N → ∞ is 1 / 0.2 = 5× — no matter how many workers you add. Before recommending "add more workers/threads/pods," measure the serial fraction (locks, single-writer steps, shared queues); if it is already the bottleneck, the fix is architectural (remove the serial section), not more parallelism.
Performance task
-> Define user-visible symptom and success budget
-> Reproduce with controlled load, trace, or profile
-> Locate bottleneck in CPU, memory, I/O, network, DB, or rendering
-> Apply the smallest proven fix
-> Re-measure with the same method
-> Add regression guardrail and report tradeoffs
| Scenario | Use For | Pass/Fail Defined Before Run |
|---|---|---|
| Smoke | Correctness under low load | Yes — define before starting |
| Load | Expected production traffic | Yes |
| Stress | Breaking point | Yes |
| Soak | Long-duration degradation, memory leaks | Yes — time + heap trend |
| Spike | Sudden surge behavior | Yes |
| Surface | Metric | Gate |
|---|---|---|
| Frontend | LCP, INP, CLS, TBT, JS bundle size | Lighthouse CI assertions in PR pipeline |
| Backend | p95, p99 latency, error rate, startup time | k6 thresholds in CI smoke run |
Automated gates catch regressions before they reach production.
Add a cache only after ruling out the above. Caching an unindexed query shifts load; fixing the index eliminates it.
Default to one of these:
1 − (0.99)^10 ≈ 9.6% — a healthy-looking per-service p99 does not imply a healthy end-to-end tail.| Anti-Pattern | Why It Fails |
|---|---|
| Premature optimization | Fixes the wrong bottleneck before measuring |
| Optimizing without before/after metrics | No way to confirm the change helped |
| Treating microbenchmarks as system proof | Ignores real load shape, concurrency, and infrastructure latency |
| Adding caches before understanding query behavior | Caching a missing index shifts load instead of eliminating it |
| Reading one benchmark run as meaningful | Single-run noise can be larger than the signal |
| Profiling debug builds | Debug builds have different hot paths and no compiler optimizations |
CrUX reports LCP at 4.8s at the 75th percentile. Check TTFB first (if above 800ms, server-side fixes unblock everything else); then audit the LCP element for missing fetchpriority="high", unoptimized image format, and missing explicit dimensions causing CLS. Add LHCI assertions on LCP and TBT before closing the ticket.
Capture a CPU flamegraph under production-like load before bisecting code changes. Identify hot paths (JWT decode per request, N+1 queries, lock contention) and fix the smallest measured bottleneck first. Benchmark before and after each change with at least 5 runs; compare medians and p99s, not single-run results.
Define a perf-budget.json with LCP, INP, CLS, TBT, JS bytes, and Lighthouse score thresholds. Add Lighthouse CI to the PR pipeline with assertion blocks. Flag the JS bundle in the budget once it exceeds roughly 300kB gzipped initial load (300-350kB is a lenient ceiling; 150-250kB is the tighter target teams increasingly hold to on mobile); recommend route-based code splitting. Bundle-size guidance is hardware- and network-dependent and shifts over time — verify current community consensus before treating a specific kB figure as fixed. See references/web-vitals-and-budgets.md for budget templates.
Write a k6 script with smoke, load, and stress stages. Define p95 and p99 latency thresholds and an error-rate threshold before running. Run the stress test against a staging environment that matches production concurrency, connection pool sizes, and downstream stub latency. Gate the CI pipeline on the smoke test; run load and stress as pre-launch gates only.
Use a soak test (k6 or autocannon, 4-hour duration, steady load) and monitor heap growth over time. Capture heap snapshots at the start and after 2 hours; diff the allocation trees. Look for retained closures, growing caches without eviction, and event listeners not removed on request end. Confirm the fix by re-running the soak and showing flat heap growth.
Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
Frequently asked questions
Use this skill for systematic performance work across APIs, web apps, services, and release gates. It owns profiling, load and stress testing, performance budgets, and regression detection. It does not replace SQL tuning, observability setup, or system-architecture design.
The source record exposes this install command: npx skills add https://github.com/vasilyu1983/AI-Agents-public --skill "frameworks/shared-skills/skills/software-performance". Inspect the command and pinned source before running it.
The pinned source record declares support for: codex, claude code.
Alternatives
vasilyu1983/AI-Agents-public
Guides iOS testing with XCTest, XCUITest, Swift Testing, simctl, and xcresult. Use when choosing destinations, controlling flakes, or parsing test artifacts for native apps.
lobu-ai/lobu
Set up new Lobu agents end to end and operate existing Lobu projects and memory: interview, scaffold, validate, authenticate, connect feeds, execute operations, and test Automations.
upex-galaxy/agentic-qa-boilerplate
Execute regression test suites via CI/CD, analyze results, classify failures, and produce GO/NO-GO release decisions. Use when running regression, smoke, or sanity suites through GitHub Actions, monitoring workflow runs, downloading Allure or Playwright artifacts, classifying failures (REGRESSION vs FLAKY vs KNOWN vs ENVIRONMENT vs NEW TEST), computing pass-rate and trend metrics, deciding release readiness, generating executive quality reports, or creating regression issues. Triggers on: run re
vasilyu1983/AI-Agents-public
Risk-based test strategy for software delivery. Use when defining coverage, setting CI gates, managing flaky tests, choosing test layers, or establishing release criteria.