A collection of Agent Skills for measuring and debugging web performance using Chrome DevTools.
Compatible with multiple AI coding agents including Claude Code, Cursor, OpenCode, VS Code extensions, and more. Also compatible with Chrome DevTools MCP for automated browser-based performance auditing.
These skills transform 49 battle-tested JavaScript snippets into agent capabilities for any skills-compatible AI coding assistant:
- Browser Console Integration: Run performance measurements directly in Chrome DevTools
- Real-time Analysis: Measure actual user experience on live pages
- Core Web Vitals: Track LCP, CLS, INP with detailed breakdowns
- Resource Optimization: Analyze scripts, fonts, images, and network performance
- Interaction Debugging: Detect long tasks, animation frames, and scroll jank
- Intelligent Workflows: Predefined sequences for common performance scenarios
- Decision Trees: Autonomous follow-up analysis based on measurement results
| Skill | Snippets | Use when |
|---|---|---|
| webperf | Meta-skill | "Audit performance", "check web vitals", "analyze this page" |
| webperf-core-web-vitals | 7 | "Debug LCP", "check CLS", "measure INP" |
| webperf-loading | 29 | "Analyze TTFB", "check render-blocking", "audit scripts" |
| webperf-interaction | 8 | "Debug jank", "long tasks", "animation frames" |
| webperf-media | 3 | "Audit images", "optimize video", "lazy loading" |
| webperf-resources | 1 | "Check bandwidth", "network quality" |
npx skills add nucliweb/webperf-snippetsInstalls directly from GitHub repository to ~/.claude/skills/. This is the easiest method for end users.
Install skills to .claude/skills/ in your project:
git clone https://github.com/nucliweb/webperf-snippets.git
cd webperf-snippets
npm run install-skillsSkills will be registered in .claude/settings.json and available only in this project.
Install skills to ~/.claude/skills/ for development:
git clone https://github.com/nucliweb/webperf-snippets.git
cd webperf-snippets
npm run install-globalAfter installation, register skills in your project's .claude/settings.json:
{
"skills": [
{ "path": "~/.claude/skills/webperf" },
{ "path": "~/.claude/skills/webperf-core-web-vitals" },
{ "path": "~/.claude/skills/webperf-loading" },
{ "path": "~/.claude/skills/webperf-interaction" },
{ "path": "~/.claude/skills/webperf-media" },
{ "path": "~/.claude/skills/webperf-resources" }
]
}Skills activate automatically when matched. Examples:
Audit this page for Core Web Vitals
Check loading performance and TTFB
Analyze images for optimization opportunities
Debug layout shifts and measure CLS
The main entry point that helps identify the right skill for your performance question.
Trigger phrases: "audit performance", "check web vitals", "analyze this page", "debug performance"
What it does:
- Routes to the appropriate specialized skill
- Provides overview of all 49 available snippets
- Suggests which skill to use based on your question
Measure and debug the three Core Web Vitals that impact Google Search ranking.
Trigger phrases: "Core Web Vitals", "LCP", "CLS", "INP", "slow loading", "layout shifts"
Snippets (7):
- Largest Contentful Paint (LCP) with sub-parts breakdown
- Cumulative Layout Shift (CLS) tracking
- Interaction to Next Paint (INP) measurement
- LCP Trail (visual candidate tracking)
- LCP Image Entropy analysis
- LCP Video Candidate detection
Thresholds:
- LCP: Good ≤ 2.5s | Needs Improvement ≤ 4.0s | Poor > 4.0s
- CLS: Good ≤ 0.1 | Needs Improvement ≤ 0.25 | Poor > 0.25
- INP: Good ≤ 200ms | Needs Improvement ≤ 500ms | Poor > 500ms
Comprehensive loading performance analysis and optimization with built-in workflows and decision trees.
Trigger phrases: "TTFB", "FCP", "render-blocking", "script loading", "font loading", "resource hints"
Snippets (28):
- TTFB (Time to First Byte) with sub-parts
- FCP (First Contentful Paint)
- Render-blocking resources detection
- Script loading patterns and timings
- Font preloading and usage analysis
- Resource hints validation (preload, prefetch, preconnect)
- Service Worker analysis
- Critical CSS detection
- Inline script/CSS analysis
- Back/Forward Cache compatibility
- Priority hints audit
- Client-side redirect detection
Intelligent Features:
8 Common Workflows:
- Complete loading performance audit (6 snippets)
- Server/backend performance investigation (4 snippets)
- Font loading optimization (3 snippets)
- Script performance deep dive (6 snippets)
- Resource hints & priority optimization (5 snippets)
- CSS optimization workflow (4 snippets)
- Image loading audit (4 snippets)
- SSR/framework performance (4 snippets)
16 Decision Trees:
- Automatic follow-up snippets based on thresholds
- Example: If TTFB > 600ms → runs TTFB-Sub-Parts.js
- Example: If FCP > 1.8s → runs render-blocking analysis + critical CSS detection
- Example: If many third-party scripts → analyzes timing and execution impact
This enables autonomous, multi-snippet performance audits that progressively diagnose issues.
Measure and debug user interaction responsiveness.
Trigger phrases: "jank", "long tasks", "animation frames", "scroll performance", "interaction latency"
Snippets (8):
- Long Animation Frames (LoAF) detection
- Long Animation Frames with script attribution
- Long Tasks tracking
- Interaction latency breakdown
- Scroll performance analysis
- Layout shifts during interaction
- Event processing time
Audit images and videos for performance optimization.
Trigger phrases: "image audit", "lazy loading", "image optimization", "video performance", "SVG analysis"
Snippets (3):
- Image element audit (format, lazy loading, sizing)
- Video element audit (poster, preload, formats)
- SVG embedded bitmap analysis
Analyze network and connection quality.
Trigger phrases: "bandwidth", "network quality", "connection type", "save-data mode"
Snippets (1):
- Network bandwidth and connection quality detection
These skills are designed to work with the Chrome DevTools Model Context Protocol:
- Navigate:
mcp__chrome-devtools__navigate_page→ go to target URL - Execute:
mcp__chrome-devtools__evaluate_script→ run snippet code - Capture:
mcp__chrome-devtools__get_console_message→ read results - Interpret: Use thresholds from SKILL.md to analyze results
- Recommend: Provide actionable optimization suggestions
Skills are auto-generated from the snippets/ directory:
npm run generate-skillsThis creates:
skills/{category}/SKILL.md- Skill documentation with injected workflowsskills/{category}/scripts/*.js- Snippet code
The generator:
- Reads all
.jsfiles fromsnippets/{Category}/ - Extracts metadata from
pages/{Category}/*.mdxdocumentation - Injects workflows from
snippets/{Category}/WORKFLOWS.md(if exists) - Generates complete
SKILL.mdwith thresholds and execution instructions
- Add JavaScript snippet to
snippets/{Category}/ - Document in
pages/{Category}/*.mdx - Run
npm run generate-skills - Run
npm run install-skillsto update local installation
To add intelligent workflows to a skill category:
- Create
snippets/{Category}/WORKFLOWS.md - Structure with
## Common Workflowsand## Decision Treesections - Run
npm run generate-skillsto inject into generated skills
Example structure:
## Common Workflows
### Workflow Name
When the user asks about [scenario]:
1. **Snippet1.js** - Brief description
2. **Snippet2.js** - Brief description
## Decision Tree
### After Snippet1.js
- **If condition** → Run **Snippet2.js**
- **If other condition** → Run **Snippet3.js**See snippets/Loading/WORKFLOWS.md for a complete example with 8 workflows and 16 decision trees.
Agent Skills is an open format supported by many AI coding tools:
- Claude Code - Anthropic's CLI coding assistant
- Cursor - AI-first code editor
- OpenCode - Open-source AI coding agent
- VS Code Extensions - Various AI assistant extensions
- Gemini CLI - Google's Gemini coding assistant
- GitHub Copilot Workspace - GitHub's AI development environment
- And many more - See agentskills.io for full list
The standard .claude/skills/ directory and SKILL.md format work across all compatible agents.
- WebPerf Snippets Documentation
- Agent Skills Specification
- Chrome DevTools MCP
- Web Vitals
- Core Web Vitals
MIT License - see LICENSE for details.