[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CBXAJR964EBG32AQ4F3DTJ":3,"skill-same:01M6CBXAJR964EBG32AQ4F3DTJ":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":43,"linkOnly":44,"markdownContent":45,"markdownBody":46,"frontMatter":47,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":13,"ownerHtmlUrl":53,"ownerBlogUrl":13,"ownerDescription":13,"updatedAt":54,"install":55,"resources":68},"01M6CBXAJR964EBG32AQ4F3DTJ","web-performance-optimization","Web 应用性能优化","Optimize web application performance using code splitting, lazy loading, caching, compression, and monitoring. Use when improving Core Web Vitals and user experience.","通过代码分割、懒加载、缓存、压缩和监控来优化 Web 应用性能。在改善 Core Web Vitals（核心网页指标）和用户体验时使用此技能。","ray-manaloto\u002Fmacos-development-environment","ray-manaloto","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F227192835?v=4","01M6CBR7J13ZA01X5YB1A1QRJP",null,"01M6CBR7P0S3NS8ZV81JYNST14",1,"MIT","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweb-performance-optimization\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8C796JZ1YCTM2B2X7TKEWZZ","性能剖析与优化","SCENARIO","使用场景",[30,31,32,33,34,35,36,37,38,39,40,41,42],"performance","web","web performance","Optimization","web performance optimization","performance optimization","core","code","compression","monitoring","core web vitals","user","use","2026-11-10 10:12:30",false,"---\nname: web-performance-optimization\ndescription: Optimize web application performance using code splitting, lazy loading, caching, compression, and monitoring. Use when improving Core Web Vitals and user experience.\n---\n\n# Web Performance Optimization\n\n## Overview\n\nImplement performance optimization strategies including lazy loading, code splitting, caching, compression, and monitoring to improve Core Web Vitals and user experience.\n\n## When to Use\n\n- Slow page load times\n- High Largest Contentful Paint (LCP)\n- Large bundle sizes\n- Frequent Cumulative Layout Shift (CLS)\n- Mobile performance issues\n\n## Implementation Examples\n\n### 1. **Code Splitting and Lazy Loading (React)**\n\n```typescript\n\u002F\u002F utils\u002FlazyLoad.ts\nimport React from 'react';\n\nexport const lazyLoad = (importStatement: Promise\u003Cany>) => {\n  return React.lazy(() =>\n    importStatement.then(module => ({\n      default: module.default\n    }))\n  );\n};\n\n\u002F\u002F routes.tsx\nimport { lazyLoad } from '.\u002Futils\u002FlazyLoad';\n\nexport const routes = [\n  {\n    path: '\u002F',\n    component: () => import('.\u002Fpages\u002FHome'),\n    lazy: lazyLoad(import('.\u002Fpages\u002FHome'))\n  },\n  {\n    path: '\u002Fdashboard',\n    lazy: lazyLoad(import('.\u002Fpages\u002FDashboard'))\n  },\n  {\n    path: '\u002Fusers',\n    lazy: lazyLoad(import('.\u002Fpages\u002FUsers'))\n  }\n];\n\n\u002F\u002F App.tsx with Suspense\nimport { Suspense } from 'react';\nimport { BrowserRouter, Routes, Route } from 'react-router-dom';\n\nexport const App = () => {\n  return (\n    \u003CBrowserRouter>\n      \u003CSuspense fallback={\u003CLoadingSpinner \u002F>}>\n        \u003CRoutes>\n          {routes.map(route => (\n            \u003CRoute key={route.path} path={route.path} element={\u003Croute.lazy \u002F>} \u002F>\n          ))}\n        \u003C\u002FRoutes>\n      \u003C\u002FSuspense>\n    \u003C\u002FBrowserRouter>\n  );\n};\n\n\u002F\u002F webpack.config.js\nmodule.exports = {\n  optimization: {\n    splitChunks: {\n      chunks: 'all',\n      cacheGroups: {\n        vendor: {\n          test: \u002F[\\\\\u002F]node_modules[\\\\\u002F]\u002F,\n          name: 'vendors',\n          priority: 10\n        },\n        common: {\n          minChunks: 2,\n          priority: 5,\n          reuseExistingChunk: true\n        }\n      }\n    }\n  }\n};\n```\n\n### 2. **Image Optimization**\n\n```html\n\u003C!-- Picture element with srcset for responsive images -->\n\u003Cpicture>\n  \u003Csource media=\"(min-width: 1024px)\" srcset=\"image-large.jpg, image-large@2x.jpg 2x\" \u002F>\n  \u003Csource media=\"(min-width: 640px)\" srcset=\"image-medium.jpg, image-medium@2x.jpg 2x\" \u002F>\n  \u003Csource srcset=\"image-small.jpg, image-small@2x.jpg 2x\" \u002F>\n  \u003Cimg src=\"image-fallback.jpg\" alt=\"Description\" loading=\"lazy\" \u002F>\n\u003C\u002Fpicture>\n\n\u003C!-- WebP format with fallback -->\n\u003Cpicture>\n  \u003Csource srcset=\"image.webp\" type=\"image\u002Fwebp\" \u002F>\n  \u003Cimg src=\"image.jpg\" alt=\"Description\" loading=\"lazy\" \u002F>\n\u003C\u002Fpicture>\n\n\u003C!-- TypeScript Image Component -->\n\u003Cscript lang=\"typescript\">\ninterface ImageProps {\n  src: string;\n  alt: string;\n  width: number;\n  height: number;\n  sizes?: string;\n  loading?: 'lazy' | 'eager';\n}\n\nconst OptimizedImage: React.FC\u003CImageProps> = ({\n  src,\n  alt,\n  width,\n  height,\n  sizes = '100vw',\n  loading = 'lazy'\n}) => {\n  const webpSrc = src.replace(\u002F\\.(jpg|png)$\u002F, '.webp');\n\n  return (\n    \u003Cpicture>\n      \u003Csource srcSet={webpSrc} type=\"image\u002Fwebp\" \u002F>\n      \u003Cimg\n        src={src}\n        alt={alt}\n        width={width}\n        height={height}\n        sizes={sizes}\n        loading={loading}\n        decoding=\"async\"\n      \u002F>\n    \u003C\u002Fpicture>\n  );\n};\n\u003C\u002Fscript>\n```\n\n### 3. **HTTP Caching and Service Workers**\n\n```typescript\n\u002F\u002F service-worker.ts\nconst CACHE_NAME = 'v1';\nconst ASSETS_TO_CACHE = [\n  '\u002F',\n  '\u002Findex.html',\n  '\u002Fcss\u002Fstyle.css',\n  '\u002Fjs\u002Fapp.js'\n];\n\nself.addEventListener('install', (event: ExtendableEvent) => {\n  event.waitUntil(\n    caches.open(CACHE_NAME).then(cache => {\n      return cache.addAll(ASSETS_TO_CACHE);\n    })\n  );\n});\n\nself.addEventListener('fetch', (event: FetchEvent) => {\n  \u002F\u002F Cache first, fall back to network\n  event.respondWith(\n    caches.match(event.request).then(response => {\n      if (response) return response;\n\n      return fetch(event.request).then(response => {\n        \u002F\u002F Clone the response\n        const cloned = response.clone();\n\n        \u002F\u002F Cache successful responses\n        if (response.status === 200) {\n          caches.open(CACHE_NAME).then(cache => {\n            cache.put(event.request, cloned);\n          });\n        }\n\n        return response;\n      }).catch(() => {\n        \u002F\u002F Return offline page if available\n        return caches.match('\u002Foffline.html');\n      });\n    })\n  );\n});\n\n\u002F\u002F Register service worker\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('\u002Fservice-worker.js')\n      .catch(err => console.error('SW registration failed:', err));\n  });\n}\n```\n\n### 4. **Gzip Compression and Asset Optimization**\n\n```javascript\n\u002F\u002F webpack.config.js with compression\nconst CompressionPlugin = require('compression-webpack-plugin');\nconst TerserPlugin = require('terser-webpack-plugin');\n\nmodule.exports = {\n  mode: 'production',\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new TerserPlugin({\n        terserOptions: {\n          compress: {\n            drop_console: true\n          }\n        }\n      })\n    ]\n  },\n  plugins: [\n    new CompressionPlugin({\n      algorithm: 'gzip',\n      test: \u002F\\.(js|css|html|svg)$\u002F,\n      threshold: 8192,\n      minRatio: 0.8\n    })\n  ]\n};\n\n\u002F\u002F .htaccess (Apache)\n\u003CIfModule mod_deflate.c>\n  AddOutputFilterByType DEFLATE text\u002Fhtml text\u002Fplain text\u002Fxml text\u002Fcss text\u002Fjavascript application\u002Fjavascript\n\u003C\u002FIfModule>\n\n# nginx.conf\ngzip on;\ngzip_types text\u002Fplain text\u002Fcss application\u002Fjson application\u002Fjavascript text\u002Fxml application\u002Fxml application\u002Fxml+rss text\u002Fjavascript;\ngzip_min_length 1000;\ngzip_proxied any;\n```\n\n### 5. **Performance Monitoring**\n\n```typescript\n\u002F\u002F utils\u002FperformanceMonitor.ts\ninterface PerformanceMetrics {\n  fcp: number;  \u002F\u002F First Contentful Paint\n  lcp: number;  \u002F\u002F Largest Contentful Paint\n  cls: number;  \u002F\u002F Cumulative Layout Shift\n  fid: number;  \u002F\u002F First Input Delay\n  ttfb: number; \u002F\u002F Time to First Byte\n}\n\nexport const observeWebVitals = (callback: (metrics: Partial\u003CPerformanceMetrics>) => void) => {\n  const metrics: Partial\u003CPerformanceMetrics> = {};\n\n  \u002F\u002F LCP\n  const lcpObserver = new PerformanceObserver((list) => {\n    const entries = list.getEntries();\n    const lastEntry = entries[entries.length - 1];\n    metrics.lcp = lastEntry.renderTime || lastEntry.loadTime;\n    callback(metrics);\n  });\n\n  try {\n    lcpObserver.observe({ entryTypes: ['largest-contentful-paint'] });\n  } catch (e) {\n    console.warn('LCP observer not supported');\n  }\n\n  \u002F\u002F CLS\n  const clsObserver = new PerformanceObserver((list) => {\n    for (const entry of list.getEntries()) {\n      if (!(entry as any).hadRecentInput) {\n        metrics.cls = (metrics.cls || 0) + (entry as any).value;\n        callback(metrics);\n      }\n    }\n  });\n\n  try {\n    clsObserver.observe({ entryTypes: ['layout-shift'] });\n  } catch (e) {\n    console.warn('CLS observer not supported');\n  }\n\n  \u002F\u002F FID via INP\n  const inputObserver = new PerformanceObserver((list) => {\n    const entries = list.getEntries();\n    const firstEntry = entries[0];\n    metrics.fid = firstEntry.processingDuration;\n    callback(metrics);\n  });\n\n  try {\n    inputObserver.observe({ entryTypes: ['first-input', 'event'] });\n  } catch (e) {\n    console.warn('FID observer not supported');\n  }\n\n  \u002F\u002F TTFB\n  const navigationTiming = performance.getEntriesByType('navigation')[0];\n  if (navigationTiming) {\n    metrics.ttfb = (navigationTiming as any).responseStart - (navigationTiming as any).requestStart;\n    callback(metrics);\n  }\n};\n\n\u002F\u002F Usage\nobserveWebVitals((metrics) => {\n  console.log('Performance metrics:', metrics);\n  \u002F\u002F Send to analytics\n  fetch('\u002Fapi\u002Fmetrics', {\n    method: 'POST',\n    body: JSON.stringify(metrics)\n  });\n});\n\n\u002F\u002F Chrome DevTools Protocol for performance testing\nimport puppeteer from 'puppeteer';\n\nasync function measurePagePerformance(url: string) {\n  const browser = await puppeteer.launch();\n  const page = await browser.newPage();\n\n  await page.goto(url, { waitUntil: 'networkidle2' });\n\n  const metrics = JSON.parse(\n    await page.evaluate(() => JSON.stringify(window.performance))\n  );\n\n  console.log('Page Load Time:', metrics.timing.loadEventEnd - metrics.timing.navigationStart);\n  console.log('DOM Content Loaded:', metrics.timing.domContentLoadedEventEnd - metrics.timing.navigationStart);\n\n  await browser.close();\n}\n```\n\n## Best Practices\n\n- Minimize bundle size with code splitting\n- Optimize images with appropriate formats\n- Implement lazy loading strategically\n- Use HTTP caching headers\n- Enable gzip\u002Fbrotli compression\n- Monitor Core Web Vitals continuously\n- Implement service workers\n- Defer non-critical JavaScript\n- Optimize critical rendering path\n- Test on real devices and networks\n\n## Resources\n\n- [Web Vitals](https:\u002F\u002Fweb.dev\u002Fvitals\u002F)\n- [Google PageSpeed Insights](https:\u002F\u002Fpagespeed.web.dev\u002F)\n- [Lighthouse](https:\u002F\u002Fdevelopers.google.com\u002Fweb\u002Ftools\u002Flighthouse)\n- [WebPageTest](https:\u002F\u002Fwww.webpagetest.org\u002F)\n- [Performance API](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FPerformance)\n","# Web Performance Optimization\n\n## Overview\n\nImplement performance optimization strategies including lazy loading, code splitting, caching, compression, and monitoring to improve Core Web Vitals and user experience.\n\n## When to Use\n\n- Slow page load times\n- High Largest Contentful Paint (LCP)\n- Large bundle sizes\n- Frequent Cumulative Layout Shift (CLS)\n- Mobile performance issues\n\n## Implementation Examples\n\n### 1. **Code Splitting and Lazy Loading (React)**\n\n```typescript\n\u002F\u002F utils\u002FlazyLoad.ts\nimport React from 'react';\n\nexport const lazyLoad = (importStatement: Promise\u003Cany>) => {\n  return React.lazy(() =>\n    importStatement.then(module => ({\n      default: module.default\n    }))\n  );\n};\n\n\u002F\u002F routes.tsx\nimport { lazyLoad } from '.\u002Futils\u002FlazyLoad';\n\nexport const routes = [\n  {\n    path: '\u002F',\n    component: () => import('.\u002Fpages\u002FHome'),\n    lazy: lazyLoad(import('.\u002Fpages\u002FHome'))\n  },\n  {\n    path: '\u002Fdashboard',\n    lazy: lazyLoad(import('.\u002Fpages\u002FDashboard'))\n  },\n  {\n    path: '\u002Fusers',\n    lazy: lazyLoad(import('.\u002Fpages\u002FUsers'))\n  }\n];\n\n\u002F\u002F App.tsx with Suspense\nimport { Suspense } from 'react';\nimport { BrowserRouter, Routes, Route } from 'react-router-dom';\n\nexport const App = () => {\n  return (\n    \u003CBrowserRouter>\n      \u003CSuspense fallback={\u003CLoadingSpinner \u002F>}>\n        \u003CRoutes>\n          {routes.map(route => (\n            \u003CRoute key={route.path} path={route.path} element={\u003Croute.lazy \u002F>} \u002F>\n          ))}\n        \u003C\u002FRoutes>\n      \u003C\u002FSuspense>\n    \u003C\u002FBrowserRouter>\n  );\n};\n\n\u002F\u002F webpack.config.js\nmodule.exports = {\n  optimization: {\n    splitChunks: {\n      chunks: 'all',\n      cacheGroups: {\n        vendor: {\n          test: \u002F[\\\\\u002F]node_modules[\\\\\u002F]\u002F,\n          name: 'vendors',\n          priority: 10\n        },\n        common: {\n          minChunks: 2,\n          priority: 5,\n          reuseExistingChunk: true\n        }\n      }\n    }\n  }\n};\n```\n\n### 2. **Image Optimization**\n\n```html\n\u003C!-- Picture element with srcset for responsive images -->\n\u003Cpicture>\n  \u003Csource media=\"(min-width: 1024px)\" srcset=\"image-large.jpg, image-large@2x.jpg 2x\" \u002F>\n  \u003Csource media=\"(min-width: 640px)\" srcset=\"image-medium.jpg, image-medium@2x.jpg 2x\" \u002F>\n  \u003Csource srcset=\"image-small.jpg, image-small@2x.jpg 2x\" \u002F>\n  \u003Cimg src=\"image-fallback.jpg\" alt=\"Description\" loading=\"lazy\" \u002F>\n\u003C\u002Fpicture>\n\n\u003C!-- WebP format with fallback -->\n\u003Cpicture>\n  \u003Csource srcset=\"image.webp\" type=\"image\u002Fwebp\" \u002F>\n  \u003Cimg src=\"image.jpg\" alt=\"Description\" loading=\"lazy\" \u002F>\n\u003C\u002Fpicture>\n\n\u003C!-- TypeScript Image Component -->\n\u003Cscript lang=\"typescript\">\ninterface ImageProps {\n  src: string;\n  alt: string;\n  width: number;\n  height: number;\n  sizes?: string;\n  loading?: 'lazy' | 'eager';\n}\n\nconst OptimizedImage: React.FC\u003CImageProps> = ({\n  src,\n  alt,\n  width,\n  height,\n  sizes = '100vw',\n  loading = 'lazy'\n}) => {\n  const webpSrc = src.replace(\u002F\\.(jpg|png)$\u002F, '.webp');\n\n  return (\n    \u003Cpicture>\n      \u003Csource srcSet={webpSrc} type=\"image\u002Fwebp\" \u002F>\n      \u003Cimg\n        src={src}\n        alt={alt}\n        width={width}\n        height={height}\n        sizes={sizes}\n        loading={loading}\n        decoding=\"async\"\n      \u002F>\n    \u003C\u002Fpicture>\n  );\n};\n\u003C\u002Fscript>\n```\n\n### 3. **HTTP Caching and Service Workers**\n\n```typescript\n\u002F\u002F service-worker.ts\nconst CACHE_NAME = 'v1';\nconst ASSETS_TO_CACHE = [\n  '\u002F',\n  '\u002Findex.html',\n  '\u002Fcss\u002Fstyle.css',\n  '\u002Fjs\u002Fapp.js'\n];\n\nself.addEventListener('install', (event: ExtendableEvent) => {\n  event.waitUntil(\n    caches.open(CACHE_NAME).then(cache => {\n      return cache.addAll(ASSETS_TO_CACHE);\n    })\n  );\n});\n\nself.addEventListener('fetch', (event: FetchEvent) => {\n  \u002F\u002F Cache first, fall back to network\n  event.respondWith(\n    caches.match(event.request).then(response => {\n      if (response) return response;\n\n      return fetch(event.request).then(response => {\n        \u002F\u002F Clone the response\n        const cloned = response.clone();\n\n        \u002F\u002F Cache successful responses\n        if (response.status === 200) {\n          caches.open(CACHE_NAME).then(cache => {\n            cache.put(event.request, cloned);\n          });\n        }\n\n        return response;\n      }).catch(() => {\n        \u002F\u002F Return offline page if available\n        return caches.match('\u002Foffline.html');\n      });\n    })\n  );\n});\n\n\u002F\u002F Register service worker\nif ('serviceWorker' in navigator) {\n  window.addEventListener('load', () => {\n    navigator.serviceWorker.register('\u002Fservice-worker.js')\n      .catch(err => console.error('SW registration failed:', err));\n  });\n}\n```\n\n### 4. **Gzip Compression and Asset Optimization**\n\n```javascript\n\u002F\u002F webpack.config.js with compression\nconst CompressionPlugin = require('compression-webpack-plugin');\nconst TerserPlugin = require('terser-webpack-plugin');\n\nmodule.exports = {\n  mode: 'production',\n  optimization: {\n    minimize: true,\n    minimizer: [\n      new TerserPlugin({\n        terserOptions: {\n          compress: {\n            drop_console: true\n          }\n        }\n      })\n    ]\n  },\n  plugins: [\n    new CompressionPlugin({\n      algorithm: 'gzip',\n      test: \u002F\\.(js|css|html|svg)$\u002F,\n      threshold: 8192,\n      minRatio: 0.8\n    })\n  ]\n};\n\n\u002F\u002F .htaccess (Apache)\n\u003CIfModule mod_deflate.c>\n  AddOutputFilterByType DEFLATE text\u002Fhtml text\u002Fplain text\u002Fxml text\u002Fcss text\u002Fjavascript application\u002Fjavascript\n\u003C\u002FIfModule>\n\n# nginx.conf\ngzip on;\ngzip_types text\u002Fplain text\u002Fcss application\u002Fjson application\u002Fjavascript text\u002Fxml application\u002Fxml application\u002Fxml+rss text\u002Fjavascript;\ngzip_min_length 1000;\ngzip_proxied any;\n```\n\n### 5. **Performance Monitoring**\n\n```typescript\n\u002F\u002F utils\u002FperformanceMonitor.ts\ninterface PerformanceMetrics {\n  fcp: number;  \u002F\u002F First Contentful Paint\n  lcp: number;  \u002F\u002F Largest Contentful Paint\n  cls: number;  \u002F\u002F Cumulative Layout Shift\n  fid: number;  \u002F\u002F First Input Delay\n  ttfb: number; \u002F\u002F Time to First Byte\n}\n\nexport const observeWebVitals = (callback: (metrics: Partial\u003CPerformanceMetrics>) => void) => {\n  const metrics: Partial\u003CPerformanceMetrics> = {};\n\n  \u002F\u002F LCP\n  const lcpObserver = new PerformanceObserver((list) => {\n    const entries = list.getEntries();\n    const lastEntry = entries[entries.length - 1];\n    metrics.lcp = lastEntry.renderTime || lastEntry.loadTime;\n    callback(metrics);\n  });\n\n  try {\n    lcpObserver.observe({ entryTypes: ['largest-contentful-paint'] });\n  } catch (e) {\n    console.warn('LCP observer not supported');\n  }\n\n  \u002F\u002F CLS\n  const clsObserver = new PerformanceObserver((list) => {\n    for (const entry of list.getEntries()) {\n      if (!(entry as any).hadRecentInput) {\n        metrics.cls = (metrics.cls || 0) + (entry as any).value;\n        callback(metrics);\n      }\n    }\n  });\n\n  try {\n    clsObserver.observe({ entryTypes: ['layout-shift'] });\n  } catch (e) {\n    console.warn('CLS observer not supported');\n  }\n\n  \u002F\u002F FID via INP\n  const inputObserver = new PerformanceObserver((list) => {\n    const entries = list.getEntries();\n    const firstEntry = entries[0];\n    metrics.fid = firstEntry.processingDuration;\n    callback(metrics);\n  });\n\n  try {\n    inputObserver.observe({ entryTypes: ['first-input', 'event'] });\n  } catch (e) {\n    console.warn('FID observer not supported');\n  }\n\n  \u002F\u002F TTFB\n  const navigationTiming = performance.getEntriesByType('navigation')[0];\n  if (navigationTiming) {\n    metrics.ttfb = (navigationTiming as any).responseStart - (navigationTiming as any).requestStart;\n    callback(metrics);\n  }\n};\n\n\u002F\u002F Usage\nobserveWebVitals((metrics) => {\n  console.log('Performance metrics:', metrics);\n  \u002F\u002F Send to analytics\n  fetch('\u002Fapi\u002Fmetrics', {\n    method: 'POST',\n    body: JSON.stringify(metrics)\n  });\n});\n\n\u002F\u002F Chrome DevTools Protocol for performance testing\nimport puppeteer from 'puppeteer';\n\nasync function measurePagePerformance(url: string) {\n  const browser = await puppeteer.launch();\n  const page = await browser.newPage();\n\n  await page.goto(url, { waitUntil: 'networkidle2' });\n\n  const metrics = JSON.parse(\n    await page.evaluate(() => JSON.stringify(window.performance))\n  );\n\n  console.log('Page Load Time:', metrics.timing.loadEventEnd - metrics.timing.navigationStart);\n  console.log('DOM Content Loaded:', metrics.timing.domContentLoadedEventEnd - metrics.timing.navigationStart);\n\n  await browser.close();\n}\n```\n\n## Best Practices\n\n- Minimize bundle size with code splitting\n- Optimize images with appropriate formats\n- Implement lazy loading strategically\n- Use HTTP caching headers\n- Enable gzip\u002Fbrotli compression\n- Monitor Core Web Vitals continuously\n- Implement service workers\n- Defer non-critical JavaScript\n- Optimize critical rendering path\n- Test on real devices and networks\n\n## Resources\n\n- [Web Vitals](https:\u002F\u002Fweb.dev\u002Fvitals\u002F)\n- [Google PageSpeed Insights](https:\u002F\u002Fpagespeed.web.dev\u002F)\n- [Lighthouse](https:\u002F\u002Fdevelopers.google.com\u002Fweb\u002Ftools\u002Flighthouse)\n- [WebPageTest](https:\u002F\u002Fwww.webpagetest.org\u002F)\n- [Performance API](https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FPerformance)\n",{"name":5,"description":7},"main","716b17df3ef6719d88aeac180015008b7ddfff6f",".agents\u002Fskills\u002Fweb-performance-optimization",0,"https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment","https:\u002F\u002Fgithub.com\u002Fray-manaloto","2026-08-03 16:55:50",{"source":9,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add ray-manaloto\u002Fmacos-development-environment --skill web-performance-optimization",{"tool":61,"command":62},"bunx","bunx skills add ray-manaloto\u002Fmacos-development-environment --skill web-performance-optimization",{"tool":64,"command":65},"pnpm","pnpm dlx skills add ray-manaloto\u002Fmacos-development-environment --skill web-performance-optimization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fweb-performance-optimization\u002FSKILL.md",true,[69,75,79],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"agents\u002Fopenai.yaml","REFERENCE","参考文档",77,"https:\u002F\u002Fgithub.com\u002Ffernando-delosrios-sp\u002Fsailpoint-utils\u002Fblob\u002Fmain\u002FEntro\u002Fentro-connect\u002F.agents\u002Fskills\u002Ftdd\u002Fagents\u002Fopenai.yaml",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"mocking.md",1481,"https:\u002F\u002Fgithub.com\u002Ffernando-delosrios-sp\u002Fsailpoint-utils\u002Fblob\u002Fmain\u002FEntro\u002Fentro-connect\u002F.agents\u002Fskills\u002Ftdd\u002Fmocking.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"tests.md",2214,"https:\u002F\u002Fgithub.com\u002Ffernando-delosrios-sp\u002Fsailpoint-utils\u002Fblob\u002Fmain\u002FEntro\u002Fentro-connect\u002F.agents\u002Fskills\u002Ftdd\u002Ftests.md",[84,100,118,137,154,168],{"skillNo":85,"name":86,"nameZh":13,"description":87,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":43},"01M6CC8DXNJ39YWERYTWCGGCGG","next-workflow-step","Use this skill when the user wants to transition to the next workflow step, wrap up a session cleanly, prepare a handoff, or says things like \"next step\", \"continue the workflow\", \"wrap up\", \"hand off\", \"move to the next phase\", \"what's next in embrace\", or \"prepare for \u002Fclear\". Also triggers when the current octo:embrace phase appears complete and no explicit next action is set.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fworkflow-toolkit\u002Fskills\u002Fnext-workflow-step\u002FSKILL.md",[],[91,92,93,42,94,41,95,96,97,98,99],"next workflow step","workflow","up","session","wrap up","continue","handoff","prepare","SET",{"skillNo":101,"name":102,"nameZh":13,"description":103,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":43},"01M6CC8BRZBQHEBXGMKPDM422P","source-discovery","This skill should be used when the user asks to \"find sources\", \"discover URLs\", \"catalog a source\", \"classify a URL\", \"search for libraries\", \"check what exists\", or mentions source discovery, URL cataloging, source classification, or research source management.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fresearch-review-toolkit\u002Fskills\u002Fsource-discovery\u002FSKILL.md",[],[107,108,109,110,111,112,113,114,115,41,116,117],"discovery","source discovery","research","libraries","search","classification","find","check","management","catalog","find sources",{"skillNo":119,"name":120,"nameZh":13,"description":121,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":43},"01M6CC89CGJP69A0PS22G2H1FV","review-synthesis","This skill should be used when the user asks to \"summarize review findings\", \"prioritize fixes\", \"rank review issues\", \"combine reviewer feedback\", \"create action items from review\", or mentions review synthesis, finding prioritization, severity ranking, or review result summarization.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fresearch-review-toolkit\u002Fskills\u002Freview-synthesis\u002FSKILL.md",[],[125,126,127,128,129,130,131,41,132,133,134,135,136],"review","review synthesis","Synthesis","prioritize","create action","feedback","reviewer","summarize","prioritization","create","issues","severity",{"skillNo":138,"name":139,"nameZh":13,"description":140,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":43},"01M6CC872EZ9GRJY0HRCG0RT2M","research-scoring","This skill should be used when the user asks to \"score research\", \"check research quality\", \"evaluate coverage\", \"measure improvement\", \"assess research completeness\", or mentions research scoring, quality metrics, coverage gaps, improvement baseline, or research pipeline status.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fresearch-review-toolkit\u002Fskills\u002Fresearch-scoring\u002FSKILL.md",[],[144,109,145,146,147,148,149,150,114,41,151,152,153],"research scoring","status","coverage gaps","metrics","pipeline","baseline","quality","coverage","pipeline status","research quality",{"skillNo":155,"name":156,"nameZh":13,"description":157,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":43},"01M6CC852HSDS1FE4EJAT0RHGR","notebooklm-integration","This skill should be used when the user asks to \"ingest into NotebookLM\", \"query NotebookLM\", \"add sources to notebook\", \"cross-source synthesis\", \"check stale sources\", or mentions NotebookLM, notebook integration, source ingestion, or knowledge consolidation.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fresearch-review-toolkit\u002Fskills\u002Fnotebooklm-integration\u002FSKILL.md",[],[161,162,163,164,114,41,165,166,167,127],"notebooklm integration","notebooklm","integration","knowledge","ingestion","ingest","stale",{"skillNo":169,"name":170,"nameZh":13,"description":171,"descriptionZh":13,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":13,"sourceHtmlUrl":172,"categories":173,"keywords":174,"publishedAt":43},"01M6CC82Z4V3205KCJWQZPS2VG","evidence-synthesis","This skill should be used when the user asks to \"synthesize findings\", \"combine research\", \"cross-reference sources\", \"summarize evidence\", \"write a deep review\", or mentions evidence synthesis, finding consolidation, cross-source analysis, or research summarization.","https:\u002F\u002Fgithub.com\u002Fray-manaloto\u002Fmacos-development-environment\u002Fblob\u002Fmain\u002Frsm-subagents\u002Fplugins\u002Fresearch-review-toolkit\u002Fskills\u002Fevidence-synthesis\u002FSKILL.md",[],[175,127,176,132,109,177,178,179,41,180,125],"evidence synthesis","evidence","deep review","analysis","write","reference"]