skills/web-dev/web-performance/SKILL.md
Core Web Vitals, Lighthouse, bundle optimization, lazy loading, CDN, caching strategies
npx skillsauth add alphaonedev/openclaw-graph web-performanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill focuses on optimizing web performance by leveraging tools and strategies like Core Web Vitals, Lighthouse for audits, bundle optimization with Webpack, lazy loading in HTML/JS, CDN setup, and caching strategies to improve load times and user experience.
Use this skill when analyzing and improving site performance, such as for slow-loading pages, preparing for SEO impacts from Core Web Vitals, optimizing large JavaScript bundles, or implementing efficient asset delivery in production environments.
loading="lazy" on images) or React's lazy() function.To accomplish tasks, invoke this skill via OpenClaw's API or CLI, passing parameters like URLs or config files. For audits, provide a URL and options; for optimization, supply code snippets or build configs. Always wrap calls in try-catch for error handling. Example pattern: Use the skill in a CI/CD pipeline to audit PR builds automatically.
Use OpenClaw's CLI or API endpoint /api/skills/web-performance/execute with JSON payload. Authentication requires $OPENCLAW_API_KEY in headers.
openclaw execute web-performance --url https://example.com --audit-type full --output json/api/skills/web-performance/execute with body: {"url": "https://example.com", "options": {"chromeFlags": "--headless"}}import React, { lazy, Suspense } from 'react';
const LazyImage = lazy(() => import('./ImageComponent'));
<Suspense fallback={<div>Loading...</div>}><LazyImage /></Suspense>;
{ "optimization": { "minimizer": ["terser-webpack-plugin"], "splitChunks": { "chunks": "all" } } }
location /static/ { proxy_pass https://cdn.example.com; expires 1d; }Integrate by importing OpenClaw SDK and calling the skill function with required params. For auth, set env var $OPENCLAW_API_KEY before runtime. Combine with other skills like monitoring tools: e.g., pipe Lighthouse results to a logging service. Use JSON config files for multi-step optimizations, such as: {"steps": ["audit", "optimize-bundle", "apply-caching"]}. Ensure compatibility with Node.js 14+ for Webpack integrations.
Handle errors by checking response codes from API calls (e.g., 400 for invalid URL, 401 for auth issues). In code, use try-catch around skill executions: e.g.,
try {
const result = await openclaw.execute('web-performance', { url: 'https://example.com' });
console.log(result);
} catch (error) {
if (error.code === 'AUTH_ERROR') process.env.OPENCLAW_API_KEY = 'new-key';
else console.error(error.message);
}
Common issues: Invalid URLs return "Invalid input"; network errors suggest retry with exponential backoff. Always validate inputs like URLs before calling.
openclaw execute web-performance --url https://example.com --report-path ./report.json to generate a JSON report with Core Web Vitals scores, then analyze LCP > 2.5s as a failure threshold.openclaw execute web-performance --action optimize-bundle --config webpack.config.js, followed by openclaw execute web-performance --action setup-cdn --provider cloudflare --assets /static/, to enable caching and reduce load times by 30-50%.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui