Skip to content
Development
Skill

/perf-audit

Run Lighthouse performance audit with auto-fix for common issues. Use when user wants to check or improve site performance.

From plugin
ultraship
12445 skills13 agents16 commands3 hooks
+1

Claude Code

$ npx -y skills add Houseofmvps/ultraship --skill perf-audit --agent claude-code

SKILL.md

perf-audit.SKILL.md
name: perf-audit
description: Run Lighthouse performance audit with auto-fix for common issues. Use when user wants to check or improve site performance.
argument-hint: "<url>"
allowed-tools: Bash, Read, Edit, Grep, Glob

Performance Audit

Run Lighthouse against the project and fix performance issues.

Process

Step 1: Find the URL

  • Check if dev server is running (try common ports: 3000, 5173, 4321, 8080)
  • Check package.json scripts for dev/start commands
  • Ask user for URL if not auto-detected
  • If no server running, suggest starting one first

Step 2: Run Lighthouse

node ${CLAUDE_PLUGIN_ROOT}/tools/lighthouse-runner.mjs <url>

Parse JSON output for scores and opportunities.

Step 3: Report Scores & Core Web Vitals

Present all four Lighthouse scores:

  • Performance (target 90+)
  • Accessibility (target 90+)
  • Best Practices (target 90+)
  • SEO (target 100)

Report Core Web Vitals with targets:

  • **LCP** (Largest Contentful Paint): target <2.5s — report the LCP element from `lcp_element`
  • **TBT** (Total Blocking Time): target <200ms — proxy for INP
  • **CLS** (Cumulative Layout Shift): target <0.1
  • **FCP** (First Contentful Paint): target <1.8s
  • **SI** (Speed Index): target <3.4s

Step 4: Identify Root Causes

Before fixing, identify what's actually causing problems:

**LCP too high?** Check `lcp_element` in results — fix THAT specific element:

  • If it's an `<img>`: preload it, use WebP, add fetchpriority="high"
  • If it's text: check web font loading, add font-display: swap
  • If it's a background image: preload via `<link rel="preload">`

**CLS too high?** Check diagnostics for layout shift sources:

  • Images without width/height → add dimensions (scanner already checks this)
  • Dynamic content injected above fold → reserve space with CSS
  • Web fonts causing FOUT → add font-display: optional or swap

**Unused resources?** Check `wasted_resources`:

  • `unused_js_kb` > 100KB → code splitting or tree shaking needed
  • `unused_css_kb` > 50KB → purge unused CSS (PurgeCSS, Tailwind purge)

**Third-party scripts slow?** Check `third_party_impact`:

  • Analytics blocking >100ms → defer/async load
  • Ad scripts blocking >200ms → lazy load below fold
  • Chat widgets → load on user interaction, not page load

Step 5: Apply Fixes

For each opportunity, apply fixes using Edit tool:

**Performance fixes (high impact first):**

  • **Render-blocking resources** → add `defer` or `async` to non-critical scripts
  • **Unused JavaScript** → recommend code splitting, dynamic imports, tree shaking
  • **Unused CSS** → recommend PurgeCSS or Tailwind purge config
  • **LCP image not preloaded** → add `<link rel="preload" as="image" href="...">`
  • **Images not lazy-loaded** → add `loading="lazy"` to below-fold images
  • **Images without dimensions** → add `width` and `height` attributes
  • **No preconnect** → add `<link rel="preconnect" href="...">` for external origins
  • **Font display** → add `font-display: swap` to @font-face declarations
  • **Third-party scripts** → defer non-essential scripts, lazy load on interaction

**Accessibility fixes:**

  • Missing alt text (also caught by SEO scanner)
  • Missing form labels → add `<label>` elements
  • Low contrast → adjust colors
  • Missing landmark regions → add `<main>`, `<nav>`, `<footer>`

Step 6: Graceful Degradation

  • **No Chrome**: report "Chrome needed for Lighthouse. Install Chrome or Chromium."
  • **Lighthouse timeout**: return partial results with warning
  • **No dev server**: suggest starting one, or test against production URL

Key Principle

**Fix, don't just audit.** Identify the specific elements causing problems. Apply every automated fix possible. For build-tool changes (code splitting, tree shaking), provide exact config recommendations.

Read more
@houseofmvps
Ships withultraship

"ULTRASHIP" Claude Code plugin — 39 skills, 33 tools, 11 agents for ship-ready workflows: planning, review, pentesting, safety guardrails, canary monitoring, SEO/AI-readiness check, penetration testing, code review, competitive analysis, incident response. 1 dependency. 180 tests. MIT.

12445 skills13 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
124
Star history of Houseofmvps/ultraship on GitHub, a chart by star-history.com

Other skills on ultraship.

a11y

a11y

Accessibility audit + auto-fix (WCAG 2.2 A/AA). Scans built/static HTML for screen-reader, keyboard, and structure failures,…

architecture

architecture

Living Architecture Map — auto-generate Mermaid diagrams of your codebase. Use when user wants to visualize architecture,…

brainstorming

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior.…

canary

canary

Post-deploy canary monitoring — checks site health, detects regressions, monitors for errors after deployment. Use after…

clone-patterns

clone-patterns

Learn From the Best — analyze patterns from any codebase and apply them to yours. Use when user wants to adopt best practices…

code-review

code-review

Code review with principal-engineer-level depth. Reviews for correctness, performance, security, maintainability, and…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about perf-audit.

Which coding agents can use perf-audit?
perf-audit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.