@redsift/ds-mcp-server 12.3.1-muiv6-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/README.md +203 -0
  2. package/consumer-instructions/.cursorrules +80 -0
  3. package/consumer-instructions/.windsurfrules +80 -0
  4. package/consumer-instructions/CLAUDE.md +87 -0
  5. package/consumer-instructions/redsift-design-system.instructions.md +87 -0
  6. package/data/demos/patterns/crossfiltered-datagrid-page/example.tsx +750 -0
  7. package/data/demos/patterns/crossfiltered-datagrid-page/with-empty-state.tsx +111 -0
  8. package/data/demos/patterns/crossfiltered-datagrid-page/with-error.tsx +122 -0
  9. package/data/demos/patterns/crossfiltered-datagrid-page/with-loading.tsx +88 -0
  10. package/data/demos/patterns/datagrid-page/example.tsx +521 -0
  11. package/data/demos/patterns/datagrid-page/with-empty-state.tsx +80 -0
  12. package/data/demos/patterns/datagrid-page/with-error.tsx +96 -0
  13. package/data/demos/patterns/datagrid-page/with-loading.tsx +57 -0
  14. package/data/demos/patterns/drilldown-datagrid-page/example.tsx +715 -0
  15. package/data/demos/patterns/drilldown-datagrid-page/with-empty-state.tsx +113 -0
  16. package/data/demos/patterns/drilldown-datagrid-page/with-error.tsx +125 -0
  17. package/data/demos/patterns/drilldown-datagrid-page/with-loading.tsx +90 -0
  18. package/data/demos/patterns/server-datagrid-page/example.tsx +757 -0
  19. package/data/demos/patterns/server-datagrid-page/with-empty-state.tsx +107 -0
  20. package/data/demos/patterns/server-datagrid-page/with-error.tsx +107 -0
  21. package/data/demos/patterns/server-datagrid-page/with-loading.tsx +63 -0
  22. package/data/docs/components/charts/Arc.json +179 -0
  23. package/data/docs/components/charts/Arcs.json +104 -0
  24. package/data/docs/components/charts/Axis.json +269 -0
  25. package/data/docs/components/charts/Bar.json +236 -0
  26. package/data/docs/components/charts/BarChart.json +852 -0
  27. package/data/docs/components/charts/BarChartBars.json +18 -0
  28. package/data/docs/components/charts/BarChartGroupedTooltip.json +9 -0
  29. package/data/docs/components/charts/BarChartOverlay.json +34 -0
  30. package/data/docs/components/charts/BarChartSection.json +94 -0
  31. package/data/docs/components/charts/BaseBarChart.json +852 -0
  32. package/data/docs/components/charts/ChartContainerTitle.json +574 -0
  33. package/data/docs/components/charts/DataPoint.json +160 -0
  34. package/data/docs/components/charts/Dot.json +191 -0
  35. package/data/docs/components/charts/EmptyBarChart.json +852 -0
  36. package/data/docs/components/charts/EmptyLineChart.json +753 -0
  37. package/data/docs/components/charts/EmptyPieChart.json +826 -0
  38. package/data/docs/components/charts/EmptyScatterPlot.json +802 -0
  39. package/data/docs/components/charts/Legend.json +510 -0
  40. package/data/docs/components/charts/LegendItem.json +128 -0
  41. package/data/docs/components/charts/Line.json +69 -0
  42. package/data/docs/components/charts/LineChart.json +753 -0
  43. package/data/docs/components/charts/LoadingBarChart.json +852 -0
  44. package/data/docs/components/charts/LoadingLineChart.json +753 -0
  45. package/data/docs/components/charts/LoadingPieChart.json +826 -0
  46. package/data/docs/components/charts/LoadingScatterPlot.json +802 -0
  47. package/data/docs/components/charts/PieChart.json +826 -0
  48. package/data/docs/components/charts/RenderedLineChart.json +753 -0
  49. package/data/docs/components/charts/RenderedLinearBarChart.json +823 -0
  50. package/data/docs/components/charts/RenderedOrdinalBarChart.json +852 -0
  51. package/data/docs/components/charts/RenderedPieChart.json +826 -0
  52. package/data/docs/components/charts/RenderedScatterPlot.json +802 -0
  53. package/data/docs/components/charts/ScatterPlot.json +802 -0
  54. package/data/docs/components/charts/getAxisType.json +9 -0
  55. package/data/docs/components/charts/getComponentPosition.json +9 -0
  56. package/data/docs/components/dashboard/ChartEmptyState.json +42 -0
  57. package/data/docs/components/dashboard/Dashboard.json +26 -0
  58. package/data/docs/components/dashboard/DataCard.json +300 -0
  59. package/data/docs/components/dashboard/DataCardBody.json +431 -0
  60. package/data/docs/components/dashboard/DataCardHeader.json +304 -0
  61. package/data/docs/components/dashboard/DataCardListbox.json +529 -0
  62. package/data/docs/components/dashboard/DataRow.json +539 -0
  63. package/data/docs/components/dashboard/DrilldownItem.json +342 -0
  64. package/data/docs/components/dashboard/FilterableBarChart.json +83 -0
  65. package/data/docs/components/dashboard/FilterableDataGrid.json +83 -0
  66. package/data/docs/components/dashboard/FilterablePieChart.json +83 -0
  67. package/data/docs/components/dashboard/FilterableScatterPlot.json +83 -0
  68. package/data/docs/components/dashboard/PdfDocument.json +58 -0
  69. package/data/docs/components/dashboard/PdfExportButton.json +458 -0
  70. package/data/docs/components/dashboard/TimeSeriesBarChart.json +172 -0
  71. package/data/docs/components/dashboard/WithFilters.json +83 -0
  72. package/data/docs/components/design-system/ActiveDescendantListbox.json +521 -0
  73. package/data/docs/components/design-system/Alert.json +349 -0
  74. package/data/docs/components/design-system/AppBar.json +64 -0
  75. package/data/docs/components/design-system/AppContainer.json +67 -0
  76. package/data/docs/components/design-system/AppContent.json +566 -0
  77. package/data/docs/components/design-system/AppSidePanel.json +87 -0
  78. package/data/docs/components/design-system/Badge.json +293 -0
  79. package/data/docs/components/design-system/BaseBreadcrumbs.json +298 -0
  80. package/data/docs/components/design-system/BaseGrid.json +543 -0
  81. package/data/docs/components/design-system/BaseSkeleton.json +338 -0
  82. package/data/docs/components/design-system/BreadcrumbItem.json +231 -0
  83. package/data/docs/components/design-system/Breadcrumbs.json +298 -0
  84. package/data/docs/components/design-system/Button.json +402 -0
  85. package/data/docs/components/design-system/ButtonGroup.json +415 -0
  86. package/data/docs/components/design-system/ButtonLink.json +568 -0
  87. package/data/docs/components/design-system/Card.json +328 -0
  88. package/data/docs/components/design-system/CardActions.json +431 -0
  89. package/data/docs/components/design-system/CardBody.json +431 -0
  90. package/data/docs/components/design-system/CardHeader.json +428 -0
  91. package/data/docs/components/design-system/Checkbox.json +426 -0
  92. package/data/docs/components/design-system/CheckboxGroup.json +382 -0
  93. package/data/docs/components/design-system/ConditionalWrapper.json +40 -0
  94. package/data/docs/components/design-system/DetailedCard.json +401 -0
  95. package/data/docs/components/design-system/DetailedCardCollapsibleSectionItems.json +29 -0
  96. package/data/docs/components/design-system/DetailedCardHeader.json +37 -0
  97. package/data/docs/components/design-system/DetailedCardSection.json +90 -0
  98. package/data/docs/components/design-system/DetailedCardSectionItem.json +109 -0
  99. package/data/docs/components/design-system/Flexbox.json +523 -0
  100. package/data/docs/components/design-system/FocusWithinGroup.json +9 -0
  101. package/data/docs/components/design-system/Grid.json +543 -0
  102. package/data/docs/components/design-system/GridItem.json +388 -0
  103. package/data/docs/components/design-system/Heading.json +390 -0
  104. package/data/docs/components/design-system/Icon.json +325 -0
  105. package/data/docs/components/design-system/IconButton.json +371 -0
  106. package/data/docs/components/design-system/IconButtonLink.json +588 -0
  107. package/data/docs/components/design-system/Item.json +554 -0
  108. package/data/docs/components/design-system/Link.json +552 -0
  109. package/data/docs/components/design-system/LinkButton.json +397 -0
  110. package/data/docs/components/design-system/Listbox.json +529 -0
  111. package/data/docs/components/design-system/Number.json +773 -0
  112. package/data/docs/components/design-system/NumberField.json +594 -0
  113. package/data/docs/components/design-system/Pill.json +378 -0
  114. package/data/docs/components/design-system/ProgressBar.json +121 -0
  115. package/data/docs/components/design-system/RadarSvgLinearGradient.json +9 -0
  116. package/data/docs/components/design-system/Radio.json +415 -0
  117. package/data/docs/components/design-system/RadioGroup.json +382 -0
  118. package/data/docs/components/design-system/RenderedListboxItem.json +18 -0
  119. package/data/docs/components/design-system/RovingTabindexListbox.json +521 -0
  120. package/data/docs/components/design-system/Shield.json +360 -0
  121. package/data/docs/components/design-system/SideNavigationMenu.json +144 -0
  122. package/data/docs/components/design-system/SideNavigationMenuBar.json +89 -0
  123. package/data/docs/components/design-system/SideNavigationMenuItem.json +319 -0
  124. package/data/docs/components/design-system/Skeleton.json +338 -0
  125. package/data/docs/components/design-system/SkeletonCircle.json +338 -0
  126. package/data/docs/components/design-system/SkeletonText.json +371 -0
  127. package/data/docs/components/design-system/Spinner.json +291 -0
  128. package/data/docs/components/design-system/Switch.json +415 -0
  129. package/data/docs/components/design-system/SwitchGroup.json +382 -0
  130. package/data/docs/components/design-system/Text.json +418 -0
  131. package/data/docs/components/design-system/TextArea.json +501 -0
  132. package/data/docs/components/design-system/TextField.json +539 -0
  133. package/data/docs/components/design-system/sizeToDimension.json +9 -0
  134. package/data/docs/components/pickers/BaseCombobox.json +320 -0
  135. package/data/docs/components/pickers/BaseComboboxContent.json +453 -0
  136. package/data/docs/components/pickers/BaseMenuButton.json +240 -0
  137. package/data/docs/components/pickers/BaseMenuButtonContent.json +442 -0
  138. package/data/docs/components/pickers/BaseSelect.json +258 -0
  139. package/data/docs/components/pickers/Combobox.json +320 -0
  140. package/data/docs/components/pickers/ComboboxContent.json +453 -0
  141. package/data/docs/components/pickers/ComboboxContentFooter.json +431 -0
  142. package/data/docs/components/pickers/ComboboxContentHeader.json +431 -0
  143. package/data/docs/components/pickers/ComboboxContentListbox.json +541 -0
  144. package/data/docs/components/pickers/ComboboxTrigger.json +336 -0
  145. package/data/docs/components/pickers/Item.json +554 -0
  146. package/data/docs/components/pickers/MenuButton.json +240 -0
  147. package/data/docs/components/pickers/MenuButtonContent.json +442 -0
  148. package/data/docs/components/pickers/MenuButtonContentFooter.json +431 -0
  149. package/data/docs/components/pickers/MenuButtonContentHeader.json +431 -0
  150. package/data/docs/components/pickers/MenuButtonContentMenu.json +523 -0
  151. package/data/docs/components/pickers/MenuButtonTrigger.json +287 -0
  152. package/data/docs/components/pickers/Select.json +258 -0
  153. package/data/docs/components/pickers/SelectContent.json +442 -0
  154. package/data/docs/components/pickers/SelectTrigger.json +298 -0
  155. package/data/docs/components/popovers/BaseDialog.json +114 -0
  156. package/data/docs/components/popovers/BaseDialogContent.json +21 -0
  157. package/data/docs/components/popovers/BasePopover.json +171 -0
  158. package/data/docs/components/popovers/BaseToggletip.json +184 -0
  159. package/data/docs/components/popovers/BaseTooltip.json +121 -0
  160. package/data/docs/components/popovers/Button.json +402 -0
  161. package/data/docs/components/popovers/ButtonLink.json +568 -0
  162. package/data/docs/components/popovers/Dialog.json +114 -0
  163. package/data/docs/components/popovers/DialogContent.json +21 -0
  164. package/data/docs/components/popovers/DialogContentActions.json +442 -0
  165. package/data/docs/components/popovers/DialogContentBody.json +442 -0
  166. package/data/docs/components/popovers/DialogContentHeader.json +76 -0
  167. package/data/docs/components/popovers/DialogTrigger.json +276 -0
  168. package/data/docs/components/popovers/IconButton.json +371 -0
  169. package/data/docs/components/popovers/IconButtonLink.json +588 -0
  170. package/data/docs/components/popovers/Link.json +552 -0
  171. package/data/docs/components/popovers/LinkButton.json +397 -0
  172. package/data/docs/components/popovers/Popover.json +171 -0
  173. package/data/docs/components/popovers/PopoverContent.json +442 -0
  174. package/data/docs/components/popovers/PopoverTrigger.json +276 -0
  175. package/data/docs/components/popovers/Toast.json +145 -0
  176. package/data/docs/components/popovers/ToastContainer.json +122 -0
  177. package/data/docs/components/popovers/Toggletip.json +184 -0
  178. package/data/docs/components/popovers/ToggletipContent.json +402 -0
  179. package/data/docs/components/popovers/ToggletipTrigger.json +276 -0
  180. package/data/docs/components/popovers/Tooltip.json +121 -0
  181. package/data/docs/components/popovers/TooltipContent.json +402 -0
  182. package/data/docs/components/popovers/TooltipTrigger.json +276 -0
  183. package/data/docs/components/products/Dialog.json +106 -0
  184. package/data/docs/components/products/MenuButton.json +232 -0
  185. package/data/docs/components/products/PulsedRadarImage.json +9 -0
  186. package/data/docs/components/products/RadarButton.json +402 -0
  187. package/data/docs/components/products/RadarItem.json +554 -0
  188. package/data/docs/components/table/ControlledPagination.json +9 -0
  189. package/data/docs/components/table/DataGrid.json +93 -0
  190. package/data/docs/components/table/GridToolbarFilterSemanticField.json +69 -0
  191. package/data/docs/components/table/ServerSideControlledPagination.json +9 -0
  192. package/data/docs/components/table/StatefulDataGrid.json +117 -0
  193. package/data/docs/components/table/TextCell.json +118 -0
  194. package/data/docs/components/table/Toolbar.json +145 -0
  195. package/data/docs/components/table/ToolbarWrapper.json +9 -0
  196. package/data/docs/components-index.json +1206 -0
  197. package/data/docs/components.json +55694 -0
  198. package/data/docs/llms-full.txt +8012 -0
  199. package/data/docs/llms.txt +234 -0
  200. package/data/docs/patterns-catalog.md +359 -0
  201. package/data/docs/patterns.json +712 -0
  202. package/data/metadata.json +4 -0
  203. package/data/patterns/crossfiltered-datagrid-page.mdx +386 -0
  204. package/data/patterns/datagrid-page.mdx +214 -0
  205. package/data/patterns/drilldown-datagrid-page.mdx +291 -0
  206. package/data/patterns/server-datagrid-page.mdx +301 -0
  207. package/data/tokens/properties/components/dark-components.json +1108 -0
  208. package/data/tokens/properties/components/light-components.json +1108 -0
  209. package/data/tokens/properties/core/border-radius.json +3 -0
  210. package/data/tokens/properties/core/color.json +280 -0
  211. package/data/tokens/properties/core/layout.json +14 -0
  212. package/data/tokens/properties/core/typography.json +199 -0
  213. package/data/tokens/redsift-design-tokens.css +1391 -0
  214. package/dist/data-store.d.ts +47 -0
  215. package/dist/data-store.d.ts.map +1 -0
  216. package/dist/data-store.js +152 -0
  217. package/dist/data-store.js.map +1 -0
  218. package/dist/index.d.ts +16 -0
  219. package/dist/index.d.ts.map +1 -0
  220. package/dist/index.js +50 -0
  221. package/dist/index.js.map +1 -0
  222. package/dist/init.d.ts +14 -0
  223. package/dist/init.d.ts.map +1 -0
  224. package/dist/init.js +137 -0
  225. package/dist/init.js.map +1 -0
  226. package/dist/paths.d.ts +30 -0
  227. package/dist/paths.d.ts.map +1 -0
  228. package/dist/paths.js +53 -0
  229. package/dist/paths.js.map +1 -0
  230. package/dist/pattern-store.d.ts +41 -0
  231. package/dist/pattern-store.d.ts.map +1 -0
  232. package/dist/pattern-store.js +177 -0
  233. package/dist/pattern-store.js.map +1 -0
  234. package/dist/prompts.d.ts +14 -0
  235. package/dist/prompts.d.ts.map +1 -0
  236. package/dist/prompts.js +762 -0
  237. package/dist/prompts.js.map +1 -0
  238. package/dist/resources.d.ts +14 -0
  239. package/dist/resources.d.ts.map +1 -0
  240. package/dist/resources.js +482 -0
  241. package/dist/resources.js.map +1 -0
  242. package/dist/scaffold.d.ts +31 -0
  243. package/dist/scaffold.d.ts.map +1 -0
  244. package/dist/scaffold.js +239 -0
  245. package/dist/scaffold.js.map +1 -0
  246. package/dist/token-store.d.ts +70 -0
  247. package/dist/token-store.d.ts.map +1 -0
  248. package/dist/token-store.js +196 -0
  249. package/dist/token-store.js.map +1 -0
  250. package/dist/tools.d.ts +15 -0
  251. package/dist/tools.d.ts.map +1 -0
  252. package/dist/tools.js +491 -0
  253. package/dist/tools.js.map +1 -0
  254. package/dist/types.d.ts +108 -0
  255. package/dist/types.d.ts.map +1 -0
  256. package/dist/types.js +17 -0
  257. package/dist/types.js.map +1 -0
  258. package/package.json +39 -0
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # Red Sift Design System — MCP Server
2
+
3
+ A [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server that gives AI assistants deep knowledge of the Red Sift Design System. It provides tools for component search, prop documentation, code generation, design token lookup, and composition pattern guidance.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # From the design-system repo root:
9
+ yarn mcp:build # Build the server
10
+ yarn mcp:start # Run (production)
11
+ yarn mcp:dev # Run (development, no build needed)
12
+ ```
13
+
14
+ The server uses **stdio transport** — it communicates over stdin/stdout and is designed to be launched by an AI client (VS Code, Claude Desktop, etc.), not run as a standalone HTTP server.
15
+
16
+ ## Architecture
17
+
18
+ ```
19
+ scripts/extract-component-docs.ts
20
+ ↓ yarn extract:docs
21
+ docs/components.json, components-index.json, patterns.json, patterns-catalog.md
22
+ ↓ loaded at startup
23
+ DataStore, TokenStore, PatternStore
24
+ ↓ queried by
25
+ Tools (10) + Resources (7) + Prompts (7)
26
+ ↓ exposed via
27
+ MCP stdio transport → AI client
28
+ ```
29
+
30
+ ### Data Flow
31
+
32
+ 1. **`yarn extract:docs`** parses the component source files and generates machine-readable documentation in `docs/`.
33
+ 2. At startup, the MCP server loads `docs/components.json`, `docs/components-index.json`, `docs/patterns.json`, and `docs/patterns-catalog.md` into in-memory stores.
34
+ 3. AI clients call tools, read resources, and use prompts — all backed by the stores.
35
+
36
+ **Important:** If you add or change components, run `yarn extract:docs` to regenerate the data the MCP server sees.
37
+
38
+ ## Tools
39
+
40
+ | Tool | Description | Key Parameters |
41
+ | ----------------------------- | ----------------------------------------------------- | -------------------------------------------------------- |
42
+ | `search_components` | Search components by name, description, or keyword | `query`, `package?`, `limit?` |
43
+ | `get_component_props` | Get full prop documentation grouped by category | `name`, `package?` |
44
+ | `get_component_usage` | Get import statement and minimal JSX example | `name`, `package?` |
45
+ | `list_packages` | List all packages with component counts | — |
46
+ | `generate_component_scaffold` | Generate all 6 boilerplate files for a new component | `name`, `package?`, `element?`, `description?`, `props?` |
47
+ | `search_design_tokens` | Search design tokens by name, value, or CSS variable | `query`, `category?`, `limit?` |
48
+ | `get_design_tokens` | Get all tokens for a category | `category` |
49
+ | `get_css_variables` | Find CSS custom properties by component or token type | `pattern`, `limit?` |
50
+ | `update_changelog` | Generate a formatted CHANGELOG.md entry | `type`, `package`, `description` |
51
+ | `search_patterns` | Search composition patterns for common UI scenarios | `query`, `limit?` |
52
+
53
+ ## Resources
54
+
55
+ | URI | Description |
56
+ | --------------------------------------------- | --------------------------------------------------------------------------- |
57
+ | `design-system://llms.txt` | Lightweight overview of all components for initial orientation |
58
+ | `design-system://llms-full.txt` | Complete documentation for all 170+ components |
59
+ | `design-system://conventions` | Component structure conventions, naming rules, coding patterns |
60
+ | `design-system://usage-rules` | Mandatory lookup rules for consuming projects (prevents prop hallucination) |
61
+ | `design-system://components/{package}/{name}` | Full JSON documentation for a specific component |
62
+ | `design-system://patterns-catalog` | Markdown catalog of all composition patterns |
63
+ | `design-system://patterns/{slug}` | Full pattern spec: anatomy, state hooks, data contracts, demo code |
64
+
65
+ ## Prompts
66
+
67
+ | Prompt | Description | Key Arguments |
68
+ | ------------------ | --------------------------------------------------- | -------------------------------------------------------------------- |
69
+ | `create-component` | Step-by-step guide to scaffold a new component | `name`, `package?`, `element?`, `description?` |
70
+ | `add-prop` | Guide to add a prop across all component files | `component`, `propName`, `propType`, `required?`, `defaultValue?` |
71
+ | `build-form` | Generate a form composition from field definitions | `fields`, `submitLabel?`, `layout?` |
72
+ | `pr-description` | Generate a PR description from the repo template | `title`, `changes`, `issueNumber?`, `packages?` |
73
+ | `implement-ui` | Build a UI from a description using proven patterns | `description`, `target?` |
74
+ | `create-pattern` | Create a new pattern page for the website | `name`, `description`, `components`, `relatedPatterns?`, `variants?` |
75
+ | `add-demo` | Create a demo file for the documentation website | `patternSlug`, `variant`, `description` |
76
+
77
+ ## Using in Other Projects
78
+
79
+ The MCP server runs locally from this repo and is available to any AI tool on your machine. It does **not** need to be installed in the consuming project.
80
+
81
+ ### VS Code (Copilot Chat) — Recommended
82
+
83
+ Add to the consuming project's `.vscode/mcp.json`:
84
+
85
+ ```json
86
+ {
87
+ "servers": {
88
+ "design-system": {
89
+ "type": "stdio",
90
+ "command": "node",
91
+ "args": ["/absolute/path/to/design-system/apps/mcp-server/dist/index.js"]
92
+ }
93
+ }
94
+ }
95
+ ```
96
+
97
+ > **Tip:** Run `yarn mcp:build` in this repo first. For a build-free setup, use `tsx`:
98
+ >
99
+ > ```json
100
+ > {
101
+ > "servers": {
102
+ > "design-system": {
103
+ > "type": "stdio",
104
+ > "command": "npx",
105
+ > "args": ["tsx", "/absolute/path/to/design-system/apps/mcp-server/src/index.ts"]
106
+ > }
107
+ > }
108
+ > }
109
+ > ```
110
+
111
+ ### Claude Desktop
112
+
113
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
114
+
115
+ ```json
116
+ {
117
+ "mcpServers": {
118
+ "design-system": {
119
+ "command": "node",
120
+ "args": ["/absolute/path/to/design-system/apps/mcp-server/dist/index.js"]
121
+ }
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Any MCP-compatible Client
127
+
128
+ The server uses stdio transport. Point any MCP client at:
129
+
130
+ ```
131
+ node /absolute/path/to/design-system/apps/mcp-server/dist/index.js
132
+ ```
133
+
134
+ ### Forcing Correct Usage (Preventing Hallucination)
135
+
136
+ LLMs often guess component props based on other design systems (MUI, Chakra, etc.). To force them to look up the actual API, copy one of the instruction files from `consumer-instructions/` into your project:
137
+
138
+ | File | Target | Where to place it |
139
+ | --------------------------------------- | --------------- | --------------------------------------- |
140
+ | `redsift-design-system.instructions.md` | VS Code Copilot | `.github/instructions/` in your project |
141
+ | `CLAUDE.md` | Claude Code | Project root |
142
+ | `.cursorrules` | Cursor | Project root |
143
+
144
+ These files contain mandatory rules that tell the AI to call `get_component_props` before using any `@redsift/*` component.
145
+
146
+ ## Development
147
+
148
+ ### Source Files
149
+
150
+ | File | Purpose |
151
+ | ---------------------- | --------------------------------------------------------- |
152
+ | `src/index.ts` | Server entry point, store initialization, stdio transport |
153
+ | `src/tools.ts` | All MCP tool registrations |
154
+ | `src/resources.ts` | All MCP resource registrations |
155
+ | `src/prompts.ts` | All MCP prompt registrations |
156
+ | `src/data-store.ts` | Component data loading, search, and lookup |
157
+ | `src/token-store.ts` | Design token loading and search |
158
+ | `src/pattern-store.ts` | Pattern loading, search, and demo code extraction |
159
+ | `src/scaffold.ts` | Component boilerplate generation |
160
+ | `src/types.ts` | Shared TypeScript interfaces |
161
+
162
+ ### Adding a New Tool
163
+
164
+ 1. Open `src/tools.ts`
165
+ 2. Add a `server.tool(...)` call inside `registerTools()`
166
+ 3. Follow the existing pattern: name, schema with `z.object(...)`, description, handler
167
+ 4. Rebuild: `yarn mcp:build`
168
+
169
+ ### Adding a New Resource
170
+
171
+ 1. Open `src/resources.ts`
172
+ 2. Add a `server.resource(...)` call inside `registerResources()`
173
+ 3. For static resources, use a direct URI. For templates, use `new ResourceTemplate(...)`
174
+ 4. Rebuild: `yarn mcp:build`
175
+
176
+ ### Adding a New Prompt
177
+
178
+ 1. Open `src/prompts.ts`
179
+ 2. Add a `server.registerPrompt(...)` call inside `registerPrompts()`
180
+ 3. Define `argsSchema` with Zod and return `{ messages: [...] }`
181
+ 4. Rebuild: `yarn mcp:build`
182
+
183
+ ### Updating Data
184
+
185
+ When components are added, removed, or modified:
186
+
187
+ ```bash
188
+ yarn extract:docs # Regenerate docs/components.json, etc.
189
+ yarn mcp:build # Rebuild the server
190
+ ```
191
+
192
+ ### Testing
193
+
194
+ Use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) to test tools and resources interactively:
195
+
196
+ ```bash
197
+ npx @modelcontextprotocol/inspector node apps/mcp-server/dist/index.js
198
+ ```
199
+
200
+ Or verify in VS Code by opening Copilot Chat and asking:
201
+
202
+ - "Search for button components in the design system" → should call `search_components`
203
+ - "What props does DataGrid accept?" → should call `get_component_props`
@@ -0,0 +1,80 @@
1
+ # Red Sift Design System — Mandatory Lookup Rules
2
+
3
+ > **This file is for projects that consume the Red Sift Design System.** It ensures your AI assistant uses the MCP server to look up component APIs instead of guessing.
4
+
5
+ This project uses the **Red Sift Design System** (`@redsift/*` packages). The design system has its own prop names, variants, and API conventions that **differ from other component libraries** (MUI, Chakra, Ant Design, Radix, etc.).
6
+
7
+ **DO NOT guess or infer component props.** Always look them up using the `design-system` MCP server.
8
+
9
+ ## Setup Checklist
10
+
11
+ 1. Configure the MCP server — see [MCP Server docs](https://design-system.redsift.io/introduction/mcp-server)
12
+ 2. Copy this file to your project root as `.cursorrules`
13
+ 3. Verify: ask the AI _"What props does Button accept?"_ — it should call `get_component_props`, not answer from memory
14
+
15
+ ## Rule 1 — Mandatory Prop Lookup
16
+
17
+ Before using ANY component from `@redsift/design-system`, `@redsift/icons`, `@redsift/popovers`, `@redsift/pickers`, `@redsift/table`, `@redsift/charts`, `@redsift/dashboard`, or `@redsift/products`:
18
+
19
+ 1. Call `get_component_props` to look up the exact props, types, accepted values, and defaults.
20
+ 2. **Only use prop values that appear in the returned documentation.**
21
+ 3. If a prop you expect is NOT listed, it does not exist — do not add it.
22
+
23
+ **Why:** The Red Sift DS uses custom prop names and variants. Guessing based on other libraries will produce incorrect code.
24
+
25
+ ## Rule 2 — Import Verification
26
+
27
+ Always call `get_component_usage` to get the correct import path and package. Components may live in different packages than expected (e.g., `Select` is in `@redsift/pickers`, not `@redsift/design-system`).
28
+
29
+ ## Rule 3 — Pattern Lookup for Page Layouts
30
+
31
+ When building a page layout, complex form, data table page, or any multi-component composition:
32
+
33
+ 1. Call `search_patterns` to check for an existing proven pattern.
34
+ 2. If a match exists, fetch the full spec with the `design-system://patterns/{slug}` resource — it includes state management hooks, data contracts, implementation checklists, and complete working code.
35
+
36
+ ## Rule 4 — Design Token Lookup
37
+
38
+ When applying colors, spacing, or typography:
39
+
40
+ 1. Call `search_design_tokens` to find the correct token names and CSS custom properties.
41
+ 2. Do not hardcode color hex values — use the design token CSS variables.
42
+
43
+ ## Common Mistakes
44
+
45
+ These are real examples of props that do NOT exist in the Red Sift DS:
46
+
47
+ - `variant="primary"` → Look up actual variants with `get_component_props`
48
+ - `size="sm"` / `size="lg"` → Most components have no size prop — verify with `get_component_props`
49
+ - `colorScheme="red"` → Does not exist
50
+ - `isDisabled` → Use `disabled`
51
+ - `onPress` → Use `onClick`
52
+ - `import { Select } from '@redsift/design-system'` → Should be `@redsift/pickers`
53
+ - `import { Dialog } from '@redsift/design-system'` → Should be `@redsift/popovers`
54
+ - `import { DataGrid } from '@redsift/design-system'` → Should be `@redsift/table`
55
+
56
+ ## NEVER Do This
57
+
58
+ ```tsx
59
+ // ❌ WRONG — Button has NO size prop
60
+ <Button size="small">Save</Button>
61
+
62
+ // ❌ WRONG — "primary" is not a valid variant
63
+ <Button variant="primary">Save</Button>
64
+
65
+ // ❌ WRONG — these props do not exist
66
+ <TextField colorScheme="red" />
67
+ <Button isDisabled />
68
+ <Button onPress={() => {}} />
69
+
70
+ // ❌ WRONG — wrong package
71
+ import { Select } from '@redsift/design-system';
72
+ ```
73
+
74
+ ## Verification
75
+
76
+ Test that your AI assistant is using the MCP server correctly with these prompts:
77
+
78
+ 1. _"What props does Button accept?"_ → Should call `get_component_props`, NOT answer from memory
79
+ 2. _"Import the Select component"_ → Should call `get_component_usage`, return `@redsift/pickers`
80
+ 3. _"Create a data table page"_ → Should call `search_patterns` first, then follow the pattern spec
@@ -0,0 +1,80 @@
1
+ # Red Sift Design System — Mandatory Lookup Rules
2
+
3
+ > **This file is for projects that consume the Red Sift Design System.** It ensures your AI assistant uses the MCP server to look up component APIs instead of guessing.
4
+
5
+ This project uses the **Red Sift Design System** (`@redsift/*` packages). The design system has its own prop names, variants, and API conventions that **differ from other component libraries** (MUI, Chakra, Ant Design, Radix, etc.).
6
+
7
+ **DO NOT guess or infer component props.** Always look them up using the `design-system` MCP server.
8
+
9
+ ## Setup Checklist
10
+
11
+ 1. Configure the MCP server — see [MCP Server docs](https://design-system.redsift.io/introduction/mcp-server)
12
+ 2. Copy this file to your project root as `.cursorrules`
13
+ 3. Verify: ask the AI *"What props does Button accept?"* — it should call `get_component_props`, not answer from memory
14
+
15
+ ## Rule 1 — Mandatory Prop Lookup
16
+
17
+ Before using ANY component from `@redsift/design-system`, `@redsift/icons`, `@redsift/popovers`, `@redsift/pickers`, `@redsift/table`, `@redsift/charts`, `@redsift/dashboard`, or `@redsift/products`:
18
+
19
+ 1. Call `get_component_props` to look up the exact props, types, accepted values, and defaults.
20
+ 2. **Only use prop values that appear in the returned documentation.**
21
+ 3. If a prop you expect is NOT listed, it does not exist — do not add it.
22
+
23
+ **Why:** The Red Sift DS uses custom prop names and variants. Guessing based on other libraries will produce incorrect code.
24
+
25
+ ## Rule 2 — Import Verification
26
+
27
+ Always call `get_component_usage` to get the correct import path and package. Components may live in different packages than expected (e.g., `Select` is in `@redsift/pickers`, not `@redsift/design-system`).
28
+
29
+ ## Rule 3 — Pattern Lookup for Page Layouts
30
+
31
+ When building a page layout, complex form, data table page, or any multi-component composition:
32
+
33
+ 1. Call `search_patterns` to check for an existing proven pattern.
34
+ 2. If a match exists, fetch the full spec with the `design-system://patterns/{slug}` resource — it includes state management hooks, data contracts, implementation checklists, and complete working code.
35
+
36
+ ## Rule 4 — Design Token Lookup
37
+
38
+ When applying colors, spacing, or typography:
39
+
40
+ 1. Call `search_design_tokens` to find the correct token names and CSS custom properties.
41
+ 2. Do not hardcode color hex values — use the design token CSS variables.
42
+
43
+ ## Common Mistakes
44
+
45
+ These are real examples of props that do NOT exist in the Red Sift DS:
46
+
47
+ - `variant="primary"` → Look up actual variants with `get_component_props`
48
+ - `size="sm"` / `size="lg"` → Most components have no size prop — verify with `get_component_props`
49
+ - `colorScheme="red"` → Does not exist
50
+ - `isDisabled` → Use `disabled`
51
+ - `onPress` → Use `onClick`
52
+ - `import { Select } from '@redsift/design-system'` → Should be `@redsift/pickers`
53
+ - `import { Dialog } from '@redsift/design-system'` → Should be `@redsift/popovers`
54
+ - `import { DataGrid } from '@redsift/design-system'` → Should be `@redsift/table`
55
+
56
+ ## NEVER Do This
57
+
58
+ ```tsx
59
+ // ❌ WRONG — Button has NO size prop
60
+ <Button size="small">Save</Button>
61
+
62
+ // ❌ WRONG — "primary" is not a valid variant
63
+ <Button variant="primary">Save</Button>
64
+
65
+ // ❌ WRONG — these props do not exist
66
+ <TextField colorScheme="red" />
67
+ <Button isDisabled />
68
+ <Button onPress={() => {}} />
69
+
70
+ // ❌ WRONG — wrong package
71
+ import { Select } from '@redsift/design-system';
72
+ ```
73
+
74
+ ## Verification
75
+
76
+ Test that your AI assistant is using the MCP server correctly with these prompts:
77
+
78
+ 1. *"What props does Button accept?"* → Should call `get_component_props`, NOT answer from memory
79
+ 2. *"Import the Select component"* → Should call `get_component_usage`, return `@redsift/pickers`
80
+ 3. *"Create a data table page"* → Should call `search_patterns` first, then follow the pattern spec
@@ -0,0 +1,87 @@
1
+ # Red Sift Design System — Mandatory Lookup Rules
2
+
3
+ > **This file is for projects that consume the Red Sift Design System.** It ensures your AI assistant uses the MCP server to look up component APIs instead of guessing.
4
+
5
+ This project uses the **Red Sift Design System** (`@redsift/*` packages). The design system has its own prop names, variants, and API conventions that **differ from other component libraries** (MUI, Chakra, Ant Design, Radix, etc.).
6
+
7
+ **DO NOT guess or infer component props.** Always look them up using the `design-system` MCP server.
8
+
9
+ ## Setup Checklist
10
+
11
+ 1. Configure the MCP server — see [MCP Server docs](https://design-system.redsift.io/introduction/mcp-server)
12
+ 2. Copy this file to your project root as `CLAUDE.md`
13
+ 3. Verify: ask the AI _"What props does Button accept?"_ — it should call `get_component_props`, not answer from memory
14
+
15
+ ## Rule 1 — Mandatory Prop Lookup
16
+
17
+ Before using ANY component from `@redsift/design-system`, `@redsift/icons`, `@redsift/popovers`, `@redsift/pickers`, `@redsift/table`, `@redsift/charts`, `@redsift/dashboard`, or `@redsift/products`:
18
+
19
+ 1. Call `get_component_props` to look up the exact props, types, accepted values, and defaults.
20
+ 2. **Only use prop values that appear in the returned documentation.**
21
+ 3. If a prop you expect is NOT listed, it does not exist — do not add it.
22
+
23
+ **Why:** The Red Sift DS uses custom prop names and variants. Guessing based on other libraries will produce incorrect code.
24
+
25
+ ## Rule 2 — Import Verification
26
+
27
+ Always call `get_component_usage` to get the correct import path and package. Components may live in different packages than expected (e.g., `Select` is in `@redsift/pickers`, not `@redsift/design-system`).
28
+
29
+ ## Rule 3 — Pattern Lookup for Page Layouts
30
+
31
+ When building a page layout, complex form, data table page, or any multi-component composition:
32
+
33
+ 1. Call `search_patterns` to check for an existing proven pattern.
34
+ 2. If a match exists, fetch the full spec with the `design-system://patterns/{slug}` resource — it includes state management hooks, data contracts, implementation checklists, and complete working code.
35
+
36
+ ## Rule 4 — Design Token Lookup
37
+
38
+ When applying colors, spacing, or typography:
39
+
40
+ 1. Call `search_design_tokens` to find the correct token names and CSS custom properties.
41
+ 2. Do not hardcode color hex values — use the design token CSS variables.
42
+
43
+ ## NEVER Do This
44
+
45
+ These are concrete examples of wrong code. **Every single one will fail:**
46
+
47
+ ```tsx
48
+ // ❌ WRONG — Button has NO size prop
49
+ <Button size="small">Save</Button>
50
+
51
+ // ❌ WRONG — "primary" is not a valid variant
52
+ <Button variant="primary">Save</Button>
53
+
54
+ // ❌ WRONG — these props do not exist
55
+ <TextField colorScheme="red" />
56
+ <Button isDisabled />
57
+ <Button onPress={() => {}} />
58
+
59
+ // ❌ WRONG — wrong package
60
+ import { Select } from '@redsift/design-system';
61
+ ```
62
+
63
+ ## Common Mistakes
64
+
65
+ | Wrong (guessed) | Correct (actual) | How to verify |
66
+ | --------------------------------------------------- | -------------------------------------------- | --------------------------------------- |
67
+ | `variant="primary"` | Look up actual variants | `get_component_props` for the component |
68
+ | `size="sm"` / `size="lg"` | Most components have no size prop | `get_component_props` for the component |
69
+ | `colorScheme="red"` | Does not exist | `get_component_props` for the component |
70
+ | `isDisabled` | `disabled` | `get_component_props` for the component |
71
+ | `onPress` | `onClick` | `get_component_props` for the component |
72
+ | `leftIcon` / `rightIcon` | Look up actual icon prop names | `get_component_props` for the component |
73
+ | `import { Select } from '@redsift/design-system'` | `import { Select } from '@redsift/pickers'` | `get_component_usage` |
74
+ | `import { Dialog } from '@redsift/design-system'` | `import { Dialog } from '@redsift/popovers'` | `get_component_usage` |
75
+ | `import { DataGrid } from '@redsift/design-system'` | `import { DataGrid } from '@redsift/table'` | `get_component_usage` |
76
+
77
+ ## Verification
78
+
79
+ Test that your AI assistant is using the MCP server correctly with these prompts:
80
+
81
+ 1. _"What props does Button accept?"_ → Should call `get_component_props`, NOT answer from memory
82
+ 2. _"Import the Select component"_ → Should call `get_component_usage`, return `@redsift/pickers`
83
+ 3. _"Create a data table page"_ → Should call `search_patterns` first, then follow the pattern spec
84
+
85
+ ## MCP Server Setup
86
+
87
+ This file assumes the `design-system` MCP server is configured. See the [MCP Server documentation](https://design-system.redsift.io/introduction/mcp-server) for setup instructions.
@@ -0,0 +1,87 @@
1
+ ---
2
+ applyTo: '**/*.{tsx,jsx}'
3
+ ---
4
+
5
+ # Red Sift Design System — Mandatory Lookup Rules
6
+
7
+ > **This file is for projects that consume the Red Sift Design System.** It ensures your AI assistant uses the MCP server to look up component APIs instead of guessing.
8
+
9
+ This project uses the **Red Sift Design System** (`@redsift/*` packages). The design system has its own prop names, variants, and API conventions that **differ from other component libraries** (MUI, Chakra, Ant Design, Radix, etc.).
10
+
11
+ **DO NOT guess or infer component props.** Always look them up using the `design-system` MCP server.
12
+
13
+ ## Setup Checklist
14
+
15
+ 1. Configure the MCP server in `.vscode/mcp.json` — see [MCP Server docs](https://design-system.redsift.io/introduction/mcp-server)
16
+ 2. Copy this file to `.github/instructions/` in your project
17
+ 3. Verify: ask the AI _"What props does Button accept?"_ — it should call `get_component_props`, not answer from memory
18
+
19
+ ## Rule 1 — Mandatory Prop Lookup
20
+
21
+ Before using ANY component from `@redsift/design-system`, `@redsift/icons`, `@redsift/popovers`, `@redsift/pickers`, `@redsift/table`, `@redsift/charts`, `@redsift/dashboard`, or `@redsift/products`:
22
+
23
+ 1. Call `get_component_props` to look up the exact props, types, accepted values, and defaults.
24
+ 2. **Only use prop values that appear in the returned documentation.**
25
+ 3. If a prop you expect is NOT listed, it does not exist — do not add it.
26
+
27
+ **Why:** The Red Sift DS uses custom prop names and variants. Guessing based on other libraries will produce incorrect code.
28
+
29
+ ## Rule 2 — Import Verification
30
+
31
+ Always call `get_component_usage` to get the correct import path and package. Components may live in different packages than expected (e.g., `Select` is in `@redsift/pickers`, not `@redsift/design-system`).
32
+
33
+ ## Rule 3 — Pattern Lookup for Page Layouts
34
+
35
+ When building a page layout, complex form, data table page, or any multi-component composition:
36
+
37
+ 1. Call `search_patterns` to check for an existing proven pattern.
38
+ 2. If a match exists, fetch the full spec with the `design-system://patterns/{slug}` resource — it includes state management hooks, data contracts, implementation checklists, and complete working code.
39
+
40
+ ## Rule 4 — Design Token Lookup
41
+
42
+ When applying colors, spacing, or typography:
43
+
44
+ 1. Call `search_design_tokens` to find the correct token names and CSS custom properties.
45
+ 2. Do not hardcode color hex values — use the design token CSS variables.
46
+
47
+ ## NEVER Do This
48
+
49
+ These are concrete examples of wrong code. **Every single one will fail:**
50
+
51
+ ```tsx
52
+ // ❌ WRONG — Button has NO size prop
53
+ <Button size="small">Save</Button>
54
+
55
+ // ❌ WRONG — "primary" is not a valid variant
56
+ <Button variant="primary">Save</Button>
57
+
58
+ // ❌ WRONG — these props do not exist
59
+ <TextField colorScheme="red" />
60
+ <Button isDisabled />
61
+ <Button onPress={() => {}} />
62
+
63
+ // ❌ WRONG — wrong package
64
+ import { Select } from '@redsift/design-system';
65
+ ```
66
+
67
+ ## Common Mistakes
68
+
69
+ | Wrong (guessed) | Correct (actual) | How to verify |
70
+ | --------------------------------------------------- | -------------------------------------------- | --------------------------------------- |
71
+ | `variant="primary"` | Look up actual variants | `get_component_props` for the component |
72
+ | `size="sm"` / `size="lg"` | Most components have no size prop | `get_component_props` for the component |
73
+ | `colorScheme="red"` | Does not exist | `get_component_props` for the component |
74
+ | `isDisabled` | `disabled` | `get_component_props` for the component |
75
+ | `onPress` | `onClick` | `get_component_props` for the component |
76
+ | `leftIcon` / `rightIcon` | Look up actual icon prop names | `get_component_props` for the component |
77
+ | `import { Select } from '@redsift/design-system'` | `import { Select } from '@redsift/pickers'` | `get_component_usage` |
78
+ | `import { Dialog } from '@redsift/design-system'` | `import { Dialog } from '@redsift/popovers'` | `get_component_usage` |
79
+ | `import { DataGrid } from '@redsift/design-system'` | `import { DataGrid } from '@redsift/table'` | `get_component_usage` |
80
+
81
+ ## Verification
82
+
83
+ Test that your AI assistant is using the MCP server correctly with these prompts:
84
+
85
+ 1. _"What props does Button accept?"_ → Should call `get_component_props`, NOT answer from memory
86
+ 2. _"Import the Select component"_ → Should call `get_component_usage`, return `@redsift/pickers`
87
+ 3. _"Create a data table page"_ → Should call `search_patterns` first, then follow the pattern spec