一键导入
benchmark
Performance measurement with Core Web Vitals thresholds — baseline capture, regression detection, optional PageSpeed Insights
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Performance measurement with Core Web Vitals thresholds — baseline capture, regression detection, optional PageSpeed Insights
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Convert PDF/EPUB library to Markdown and generate Obsidian MOC notes
Hook-based compaction suggestions at logical task boundaries
Context window management — track spend, decide when to compact, preserve state
Session-start orientation — loads context, surfaces learnings, confirms registry
Quality and semantic review — catches what automated tools miss
Planner → Architect → Critic deliberation loop — produces a formally validated ADR
| name | benchmark |
| description | Performance measurement with Core Web Vitals thresholds — baseline capture, regression detection, optional PageSpeed Insights |
Performance measurement with hardcoded Core Web Vitals thresholds, 3-pass median reporting, and regression detection against a saved baseline. Measure, do not guess. Think of a baseline as a before photo: without it, you cannot tell whether the change made things better, worse, or did nothing.
Without a protocol, performance "checks" produce a single data point with no comparison context. One curl request is not a measurement: it is a sample. One sample is dominated by network variance, server cold starts, and caching state. A 3-pass median is a measurement.
The other failure mode is missing the baseline: making a change, running a check, seeing numbers, and having no reference to know whether those numbers are a regression.
/benchmark <url> # Full audit with baseline comparison
/benchmark <url> --baseline # Capture baseline before making changes
/benchmark <url> --quick # Single-pass timing, no baseline
/benchmark <url> --pages /,/dash # Specify multiple pages
/benchmark --diff # Pages touched by current branch only
/benchmark --trend # Show historical trend from saved snapshots
| Metric | Good | Needs Work | Poor |
|---|---|---|---|
| TTFB (Time to First Byte) | < 800ms | 800ms-1.8s | > 1.8s |
| FCP (First Contentful Paint) | < 1.8s | 1.8-3s | > 3s |
| LCP (Largest Contentful Paint) | < 2.5s | 2.5-4s | > 4s |
These thresholds are not configurable. They are the Google CWV standard.
| Signal | Timing | Bundle Size |
|---|---|---|
| REGRESSION | > 50% increase OR > 500ms absolute | > 25% increase |
| WARNING | > 20% increase | > 10% increase |
For each target page, run 3 passes and report the median:
curl -o /dev/null -s -w "TTFB:%{time_starttransfer} Total:%{time_total} Size:%{size_download}" <url>
Collect: TTFB, total load time, response size. Use --quick for a single pass when a rough number is sufficient and speed matters more than precision.
If GOOGLE_API_KEY is set:
curl -s "https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=<url>&strategy=mobile&key=$GOOGLE_API_KEY"
Extract: LCP, FCP, TTFB real-user p75 field data and Lighthouse lab scores.
If GOOGLE_API_KEY is not set: skip this phase. Report: "Field data unavailable: set GOOGLE_API_KEY for real-user metrics." Do not fail or warn: this is an optional enrichment, not a requirement.
If a baseline exists at context/benchmarks/<url-slug>-baseline.json:
If no baseline exists and --baseline was not passed:
/benchmark <url> --baseline before making changes to enable regression detection."When --baseline is passed: capture the current measurements as the baseline and save to context/benchmarks/<url-slug>-baseline.json. Do not run a comparison: you are establishing the reference point.
## Benchmark: <url>
Date: [date]
Pages tested: [list]
### <page>
TTFB: [value] ([delta vs baseline if available]): [GOOD | NEEDS WORK | POOR]
FCP: [value if available] : [GOOD | NEEDS WORK | POOR]
LCP: [value if available] : [GOOD | NEEDS WORK | POOR]
Size: [bytes] ([delta])
Verdict: PASS | WARNING | REGRESSION
[If regression]: Slowest resource: [resource] at [time]ms
[If PSI available]: Real-user p75 LCP: [value]: [GOOD | NEEDS WORK | POOR]
Final verdict across all pages: PASS | WARNING | REGRESSION
Save each run to context/benchmarks/[url-slug]-[date].json. Baseline snapshots save to context/benchmarks/[url-slug]-baseline.json on --baseline runs. The --trend flag reads all saved snapshots for a URL and reports directional movement.
Do not report a single curl pass as a benchmark. Single-pass numbers are dominated by variance. Run 3 passes and report the median.
Do not treat WARNING as PASS. A 20% regression in TTFB is a signal worth investigating before deploying.
Do not skip capturing a baseline before making changes. A regression you cannot prove is a regression you cannot fix with confidence.
Do not fail the run because GOOGLE_API_KEY is not set. Field data is an enrichment, not a requirement.