You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(react-native): port MCP subcomponent-resolution fix and doc tooling from hearth-react
Ports the hearth-react fix where a compound component's sub-component only
gets a resolvable MCP entry if it has its own Storybook story:
- Add dedicated `.stories.tsx` for 10 sub-components (ModalImage, Pill,
CardPressHandler, TableHeader, TableHeaderCell, HighlightBannerImage,
ProgressStep, TimelineItem, BannerImage, BannerIllustration)
- Wire up storybook-addon-oversight/oversight-lint and a path-filtered CI
workflow, mirroring packages/react's setup
- Document every component's own props and add component-level JSDoc
descriptions across the package, clearing all oversight findings
- Default packages/react-native/SKILL.md to the MCP server over local
markdown, matching packages/react's SKILL.md
- Update react-native-component-addition/react-native-component-docs
skills to require sub-component stories going forward
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds `storybook-addon-oversight` / `oversight-lint` to this package, mirroring the setup already in place for `hearth-react`, plus a `react-native-storybook-oversight` CI workflow that lints the Storybook manifest on every PR touching `packages/react-native`. This catches components or props with no JSDoc description before they reach the `hearth-react-native` MCP server, where an undocumented prop is invisible to AI coding agents.
8
+
9
+
Running this lint for the first time surfaced JSDoc gaps across almost every component in the package (unlike `hearth-react`, which already had partial coverage). Component-level descriptions and each component's own props have been documented across the library. Props inherited from React Native's own `ViewProps`/`PressableProps`/`TextProps` (e.g. `onTouchStart`, `onPointerEnter`, `style`, `ref`) are excluded from the `prop-descriptions-missing` rule via `oversight.config.json`, since documenting them would mean duplicating the same JSDoc across dozens of unrelated components.
10
+
11
+
**Developer changes**:
12
+
13
+
No action required — this only adds documentation and CI tooling, not runtime behaviour.
💅 [ENHANCEMENT]: Subcomponents now have their own Storybook entries, so the `hearth-react-native` MCP server can resolve their props
6
+
7
+
`ModalImage`, `Pill`, `CardPressHandler`, `TableHeader`, `TableHeaderCell`, `HighlightBannerImage`, `ProgressStep`, `TimelineItem`, `BannerImage`, and `BannerIllustration` each now have their own Storybook story. Previously these subcomponents only appeared nested inside their parent's docs page, so the `hearth-react-native` MCP server (used by AI coding agents) couldn't resolve their props — it could only resolve props for a component with its own Storybook entry. `packages/react-native/SKILL.md` has been updated to default to the MCP server for component lookups, reflecting this.
8
+
9
+
**Components affected**:
10
+
11
+
-`Modal` (`ModalImage`)
12
+
-`PillGroup` (`Pill`)
13
+
-`Card` (`CardPressHandler`)
14
+
-`Table` (`TableHeader`, `TableHeaderCell`)
15
+
-`HighlightBanner` (`HighlightBannerImage`)
16
+
-`ProgressStepper` (`ProgressStep`)
17
+
-`Timeline` (`TimelineItem`)
18
+
-`Banner` (`BannerImage`, `BannerIllustration`)
19
+
20
+
**Developer changes**:
21
+
22
+
No action required — this only affects Storybook navigation and the guidance given to AI coding agents using this library, not the runtime API.
<SubComponent>.stories.tsx # Required — see "Sub-component stories" below
30
32
```
31
33
32
34
Add additional files as needed (subcomponents, helpers, platform-specific variants).
33
35
36
+
### Sub-component stories
37
+
38
+
Every exported sub-component needs its **own**`<SubComponent>.stories.tsx` with its
39
+
own `Meta` (`title: 'Stories / <SubComponent>'`, `component: <SubComponent>`) — even
40
+
though it's already documented via a nested `### <SubComponent> Props` table in the
41
+
parent's `.docs.mdx` (see the [react-native-component-docs](./../react-native-component-docs/SKILL.md)
42
+
skill). The `hearth-react-native` MCP server only lists a component as its own
43
+
resolvable entry in `list-all-documentation` when it has its own Storybook story — a
44
+
sub-component documented only inside its parent's `.docs.mdx` doesn't get one. No
45
+
separate `<SubComponent>.docs.mdx` is needed — mirror
46
+
`src/components/Card/CardAction/CardAction.stories.tsx`: a `Meta` + at least one
47
+
story, wrapped in whatever ancestor context the sub-component needs to render
48
+
meaningfully.
49
+
50
+
Note: `packages/react-native` has no `react-audit`-equivalent skill to catch this
51
+
gap automatically (unlike `packages/react`) — treat this checklist item as the only
52
+
guard against it regressing until one exists.
53
+
34
54
## Implementation Steps
35
55
1.**Props**: Define public props in <Component>.props.ts. Keep types explicit and add JSDoc defaults.
36
56
2.**Component**: Implement <Component>.tsx using tokens from theme (useTheme or StyleSheet variants).
@@ -49,6 +69,8 @@ Add storybook story tests for interaction behviour tests where necessary too.
49
69
- Token usage aligns with components tokens (theme.components.<component>)
50
70
- Stories include a Playground story and at least one variant example
51
71
- Docs include Playground, Usage, Props table, and Figma links when available
72
+
- Every sub-component (compound pattern) has its own `<SubComponent>.stories.tsx` — see [Sub-component stories](#sub-component-stories); required for the MCP server, not optional
73
+
- Run `pnpm build:storybook && npx oversight --max-warnings 0 --expected-extractor react-docgen-typescript` (from `packages/react-native`) and fix any findings — confirms the MCP can actually resolve the new component's description and props, not just that JSDoc was added by eye
Copy file name to clipboardExpand all lines: .claude/skills/react-native-component-docs/SKILL.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Make sure to include code blocks for each example. This is likely needed for mos
68
68
1.**Read the component's source of truth:** Open `<Component>.props.ts` and cross-check every prop against your drafted Props table. Include all public props with correct types and defaults. For compound components, verify each subcomponent's `.props.ts` file and include a nested props table under the subcomponent's heading.
69
69
2.**Treat mismatches as blocking:** If a prop appears in `.props.ts` but not in your table (or vice versa), stop and fix it. This is not a nice-to-have — it's the ground truth check.
70
70
3.**Match story names exactly:** Verify that `Stories.Playground` and any other story references exist in the component's `.stories.tsx` file.
71
-
4.**Check compound-component structure:** If the component has subcomponents (e.g. `BadgeIcon`, `AccordionItem`), ensure each has its own `### Heading` with a `#### Props` table.
71
+
4.**Check compound-component structure:** If the component has subcomponents (e.g. `BadgeIcon`, `AccordionItem`), ensure each has its own `### Heading` with a `#### Props` table. This nested table is **not** a substitute for the subcomponent's own `<SubComponent>.stories.tsx` — the `hearth-react-native` MCP server only resolves a component's real props when that component has its own Storybook entry. See [Sub-component stories](../react-native-component-addition/SKILL.md#sub-component-stories) in the `react-native-component-addition` skill.
72
72
73
73
## Checklist
74
74
@@ -77,6 +77,6 @@ Make sure to include code blocks for each example. This is likely needed for mos
77
77
-`Playground` and `Controls` reference a real story
78
78
-`Usage` section has both a live example and a code block
79
79
- Props table verified against `.props.ts` (including subcomponents)
80
-
- Compound component sub-props documented if applicable
80
+
- Compound component sub-props documented if applicable, AND each subcomponent has its own `<SubComponent>.stories.tsx` (required for MCP resolution, not optional — see `react-native-component-addition`)
81
81
- Optional sections are only added when helpful
82
82
- Order of sections should be in the standard pattern (Playground, Usage, Props, then optional sections)
0 commit comments