web-perf-ux
Web application performance and UX optimization through automated analysis. Use when developers need to (1) measure and diagnose performance issues using Lighthouse and Core Web Vitals, (2) identify root causes of LCP, CLS, INP problems, (3) analyze UX pain points like layout shifts or slow interactivity, (4) generate actionable improvement plans with concrete code-level fixes. Triggers on requests like "analyze performance", "why is my page slow", "fix CLS issues", "optimize web vitals", "run Lighthouse", "performance audit", or "improve page speed".
What this skill does
# Web Performance & UX Optimization End-to-end workflow: **measure → analyze → explain → plan → execute** ## Preflight Checklist Before starting, verify: 1. **Playwright MCP** - Browser automation available - Test: `browser_navigate` to target URL works - If unavailable: User must configure Playwright MCP server 2. **Lighthouse CLI** - Performance measurement - Test: `lighthouse --version` - Install if missing: `npm install -g lighthouse` 3. **Target URL accessible** - Production/staging preferred for reliable metrics - Local dev works but label results as "non-prod environment" ## Workflow ### 1. Measure **Primary: Lighthouse CLI** Run via `scripts/lighthouse-runner.sh`: ```bash ./lighthouse-runner.sh https://example.com # Mobile (default) ./lighthouse-runner.sh https://example.com --desktop # Desktop ./lighthouse-runner.sh http://localhost:3000 --no-throttling # Local dev ``` **Secondary: Real-time Web Vitals via Playwright** Inject `scripts/collect-vitals.js` for interaction-based metrics: ```javascript // Navigate and inject await page.evaluate(collectVitalsScript); // Interact with page... // Retrieve metrics const vitals = await page.evaluate(() => window.__GET_VITALS_SUMMARY__()); ``` Use Playwright collection when: - Testing specific user flows (not just page load) - Measuring INP on real interactions - Debugging CLS sources during navigation ### 2. Analyze Parse Lighthouse JSON for: - Performance score and individual metric values - Failed audits with estimated savings - Diagnostic details (render-blocking resources, unused JS, etc.) Cross-reference with: - **CWV thresholds** → See `references/core-web-vitals.md` - **Known issue patterns** → See `references/common-issues.md` **Framework-specific analysis:** - Next.js apps → See `references/nextjs.md` - React apps → See `references/react.md` ### 3. Explain (Generate Report) Output markdown report with this structure: ```markdown # Performance & UX Report **Target:** [URL] **Environment:** [Production | Staging | Local Dev*] **Device:** [Mobile | Desktop] **Date:** [timestamp] *Local dev results may not reflect production performance ## Executive Summary Top 3 issues with expected impact: 1. [Issue] → [Expected improvement] 2. [Issue] → [Expected improvement] 3. [Issue] → [Expected improvement] ## Scorecard | Metric | Value | Rating | Target | |--------|-------|--------|--------| | Performance | X/100 | 🟡 | ≥90 | | LCP | Xs | 🔴 | ≤2.5s | | CLS | X.XX | 🟢 | ≤0.1 | | INP | Xms | 🟡 | ≤200ms | | FCP | Xs | | ≤1.8s | | TTFB | Xms | | ≤800ms | Rating: 🟢 Good | 🟡 Needs Improvement | 🔴 Poor ## Findings ### Finding 1: [Title] **Evidence:** - [Lighthouse audit / metric value / observation] **Root Cause:** - [Technical explanation of why this happens] **Fix Proposal:** - [Specific code/config change] - [File(s) likely affected] **Verification:** - [How to confirm the fix worked] ### Finding 2: ... ## Quick Wins vs Strategic Fixes ### Quick Wins (< 1 hour, high confidence) - [ ] [Action item] - [ ] [Action item] ### Strategic Fixes (requires planning) - [ ] [Action item with complexity note] ## Re-test Plan After implementing fixes: 1. Run Lighthouse again with same configuration 2. Compare: [specific metrics to watch] 3. Expected improvements: [quantified targets] ``` ### 4. Plan (Create Tasks) Convert findings to tasks using Plan/Task tools: **Task structure:** ``` Subject: [Action verb] [specific target] Description: - Rationale: [why this matters, linked to finding] - Files/Areas: [likely locations to modify] - Acceptance Criteria: [measurable outcome] - Re-measure: [how to verify improvement] ``` **Prioritization:** 1. **Impact** (CWV improvement potential) 2. **Confidence** (certainty the fix will help) 3. **Category** labels: `Hydration/SSR`, `Images`, `JS Bundle`, `Fonts`, `CSS`, `Caching`, `Third-Party` **Example tasks:** ``` High Priority: 1. [Images] Add width/height to hero image - Impact: CLS 0.15 → <0.1 - Files: components/Hero.tsx - Verify: CLS audit passes 2. [JS Bundle] Lazy load chart component - Impact: TBT -200ms, LCP -0.5s - Files: pages/dashboard.tsx - Verify: Main bundle <200KB Medium Priority: 3. [Fonts] Preload critical font - Impact: FCP -100ms - Files: app/layout.tsx ``` ## Environment Notes ### Production/Staging (Recommended) - Metrics reflect real CDN, caching, compression - Use throttled Lighthouse (default) for user-representative results ### Local Development - **Always label** results as "Local Dev Environment" - Use `--no-throttling` flag - Useful for: regression testing, debugging specific issues - Not reliable for: absolute performance numbers, TTFB, caching ## When to Use Each Reference | Situation | Reference File | |-----------|----------------| | Understanding metric thresholds | `core-web-vitals.md` | | Identifying root cause of issue | `common-issues.md` | | Next.js-specific optimizations | `nextjs.md` | | React patterns (any framework) | `react.md` | ## Optional: Implementation Mode By default, stop at plan + task list. If user requests implementation: 1. Confirm scope of changes 2. For high-confidence fixes, provide specific code patches 3. Still require user approval before applying 4. Re-run measurement after changes to verify
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.