docs-components
Comprehensive MDX component patterns (Note, Pitfall, DeepDive, Recipes, etc.) for all documentation types. Authoritative source for component usage, examples,…
Reference page structure, templates, and writing patterns for src/content/reference/. For components, see /docs-components. For code examples, see /docs-sandpack.
$ npx -y skills add reactjs/react.dev --skill docs-writer-reference --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/docs-writer-referenceContext preview
The summary Claude sees to decide when to auto-load this skill.
Reference page structure, templates, and writing patterns for src/content/reference/. For components, see /docs-components. For code examples, see /docs-sandpack.
name: docs-writer-reference description: Reference page structure, templates, and writing patterns for src/content/reference/. For components, see /docs-components. For code examples, see /docs-sandpack.
1. Is it a Hook? Use **Type A (Hook/Function)** 2. Is it a React component (`<Something>`)? Use **Type B (Component)** 3. Is it a compiler configuration option? Use **Type C (Configuration)** 4. Is it a directive (`'use something'`)? Use **Type D (Directive)** 5. Is it an ESLint rule? Use **Type E (ESLint Rule)** 6. Is it listing multiple APIs? Use **Type F (Index/Category)**
For component selection and patterns, invoke `/docs-components`.
---
**Voice:** Authoritative technical reference writer **Tone:** Precise, comprehensive, neutral
For tone, capitalization, jargon, and prose patterns, invoke `/docs-voice`.
**Do:**
**Don't:**
---
**When to use:** Documenting React hooks and standalone functions (useState, useEffect, memo, lazy, etc.)
--- title: hookName --- <Intro> `hookName` is a React Hook that lets you [brief description]. ```js const result = hookName(arg)
</Intro>
<InlineToc />
---
Call `hookName` at the top level of your component to...
[signature example with annotations]
[See more examples below.](#usage)
Description of return value.
---
Explanation with Sandpack examples...
---
How to solve it...
---
### Type B: Component
**When to use:** Documenting React components (Suspense, Fragment, Activity, StrictMode)
```mdx
---
title: <ComponentName>
---
<Intro>
`<ComponentName>` lets you [primary action].
```js
<ComponentName prop={value}>
<Children />
</ComponentName></Intro>
<InlineToc />
---
[Component purpose and behavior]
**Key differences from Hook pages:**
- Title uses JSX syntax: `<ComponentName>`
- Uses `#### Props` instead of `#### Parameters`
- Reference heading uses JSX: `` ### `<ComponentName>` ``
---
### Type C: Configuration
**When to use:** Documenting React Compiler configuration options
```mdx
---
title: optionName
---
<Intro>
The `optionName` option [controls/specifies/determines] [what it does].
</Intro>
```js
{
optionName: 'value' // Quick example
}<InlineToc />
---
[Description of the option's purpose]
'value1' | 'value2' | 'value3'
`'value1'`
---
### Type D: Directive
**When to use:** Documenting directives like 'use server', 'use client', 'use memo'
```mdx
---
title: "'use directive'"
titleForTitleTag: "'use directive' directive"
---
<RSC>
`'use directive'` is for use with [React Server Components](/reference/rsc/server-components).
</RSC>
<Intro>
`'use directive'` marks [what it marks] for [purpose].
```js {1}
function MyComponent() {
'use directive';
// ...
}</Intro>
<InlineToc />
---
Add `'use directive'` at the beginning of [location] to [action].
**Key characteristics:**
- Title includes quotes: `title: "'use server'"`
- Uses `titleForTitleTag` for browser tab title
- `<RSC>` block appears before `<Intro>`
- Caveats focus on placement and syntax requirements
---
### Type E: ESLint Rule
**When to use:** Documenting ESLint plugin rules
```mdx
---
title: rule-name
---
<Intro>
Validates that [what the rule checks].
</Intro>
## Rule Details {/*rule-details*/}
[Explanation of why this rule exists and React's underlying assumptions]
## Common Violations {/*common-violations*/}
[Description of violation patterns]
### Invalid {/*invalid*/}
Examples of incorrect code for this rule:
```js
// X Missing dependency
useEffect(() => {
console.log(count);
}, []); // Missing 'count'Exampl
This repo contains the source code and documentation powering react.dev.
Repo: reactjs/react.dev
Comprehensive MDX component patterns (Note, Pitfall, DeepDive, Recipes, etc.) for all documentation types. Authoritative source for component usage, examples,…
Use when adding interactive RSC (React Server Components) code examples to React docs using <SandpackRSC>, or when modifying the RSC sandpack infrastructure.
Use when adding interactive code examples to React docs.
Use when writing any React documentation. Provides voice, tone, and style rules for all doc types.
Use when writing or editing files in src/content/blog/. Provides blog post structure and conventions.
Use when writing or editing files in src/content/learn/. Provides Learn page structure and tone.