shadow-perf
Skill1 starsChanged yesterdayMITView on GitHub
Pre-UAT Performance & Load Testing Gate. Use ONLY when entering the Pre-UAT/Staging performance gate or when explicitly asked for k6 load/stress/spike testing or SQL EXPLAIN ANALYZE profiling. Do NOT use automatically during feature coding.
In this repository51 other files it gives its agents.
- antislop-codeSkill
- antislop-copywritingSkill
- antislop-humanSkill
- antislop-layoutmobileSkill
- antislopSkill
- antislop-uiSkill
- context7Skill
- handoffSkill
- shadow-accessibilitySkill
- shadow-apiSkill
- shadow-architectSkill
- shadow-authSkill
- shadow-bootstrapSkill
- shadow-browserSkill
- shadow-cacheSkill
- shadow-compatSkill
- shadow-concurrencySkill
- shadow-dataSkill
- shadow-dbSkill
- shadow-debugSkill
- shadow-designSkill
- shadow-discoverySkill
- shadow-docSkill
- shadow-domainSkill
- shadow-eaSkill
- shadow-evalSkill
- shadow-finopsSkill
- shadow-gitSkill
- shadow-grcSkill
- shadow-handoverSkill
- shadow-integrateSkill
- shadow-maintainSkill
- shadow-mobileSkill
- shadow-modernizeSkill
- shadow-monarchSkill
- shadow-observeSkill
- shadow-opsSkill
- shadow-planSkill
- shadow-pmoSkill
- shadow-presalesSkill
- shadow-privacySkill
- shadow-qualitySkill
- shadow-realtimeSkill
- shadow-refactorSkill
- shadow-releaseSkill
- shadow-resilienceSkill
- shadow-searchSkill
- shadow-secSkill
- shadow-supplychainSkill
- shadow-testSkill
- shadow-uatSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
When the Monarch invokes /shadow-perf before UAT:
- Very specific: line 30
Run the generator script against the project's openapi.yaml:
- Very specific: line 35
Read endpoints (GET) represent ~70–80% of traffic weight and write endpoints (POST/PUT/PATCH) represent ~20–30%.
- Very specific: line 40
Use the shadow_db MCP (run_readonly_query) to run EXPLAIN on the top high-traffic queries:
- Very specific: line 43
Check for Seq Scan / ALL full-table scans on tables with $> 1,000$ rows, missing composite indexes on (tenant_id, status, created_at), and …
- Very specific: line 46
Verify all list endpoints enforce bounded pagination (limit <= 100).
- Very specific: line 47
Verify response compression (gzip / brotli / zstd) and static asset Cache-Control headers.
- Very specific: line 51
Profile First: Never guess bottlenecks — capture CPU/heap flamegraphs or EXPLAIN (ANALYZE, BUFFERS) before changing code or indexes.
- Very specific: line 53
Write a concise report in docs/perf/PRE-UAT-PERFORMANCE-REPORT.md documenting:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Shadow Perf (/shadow-perf) — Pre-UAT Load Testing (k6) & Bottleneck Profiler
[!IMPORTANT] STRICT EXECUTION GATE (PRE-UAT ONLY): Do NOT trigger
/shadow-perfautomatically while developing/coding features (duringmode). Execute/shadow-perfONLY when:
- Feature development is complete and the system enters the Pre-UAT / Staging Readiness Gate, OR
- The Monarch explicitly invokes
/shadow-perfor asks for load testing / performance profiling.
1. Local Reference & Generator Tools
references/K6-OPENAPI-PATTERNS.md— Productionk6load testing patterns (SharedArray, state correlation across endpoints, VU token caching, and SLO pass/fail thresholds).references/SQL-AND-RUNTIME-PROFILING.md— PostgreSQL & MySQLEXPLAIN ANALYZEbottleneck diagnosis, composite index tuning, N+1 detection, and runtime memory/CPU profiling.scripts/openapi_to_k6_scaffold.mjs— Automated CLI generator that reads a project'sopenapi.yaml/openapi.json(generated by/shadow-api) and creates a complete Pre-UATk6test suite (01-smoke.k6.js,02-load-pre-uat.k6.js,03-stress-spike.k6.js).
2. Pre-UAT Execution Workflow
When the Monarch invokes /shadow-perf before UAT:
Step 1: Generate Pre-UAT k6 Load Test Suite from openapi.yaml
Run the generator script against the project's openapi.yaml:
node "d:\Ridhuan Ngoding Moment\SKILL\shadow-perf\scripts\openapi_to_k6_scaffold.mjs" --spec openapi.yaml --out tests/perfThen customize the generated tests/perf/02-load-pre-uat.k6.js so that:
- Read endpoints (
GET) represent ~70–80% of traffic weight and write endpoints (POST/PUT/PATCH) represent ~20–30%. - Dynamic resource IDs created in
POSTsteps are correlated into downstreamGET/PATCHsteps. - Realistic test accounts/payloads are loaded via
SharedArrayso Virtual Users do not all hit a single cached DB row.
Step 2: Database Query Bottleneck Audit (shadow_db MCP)
Use the shadow_db MCP (run_readonly_query) to run EXPLAIN on the top high-traffic queries:
- PostgreSQL:
EXPLAIN (ANALYZE, BUFFERS) SELECT ... - MySQL / MariaDB:
EXPLAIN FORMAT=JSON SELECT ...Check forSeq Scan/ALLfull-table scans on tables with $> 1,000$ rows, missing composite indexes on(tenant_id, status, created_at), and unpaginated queries lackingLIMIT.
Step 3: API & Frontend Payload Audit
- Verify all list endpoints enforce bounded pagination (
limit <= 100). - Verify response compression (
gzip/brotli/zstd) and static assetCache-Controlheaders. - For web frontends, verify bundle chunk splitting and Core Web Vitals (
LCP < 2.5s,INP < 200ms,CLS < 0.1).
Step 4: Profiling Before Optimization, Variance & Regression Baseline
- Profile First: Never guess bottlenecks — capture CPU/heap flamegraphs or
EXPLAIN (ANALYZE, BUFFERS)before changing code or indexes. - Run-to-Run Variance & Longitudinal Baseline: Execute >= 3 warm runs per benchmark, report
p50/p95/p99plus variance/spread across runs, and enforce a strict no-regression comparison against the previous Pre-UAT baseline. - Write a concise report in
docs/perf/PRE-UAT-PERFORMANCE-REPORT.mddocumenting:- Target VU concurrency & RPS vs measured
p50,p95,p99latency, error rate (%), and run-to-run variance. - SQL indexes added or N+1 queries eliminated.
- Readiness verdict (
PASS FOR UATorTUNING REQUIRED).
- Target VU concurrency & RPS vs measured
3. Execution Approval & Intent Boundary (L3 / L4)
- Generating
k6scaffolds (--out) or read-only localEXPLAINisL0/L1, whereas executingk6load/stress/soak/spike runs is strictlyL3: RESOURCE_INTENSIVE(andL4: HIGH_IMPACTon staging/production/unknown environments). NEVER execute load or stress benchmarks without explicit action-specific 7-part Monarch approval (shadow-monarch/scripts/execution_approval_gate.py).
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.

