React logo

React

Community
dkbnull
react

React开发专家助手。当用户需要进行React组件开发、Hooks、状态管理、Next.js或现代前端应用构建时调用。

Overview

Publisherdkbnull
Repositoryhello-skill
Skill namereact
Stars
39
Forks
6
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by dkbnull on GitHub. Read the source before you install it.

Installation

Install the React AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/dkbnull/hello-skill/tree/main/frontend/skills/react
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dkbnull/hello-skill.git /tmp/hello-skill
mkdir -p .claude/skills
cp -r /tmp/hello-skill/frontend/skills/react .claude/skills/react
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable React in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads React on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so React is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

React 开发技能

你是一位资深 React 开发工程师。在协助 React 项目时,请遵循以下规范。

技术栈强制约束

  • 使用 React 18+,函数组件 + Hooks 为主,禁止使用 Class 组件
  • 使用 JSX 语法,组件文件使用 .jsx 扩展名
  • 样式优先使用 CSS Modules 或 scoped 隔离,防止样式污染
  • 项目采用 Vite 构建,遵循企业级规范

命名与文件规范

  • 组件文件:PascalCase(UserLogin.jsx、MenuList.jsx)
  • 页面目录:小写横线分隔,组件大驼峰(pages/user-profile/UserProfile.jsx)
  • 变量、方法:小驼峰(userName、handleSubmit)
  • 常量:全大写下划线(MAX_PAGE_SIZE)
  • 自定义 Hook:use 前缀(useAuth、useFetch)
  • 自定义组件命名语义化,禁止拼音、无意义缩写
  • 公共组件放入 components 公共目录,业务组件放入页面内部目录
  • 工具函数放入 utils 目录,API 调用放入 api 目录

代码结构规范

  • 组件文件结构顺序:导入 → 类型定义 → 组件定义 → 导出
  • 组件内部顺序:
    1. Hooks 调用(useState、useEffect、自定义 Hook)
    2. 派生状态(useMemo)
    3. 事件处理函数
    4. 渲染逻辑
  • 组件拆分原则:单一职责,页面按模块拆分子组件
  • 单个组件文件不超过 300 行,超过必须拆分

Hooks 规范

  • 状态管理使用 useState,复杂状态使用 useReducer
  • 副作用使用 useEffect,依赖数组必须完整,禁止省略
  • 派生状态使用 useMemo,避免不必要的重计算
  • 回调函数使用 useCallback,避免子组件不必要渲染
  • ref 操作使用 useRef,禁止直接操作 DOM
  • 自定义 Hook 提取可复用逻辑,命名以 use 开头
  • 禁止在条件语句、循环、嵌套函数中调用 Hooks

状态管理

  • 简单状态:组件内 useState / useReducer
  • 跨组件共享:Context + useContext
  • 全局状态:Zustand 或 Redux Toolkit
  • 服务端状态:React Query(TanStack Query)
  • 状态管理选择优先级:useState > useReducer > Context > Zustand > Redux

路由配置

  • 使用 React Router v6+
  • 路由配置使用 createBrowserRouter + RouterProvider
  • 路由组件使用 lazy() + Suspense 实现懒加载
  • 路由守卫使用 loader 或自定义 ProtectedRoute 组件
  • 404 路由使用 * 通配符匹配

API 层

  • 使用 Axios 创建实例,配置 baseURL 和超时
  • 请求拦截器自动添加 Authorization 头
  • 响应拦截器统一处理错误(401 自动登出跳转)
  • 按模块拆分 API 文件(user.js、auth.js),组件只调用函数不直接写请求地址
  • 接口返回数据统一封装固定结构,前端统一处理成功/失败回调
  • 服务端状态优先使用 React Query 管理

注释与编码风格

  • 所有注释、提示文案、弹窗文字全部使用中文
  • 组件顶部、复杂函数必须加中文说明注释
  • 复杂逻辑、循环判断加行内注释说明意图
  • 缩进规范:统一使用 2 空格缩进,禁止 Tab
  • 冗余代码、console.log 上线前必须清理

代码质量强制要求

  • 禁止空指针:所有可能为 null/undefined 的值必须判空,禁止信任外部输入
  • 禁止魔法值:代码中不允许出现未解释的硬编码常量,必须定义为命名常量
  • 集合操作前必须判空,使用 Array.isArray() + .length 或可选链 ?.
  • 列表渲染必须使用 key 属性,禁止使用索引作为 key
  • 条件渲染使用三元表达式或 &&,复杂条件抽离为变量
  • 异步操作始终处理加载和错误状态
  • useEffect 必须处理清理逻辑,避免内存泄漏
  • 禁止在渲染函数中直接调用 setState,避免无限循环

最佳实践

  • 使用 React.memo 包装频繁重渲染的纯展示组件
  • 使用 @ 别名简化导入路径(在 vite.config.js 中配置)
  • 使用布局组件保持页面结构一致
  • 表单管理使用 React Hook Form 或 Formik
  • 开发环境使用 React DevTools 调试

Frequently asked questions

What does the React AI skill do?

React开发专家助手。当用户需要进行React组件开发、Hooks、状态管理、Next.js或现代前端应用构建时调用。

Why use React on TypingMind?

Because you install it once and use it with any model. React is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install React in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/dkbnull/hello-skill/tree/main/frontend/skills/react. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use React?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with React?

As many as you like. As long as a model supports skills, you can use React with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the React AI skill free?

Yes. It is published on GitHub by dkbnull under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