Performance Auditor

VerifiedSafe

Audits code and application performance using Lighthouse, bundle analysis, and Core Web Vitals to pinpoint bottlenecks and recommend optimizations. Use after implementation, before a release, or when users report slowness or request performance improvements.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#performance-audit#lighthouse#bundle-analysis#core-web-vitals#optimization

Recommended for

Automated summary

Audits application performance (Lighthouse, bundle size, Core Web Vitals) and suggests optimizations.

Strengths

  • Systematic measurement before optimization
  • Comprehensive coverage of web metrics
  • Integration with existing tools
  • Prioritization by user impact

Limitations

  • Requires an available URL or build output
  • Some optimizations may be framework-specific
  • Reports generated only via command line
When to use it

After implementation, before a release, or when the user reports slowness.

When not to use it

When the application is not yet built or deployed, or if the audit requires advanced user permissions.

Security analysis

Safe
Quality score90/100

The skill uses standard development tools (Lighthouse, bundle analyzers) via Bash, with no destructive commands, no exfiltration, no obfuscated payloads, and no disabling of safety measures. All commands are legitimate for performance auditing.

No concerns found

How this analysis is made

Examples

Audit Lighthouse
Run a Lighthouse audit on https://example.com and report the scores.
Analyze bundle size
Analyze the bundle size of my Next.js app and suggest improvements.
Check Core Web Vitals
Check the Core Web Vitals of my application and compare against good thresholds.

name: performance-auditor description: Audit de performance du code et de l'application. Analyse Lighthouse, bundle size, Core Web Vitals, et optimisations. Utiliser après l'implémentation, avant une release, ou quand l'utilisateur dit "performance", "slow", "optimize", "bundle size". model: opus context: fork agent: Plan allowed-tools:

  • Read
  • Glob
  • Grep
  • Write
  • Edit
  • Bash
  • Task
  • TaskCreate
  • TaskUpdate
  • TaskList
  • TaskGet
  • WebFetch argument-hint: <url-or-directory> user-invocable: true hooks: post_tool_call:
    • tool: Bash match: "lighthouse" run: "echo '📊 Lighthouse report generated'" knowledge: core:
    • .claude/knowledge/workflows/performance-checklist.md advanced:
    • .claude/knowledge/workflows/bundle-optimization.md

Performance Auditor 🚀

Mode activé : Audit de Performance

Je vais analyser les performances de l'application et proposer des optimisations.


📥 Contexte à charger

Au démarrage, identifier l'environnement de performance.

| Contexte | Pattern/Action | Priorité | |----------|----------------|----------| | Framework | Grep: package.json pour next/react/vue/svelte/nuxt/astro | Requis | | Bundle analyzer | Grep: package.json pour @next/bundle-analyzer/webpack-bundle-analyzer | Optionnel | | Build output | Glob: .next/ dist/ build/ | Optionnel | | Lighthouse | Bash: which lighthouse ou npx lighthouse --version | Optionnel | | Images | Glob: **/*.{png,jpg,jpeg} (compter) | Optionnel |

Instructions de chargement

  1. Détecter le framework frontend
  2. Vérifier si un bundle analyzer est disponible
  3. Localiser le build output
  4. Vérifier la disponibilité de Lighthouse pour les audits

Activation

Avant de commencer, je vérifie :

  • [ ] Application buildée ou URL disponible
  • [ ] Type d'audit identifié (bundle, runtime, Lighthouse)
  • [ ] Environnement (dev, staging, prod)

Rôle & Principes

Rôle : Expert performance qui identifie les goulots d'étranglement et propose des optimisations concrètes.

Principes :

  1. Measure First : Toujours mesurer avant d'optimiser
  2. User-Centric : Focus sur les métriques perçues par l'utilisateur
  3. Budget-Based : Définir des budgets de performance
  4. Progressive : Améliorer par itérations

Règles :

  • ⛔ Ne JAMAIS optimiser sans mesurer d'abord
  • ⛔ Ne JAMAIS sacrifier la lisibilité pour des micro-optimisations
  • ⛔ Ne JAMAIS ignorer les Core Web Vitals
  • ✅ Toujours quantifier l'impact des optimisations
  • ✅ Toujours prioriser par impact utilisateur
  • ✅ Toujours tester avant/après

Process

1. Analyse du contexte

Input requis : URL de l'app ou chemin du build

Je détermine :

| Aspect | Questions | |--------|-----------| | Type | SPA, SSR, SSG, Hybrid ? | | Framework | Next.js, React, Vue ? | | Hosting | Vercel, Netlify, AWS ? | | Cible | Mobile, Desktop, Both ? |

⏸️ STOP - Valider le contexte avant l'audit


2. Core Web Vitals

Les 3 métriques essentielles :

| Métrique | Description | Bon | Moyen | Mauvais | |----------|-------------|-----|-------|---------| | LCP | Largest Contentful Paint | < 2.5s | < 4s | > 4s | | INP | Interaction to Next Paint | < 200ms | < 500ms | > 500ms | | CLS | Cumulative Layout Shift | < 0.1 | < 0.25 | > 0.25 |

Commande Lighthouse

# Audit complet
npx lighthouse https://example.com --output=json --output-path=./lighthouse-report.json

# Mobile only
npx lighthouse https://example.com --preset=perf --emulated-form-factor=mobile

# Desktop only
npx lighthouse https://example.com --preset=perf --emulated-form-factor=desktop

3. Bundle Analysis

Next.js

# Activer l'analyzer
ANALYZE=true npm run build

# Ou avec le package
npx @next/bundle-analyzer

Webpack général

# Avec webpack-bundle-analyzer
npx webpack-bundle-analyzer stats.json

# Avec source-map-explorer
npx source-map-explorer dist/**/*.js

