Token导航 LogoToken导航

Agent Skill · 研究检索

frontend-fullchain-optimization(前端全链优化)

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

frontend-fullchain-optimization 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 42,497。

总安装 1,069周安装 45GitHub Stars 1下载 374核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frontend-fullchain-optimization(前端全链优化)
来源仓库:https://github.com/mindfold-ai/marketplace
仓库路径:skills/frontend-fullchain-optimization
安装命令:
npx skills add https://github.com/mindfold-ai/marketplace --skill frontend-fullchain-optimization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mindfold-ai/marketplace --skill frontend-fullchain-optimization

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等代码,整理组件结构或定位布局问题。需结合项目现有设计系统、路由和构建方式使用,避免生成孤立片段。涉及页面改动时应配合本地预览和构建检查确认视觉效果。

frontend-fullchain-optimization 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/frontend-fullchain-optimization

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/mindfold-ai/marketplace --skill frontend-fullc…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

frontend-fullchain-optimization 怎么安装?

在终端执行 npx skills add https://github.com/mindfold-ai/marketplace --skill frontend-fullchain-optim…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

frontend-fullchain-optimization 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

frontend-fullchain-optimization 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

frontend-fullchain-optimization 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

frontend-fullchain-optimization 用的人多吗?

公开数据是累计安装 1,069 次,近一周安装 45 次,下载 374 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

frontend-fullchain-optimization 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
frontend-fullchain-optimization

前端全链优化 · 本页

1,0691操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Frontend Full-Chain Performance Optimization Guide

A frontend performance diagnostic and optimization system based on Web Vitals core metrics. Core principle: User-centric — optimization is about doing less, not more.

Metric Threshold Quick Reference

MetricGoodNeeds ImprovementPoorUnitFocus
LCP≤ 2.5s2.5s - 4s> 4sTimeLargest Contentful Paint
FCP≤ 1.8s1.8s - 3s> 3sTimeFirst Contentful Paint
INP≤ 200ms200ms - 500ms> 500msTimeInteraction to Next Paint
CLS≤ 0.10.1 - 0.25> 0.25ScoreVisual Stability
TTFB≤ 800ms800ms - 1.8s> 1.8sTimeTime to First Byte
FID≤ 100ms100ms - 300ms> 300msTimeFirst Input Delay
TBTTasks > 50ms are long tasks——TimeTotal Blocking Time

Measurement advice: Don't rely on a single P75. Combine P60/P75/P90/P99 percentiles with daily avg/max/min trend lines. Desktop: target P98+; Mobile core pages: target P95–P99.

Diagnostic Decision Tree

Page loads slowly?
├── TTFB > 800ms → Network/server issue → See "TTFB Optimization"
├── FCP > 1.8s → Resource blocking/large files → See "FCP Optimization"
├── LCP > 2.5s
│   ├── TTFB & FCP normal → Slow viewport resource loading → See "LCP Optimization"
│   └── TTFB or FCP abnormal → Fix upstream metrics first
├── INP > 200ms → Long tasks blocking main thread → See "INP Optimization"
├── CLS > 0.1 → Layout shifts → See "CLS Optimization"
└── Lighthouse Performance Score
    ├── > 80: Few issues
    ├── 60-80: Needs focused analysis, priority: FCP → LCP → CLS
    └── < 60: Severe issues, full audit required

INP Optimization (Interaction Responsiveness)

Diagnosis: Chrome Performance panel — look for long tasks (> 50ms, highlighted red); inspect event handler duration in the flame chart.

Strategy — Break long tasks into shorter ones:

MethodMechanismUse Case
setTimeout(fn, 0)Creates a new macrotask at the end of the queueNon-urgent network requests, DB operations
Promise.resolve().then(fn)Creates a microtask, runs immediately after current macrotaskSecondary tasks needing faster execution
requestAnimationFrame(fn)Runs before next repaintRendering-related tasks
requestIdleCallback(fn)Lowest priority, runs when main thread is idleAnalytics, logging
scheduler.postTask(fn, {priority})Fine-grained priority controlScenarios requiring precise scheduling

postTask priorities: user-blocking (high) > user-visible (medium) > background (low)

Layout & Rendering Optimization:

  • Reduce calc() usage frequency; avoid unnecessary pseudo-class selectors (nth-child, nth-last-child, not())
  • Avoid frequent JS modifications to element position/size; use className or cssText for batch updates
  • Avoid alternating DOM read/write in loops (layout thrashing): cache reads into variables first, then batch write
  • Use skeleton screens for lazy-loaded content
  • Use <></> (Fragment) instead of meaningless <div> wrappers
  • DOM nodes > 800: caution; > 1400: excessive
  • Use virtualization for long lists (react-window / vue-virtual-scroll-list)
  • Swiper lists: preload only current item ± 1

CSS Optimization:

  • Avoid table layout; reduce deeply nested CSS selectors
  • Use GPU-accelerated animations: transform/opacity trigger compositing layer; avoid top/left which trigger reflow
  • Use semantic HTML elements; avoid meaningless tags (e.g., use <button> not <div> for buttons)

TTFB Optimization (Network & Server)

Diagnostic formula: TTFB ≈ HTTP request time + Server processing time + HTTP response time

Diagnosis: DevTools Network panel → click request → Timing → "Waiting for server response" = TTFB.

TTFB differences by page type: Static pages (CDN direct, fastest) < SPA (tiny HTML shell, near-static) < SSR (Node.js computation required, slowest). Adjust baseline by page type.

DirectionStrategy
GeneralCDN acceleration (solves 90%+; proactively purge CDN cache after deploys), HTTP/2 multiplexing, Gzip compression, code splitting & dynamic imports
UXWeb Workers for heavy requests, DNS prefetch <link rel="dns-prefetch">, preconnect <link rel="preconnect">
Server (SSR)Internal network for APIs, Redis cache for low-frequency data, reduce redirects, pre-generate static pages at build time
Resource CachingApp hot-update: pre-download HTML/JS/CSS locally (TTFB ≈ 0), PWA Service Worker offline cache

FCP Optimization (White Screen & First Content)

Diagnostic formula: FCP ≈ TTFB + Resource download time + DOM parse time + Render time

White screen time ≈ FCP time. Target: instant open (< 1s).

StrategyDetails
Remove render-blocking resourcesAdd defer or async to script tags; non-critical JS → NPM bundle or framework components (e.g., next/script)
Reduce JS/CSS sizeRemove unused code, Tree Shaking, code splitting
Control network payloadCompress above-fold images, use WebP/AVIF, lazy-load videos with placeholders
Caching strategyCache-Control: max-age=31536000 (static assets cached 1 year); JS/CSS as needed
Shorten critical request depthReduce nested resource dependencies (e.g., CSS @import chains); flatten critical resource request chains
Font optimizationSee "Font Optimization Strategies" below
White screen solutionsPWA (international markets); App hot-update local loading (domestic markets)

Font Optimization Strategies

ApproachDescription
Limit font countUse only one custom font + system font fallback; don't use different Web Fonts for body and p
Prefer WOFF230% better compression than WOFF, supported by all modern browsers
unicode-range subsettingDefine character ranges (e.g., CJK U+4E00-9FA5); browser downloads only needed subsets
local() local fontsFor apps with bundled fonts: src: local('Font Name'), url(...) reads local font first, no network request
font-display strategyswap: system font first then replace (lowest CLS); optional: with preload (no re-layout on failure); block: wait (blocks rendering); fallback/auto: compromise
CSS Font Loading APInew FontFace() + font.load() + document.fonts.ready.then() — programmatic control of font download timing and swap logic
Slow network fallbackUse navigator.connection to detect; slow users get system default fonts

LCP Optimization (Largest Contentful Paint)

Diagnosis: Performance panel — find the LCP marker element; Lighthouse report "Largest Contentful Paint element" entry.

4 element types LCP can mark:

  1. <img> elements (most common) and <image> within SVG
  2. <video> poster attribute image or first frame
  3. Elements with CSS url() background images
  4. Block-level elements containing text nodes

Key insights:

  • LCP time is always ≥ FCP time
  • If TTFB and FCP are normal but LCP is abnormal → problem is viewport resource loading
  • SPA: FCP matters more than LCP; SSR/MPA: LCP matters more than FCP
StrategyDetails
Preload LCP image<link rel="preload" href="..." as="image">
Framework image componentsUse next/image (includes priority & format optimization); set priority={true}
Split large imagesSlice large background images into smaller pieces
Image formatPNG/JPEG → WebP/AVIF, saves 30%+ size
Cloud image paramsDynamically set image size/quality/format per device (e.g., Alibaba Cloud OSS params)
Rich text imagesExtract image URLs from content, set <link rel="preload"> in advance
Avoid duplicate preloadsWhen using framework image components (e.g., next/image) with priority, don't also add manual <link rel="preload"> — duplicates waste bandwidth

Sampling advice: PV < 1M → full LCP collection; above that → ratio sampling or threshold-based reporting.

CLS Optimization (Layout Shift)

Diagnostic formula: Layout shift score = Impact fraction × Distance fraction, CLS = SUM(all shift scores)

Key conclusion: The farther the element shifts + the more viewport area affected → higher CLS.

ScenarioOptimization Strategy
ImagesSet width/height on all <img>; use aspect-ratio for mobile; use srcset/<picture> for responsive images
Dynamic contentReserve fixed-size placeholder containers for ads/iframes; avoid inserting content at top of viewport without interaction; inserting near bottom has less CLS impact
CSS animationsUse transform instead of top/left/width/height; use transform: scale() instead of changing dimensions
Fontsfont-display: optional + preload; or font-display: swap to reduce CLS impact

General Optimization Tips

TipDescription
Network awarenessnavigator.connection.effectiveType to detect 2G/3G/4G; degrade for slow users (smaller images, system fonts, less loading)
SVG iconsAll small icons (< 5KB / < 50px) should use SVG instead of images to reduce async requests
Responsive degradationCSS media queries split CSS by screen size; skip background images on small screens
Cache-firstCache list data in LocalStorage; render cache first then async refresh to reduce white screen
Request mergingMerge resources, reduce HTTP request count and domain count
Rendering modeChoose SSR (fast first paint) / CSR (strong interactivity) / SSG (static content) by scenario

Practical Examples with External Services

The following examples demonstrate how to implement strategies with CDN, OSS, Redis, and other external services.

Example 1: Alibaba Cloud OSS — Adaptive Image Quality by Network

Use case: Prioritize visible content for slow-network users; reduce image size and download time.

const BASE_IMAGE_URL =
  "https://oss-console-img-demo-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/example.jpg";

function getNetworkLevel() {
  const connection = navigator.connection || {};
  const type = connection.effectiveType || "4g";
  // Slow network: slow-2g / 2g / 3g
  if (/slow-2g|2g|3g/.test(type)) return "slow";
  return "fast";
}

function buildOssImageUrl(baseUrl) {
  const level = getNetworkLevel();
  // OSS image processing params: lower resolution + quality for slow networks
  const ossParams =
    level === "slow"
      ? "x-oss-process=image/resize,w_100/quality,q_60/format,webp"
      : "x-oss-process=image/resize,w_300/quality,q_82/format,webp";

  return `${baseUrl}?${ossParams}`;
}

function updateHeroImage(imgEl) {
  imgEl.src = buildOssImageUrl(BASE_IMAGE_URL);
}

const heroImage = document.querySelector("#hero-image");
if (heroImage) {
  updateHeroImage(heroImage);
  // Update resource strategy on network change
  navigator.connection?.addEventListener("change", () => updateHeroImage(heroImage));
}

Example 2: CDN Proactive Purge (Post-Deploy)

Use case: Prevent CDN serving stale resources after SPA deployment, avoiding version inconsistencies.

# Executed by CI/CD or server-side — never expose keys in frontend
# Example: proactively purge entry HTML and critical static assets after deploy
curl -X POST "https://your-cdn-provider.example.com/purge" \
  -H "Authorization: Bearer $CDN_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "urls": [
      "https://example.com/index.html",
      "https://example.com/assets/app.abc123.js",
      "https://example.com/assets/app.abc123.css"
    ]
  }'

Example 3: SSR + Redis Cache to Reduce TTFB

Use case: SSR pages reading low-frequency config or first-screen data; reduce DB/remote API latency per request.

// Node.js (SSR) example
import Redis from "ioredis";

const redis = new Redis(process.env.REDIS_URL);

export async function getHomepageData() {
  const cacheKey = "homepage:data:v1";
  const cached = await redis.get(cacheKey);
  if (cached) return JSON.parse(cached);

  // Assume this is a slow API or DB query
  const data = await fetch("https://api.example.com/homepage").then((r) => r.json());

  // Cache for 60s to reduce backend pressure under high concurrency
  await redis.set(cacheKey, JSON.stringify(data), "EX", 60);
  return data;
}

Tool Usage Recommendations

Tool ModeUse Case
Lighthouse Navigation modeFull process analysis from request to load complete for a single page
Lighthouse Timespan modeINP/CLS analysis for SPA route transitions and form interactions
Lighthouse Snapshot modeAnalysis of campaigns, animations, and changing-state pages
Performance panelFlame chart for long tasks, timeline for resource loading order, frame-by-frame layout shift analysis
Network panelRequest count/total size/TTFB/queue time — determine if CDN/prefetch/HTTP2 is needed

Key Analysis Paths:

  1. FCP appears late → Check JS/CSS load time; for SSR check server API latency
  2. Long gap between FP and FCP → Check long tasks blocking rendering
  3. Large gap between FCP and LCP → Too many or too large viewport resources; SSR underutilized
  4. CLS spikes multiple times → Total > 0.25 needs priority fix

Manual Measurement Requirement

  • By default, treat Lighthouse and Performance evidence as manually collected data
  • Prefer measuring the same page/route 2–3 times and using the median result
  • Record device type, browser version, network condition, and whether the page is SPA / SSR / SSG
  • If possible, keep the measurement environment stable between before/after comparisons

Recommended manual collection flow

  1. Open Chrome DevTools
  2. Run Lighthouse manually for the target page or route
  3. Record the key metrics: LCP / FCP / INP / CLS / TTFB
  4. Open the Performance panel and manually record a trace for the same scenario
  5. Use the Network panel to confirm TTFB, request waterfalls, and heavy resources
  6. Keep screenshots or exported traces as evidence for before/after comparison

If Manual Measurement Is Missing

If the user has no manual Lighthouse or Performance measurements yet, do not claim a root cause with certainty.

Instead:

  1. Explicitly state that the diagnosis is inferred without manual measurement
  2. Give hypothesis-based suggestions according to visible symptoms, code structure, and page type
  3. Label each suggestion with the metric it is most likely to improve
  4. Recommend manually measuring Lighthouse and Performance after the change

Suggested fallback advice without manual data

  • If the page visibly shows a long white screen → prioritize FCP suggestions
  • If the hero image or first screen content appears late → prioritize LCP suggestions
  • If clicking or typing feels delayed → prioritize INP / TBT suggestions
  • If the page jumps during load → prioritize CLS suggestions
  • If the whole page starts slowly before any content appears → prioritize TTFB suggestions

These recommendations are best-effort hypotheses, not verified conclusions.

Standalone Usage Mode

This Skill contains executable judgment criteria, optimization strategies, code examples, and external service implementation patterns. It can be used independently without requiring access to any course documents.

Standard Execution Flow

  1. Collect current state

- Get core metrics: LCP/FCP/INP/CLS/TTFB (at least P75 and daily average) - Gather evidence from manual Lighthouse + Performance + Network measurements

  1. Determine priority

- Fix worst metrics (Poor) first, then Needs Improvement - Suggested order: FCP → LCP → CLS → INP → TTFB (adjust per business needs)

  1. Match strategy

- Follow this Skill's diagnostic decision tree to select the corresponding optimization branch - For external services, prefer the "Practical Examples" section above

  1. Implement & verify

- Small incremental commits; one type of optimization per change - If possible, re-test 2–3 times using median values to confirm real improvement

  1. Document & prevent regression

- Record metrics before and after changes - Consider adding key checks to CI (Lighthouse / performance budgets)

Delivery Template

## Optimization Target
- Page/Feature:
- Target Metric:
- Current Value:
- Target Value:

## Evidence
- Manual Lighthouse evidence:
- Manual Performance evidence:
- Network evidence:

## Execution Strategy
- Approach:
- External services involved:
- Risk & rollback:

## Result Verification
- Before:
- After:
- Conclusion:

Usage Constraints

  • Don't sacrifice core functionality correctness for perceived speed
  • Don't treat a single user's anomaly as a global performance issue
  • Don't claim optimization success without verification
  • If manual Lighthouse / Performance measurement is missing, clearly mark the advice as inferred and recommend follow-up validation

平台分布

Codex

33.77%
按下载量换算126

Claude

31.88%
按下载量换算119

Cursor

17.57%
按下载量换算66

Gemini CLI

9.71%
按下载量换算36

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills