web-performance
Core Web Vitals, Lighthouse, bundle optimization, lazy loading, CDN, caching strategies
What this skill does
## Purpose
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.
## When to Use
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.
## Key Capabilities
- Run Lighthouse audits to measure Core Web Vitals (LCP, FID, CLS) with metrics like time to first byte.
- Optimize bundles using Webpack's TerserPlugin for minification and code splitting.
- Implement lazy loading via HTML attributes (e.g., `loading="lazy"` on images) or React's `lazy()` function.
- Configure CDNs with providers like Cloudflare for static asset delivery.
- Apply caching strategies using HTTP headers (e.g., Cache-Control: max-age=3600) or service workers.
## Usage Patterns
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.
## Common Commands/API
Use OpenClaw's CLI or API endpoint `/api/skills/web-performance/execute` with JSON payload. Authentication requires `$OPENCLAW_API_KEY` in headers.
- CLI: `openclaw execute web-performance --url https://example.com --audit-type full --output json`
- API: POST to `/api/skills/web-performance/execute` with body: `{"url": "https://example.com", "options": {"chromeFlags": "--headless"}}`
- Code snippet for lazy loading:
```javascript
import React, { lazy, Suspense } from 'react';
const LazyImage = lazy(() => import('./ImageComponent'));
<Suspense fallback={<div>Loading...</div>}><LazyImage /></Suspense>;
```
- Webpack config for bundle optimization:
```json
{ "optimization": { "minimizer": ["terser-webpack-plugin"], "splitChunks": { "chunks": "all" } } }
```
- CDN config example: In Nginx, add `location /static/ { proxy_pass https://cdn.example.com; expires 1d; }`
## Integration Notes
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.
## Error Handling
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.,
```javascript
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.
## Concrete Usage Examples
1. Audit a website with Lighthouse: Run `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.
2. Optimize and deploy with CDN: In a build script, use `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%.
## Graph Relationships
- Connected to: web-dev cluster
- Related skills: seo-optimization (for performance-driven SEO), frontend-dev (for bundle and lazy loading integrations)
- Dependencies: monitoring-tools (for post-audit analysis)
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.