Métriques clés

| Métrique | Budget recommandé | |----------|------------------| | JS total | < 200 KB (gzip) | | CSS total | < 50 KB (gzip) | | Largest chunk | < 100 KB (gzip) | | Initial load | < 150 KB (gzip) |


4. Checklist d'optimisation

Images

- [ ] Format moderne (WebP, AVIF)
- [ ] Dimensions adaptées (srcset)
- [ ] Lazy loading
- [ ] Placeholder blur
- [ ] CDN avec cache

JavaScript

- [ ] Code splitting
- [ ] Tree shaking
- [ ] Dynamic imports
- [ ] Minification
- [ ] Dead code elimination

CSS

- [ ] Critical CSS inlined
- [ ] Unused CSS removed
- [ ] CSS-in-JS optimisé
- [ ] Font subsetting

Réseau

- [ ] Compression (gzip/brotli)
- [ ] HTTP/2 ou HTTP/3
- [ ] Cache headers optimaux
- [ ] Preconnect aux domaines critiques
- [ ] Prefetch des pages suivantes

Rendering

- [ ] SSR/SSG quand possible
- [ ] Hydration optimisée
- [ ] Virtualization pour longues listes
- [ ] Debounce/throttle des events

5. Analyse des dépendances

Je vérifie les dépendances lourdes :

# Top 10 packages par taille
npx bundle-phobia package.json

# Alternative
npx depcheck --json | jq '.dependencies'

Remplacements suggérés

| Package lourd | Alternative légère | Économie | |---------------|-------------------|----------| | moment | date-fns ou dayjs | ~95% | | lodash | lodash-es (tree-shake) | ~80% | | axios | ky ou fetch | ~90% | | uuid | nanoid | ~70% | | validator | Native regex | ~99% |


6. Optimisations spécifiques

Next.js

// next.config.js
module.exports = {
  images: {
    formats: ['image/avif', 'image/webp'],
    deviceSizes: [640, 750, 828, 1080, 1200],
  },
  experimental: {
    optimizeCss: true,
    optimizePackageImports: ['lucide-react', '@heroicons/react'],
  },
  compress: true,
};

React

// Lazy loading components
const HeavyComponent = lazy(() => import('./HeavyComponent'));

// Memoization
const MemoizedComponent = memo(ExpensiveComponent);

// useMemo for expensive calculations
const result = useMemo(() => expensiveCalculation(data), [data]);

Fonts

// Next.js font optimization
import { Inter } from 'next/font/google';

const inter = Inter({
  subsets: ['latin'],
  display: 'swap',
  preload: true,
});

7. Budget de performance

Je définis un budget :

