agentleFS
jholhewresjholhewres/devclaw-skills/skills/lighthouse/SKILL.md

lighthouse

Skill4 starsChanged 9 months agoMITView on GitHub

Web performance audit with Google Lighthouse

  • Installs packages

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run 3+ times and average (results vary)

    line 87
  2. Very specific:

    Use --chrome-flags="--headless --no-sandbox" for servers

    line 88
  3. Very specific:

    Use --preset=desktop to simulate desktop (default is mobile)

    line 90

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Lighthouse

Audit performance, accessibility, SEO and best practices for websites.

Setup

  1. Check if installed:
    command -v node && node --version
    command -v npx && npx lighthouse --version 2>/dev/null || npm list -g lighthouse 2>/dev/null
  2. Install:
    # Node.js (required for npx / lighthouse)
    # macOS
    brew install node
    
    # Ubuntu / Debian
    sudo apt update && sudo apt install -y nodejs npm
    
    # Lighthouse (use npx, no install needed)
    npx lighthouse <url> --output=json --chrome-flags="--headless --no-sandbox"
    
    # Or install globally
    npm install -g lighthouse

Run Audit

# Full audit (output to terminal)
npx lighthouse <url> --output=json --chrome-flags="--headless --no-sandbox" 2>/dev/null | jq '{
  performance: .categories.performance.score,
  accessibility: .categories.accessibility.score,
  bestPractices: .categories["best-practices"].score,
  seo: .categories.seo.score
}'

# Save HTML report
npx lighthouse <url> --output=html --output-path=./lighthouse-report.html --chrome-flags="--headless --no-sandbox"

# Performance only
npx lighthouse <url> --only-categories=performance --output=json --chrome-flags="--headless --no-sandbox"

Categories

CategoryWhat it measures
PerformanceLCP, FID, CLS, TTFB, speed index
AccessibilityContrast, alt text, ARIA, keyboard navigation
Best PracticesHTTPS, console errors, deprecated APIs
SEOMeta tags, structured data, mobile-friendly

Interpret Scores

  • 90-100: Good (green)
  • 50-89: Needs Improvement (orange)
  • 0-49: Poor (red)

Key Metrics (Core Web Vitals)

MetricGoodNeeds ImprovementPoor
LCP (Largest Contentful Paint)< 2.5s2.5s - 4s> 4s
FID (First Input Delay)< 100ms100ms - 300ms> 300ms
CLS (Cumulative Layout Shift)< 0.10.1 - 0.25> 0.25

Compare Results

# Run multiple times and compare
for i in 1 2 3; do
  npx lighthouse <url> --output=json --chrome-flags="--headless --no-sandbox" 2>/dev/null | \
    jq -r '"Run '$i': perf=\(.categories.performance.score) a11y=\(.categories.accessibility.score)"'
done

Tips

  • Run 3+ times and average (results vary)
  • Use --chrome-flags="--headless --no-sandbox" for servers
  • Scores are multiplied by 100 (0.95 = 95 points)
  • Use --preset=desktop to simulate desktop (default is mobile)
  • Install Chrome/Chromium on server if not available

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.