Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

reactReact 开发

Agent Skill

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

总安装

1,639

周安装

69

GitHub Stars

15

下载量

574
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/hairyf/skills --skill react

简介

react 用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段。
  • 涉及页面改动时,应配合本地预览和构建检查确认视觉效果。
  • 建议与项目技术栈保持一致,确保代码可集成和可运行。

SKILL.md

React

The skill is based on React, generated at 2026-01-31.

React is a JavaScript library for building user interfaces. It lets you compose complex UIs from small and isolated pieces of code called "components". React uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible.

Core References

TopicDescriptionReference
useStateHook for managing component state with direct updatescore-usestate
useEffectHook for synchronizing components with external systemscore-useeffect
useContextHook for reading and subscribing to contextcore-usecontext
useRefHook for referencing values that don't trigger re-renderscore-useref
useReducerHook for managing complex state with a reducer functioncore-usereducer
SuspenseComponent for displaying fallback UI while content is loadingcore-suspense
memoHigher-order component for memoizing component renderscore-memo
createContextAPI for creating context objectscore-createcontext
FragmentComponent for grouping elements without wrapper nodescore-fragment
StrictModeComponent for enabling additional development checkscore-strictmode

Features

Performance Optimization

TopicDescriptionReference
useMemoHook for caching expensive calculationsfeatures-usememo
useCallbackHook for caching function definitionsfeatures-usecallback
lazyAPI for code splitting and lazy loading componentsfeatures-lazy
useTransitionHook for non-blocking state updatesfeatures-usetransition
useDeferredValueHook for deferring non-critical UI updatesfeatures-usedeferredvalue
useLayoutEffectHook that fires synchronously before browser repaintfeatures-uselayouteffect
startTransitionAPI for marking non-blocking state updatesfeatures-starttransition

Advanced Hooks

TopicDescriptionReference
useIdHook for generating unique IDs for accessibilityfeatures-useid
useAPI for reading Promise and Context valuesfeatures-use
useActionStateHook for managing form action statefeatures-useactionstate
useOptimisticHook for optimistic UI updatesfeatures-useoptimistic
useInsertionEffectHook for CSS-in-JS libraries to inject stylesadvanced-useinsertioneffect
useSyncExternalStoreHook for subscribing to external storesadvanced-usesyncexternalstore
useImperativeHandleHook for customizing ref handlesadvanced-useimperativehandle
useEffectEventHook for extracting non-reactive logic from Effectsadvanced-useeffectevent
useDebugValueHook for adding labels to custom hooks in DevToolsadvanced-usedebugvalue

React DOM APIs

TopicDescriptionReference
createRootAPI for creating a root to render React componentsreact-dom-createroot
hydrateRootAPI for hydrating server-rendered HTMLreact-dom-hydrateroot
createPortalAPI for rendering children into different DOM nodesreact-dom-createportal
flushSyncAPI for forcing synchronous updatesreact-dom-flushsync

React Server Components

TopicDescriptionReference
cacheAPI for caching function results in Server Componentsrsc-cache

Advanced Components

TopicDescriptionReference
ProfilerComponent for measuring rendering performanceadvanced-profiler
ActivityComponent for hiding and restoring UI statefeatures-activity

Testing

TopicDescriptionReference
actTest helper for applying pending updates before assertionstesting-act

Best Practices

TopicDescriptionReference
Rules of HooksFundamental rules for using React Hooks correctlybest-practices-rules-of-hooks
Component PurityRules for keeping React components and hooks purebest-practices-purity

Key Recommendations

  • Use hooks at the top level - Never call hooks conditionally or in loops
  • Keep components pure - Components should be idempotent and have no side effects during render
  • Use useEffect for side effects - Synchronize with external systems using Effects
  • Memoize expensive calculations - Use useMemo for costly computations, useCallback for functions passed to memoized components
  • Code split with lazy - Use lazy and Suspense for route-based code splitting
  • Avoid premature optimization - Profile first, optimize only when needed
  • Use React Compiler - Consider using React Compiler for automatic memoization
  • Handle dependencies correctly - Always include all reactive values in Effect and memoization dependencies

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.51%
按下载量换算204

Claude

28.33%
按下载量换算163

Cursor

17.99%
按下载量换算103

Gemini CLI

8.82%
按下载量换算51

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

来源信息

继续浏览同类 Skills