Token导航 LogoToken导航

Agent Skill · 开发

docs-components(文档组件)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

docs-components 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 12,250。

总安装 1,371周安装 56GitHub Stars 11,661下载 439核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/reactjs/react.dev --skill docs-components

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

提供 React 官方文档中使用的 MDX 组件模式速查表。包含 Note、Pitfall、DeepDive 等语义化组件用法说明。适用于 React 开发者理解文档结构和内容组织方式。可帮助保持文档风格一致性和交互元素正确使用。docs-components 属于开发类 Skill,可作为该场景下的辅助能力补充。

包含 Sandpack 示例和 Diagram 组件使用指南。

来源仓库内路径:skills/docs-components

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/reactjs/react.dev --skill docs-components;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

docs-components 怎么安装?

在终端执行 npx skills add https://github.com/reactjs/react.dev --skill docs-components。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

docs-components 支持哪些 AI 工具?

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

docs-components 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

docs-components 是免费的吗?

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

docs-components 用的人多吗?

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

docs-components 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 11,661 星,维护活跃度相对可查。

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
docs-components

文档组件 · 本页

1,37111,661需要联网未明确通过

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

SKILL.md 原文

MDX Component Patterns

Quick Reference

Component Decision Tree

NeedComponent
Helpful tip or terminology<Note>
Common mistake warning<Pitfall>
Advanced technical explanation<DeepDive>
Canary-only feature<Canary> or <CanaryBadge />
Server Components only<RSC>
Deprecated API<Deprecated>
Experimental/WIP<Wip>
Visual diagram<Diagram>
Multiple related examples<Recipes>
Interactive code<Sandpack> (see /docs-sandpack)
Console error display<ConsoleBlock>
End-of-page exercises<Challenges> (Learn pages only)

Heading Level Conventions

ComponentHeading Level
DeepDive title#### (h4)
Titled Pitfall##### (h5)
Titled Note#### (h4)
Recipe items#### (h4)
Challenge items#### (h4)

Callout Spacing Rules

Callout components (Note, Pitfall, DeepDive) require a blank line after the opening tag before content begins.

Never place consecutively:

  • <Pitfall> followed by <Pitfall> - Combine into one with titled subsections, or separate with prose
  • <Note> followed by <Note> - Combine into one, or separate with prose

Allowed consecutive patterns:

  • <DeepDive> followed by <DeepDive> - OK for multi-part explorations (see useMemo.md)
  • <Pitfall> followed by <DeepDive> - OK when DeepDive explains "why" behind the Pitfall

Separation content: Prose paragraphs, code examples (Sandpack), or section headers.

Why: Consecutive warnings create a "wall of cautions" that overwhelms readers and causes important warnings to be skimmed.

Incorrect:

<Pitfall>
Don't do X.
</Pitfall>

<Pitfall>
Don't do Y.
</Pitfall>

Correct - combined:

<Pitfall>

##### Don't do X {/*pitfall-x*/}
Explanation.

##### Don't do Y {/*pitfall-y*/}
Explanation.

</Pitfall>

Correct - separated:

<Pitfall>
Don't do X.
</Pitfall>

This leads to another common mistake:

<Pitfall>
Don't do Y.
</Pitfall>

<Note>

Important clarifications, conventions, or tips. Less severe than Pitfall.

Simple Note

<Note>

