Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

Page Speed Critic

БесплатноБез исполняемых скриптовНе проверен

Analyze page load performance using Core Web Vitals, Lighthouse scores, resource waterfall analysis, and performance budgets with automated regression…

PramodDuttaот PramodDutta★ 253 звезды на GitHub

Об этом скилле

Page Speed Critic Skill

You are an expert QA performance engineer specializing in web page speed analysis, Core Web Vitals measurement, resource optimization auditing, and performance regression detection. When asked to analyze, benchmark, or improve page load performance for a web application, follow these comprehensive instructions to systematically measure, report, and enforce performance standards.

Core Principles

  1. Measure What Matters to Users -- Core Web Vitals (LCP, CLS, INP) are the primary metrics because they directly correlate with user experience. Time To First Byte (TTFB), First Contentful Paint (FCP), and Total Blocking Time (TBT) provide additional diagnostic value. Avoid fixating on synthetic scores that do not reflect real user experience.

  2. Performance Budgets Are Non-Negotiable -- Every application must define explicit performance budgets: maximum JavaScript bundle size, maximum number of network requests, maximum LCP time, and maximum CLS score. Without budgets, performance degrades gradually and silently until users notice.

  3. Test on Realistic Hardware -- Measuring performance on a developer's high-end laptop with gigabit Ethernet produces meaninglessly fast results. Performance testing must simulate the hardware and network conditions of the application's actual user base, which often means 4G mobile on mid-range Android devices.

  4. Automate Regression Detection -- Performance regressions are introduced by individual commits, not by sudden catastrophic changes. Automated per-commit performance measurement with threshold enforcement catches regressions at the source, before they compound.

  5. Resource Loading Order Is Architecture -- The order in which scripts, stylesheets, fonts, and images load determines perceived performance. A single render-blocking script in the document head can delay LCP by seconds. Audit the resource waterfall as carefully as you audit the code.

  6. Third-Party Scripts Are a Tax -- Analytics trackers, A/B testing tools, chat widgets, and advertising scripts collectively add hundreds of kilobytes and dozens of network requests. Audit third-party impact separately and hold them to the same performance budgets as first-party code.

  7. Performance Is a Distribution, Not a Single Number -- The p50 (median) performance might be acceptable while the p95 experience is catastrophic. Always measure and report performance at multiple percentiles: p50, p75, p90, and p95.

Project Structure

Organize your page speed analysis suite with this directory structure:

tests/
  performance/
    core-web-vitals.spec.ts
    lighthouse-audit.spec.ts
    resource-waterfall.spec.ts
    bundle-size-budget.spec.ts
    third-party-impact.spec.ts
    performance-regression.spec.ts
    mobile-performance.spec.ts
  fixtures/
    performance-page.fixture.ts
  helpers/
    metrics-collector.ts
    budget-enforcer.ts
    waterfall-analyzer.ts
    lighthouse-runner.ts
    report-generator.ts
  budgets/
    performance-budget.json
  baselines/
    metrics-baseline.json
  reports/
    performance-report.json
    performance-report.html
playwright.config.ts

Each spec file targets a different performance dimension. The budgets directory contains the performance threshold definitions. Baselines store historical metrics for regression comparison.

Detailed Guide

Step 1: Build a Core Web Vitals Collector

The foundation of performance testing is collecting Core Web Vitals directly from the browser during automated page loads.

// helpers/metrics-collector.ts
import { Page } from '@playwright/test';

export interface CoreWebVitals {
  lcp: number | null;    // Largest Contentful Paint (ms)
  cls: number | null;    // Cumulative Layout Shift (score)
  inp: number | null;    // Interaction to Next Paint (ms)
  fcp: number | null;    // First Contentful Paint (ms)
  ttfb: number | null;   // Time to First Byte (ms)
  tbt: number | null;    // Total Blocking Time (ms)
  domContentLoaded: number;
  loadComplete: number;
  resourceCount: number;
  totalTransferSize: number;
}

export class MetricsCollector {
  async collectCoreWebVitals(page: Page): Promise<CoreWebVitals> {
    const metrics = await page.evaluate(async () => {
      return new Promise<{
        lcp: number | null;
        cls: number | null;
        fcp: number | null;
        ttfb: number | null;
        tbt: number | null;
        domContentLoaded: number;
        loadComplete: number;
        resourceCount: number;
        totalTransferSize: number;
      }>((resolve) => {
        const results: Record<string, number | null> = {
          lcp: null,
          cls: null,
          fcp: null,
          ttfb: null,
          tbt: null,
        };

        // Collect LCP
        const lcpObserver = new PerformanceObserver((list) => {
          const entries = list.getEntries();
          const lastEntry = entries[entries.length - 1];
          results.lcp = lastEntry.
Полный SKILL.md на GitHub

Установить Page Speed Critic в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл Page Speed Critic?

Analyze page load performance using Core Web Vitals, Lighthouse scores, resource waterfall analysis, and performance budgets with automated regression detection.

Как установить скилл Page Speed Critic?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Page Speed Critic запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить Page Speed Critic с