# Web Performance Benchmark (benchmark)

> Measures live page metrics from performance.getEntries() in a browser and compares them with a saved baseline to detect web performance regressions.

- Category: [Performance](https://www.myskills.tools/en/categories/performance/)
- Source: Community · Garry Tan
- Repository: https://github.com/garrytan/gstack/tree/main/benchmark (commit 043feff · v1.0.0)
- SKILL.md: https://github.com/garrytan/gstack/blob/main/benchmark/SKILL.md
- Install command: `npx skills add garrytan/gstack --skill benchmark`
- License: MIT
- Compatible with: Claude Code, Codex, Cursor, Copilot
- Permissions: read-repo ✓, write-files ✓, shell ✓, network ✓
- Status: Scan passed
- A rule scan cannot catch every risk. Read this skill's SKILL.md and check its permissions before installing.
- ⚠ May drive your real signed-in browser through Aside to open the target site, and logs telemetry through gstack scripts.

## Core rule

Measure, don't guess: use actual performance.getEntries() data, not estimates.

## Execution Phases

1. **Set up and pick pages** — Create .gstack/benchmark-reports, then use --pages or propose the homepage plus up to 5 nav targets for the user to confirm; --diff limits it to pages the branch affects.
2. **Collect metrics** — Run the browser script 5 times per page for TTFB, FCP, LCP, DOM timings, full load, slow resources and JS/CSS sizes, using medians and ranges.
3. **Baseline and compare** — In --baseline mode, save baseline.json; otherwise compare against it with regression thresholds, treating deltas within the run spread as no change.
4. **Resources and budget** — List the slowest resources with one remedy each, then check FCP, LCP, JS, CSS, transfer and request budgets and assign a grade.
5. **Trends and report** — With --trend, show the last 5 runs; save Markdown and JSON reports under .gstack/benchmark-reports.

## Permissions (summarised from SKILL.md)

| Capability | Needed | Details |
|---|---|---|
| File writes | Limited | Only writes reports and baselines under .gstack/benchmark-reports; does not modify code unless explicitly asked. |
| Command execution | Required | Runs gstack scripts, git, gh, and aside repl or the bundled headless browser commands to collect data. |
| Network outbound | Limited | Only visits the target site the user named and its same-origin pages; --diff mode queries the base branch with gh. |

## SKILL.md frontmatter (YAML)

```yaml
---
name: benchmark
preamble-tier: 1
version: 1.0.0
description: Web performance regression detection. (gstack)
triggers:
  - web performance benchmark
  - check page speed
  - detect page performance regression
allowed-tools:
  - Bash
  - Read
  - Write
  - Glob
  - AskUserQuestion
---
```

Home: https://www.myskills.tools/en/ · URL: https://www.myskills.tools/en/skills/benchmark/