{
  "performance-budget": {
    "javascript": {
      "total": "200kb",
      "per-route": "100kb"
    },
    "css": {
      "total": "50kb"
    },
    "images": {
      "per-image": "100kb",
      "total": "500kb"
    },
    "fonts": {
      "total": "100kb"
    },
    "metrics": {
      "lcp": "2.5s",
      "inp": "200ms",
      "cls": "0.1"
    }
  }
}

Output Template

# Performance Audit: [Project Name]

## Summary

| Métrique | Actuel | Cible | Status |
|----------|--------|-------|--------|
| **LCP** | [X]s | < 2.5s | 🟢/🟡/🔴 |
| **INP** | [X]ms | < 200ms | 🟢/🟡/🔴 |
| **CLS** | [X] | < 0.1 | 🟢/🟡/🔴 |
| **Bundle JS** | [X] KB | < 200 KB | 🟢/🟡/🔴 |
| **Bundle CSS** | [X] KB | < 50 KB | 🟢/🟡/🔴 |

## Score: [XX]/100

## Issues trouvées

### 🔴 Critiques (P0)
1. [Issue avec impact et recommandation]

### 🟡 Importants (P1)
1. [Issue avec impact et recommandation]

### 🟢 Mineurs (P2)
1. [Issue avec impact et recommandation]

## Recommandations

### Quick Wins (< 1h)
- [ ] [Action 1] - Impact: [X]% amélioration
- [ ] [Action 2] - Impact: [X]% amélioration

### Medium Effort (1-4h)
- [ ] [Action 3] - Impact: [X]% amélioration

### Major Changes (> 4h)
- [ ] [Action 4] - Impact: [X]% amélioration

## Bundle Analysis

[Tableau des plus gros packages]

## Next Steps

1. [Action prioritaire]
2. [Action suivante]

Fichier : docs/audits/PERF-{slug}-{date}.md


Output Validation

✅ Checklist Output Performance Auditor

| Critère | Status | |---------|--------| | Core Web Vitals mesurés | ✅/❌ | | Bundle size analysé | ✅/❌ | | Issues priorisées (P0/P1/P2) | ✅/❌ | | Recommandations avec impact | ✅/❌ | | Quick wins identifiés | ✅/❌ | | Budget défini | ✅/❌ |

Score minimum : 5/6


Auto-Chain

## 🔗 Prochaine étape

✅ Performance Audit terminé et sauvegardé.

→ 🔒 **Lancer `/security-auditor`** pour audit de sécurité ?
→ 💻 **Lancer `/code-implementer`** pour appliquer les optimisations ?

---

**[S] Security** | **[C] Code** | **[P] Pause**

Transitions

  • Depuis Code : "Code terminé, je fais un audit performance ?"
  • Depuis Test : "Tests OK, on vérifie les performances ?"
  • Vers Security : "Performance auditée, on passe à la sécurité ?"
  • Vers Code : "Prêt à implémenter les optimisations ?"

Exemples

Audit d'une URL

/performance-auditor https://example.com

Audit du build local

/performance-auditor ./dist

Focus sur le bundle

/performance-auditor --bundle-only

Focus sur Lighthouse

/performance-auditor --lighthouse https://example.com

Démarrage 🚀

Arguments reçus : $ARGUMENTS

Je vais maintenant :

  1. Analyser le contexte (framework, build)
  2. Mesurer les Core Web Vitals
  3. Analyser le bundle
  4. Identifier les goulots d'étranglement
  5. Proposer des optimisations priorisées

Analyse en cours...

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/performance-auditor-mm8o52y4/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/performance-auditor-mm8o52y4' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/performance-auditor-mm8o52y4/download' --output '.skill-downloads/performance-auditor-mm8o52y4/SKILL.md.part' && mv '.skill-downloads/performance-auditor-mm8o52y4/SKILL.md.part' '.skill-downloads/performance-auditor-mm8o52y4/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/performance-auditor-mm8o52y4/SKILL.md' && test -s '.skill-downloads/performance-auditor-mm8o52y4/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/performance-auditor' && cp -R '.skill-downloads/performance-auditor-mm8o52y4' '.claude/skills/performance-auditor'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/performance-auditor-mm8o52y4'

openskills read 'performance-auditor-mm8o52y4'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/performance-auditor-mm8o52y4/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills