Communitygithub.com

YepAPI/skills

核心网页指标、懒加载、代码分割与包分析。

skills 是什么?

该技能专注于前端性能优化,涵盖核心网页指标(Core Web Vitals)、懒加载、代码分割、图片优化、包分析、缓存策略和数据库查询调优等关键领域。它提供了一个全面的性能优化规则集,适用于 Next.js、React 等现代前端框架,帮助开发者确保 LCP < 2.5s、INP < 200ms、CLS < 0.1 等指标达标。技能支持通过 React.lazy 和 next/dynamic 实现组件级懒加载,通过路由级代码分割减少首屏加载体积,并通过 WebP/AVIF 图片格式和 next/image 组件优化图片加载性能。此外,它还包括使用 @next/bundle-analyzer 进行包分析以识别大型依赖、HTTP 缓存头和 Service Worker 实现缓存策略、数据库索引优化和 EXPLAIN ANALYZE 慢查询排查,以及通过显式设置元素尺寸避免布局偏移等最佳实践。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/performance

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

性能

规则

  • 核心网页指标:LCP < 2.5s,INP < 200ms,CLS < 0.1
  • 对折叠线以下图片和重型组件进行懒加载:React.lazy()、next/dynamic
  • 路由级代码分割——每个页面只加载自身的代码
  • 优化图片:WebP/AVIF 格式、合适的尺寸、带 sizes 属性的 next/image
  • 包分析:@next/bundle-analyzer——识别大型依赖
  • 缓存:HTTP 缓存头、用于重复访问的 Service Worker、stale-while-revalidate
  • 数据库:为频繁查询的列建立索引,使用 EXPLAIN ANALYZE 查找慢查询
  • 避免布局偏移:为图片、视频和嵌入内容设置明确的尺寸

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

相关技能