The optimization of caching return values is known as [_memoization_](https://en.wikipedia.org/wiki/Memoization).

</Note>

Note with Title

Use #### (h4) heading with an ID.

<Note>

#### There is no directive for Server Components. {/*no-directive*/}

A common misunderstanding is that Server Components are denoted by `"use server"`, but there is no directive for Server Components. The `"use server"` directive is for Server Functions.

</Note>

Version-Specific Note

<Note>

Starting in React 19, you can render `<SomeContext>` as a provider.

In older versions of React, use `<SomeContext.Provider>`.

</Note>

<Pitfall>

Common mistakes that cause bugs. Use for errors readers will likely make.

Simple Pitfall

<Pitfall>

We recommend defining components as functions instead of classes. [See how to migrate.](#alternatives)

</Pitfall>

Titled Pitfall

Use ##### (h5) heading with an ID.

<Pitfall>

##### Calling different memoized functions will read from different caches. {/*pitfall-different-caches*/}

To access the same cache, components must call the same memoized function.

</Pitfall>

Pitfall with Wrong/Right Code

<Pitfall>

##### `useFormStatus` will not return status information for a `<form>` rendered in the same component. {/*pitfall-same-component*/}

function Form() { // 🔴 pending will never be true const { pending } = useFormStatus(); return <form action={submit}></form>; }


Instead call `useFormStatus` from inside a component located inside `<form>`.

---

## `<DeepDive>`

Optional deep technical content. **First child must be `####` heading with ID.**

### Standard DeepDive

<DeepDive>

Is using an updater always preferred? {/*is-updater-preferred*/}

You might hear a recommendation to always write code like setAge(a => a + 1) if the state you're setting is calculated from the previous state. There's no harm in it, but it's also not always necessary.

In most cases, there is no difference between these two approaches. React always makes sure that for intentional user actions, like clicks, the age state variable would be updated before the next click.

</DeepDive>


### Comparison DeepDive

For comparing related concepts:

<DeepDive>

When should I use cache, memo, or useMemo? {/*cache-memo-usememo*/}

All mentioned APIs offer memoization but differ in what they memoize, who can access the cache, and when their cache is invalidated.

useMemo {/*deep-dive-usememo*/}

In general, you should use useMemo for caching expensive computations in Client Components across renders.

cache {/*deep-dive-cache*/}

In general, you should use cache in Server Components to memoize work that can be shared across components.

</DeepDive>


---

## `<Recipes>`

Multiple related examples showing variations. Each recipe needs `<Solution />`.

<Recipes titleText="Basic useState examples" titleId="examples-basic">

Counter (number) {/*counter-number*/}

In this example, the count state variable holds a number.

<Sandpack> {/* code */} </Sandpack>

<Solution />

Text field (string) {/*text-field-string*/}

In this example, the text state variable holds a string.

<Sandpack> {/* code */} </Sandpack>

<Solution />

</Recipes>


**Common titleText/titleId combinations:**

- "Basic [hookName] examples" / `examples-basic`
- "Examples of [concept]" / `examples-[concept]`
- "The difference between [A] and [B]" / `examples-[topic]`

---

## `<Challenges>`

End-of-page exercises. **Learn pages only.** Each challenge needs problem + solution Sandpack.

<Challenges>

Fix the bug {/*fix-the-bug*/}

Problem description...

<Hint> Optional hint text. </Hint>

<Sandpack> {/* problem code */} </Sandpack>

<Solution>

Explanation...

<Sandpack> {/* solution code */} </Sandpack>

</Solution>

</Challenges>


**Guidelines:**

- Only at end of standard Learn pages
- No Challenges in chapter intros or tutorials
- Each challenge has `####` heading with ID

---

## `<Deprecated>`

For deprecated APIs. Content should explain what to use instead.

### Page-Level Deprecation

<Deprecated>

In React 19, forwardRef is no longer necessary. Pass ref as a prop instead.

forwardRef will be deprecated in a future release. Learn more here.

</Deprecated>


### Method-Level Deprecation

componentWillMount() {/*componentwillmount*/}

<Deprecated>

This API has been renamed from componentWillMount to UNSAFE_componentWillMount.

Run the rename-unsafe-lifecycles codemod to automatically update.

</Deprecated>


---

## `<RSC>`

For APIs that only work with React Server Components.

### Basic RSC

<RSC>

cache is only for use with React Server Components.

</RSC>


### Extended RSC (for Server Functions)

<RSC>

Server Functions are for use in React Server Components.

Note: Until September 2024, we referred to all Server Functions as "Server Actions".

</RSC>


---

## `<Canary>` and `<CanaryBadge />`

For features only available in Canary releases.

### Canary Wrapper (inline in Intro)

<Intro>

<Fragment> lets you group elements without a wrapper node.

<Canary>Fragments can also accept refs, enabling interaction with underlying DOM nodes.</Canary>

</Intro>


### CanaryBadge in Section Headings

<CanaryBadge /> FragmentInstance {/*fragmentinstance*/}


### CanaryBadge in Props Lists
  • <CanaryBadge /> optional ref: A ref object from useRef or callback function.

### CanaryBadge in Caveats
  • <CanaryBadge /> If you want to pass ref to a Fragment, you can't use the <>...</> syntax.

---

## `<Diagram>`

Visual explanations of module dependencies, render trees, or data flow.

<Diagram name="use_client_module_dependency" height={250} width={545} alt="A tree graph with the top node representing the module 'App.js'. 'App.js' has three children..."> 'use client' segments the module dependency tree, marking InspirationGenerator.js and all dependencies as client-rendered. </Diagram>


**Attributes:**

- `name`: Diagram identifier (used for image file)
- `height`: Height in pixels
- `width`: Width in pixels
- `alt`: Accessible description of the diagram

---

## `<CodeStep>` (Use Sparingly)

Numbered callouts in prose. Pairs with code block annotations.

### Syntax

In code blocks:
import { useState } from 'react';

function MyComponent() {
  const [age, setAge] = useState(42);
}
Format: `[[step_number, line_number, "text_to_highlight"], ...]`

In prose:
  1. The <CodeStep step={1}>current state</CodeStep> initially set to the <CodeStep step={3}>initial value</CodeStep>.
  2. The <CodeStep step={2}>set function</CodeStep> that lets you change it.

### Guidelines

- Maximum 2-3 different colors per explanation
- Don't highlight every keyword - only key concepts
- Use for terms in prose, not entire code blocks
- Maintain consistent usage within a section

✅ **Good use** - highlighting key concepts:

React will compare the <CodeStep step={2}>dependencies</CodeStep> with the dependencies you passed...


🚫 **Avoid** - excessive highlighting:

When an <CodeStep step={1}>Activity</CodeStep> boundary is <CodeStep step={2}>hidden</CodeStep> during its <CodeStep step={3}>initial</CodeStep> render...


---

## `<ConsoleBlock>`

Display console output (errors, warnings, logs).

<ConsoleBlock level="error"> Uncaught Error: Too many re-renders. </ConsoleBlock>


**Levels:** `error`, `warning`, `info`

---

## Component Usage by Page Type

### Reference Pages

For component placement rules specific to Reference pages, invoke `/docs-writer-reference`.

Key placement patterns:

- `<RSC>` goes before `<Intro>` at top of page
- `<Deprecated>` goes after `<Intro>` for page-level deprecation
- `<Deprecated>` goes after method heading for method-level deprecation
- `<Canary>` wrapper goes inline within `<Intro>`
- `<CanaryBadge />` appears in headings, props lists, and caveats

### Learn Pages

For Learn page structure and patterns, invoke `/docs-writer-learn`.

Key usage patterns:

- Challenges only at end of standard Learn pages
- No Challenges in chapter intros or tutorials
- DeepDive for optional advanced content
- CodeStep should be used sparingly

### Blog Pages

For Blog page structure and patterns, invoke `/docs-writer-blog`.

Key usage patterns:

- Generally avoid deep technical components
- Note and Pitfall OK for clarifications
- Prefer inline explanations over DeepDive

---

## Other Available Components

**Version/Status:** `<Experimental>`, `<ExperimentalBadge />`, `<RSCBadge />`, `<NextMajor>`, `<Wip>`

**Visuals:** `<DiagramGroup>`, `<Illustration>`, `<IllustrationBlock>`, `<CodeDiagram>`, `<FullWidth>`

**Console:** `<ConsoleBlockMulti>`, `<ConsoleLogLine>`

**Specialized:** `<TerminalBlock>`, `<BlogCard>`, `<TeamMember>`, `<YouTubeIframe>`, `<ErrorDecoder />`, `<LearnMore>`, `<Math>`, `<MathI>`, `<LanguageList>`

See existing docs for usage examples of these components.

平台分布

Codex

31.01%
按下载量换算136

Claude

30.22%
按下载量换算133

Cursor

19.17%
按下载量换算84

Gemini CLI

9.93%
按下载量换算44

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills