Benchmark

From bdfinst/agentic-dev-team · View interactive version

Benchmark is an AI agent skill from the GitHub repository bdfinst/agentic-dev-team. Capture runtime performance metrics (Core Web Vitals, resource sizes, load times) for web pages. Compare against baselines and performance budgets. Use when the user says "benchmark", "check performance", "page speed", "web vitals", "performance regression", or "how fast is this page".

How to use this skill

Skill file

Benchmark

Role: worker. This command measures runtime performance of web pages using Playwright.

You have been invoked with the /benchmark command.

Worker constraints

  1. Measure only; do not modify the page or app under test.
  2. Compare against the declared budget; do not invent thresholds.
  3. Be concise. Report the metrics table and verdict, no narration.

Parse Arguments

Arguments: $ARGUMENTS

If no URL is provided, look for a performance-budget.json file and benchmark all paths listed there.

Prerequisites Check

  1. Verify Playwright is installed: npx playwright --version. If not installed, tell the user: "Playwright is required. Run /project-init to set up this repo's tooling (it installs Playwright + Chromium for frontend projects), or install directly: npx playwright install chromium."
  2. If the URL is localhost, verify the dev server is running by attempting a fetch. If not running, tell the user: "Dev server doesn't appear to be running at <url>. Start it first."

Steps

1. Load the skill

Read skills/performance-benchmark/SKILL.md for the full metric definitions, output format, and collection methodology. Read skills/performance-benchmark/references/benchmark-script.md for the Playwright script template.

2. Generate and run the benchmark script

Generate a Node.js script based on the template that:

Run the script with node and capture the JSON output.

3. Compare against baseline (unless --baseline)

If --baseline is set:

If --baseline is NOT set:

4. Check performance budgets (if --budget or budget file exists)

Read performance-budget.json from the project root. Match the benchmarked URL path against budget entries. Flag any metric that exceeds its budget.

5. Append to trend history

Append the current metrics to benchmarks/<page-slug>/history.jsonl (one JSON object per line, with timestamp).

If --trend is set, read the history file and produce a trend summary showing metric changes over the last 10 entries.

6. Generate report

Write a markdown report to benchmarks/<page-slug>/report.md using the report format from the skill file.

Display in chat:

Integration

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.