AGENT SKILL

benchmark

使用此技能测量性能基线,检测PR前后的回归,并比较堆栈替代方案。

License 许可
MIT
最近更新
2026-11-10
Stars
★ 1
Forks
0

01 前言 Front Matter

name
benchmark
origin
ECC
description
使用此技能测量性能基线,检测PR前后的回归,并比较堆栈替代方案。

03 SKILL.md 正文

基准测试 — 性能基线及回归检测

使用场景

  • 在 PR 前后测量性能影响
  • 为项目建立性能基线
  • 用户反馈"感觉变慢"时
  • 发布前确保达到性能目标
  • 对比不同技术栈的性能表现

工作原理

模式 1:页面性能

通过浏览器 MCP 测量真实浏览器指标:

1. 导航至每个目标 URL
2. 测量核心网页指标:
   - LCP(最大内容绘制)— 目标 < 2.5 秒
   - CLS(累积布局偏移)— 目标 < 0.1
   - INP(与下一次绘制的交互)— 目标 < 200 毫秒
   - FCP(首次内容绘制)— 目标 < 1.8 秒
   - TTFB(首字节时间)— 目标 < 800 毫秒
3. 测量资源大小:
   - 页面总重量(目标 < 1MB)
   - JS 包大小(目标 < 200KB gzip 压缩后)
   - CSS 大小
   - 图片重量
   - 第三方脚本重量
4. 统计网络请求数量
5. 检查阻塞渲染的资源

模式 2:API 性能

对 API 端点进行基准测试:

1. 每个端点请求 100 次
2. 测量:p50、p95、p99 延迟
3. 追踪:响应大小、状态码
4. 负载测试:10 个并发请求
5. 与 SLA 目标进行对比

模式 3:构建性能

测量开发反馈循环效率:

1. 冷构建时间
2. 热重载时间 (HMR)
3. 测试套件执行时间
4. TypeScript 检查时间
5. 代码检查时间
6. Docker 构建时间

模式 4:前后对比

在变更前后运行以测量影响:

/benchmark baseline    # 保存当前指标
# ... 进行更改 ...
/benchmark compare     # 与基线进行比较

输出结果:

| Metric | Before | After | Delta | Verdict |
|--------|--------|-------|-------|---------|
| LCP | 1.2s | 1.4s | +200ms | WARNING: WARN |
| Bundle | 180KB | 175KB | -5KB | ✓ BETTER |
| Build | 12s | 14s | +2s | WARNING: WARN |

输出

将基线数据以 JSON 格式存储在 .ecc/benchmarks/ 中。通过 Git 追踪,便于团队共享基线。

集成

  • CI:在每个 PR 上运行 /benchmark compare
  • 配合 /canary-watch 进行部署后监控
  • 配合 /browser-qa 完成发布前完整检查清单

04 同仓库更多 Skills

YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

vercel-sandbox

Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include "Vercel Sandbox browser", "microVM Chrome", "agent-browser in sandbox", "browser automation on Vercel", or any task requiring Chrome in a Vercel Sandbox.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

slack

Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include "check my Slack", "what channels have unreads", "send a message to", "search Slack for", "extract from Slack", "find who said", or any task requiring programmatic Slack interaction.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

electron

Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include "automate Slack app", "control VS Code", "interact with Discord app", "test this Electron app", "connect to desktop app", or any task requiring automation of a native Electron application.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

dogfood

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

agent-browser

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

★ 1
YYC-Cube
YYC-Cube/YYC3-Knowledge-Base

shadcn

Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn/ui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for "shadcn init", "create an app with --preset", "switch to --preset", and for building a design system or applying a DESIGN.md or brand spec to shadcn/ui.

★ 1