Frontend Patterns
kurealnum/dotfiles
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
Guide for performance optimization in Mobazha including React rendering optimization, code splitting, Web Vitals monitoring, and utility functions for debounce/throttle/memoize.
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mobazha/mobazha-unified performance-guide --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/performance-guide .claude/skills/performance-guide && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .claude/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guideType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mobazha/mobazha-unified performance-guide --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.cursor/skills/performance-guide .agents/skills/performance-guide && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .agents/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mobazha/mobazha-unified performance-guide --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.cursor/skills/performance-guide .cursor/skills/performance-guide && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .cursor/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mobazha/mobazha-unified.git --path .cursor/skills/performance-guide--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mobazha/mobazha-unified performance-guide --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.cursor/skills/performance-guide .gemini/skills/performance-guide && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .gemini/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mobazha/mobazha-unified performance-guideInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .github/skills && cp -r skills-src/.cursor/skills/performance-guide .github/skills/performance-guide && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .github/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mobazha/mobazha-unified --skill performance-guide -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mobazha/mobazha-unified performance-guide --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mobazha/mobazha-unified.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.cursor/skills/performance-guide .opencode/skills/performance-guide && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "performance-guide" agent skill from https://github.com/mobazha/mobazha-unified/tree/main/.cursor/skills/performance-guide into .opencode/skills/performance-guide/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "performance-guide", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
performance-guideGuide for performance optimization in Mobazha including React rendering optimization, code splitting, Web Vitals monitoring, and utility functions for debounce/throttle/memoize.
Performance Guide is an agent skill from mobazha/mobazha-unified. Guide for performance optimization in Mobazha including React rendering optimization, code splitting, Web Vitals monitoring, and utility functions for debounce/throttle/memoize. Use when optimizing performance, fixing slow renders, or working with large lists, "性能优化", "渲染优化", "代码分割", "Web Vitals", "虚拟列表", "懒加载".
Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Frontend & Design, covering Web performance, Performance optimization and State management. It works with React. The repository describes itself as: Open-source commerce frontend for storefronts, marketplaces, checkout, and seller management. The licence is MPL-2.0.
Read from SKILL.md and the folder at commit 156c699. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Performance Guide loads about 1.3k tokens when it runs. Until then it costs about 83 tokens; SKILL.md has 110 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mobazha/mobazha-unified at commit 156c699, republished under its MPL-2.0 licence (© mobazha). 110 words, ~1,323 tokens.
.claude/skills/performance-guide/SKILL.md (or your agent's skills folder).Mobazha 项目的性能优化模式和已有工具。
| 工具 | 文件 | 用途 |
|---|---|---|
| PerformanceMonitor | packages/core/services/monitoring/performanceMonitor.ts | Web Vitals + 自定义指标 |
| 工具函数 | packages/core/utils/performance.ts | debounce, throttle, memoize 等 |
| ErrorTracker | packages/core/services/monitoring/errorTracker.ts | 性能 Transaction 追踪 |
// ✅ 适合 memo:接收复杂 props 的列表项
const OrderCard = memo(function OrderCard({ order }: OrderCardProps) {
return <div>...</div>;
});
// ❌ 不需要 memo:props 简单或组件很轻
function LoadingSpinner({ size }: { size: number }) {
return <div style={{ width: size }} />;
}原则:
// ✅ useMemo:计算开销大或引用需要稳定
const filteredOrders = useMemo(
() => orders.filter(o => o.status === selectedStatus),
[orders, selectedStatus]
);
// ✅ useCallback:传递给 memo 子组件的回调
const handleSelect = useCallback((id: string) => {
setSelectedId(id);
}, []);
// ❌ 过度使用:简单值不需要 memo
const label = useMemo(() => `共 ${count} 件`, [count]); // 不必要// ✅ 精确订阅,避免整个 store 订阅
const items = useCartStore(state => state.items);
// ❌ 订阅整个 store
const store = useCartStore();Next.js App Router 自动按路由分割。
import { lazy, Suspense } from 'react';
// 大型组件懒加载
const HeavyChart = lazy(() => import('@/components/charts/HeavyChart'));
function Dashboard() {
return (
<Suspense fallback={<ChartSkeleton />}>
<HeavyChart data={data} />
</Suspense>
);
}商品列表、订单列表等可能有大量数据:
// 分页加载(推荐)
function ProductList() {
const { products, hasMore, loadMore, isLoading } = useProducts();
return (
<div>
{products.map(p => <ProductCard key={p.slug} product={p} />)}
{hasMore && (
<button onClick={loadMore} disabled={isLoading}>
加载更多
</button>
)}
</div>
);
}// 使用 next/image(自动优化 + lazy loading)
import Image from 'next/image';
<Image
src={product.thumbnail}
alt={product.title}
width={300}
height={300}
loading="lazy" // 默认,视口外延迟加载
placeholder="blur" // 模糊占位
/>packages/core/utils/performance.ts 提供:
import { debounce, throttle } from '@mobazha/core';
// 搜索输入防抖(300ms)
const debouncedSearch = debounce((query: string) => {
searchProducts(query);
}, 300);
// 滚动事件节流
const throttledScroll = throttle(() => {
checkLoadMore();
}, 200);import { memoize } from '@mobazha/core';
// 缓存计算结果
const getExpensiveResult = memoize((input: string) => {
return heavyComputation(input);
});import { batchProcess } from '@mobazha/core';
// 大批量操作分块处理,避免阻塞 UI
await batchProcess(
largeArray,
async item => processItem(item),
50, // 每批 50 个
10 // 批次间延迟 10ms
);import { retry, withTimeout } from '@mobazha/core';
// 带重试的 API 调用
const data = await retry(
() => fetchData(),
3, // 最多重试 3 次
1000, // 初始延迟 1s
2 // 指数退避因子
);
// 带超时的 Promise
const result = await withTimeout(longOperation(), 10000); // 10s 超时import { scheduleIdleTask } from '@mobazha/core';
// 在浏览器空闲时执行非紧急任务
scheduleIdleTask(() => {
preloadNextPageData();
}, 5000); // 5s 超时(确保最终执行)项目已集成 Web Vitals 收集:
// performanceMonitor.ts 自动收集:
// - LCP (Largest Contentful Paint) — 目标 < 2.5s
// - FID (First Input Delay) — 目标 < 100ms
// - CLS (Cumulative Layout Shift) — 目标 < 0.1
// - FCP (First Contentful Paint)
// - TTFB (Time to First Byte)
// - INP (Interaction to Next Paint)import { performanceMonitor } from '@mobazha/core';
// 同步测量
const result = performanceMonitor.measure('orderTransform', () => {
return transformCoreOrder(data);
});
// 异步测量
const data = await performanceMonitor.measureAsync('fetchOrders', async () => {
return await ordersApi.getOrders();
});
// 手动计时
const stopTimer = performanceMonitor.startTimer('chatInit');
await initializeChat();
stopTimer(); // 记录耗时memo ?useCallback 包裹?lazy + Suspense)?next/image 或添加 loading="lazy"?batchProcess 避免 UI 阻塞?© mobazha, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .cursor/skills/performance-guide of mobazha/mobazha-unified.
Open the folder on GitHubat commit 156c699
Performance Guide next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Performance Guide this skillmobazha/mobazha-unified | 165 | — | ~1.3k | Automated safety check: Pass | MPL-2.0 | |
| Frontend Patternskurealnum/dotfiles | 290 | 19 repos | ~3.7k | Automated safety check: Pass | None | |
| React Best Practicesryokun6/ryos | 1.3k | — | ~2k | Automated safety check: Pass | MIT | |
| React Best Practicespoteto/noodle | 437 | — | ~1.4k | Automated safety check: Pass | MIT | |
| React ExpertJeffallan/claude-skills | 12k | — | ~1.4k | Automated safety check: Pass | MIT | |
| Reactblencorp/claude-code-kit | 106 | — | ~2.5k | Automated safety check: Pass | MIT |
kurealnum/dotfiles
Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.
ryokun6/ryos
React performance optimization guidelines from Vercel Engineering (vercel-labs/agent-skills).
poteto/noodle
React performance optimization guidelines. An agent skill from poteto/noodle.
Jeffallan/claude-skills
Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.
blencorp/claude-code-kit
Core React 19 patterns including hooks, Suspense, lazy loading, component structure, TypeScript best practices, and performance optimization.
MatrixAges/polywise
Guides React component implementation, performance optimization, and state management thresholds.
mobazha/mobazha-unified
Accessibility guide for Mobazha following WCAG 2.1 AA standards including color contrast, reduced motion, ARIA patterns, keyboard navigation, focus management, and screen reader testing.
mobazha/mobazha-unified
Look up Mobazha backend API endpoints, request/response formats, and field mappings.
mobazha/mobazha-unified
Review code for quality, architecture consistency, and adherence to Mobazha project standards using confidence-based filtering.
mobazha/mobazha-unified
Simplify and refine recently written code for clarity, consistency, and maintainability while preserving all functionality.
mobazha/mobazha-unified
Generate commit messages and run pre-commit validation following Mobazha conventions.
mobazha/mobazha-unified
Create and modify UI components following Mobazha conventions including directory structure, spacing standards, accessibility, and testing.
Works with
Categories
Guide for performance optimization in Mobazha including React rendering optimization, code splitting, Web Vitals monitoring, and utility functions for debounce/throttle/memoize. Performance Guide is an agent skill from mobazha/mobazha-unified. Guide for performance optimization in Mobazha including React rendering optimization, code splitting, Web Vitals monitoring, and utility functions for debounce/throttle/memoize.
Performance Guide fits situations like: optimizing performance; fixing slow renders; working with large lists.
Run `npx skills add mobazha/mobazha-unified --skill performance-guide -a claude-code`. Or copy the skill folder (.cursor/skills/performance-guide in mobazha/mobazha-unified) into .claude/skills/performance-guide in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mobazha/mobazha-unified --skill performance-guide -a codex`. Or copy the skill folder (.cursor/skills/performance-guide in mobazha/mobazha-unified) into .agents/skills/performance-guide in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mobazha/mobazha-unified --skill performance-guide -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/performance-guide, .gemini/skills/performance-guide, .github/skills/performance-guide and .opencode/skills/performance-guide in your project.
SKILL.md names no scripts, command-line tools or credentials: Performance Guide is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Performance Guide is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.3k tokens (SKILL.md is roughly 5.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Performance Guide: Frontend Patterns (kurealnum/dotfiles, 290 stars), React Best Practices (ryokun6/ryos, 1.3k stars), React Best Practices (poteto/noodle, 437 stars) and React Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mobazha (a GitHub organization) maintains it in mobazha/mobazha-unified, which has 165 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 3, 2026.
Source: mobazha/mobazha-unified on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.