@devalok/shilp-sutra 0.38.0 → 0.40.0

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 (361) hide show
  1. package/AGENTS.md +151 -0
  2. package/MIGRATION.md +255 -0
  3. package/README.md +3 -0
  4. package/dist/_chunks/badge-group.js +76 -75
  5. package/dist/_chunks/badge-group.js.map +1 -1
  6. package/dist/_chunks/chart-container.js +50 -0
  7. package/dist/_chunks/chart-container.js.map +1 -0
  8. package/dist/_chunks/chat.js +236 -228
  9. package/dist/_chunks/chat.js.map +1 -1
  10. package/dist/_chunks/colors.js +30 -0
  11. package/dist/_chunks/colors.js.map +1 -0
  12. package/dist/_chunks/document-preview.js +2 -2
  13. package/dist/_chunks/document-preview.js.map +1 -1
  14. package/dist/_chunks/emoji-data.js +45 -0
  15. package/dist/_chunks/emoji-data.js.map +1 -0
  16. package/dist/_chunks/grid-lines.js +72 -0
  17. package/dist/_chunks/grid-lines.js.map +1 -0
  18. package/dist/_chunks/image-preview.js +2 -2
  19. package/dist/_chunks/image-preview.js.map +1 -1
  20. package/dist/_chunks/mention-suggestion.js +35 -263
  21. package/dist/_chunks/mention-suggestion.js.map +1 -1
  22. package/dist/_chunks/normalize-icon.js +18 -0
  23. package/dist/_chunks/normalize-icon.js.map +1 -0
  24. package/dist/_chunks/oauth-button.js +227 -0
  25. package/dist/_chunks/oauth-button.js.map +1 -0
  26. package/dist/_chunks/popover.js +3 -3
  27. package/dist/_chunks/popover.js.map +1 -1
  28. package/dist/_chunks/primitives.js +107 -107
  29. package/dist/_chunks/primitives.js.map +1 -1
  30. package/dist/_chunks/shared.js +5 -5
  31. package/dist/_chunks/shared.js.map +1 -1
  32. package/dist/_chunks/{text.js → success.js} +26 -63
  33. package/dist/_chunks/success.js.map +1 -0
  34. package/dist/_chunks/tiptap.js +1952 -1949
  35. package/dist/_chunks/tiptap.js.map +1 -1
  36. package/dist/_chunks/tooltip.js +58 -0
  37. package/dist/_chunks/tooltip.js.map +1 -0
  38. package/dist/_chunks/tree-view.js +101 -96
  39. package/dist/_chunks/tree-view.js.map +1 -1
  40. package/dist/_chunks/use-calendar.js +5 -5
  41. package/dist/_chunks/use-calendar.js.map +1 -1
  42. package/dist/ai/ai-command-provider.d.ts +3 -2
  43. package/dist/ai/ai-command-provider.d.ts.map +1 -1
  44. package/dist/ai/ai-command-provider.js.map +1 -1
  45. package/dist/ai/block-renderer.js +11 -9
  46. package/dist/ai/block-renderer.js.map +1 -1
  47. package/dist/ai/blocks/error.js +31 -0
  48. package/dist/ai/blocks/error.js.map +1 -0
  49. package/dist/ai/blocks/index.d.ts +0 -2
  50. package/dist/ai/blocks/index.d.ts.map +1 -1
  51. package/dist/ai/blocks/index.js +2 -2
  52. package/dist/ai/blocks/text.js +19 -0
  53. package/dist/ai/blocks/text.js.map +1 -0
  54. package/dist/ai/command-bar.d.ts.map +1 -1
  55. package/dist/ai/command-bar.js +198 -193
  56. package/dist/ai/command-bar.js.map +1 -1
  57. package/dist/ai/conversation.d.ts +2 -1
  58. package/dist/ai/conversation.d.ts.map +1 -1
  59. package/dist/ai/conversation.js +92 -87
  60. package/dist/ai/conversation.js.map +1 -1
  61. package/dist/ai/index.d.ts +0 -4
  62. package/dist/ai/index.d.ts.map +1 -1
  63. package/dist/ai/index.js +45 -46
  64. package/dist/ai/index.js.map +1 -1
  65. package/dist/composed/activity-feed.d.ts +2 -1
  66. package/dist/composed/activity-feed.d.ts.map +1 -1
  67. package/dist/composed/activity-feed.js +5 -5
  68. package/dist/composed/activity-feed.js.map +1 -1
  69. package/dist/composed/avatar-group.js +4 -4
  70. package/dist/composed/avatar-group.js.map +1 -1
  71. package/dist/composed/bulk-action-bar.d.ts +2 -2
  72. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  73. package/dist/composed/bulk-action-bar.js +12 -12
  74. package/dist/composed/bulk-action-bar.js.map +1 -1
  75. package/dist/composed/command-palette.d.ts +2 -1
  76. package/dist/composed/command-palette.d.ts.map +1 -1
  77. package/dist/composed/command-palette.js +106 -101
  78. package/dist/composed/command-palette.js.map +1 -1
  79. package/dist/composed/content-card.js +1 -1
  80. package/dist/composed/content-card.js.map +1 -1
  81. package/dist/composed/date-picker/index.js +747 -3
  82. package/dist/composed/date-picker/index.js.map +1 -0
  83. package/dist/composed/emoji-picker.js +4 -4
  84. package/dist/composed/emoji-picker.js.map +1 -1
  85. package/dist/composed/empty-state.d.ts +3 -3
  86. package/dist/composed/empty-state.d.ts.map +1 -1
  87. package/dist/composed/empty-state.js +40 -31
  88. package/dist/composed/empty-state.js.map +1 -1
  89. package/dist/composed/error-boundary.js +3 -3
  90. package/dist/composed/error-boundary.js.map +1 -1
  91. package/dist/composed/extensions/emoji-node.js +81 -0
  92. package/dist/composed/extensions/emoji-node.js.map +1 -0
  93. package/dist/composed/extensions/emoji-suggestion.js +117 -0
  94. package/dist/composed/extensions/emoji-suggestion.js.map +1 -0
  95. package/dist/composed/file-preview.js +498 -2
  96. package/dist/composed/file-preview.js.map +1 -0
  97. package/dist/composed/filter-bar.js +1 -1
  98. package/dist/composed/filter-bar.js.map +1 -1
  99. package/dist/composed/index.d.ts +0 -15
  100. package/dist/composed/index.d.ts.map +1 -1
  101. package/dist/composed/index.js +16 -24
  102. package/dist/composed/inline-edit.js +1 -1
  103. package/dist/composed/inline-edit.js.map +1 -1
  104. package/dist/composed/loading-skeleton.js +9 -9
  105. package/dist/composed/loading-skeleton.js.map +1 -1
  106. package/dist/composed/markdown-viewer.js +3 -3
  107. package/dist/composed/markdown-viewer.js.map +1 -1
  108. package/dist/composed/multi-select-popover.js +1 -1
  109. package/dist/composed/multi-select-popover.js.map +1 -1
  110. package/dist/composed/page-header.js +1 -1
  111. package/dist/composed/page-header.js.map +1 -1
  112. package/dist/composed/page-skeletons.js +15 -15
  113. package/dist/composed/page-skeletons.js.map +1 -1
  114. package/dist/composed/priority-indicator.js +3 -3
  115. package/dist/composed/priority-indicator.js.map +1 -1
  116. package/dist/composed/rich-chat-input.js +2073 -2
  117. package/dist/composed/rich-chat-input.js.map +1 -0
  118. package/dist/composed/rich-text-editor.js +75 -72
  119. package/dist/composed/rich-text-editor.js.map +1 -1
  120. package/dist/composed/schedule-view.js +3 -3
  121. package/dist/composed/schedule-view.js.map +1 -1
  122. package/dist/composed/status-badge.d.ts +3 -2
  123. package/dist/composed/status-badge.d.ts.map +1 -1
  124. package/dist/composed/status-badge.js +58 -53
  125. package/dist/composed/status-badge.js.map +1 -1
  126. package/dist/shell/app-command-palette.d.ts +2 -1
  127. package/dist/shell/app-command-palette.d.ts.map +1 -1
  128. package/dist/shell/app-command-palette.js.map +1 -1
  129. package/dist/shell/bottom-navbar.d.ts +3 -1
  130. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  131. package/dist/shell/bottom-navbar.js +94 -86
  132. package/dist/shell/bottom-navbar.js.map +1 -1
  133. package/dist/shell/command-registry.d.ts +2 -1
  134. package/dist/shell/command-registry.d.ts.map +1 -1
  135. package/dist/shell/command-registry.js.map +1 -1
  136. package/dist/shell/notification-center.js +8 -8
  137. package/dist/shell/notification-center.js.map +1 -1
  138. package/dist/shell/notification-preferences.js +1 -1
  139. package/dist/shell/notification-preferences.js.map +1 -1
  140. package/dist/shell/sidebar.d.ts +7 -4
  141. package/dist/shell/sidebar.d.ts.map +1 -1
  142. package/dist/shell/sidebar.js +148 -134
  143. package/dist/shell/sidebar.js.map +1 -1
  144. package/dist/shell/top-bar.d.ts +4 -3
  145. package/dist/shell/top-bar.d.ts.map +1 -1
  146. package/dist/shell/top-bar.js +116 -108
  147. package/dist/shell/top-bar.js.map +1 -1
  148. package/dist/tokens/semantic.css +82 -9
  149. package/dist/ui/accordion.js +1 -1
  150. package/dist/ui/accordion.js.map +1 -1
  151. package/dist/ui/alert-dialog.js +3 -3
  152. package/dist/ui/alert-dialog.js.map +1 -1
  153. package/dist/ui/alert.js +2 -2
  154. package/dist/ui/alert.js.map +1 -1
  155. package/dist/ui/autocomplete.js +2 -2
  156. package/dist/ui/autocomplete.js.map +1 -1
  157. package/dist/ui/avatar.js +11 -11
  158. package/dist/ui/avatar.js.map +1 -1
  159. package/dist/ui/badge-indicator.js +1 -1
  160. package/dist/ui/badge-indicator.js.map +1 -1
  161. package/dist/ui/badge.d.ts +3 -2
  162. package/dist/ui/badge.d.ts.map +1 -1
  163. package/dist/ui/banner.js +1 -1
  164. package/dist/ui/banner.js.map +1 -1
  165. package/dist/ui/breadcrumb.js +1 -1
  166. package/dist/ui/breadcrumb.js.map +1 -1
  167. package/dist/ui/button.d.ts +5 -4
  168. package/dist/ui/button.d.ts.map +1 -1
  169. package/dist/ui/button.js +66 -65
  170. package/dist/ui/button.js.map +1 -1
  171. package/dist/ui/card.js +5 -5
  172. package/dist/ui/card.js.map +1 -1
  173. package/dist/ui/charts/area-chart.js +177 -0
  174. package/dist/ui/charts/area-chart.js.map +1 -0
  175. package/dist/ui/charts/bar-chart.js +127 -0
  176. package/dist/ui/charts/bar-chart.js.map +1 -0
  177. package/dist/ui/charts/chart-container.js +3 -0
  178. package/dist/ui/charts/gauge-chart.js +72 -0
  179. package/dist/ui/charts/gauge-chart.js.map +1 -0
  180. package/dist/ui/charts/index.js +10 -1035
  181. package/dist/ui/charts/line-chart.js +135 -0
  182. package/dist/ui/charts/line-chart.js.map +1 -0
  183. package/dist/ui/charts/pie-chart.js +111 -0
  184. package/dist/ui/charts/pie-chart.js.map +1 -0
  185. package/dist/ui/charts/radar-chart.js +170 -0
  186. package/dist/ui/charts/radar-chart.js.map +1 -0
  187. package/dist/ui/charts/sparkline.js +119 -0
  188. package/dist/ui/charts/sparkline.js.map +1 -0
  189. package/dist/ui/chat/message.d.ts +3 -3
  190. package/dist/ui/chat/message.d.ts.map +1 -1
  191. package/dist/ui/chat/system-message.d.ts +2 -1
  192. package/dist/ui/chat/system-message.d.ts.map +1 -1
  193. package/dist/ui/checkbox.js +1 -1
  194. package/dist/ui/checkbox.js.map +1 -1
  195. package/dist/ui/code.js +2 -2
  196. package/dist/ui/code.js.map +1 -1
  197. package/dist/ui/color-input.js +10 -10
  198. package/dist/ui/color-input.js.map +1 -1
  199. package/dist/ui/color-swatch.js +3 -3
  200. package/dist/ui/color-swatch.js.map +1 -1
  201. package/dist/ui/combobox.d.ts +2 -1
  202. package/dist/ui/combobox.d.ts.map +1 -1
  203. package/dist/ui/combobox.js +100 -95
  204. package/dist/ui/combobox.js.map +1 -1
  205. package/dist/ui/container.d.ts +6 -1
  206. package/dist/ui/container.d.ts.map +1 -1
  207. package/dist/ui/container.js +2 -1
  208. package/dist/ui/container.js.map +1 -1
  209. package/dist/ui/context-menu.js +6 -6
  210. package/dist/ui/context-menu.js.map +1 -1
  211. package/dist/ui/data-table-body.js +1 -1
  212. package/dist/ui/data-table-body.js.map +1 -1
  213. package/dist/ui/data-table-bulk-actions.js +2 -2
  214. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  215. package/dist/ui/data-table-card.js +2 -2
  216. package/dist/ui/data-table-card.js.map +1 -1
  217. package/dist/ui/data-table-header.js +2 -2
  218. package/dist/ui/data-table-header.js.map +1 -1
  219. package/dist/ui/data-table-pagination.js +3 -3
  220. package/dist/ui/data-table-pagination.js.map +1 -1
  221. package/dist/ui/data-table-toolbar.js +1 -1
  222. package/dist/ui/data-table-toolbar.js.map +1 -1
  223. package/dist/ui/data-table.js +1 -1
  224. package/dist/ui/data-table.js.map +1 -1
  225. package/dist/ui/devalok-grain.d.ts +1 -1
  226. package/dist/ui/devalok-grain.js.map +1 -1
  227. package/dist/ui/dialog.js +2 -2
  228. package/dist/ui/dialog.js.map +1 -1
  229. package/dist/ui/dropdown-menu.js +6 -6
  230. package/dist/ui/dropdown-menu.js.map +1 -1
  231. package/dist/ui/file-upload.js +4 -4
  232. package/dist/ui/file-upload.js.map +1 -1
  233. package/dist/ui/hover-card.js +1 -1
  234. package/dist/ui/hover-card.js.map +1 -1
  235. package/dist/ui/icon-button.d.ts +9 -2
  236. package/dist/ui/icon-button.d.ts.map +1 -1
  237. package/dist/ui/icon-button.js +14 -13
  238. package/dist/ui/icon-button.js.map +1 -1
  239. package/dist/ui/index.d.ts +1 -3
  240. package/dist/ui/index.d.ts.map +1 -1
  241. package/dist/ui/index.js +31 -33
  242. package/dist/ui/index.js.map +1 -1
  243. package/dist/ui/input-otp.js +1 -1
  244. package/dist/ui/input-otp.js.map +1 -1
  245. package/dist/ui/input.js +2 -2
  246. package/dist/ui/input.js.map +1 -1
  247. package/dist/ui/lib/icon-input.d.ts +42 -0
  248. package/dist/ui/lib/icon-input.d.ts.map +1 -0
  249. package/dist/ui/lib/normalize-icon.d.ts +39 -0
  250. package/dist/ui/lib/normalize-icon.d.ts.map +1 -0
  251. package/dist/ui/link.js +1 -1
  252. package/dist/ui/link.js.map +1 -1
  253. package/dist/ui/menubar.js +8 -8
  254. package/dist/ui/menubar.js.map +1 -1
  255. package/dist/ui/navigation-menu.js +3 -3
  256. package/dist/ui/navigation-menu.js.map +1 -1
  257. package/dist/ui/number-input.js +3 -3
  258. package/dist/ui/number-input.js.map +1 -1
  259. package/dist/ui/oauth-button/index.d.ts +3 -0
  260. package/dist/ui/oauth-button/index.d.ts.map +1 -0
  261. package/dist/ui/oauth-button/index.js +3 -0
  262. package/dist/ui/oauth-button/oauth-button.d.ts +208 -0
  263. package/dist/ui/oauth-button/oauth-button.d.ts.map +1 -0
  264. package/dist/ui/pagination.js +1 -1
  265. package/dist/ui/pagination.js.map +1 -1
  266. package/dist/ui/progress.js +2 -2
  267. package/dist/ui/progress.js.map +1 -1
  268. package/dist/ui/radio.js +1 -1
  269. package/dist/ui/radio.js.map +1 -1
  270. package/dist/ui/segmented-control.d.ts +3 -4
  271. package/dist/ui/segmented-control.d.ts.map +1 -1
  272. package/dist/ui/segmented-control.js +53 -45
  273. package/dist/ui/segmented-control.js.map +1 -1
  274. package/dist/ui/select.js +3 -3
  275. package/dist/ui/select.js.map +1 -1
  276. package/dist/ui/sheet.js +2 -2
  277. package/dist/ui/sheet.js.map +1 -1
  278. package/dist/ui/sidebar.js +11 -11
  279. package/dist/ui/sidebar.js.map +1 -1
  280. package/dist/ui/skeleton.js +9 -9
  281. package/dist/ui/skeleton.js.map +1 -1
  282. package/dist/ui/slider.js +2 -2
  283. package/dist/ui/slider.js.map +1 -1
  284. package/dist/ui/split-button.js +7 -7
  285. package/dist/ui/split-button.js.map +1 -1
  286. package/dist/ui/stack.d.ts +6 -1
  287. package/dist/ui/stack.d.ts.map +1 -1
  288. package/dist/ui/stack.js +2 -1
  289. package/dist/ui/stack.js.map +1 -1
  290. package/dist/ui/stat-card.d.ts +2 -3
  291. package/dist/ui/stat-card.d.ts.map +1 -1
  292. package/dist/ui/stat-card.js +118 -116
  293. package/dist/ui/stat-card.js.map +1 -1
  294. package/dist/ui/status-dot.js +2 -2
  295. package/dist/ui/status-dot.js.map +1 -1
  296. package/dist/ui/stepper.d.ts +2 -1
  297. package/dist/ui/stepper.d.ts.map +1 -1
  298. package/dist/ui/stepper.js +74 -69
  299. package/dist/ui/stepper.js.map +1 -1
  300. package/dist/ui/switch.js +2 -2
  301. package/dist/ui/switch.js.map +1 -1
  302. package/dist/ui/tabs.js +3 -3
  303. package/dist/ui/tabs.js.map +1 -1
  304. package/dist/ui/text.d.ts +7 -2
  305. package/dist/ui/text.d.ts.map +1 -1
  306. package/dist/ui/text.js +2 -1
  307. package/dist/ui/text.js.map +1 -1
  308. package/dist/ui/textarea.js +1 -1
  309. package/dist/ui/textarea.js.map +1 -1
  310. package/dist/ui/toast.js +8 -8
  311. package/dist/ui/toast.js.map +1 -1
  312. package/dist/ui/toaster.d.ts +11 -2
  313. package/dist/ui/toaster.d.ts.map +1 -1
  314. package/dist/ui/toaster.js.map +1 -1
  315. package/dist/ui/toggle.js +1 -1
  316. package/dist/ui/toggle.js.map +1 -1
  317. package/dist/ui/tooltip.js +12 -12
  318. package/dist/ui/tooltip.js.map +1 -1
  319. package/dist/ui/tree-view/tree-item.d.ts +3 -2
  320. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  321. package/dist/ui/tree-view/use-tree.d.ts +2 -1
  322. package/dist/ui/tree-view/use-tree.d.ts.map +1 -1
  323. package/docs/components/_header.md +90 -1
  324. package/docs/components/ui/oauth-button.md +86 -0
  325. package/docs/recipes/customize-brand.md +100 -4
  326. package/docs/recipes/index.md +5 -1
  327. package/docs/recipes/install-astro.md +15 -0
  328. package/docs/recipes/install-next-app-router.md +21 -5
  329. package/docs/recipes/install-next-pages.md +2 -0
  330. package/docs/recipes/install-remix.md +15 -0
  331. package/docs/recipes/install-tanstack-start.md +15 -0
  332. package/docs/recipes/install-vite.md +15 -0
  333. package/docs/recipes/troubleshoot.md +22 -0
  334. package/llms-full.txt +177 -2
  335. package/llms-quick.txt +247 -0
  336. package/llms.txt +116 -3
  337. package/package.json +80 -2
  338. package/scripts/welcome.mjs +219 -0
  339. package/skill/README.md +99 -0
  340. package/skill/SKILL.md +163 -0
  341. package/skill/install.sh +59 -0
  342. package/skill/references/components-full.md +7083 -0
  343. package/skill/references/components.md +778 -0
  344. package/skill/references/customize-brand.md +314 -0
  345. package/skill/references/server-components.md +211 -0
  346. package/skill/references/setup-astro.md +195 -0
  347. package/skill/references/setup-next-app-router.md +248 -0
  348. package/skill/references/setup-next-pages.md +127 -0
  349. package/skill/references/setup-remix.md +188 -0
  350. package/skill/references/setup-tanstack-start.md +160 -0
  351. package/skill/references/setup-vite.md +187 -0
  352. package/skill/references/troubleshoot.md +241 -0
  353. package/dist/_chunks/date-picker.js +0 -748
  354. package/dist/_chunks/date-picker.js.map +0 -1
  355. package/dist/_chunks/file-preview.js +0 -499
  356. package/dist/_chunks/file-preview.js.map +0 -1
  357. package/dist/_chunks/rich-chat-input.js +0 -2071
  358. package/dist/_chunks/rich-chat-input.js.map +0 -1
  359. package/dist/_chunks/text.js.map +0 -1
  360. package/dist/ui/charts/index.js.map +0 -1
  361. /package/{LICENSE → skill/LICENSE} +0 -0
@@ -0,0 +1,219 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall welcome banner for @devalok/shilp-sutra.
4
+ *
5
+ * Runs once per major.minor version on consumer install. Silent under CI,
6
+ * non-TTY environments, NO_COLOR, npm silent loglevel, or when the
7
+ * SHILP_SUTRA_NO_WELCOME env var is set. Falls back to a compact 6-line
8
+ * text block if the terminal is narrower than 70 columns or shorter than
9
+ * 28 rows. Never throws — wrapped in a try/catch so an internal error can
10
+ * never break the consumer install.
11
+ *
12
+ * Safety guards (industry best practice — see research notes in
13
+ * .changeset/wave-4-install-experience.md):
14
+ *
15
+ * - process.env.CI → silent (avoid log noise on CI)
16
+ * - process.env.SHILP_SUTRA_NO_WELCOME=1 → silent (user opt-out)
17
+ * - process.env.NO_COLOR → plain text, no ANSI
18
+ * - process.stdout.isTTY === false → silent (piped builds, Docker)
19
+ * - npm_config_loglevel === 'silent' → silent (respect pkg manager)
20
+ * - !INIT_CWD || INIT_CWD inside the package → silent (dev install, not consumer)
21
+ * - Sentinel file with current version → silent on re-install of same ver
22
+ * - try/catch around everything → always exit 0
23
+ *
24
+ * The sentinel encodes the version (`node_modules/.shilp-sutra-welcomed`)
25
+ * so version bumps re-fire the banner once.
26
+ */
27
+
28
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
29
+ import { dirname, join, resolve } from 'node:path'
30
+ import { fileURLToPath } from 'node:url'
31
+
32
+ const __dirname = dirname(fileURLToPath(import.meta.url))
33
+ const PKG_DIR = resolve(__dirname, '..')
34
+
35
+ // ── Guard rails — bail out early if any condition says "silent". ────────────
36
+ function shouldSkip() {
37
+ if (process.env.CI) return 'CI environment'
38
+ if (process.env.SHILP_SUTRA_NO_WELCOME === '1' || process.env.SHILP_SUTRA_NO_WELCOME === 'true') return 'SHILP_SUTRA_NO_WELCOME set'
39
+ if (process.env.npm_config_loglevel === 'silent') return 'npm silent loglevel'
40
+ if (!process.stdout.isTTY) return 'not a TTY (piped/Docker/etc.)'
41
+ // Dev install — we're inside the design-system repo itself, not a consumer
42
+ const initCwd = process.env.INIT_CWD || process.cwd()
43
+ const cwd = process.cwd()
44
+ const isInsideNodeModules = cwd.includes(`${process.platform === 'win32' ? '\\' : '/'}node_modules${process.platform === 'win32' ? '\\' : '/'}`) || cwd.includes('/node_modules/')
45
+ if (!isInsideNodeModules) return 'dev install (not running from node_modules/)'
46
+ // INIT_CWD points at the consumer's project root. If absent → odd setup; skip.
47
+ if (!initCwd || initCwd === cwd) return 'no INIT_CWD set (unusual install context)'
48
+ return null
49
+ }
50
+
51
+ function readPkgVersion() {
52
+ try {
53
+ const pkg = JSON.parse(readFileSync(join(PKG_DIR, 'package.json'), 'utf-8'))
54
+ return pkg.version
55
+ } catch {
56
+ return null
57
+ }
58
+ }
59
+
60
+ // Sentinel: re-fire only on version change. Stored at the workspace root's
61
+ // node_modules/.shilp-sutra-welcomed so it survives pnpm dedupe rebuilds.
62
+ function getSentinelPath() {
63
+ // Walk up from PKG_DIR (node_modules/@devalok/shilp-sutra/) to the
64
+ // enclosing node_modules/ root, then write inside it.
65
+ const parts = PKG_DIR.split(/[/\\]/)
66
+ const nmIdx = parts.lastIndexOf('node_modules')
67
+ if (nmIdx === -1) return null
68
+ const nmRoot = parts.slice(0, nmIdx + 1).join(process.platform === 'win32' ? '\\' : '/')
69
+ return join(nmRoot, '.shilp-sutra-welcomed')
70
+ }
71
+
72
+ function alreadyWelcomed(version) {
73
+ const sentinel = getSentinelPath()
74
+ if (!sentinel) return false
75
+ try {
76
+ if (!existsSync(sentinel)) return false
77
+ const previousVersion = readFileSync(sentinel, 'utf-8').trim()
78
+ return previousVersion === version
79
+ } catch {
80
+ return false
81
+ }
82
+ }
83
+
84
+ function markWelcomed(version) {
85
+ const sentinel = getSentinelPath()
86
+ if (!sentinel) return
87
+ try {
88
+ mkdirSync(dirname(sentinel), { recursive: true })
89
+ writeFileSync(sentinel, version + '\n')
90
+ } catch {
91
+ // ignored — banner already printed, sentinel write is best-effort
92
+ }
93
+ }
94
+
95
+ // ── ANSI rendering ──────────────────────────────────────────────────────────
96
+ const useColor = !process.env.NO_COLOR && process.stdout.isTTY
97
+
98
+ // Devalok pink #d946a6 = RGB(217, 70, 166)
99
+ const PINK = useColor ? '\x1b[38;2;217;70;166m' : ''
100
+ const PINK_DIM = useColor ? '\x1b[38;2;167;55;128m' : ''
101
+ const BOLD = useColor ? '\x1b[1m' : ''
102
+ const DIM = useColor ? '\x1b[2m' : ''
103
+ const RESET = useColor ? '\x1b[0m' : ''
104
+
105
+ function colour(text, code) {
106
+ return useColor ? `${code}${text}${RESET}` : text
107
+ }
108
+
109
+ // Lotus — 13 rows × 30 cols Braille. Centered in a 63-col inner box (16 left,
110
+ // 17 right padding).
111
+ const LOTUS = [
112
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
113
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠹⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
114
+ '⠀⠀⠀⠀⠀⠀⠀⠀⣷⣦⣄⣠⣿⠃⢠⣄⠈⢻⣆⣠⣴⡞⡆⠀⠀⠀⠀⠀⠀⠀',
115
+ '⠀⠀⠀⠀⠀⢀⣀⣀⣿⠀⠈⢻⣇⢀⣾⢟⡄⣸⡿⠋⠀⡇⣇⣀⣀⠀⠀⠀⠀⠀',
116
+ '⠀⣤⣤⣤⣀⣱⢻⠚⠻⣧⣀⠀⢹⡿⠃⠈⢻⣟⠀⢀⣤⠧⠓⣹⣟⣀⣤⣤⣤⡀',
117
+ '⠀⠈⠻⣧⠉⠛⣽⠀⠀⠀⠙⣷⡿⠁⠀⠀⠀⢻⣶⠛⠁⠀⠀⡟⠟⠉⣵⡟⠁⠀',
118
+ '⠀⠀⠀⠹⣧⡀⠏⡇⠀⠀⠀⣿⠁⠀⠀⠀⠀⠀⣿⡄⠀⠀⢠⢷⠀⣼⡟⠀⠀⠀',
119
+ '⠀⠀⠀⠀⠙⣟⢼⡹⡄⠀⠀⣿⡄⠀⠀⠀⠀⢀⣿⡇⠀⢀⣞⣦⢾⠟⠀⠀⠀⠀',
120
+ '⠀⠠⢶⣿⣛⠛⢒⣭⢻⣶⣤⣹⣿⣤⣀⣀⣠⣾⣟⣠⣔⡛⢫⣐⠛⢛⣻⣶⠆⠀',
121
+ '⠀⠀⠀⠉⣻⡽⠛⠉⠁⠀⠉⢙⣿⠖⠒⠛⠻⣿⡋⠉⠁⠈⠉⠙⢿⣿⠉⠀⠀⠀',
122
+ '⠀⠀⠀⠸⠿⠷⠒⣦⣤⣴⣶⢿⣿⡀⠀⠀⠀⣽⡿⢷⣦⠤⢤⡖⠶⠿⠧⠀⠀⠀',
123
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⢿⣦⣴⡾⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
124
+ '⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
125
+ ]
126
+
127
+ const TOP = '╭───────────────────────────────────────────────────────────────╮'
128
+ const BOTTOM = '╰───────────────────────────────────────────────────────────────╯'
129
+ const EMPTY = '│ │'
130
+ const INNER_WIDTH = 63
131
+
132
+ function row(content) {
133
+ // content is a string of visible chars (ANSI-stripped width assumed equal to char count for ASCII)
134
+ // We can't easily measure visible width when ANSI codes are present, so always pad based on the
135
+ // PASSED visibleWidth in callers that contain colour. For plain rows, fall back to .length.
136
+ const visible = content.replace(/\x1b\[[0-9;]*m/g, '')
137
+ const padLen = Math.max(0, INNER_WIDTH - visible.length)
138
+ return `│${content}${' '.repeat(padLen)}│`
139
+ }
140
+
141
+ function centeredLotusRow(braille) {
142
+ // 30-col Braille row, 16-left + 17-right padding
143
+ return `│ ${colour(braille, PINK)} │`
144
+ }
145
+
146
+ function buildFullBanner(version) {
147
+ const lines = []
148
+ lines.push(colour(TOP, PINK_DIM))
149
+ lines.push(colour(EMPTY, PINK_DIM))
150
+ for (const lotusRow of LOTUS) {
151
+ lines.push(`${colour('│', PINK_DIM)} ${colour(lotusRow, PINK)} ${colour('│', PINK_DIM)}`)
152
+ }
153
+ lines.push(colour(EMPTY, PINK_DIM))
154
+ lines.push(row(` ${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${version}`))
155
+ lines.push(row(` ${colour('Tailwind 4 design system · 110+ components · RSC-safe', DIM)}`))
156
+ lines.push(colour(EMPTY, PINK_DIM))
157
+ lines.push(row(` ${colour('▸', PINK)} Setup recipe (pick your framework):`))
158
+ lines.push(row(` ${colour('node_modules/@devalok/shilp-sutra/docs/recipes/', DIM)}`))
159
+ lines.push(colour(EMPTY, PINK_DIM))
160
+ lines.push(row(` ${colour('▸', PINK)} Theme it in 30 seconds:`))
161
+ lines.push(row(` ${colour('https://shilp-sutra.devalok.in/themer', DIM)}`))
162
+ lines.push(colour(EMPTY, PINK_DIM))
163
+ lines.push(row(` ${colour('▸', PINK)} Wire your AI agent (Claude Code / Cursor / Codex):`))
164
+ lines.push(row(` ${colour('cp -r node_modules/@devalok/shilp-sutra/skill \\', DIM)}`))
165
+ lines.push(row(` ${colour('~/.claude/skills/shilp-sutra', DIM)}`))
166
+ lines.push(colour(EMPTY, PINK_DIM))
167
+ lines.push(row(` ${colour('Disable this banner: SHILP_SUTRA_NO_WELCOME=1', DIM)}`))
168
+ lines.push(colour(EMPTY, PINK_DIM))
169
+ lines.push(row(` ${colour('Built by Devalok · devalok.in', PINK)}`))
170
+ lines.push(colour(EMPTY, PINK_DIM))
171
+ lines.push(colour(BOTTOM, PINK_DIM))
172
+ return lines.join('\n')
173
+ }
174
+
175
+ function buildCompactBanner(version) {
176
+ return [
177
+ '',
178
+ `${colour('✦', PINK)} ${colour('@devalok/shilp-sutra', BOLD)} ${version} ${colour('· Tailwind 4 design system', DIM)}`,
179
+ ` ${colour('▸', PINK)} Setup: ${colour('node_modules/@devalok/shilp-sutra/docs/recipes/', DIM)}`,
180
+ ` ${colour('▸', PINK)} Theme: ${colour('https://shilp-sutra.devalok.in/themer', DIM)}`,
181
+ ` ${colour('▸', PINK)} AI: ${colour('cp -r node_modules/@devalok/shilp-sutra/skill ~/.claude/skills/shilp-sutra', DIM)}`,
182
+ ` ${colour('Built by Devalok · devalok.in', PINK)} ${colour('(SHILP_SUTRA_NO_WELCOME=1 to disable)', DIM)}`,
183
+ '',
184
+ ].join('\n')
185
+ }
186
+
187
+ // ── Main ────────────────────────────────────────────────────────────────────
188
+ function main() {
189
+ // --preview / --compact bypass all guards. Used by maintainers + by the
190
+ // pre-publish-audit gate to verify the banner renders without ever
191
+ // shipping a broken one. Compose only — never writes the sentinel.
192
+ const preview = process.argv.includes('--preview')
193
+ const forceCompact = process.argv.includes('--compact')
194
+
195
+ if (!preview) {
196
+ const skipReason = shouldSkip()
197
+ if (skipReason) return // silent
198
+ }
199
+
200
+ const version = readPkgVersion() || '0.0.0-preview'
201
+
202
+ if (!preview && alreadyWelcomed(version)) return
203
+
204
+ const cols = process.stdout.columns || 80
205
+ const rows = process.stdout.rows || 40
206
+ const fitsFull = !forceCompact && cols >= 70 && rows >= 28
207
+
208
+ const banner = fitsFull ? buildFullBanner(version) : buildCompactBanner(version)
209
+ process.stdout.write('\n' + banner + '\n')
210
+
211
+ if (!preview) markWelcomed(version)
212
+ }
213
+
214
+ try {
215
+ main()
216
+ } catch {
217
+ // Never crash the consumer install. A failure here is a UX bug, not a
218
+ // blocker — pretend nothing happened.
219
+ }
@@ -0,0 +1,99 @@
1
+ # shilp-sutra — Devalok Design System
2
+
3
+ > Agent Skill for `@devalok/shilp-sutra` — Devalok Design & Strategy Studios' React design system. Tailwind 4, React 19, CVA, OKLCH tokens, framer-motion, 110+ accessible components.
4
+
5
+ Use this skill when working in a React project that depends on `@devalok/shilp-sutra` (or when adding the package to one). It teaches the agent the correct setup, the per-framework playbook, the component API, the brand-token override pattern, and the Server Component import rules — all from the same files the design system ships in its npm tarball, so the skill never drifts from the live package.
6
+
7
+ ## When the agent should activate this skill
8
+
9
+ - The user mentions `shilp-sutra`, `@devalok`, or Devalok's design system.
10
+ - The project's `package.json` lists `@devalok/shilp-sutra` or `@devalok/shilp-sutra-brand`.
11
+ - The user asks to install Tailwind, add UI components, theme an app, or migrate from shadcn/MUI/Chakra in a project that already has the package.
12
+
13
+ ## What's inside
14
+
15
+ ```
16
+ shilp-sutra/
17
+ ├── SKILL.md # Entry — load this first
18
+ ├── README.md # This file (marketplace listing)
19
+ ├── LICENSE # MIT
20
+ └── references/
21
+ ├── components.md # Concise component cheatsheet (~660 lines)
22
+ ├── components-full.md # Exhaustive per-component reference (~6900 lines)
23
+ ├── setup-next-app-router.md # Next.js (App Router) install playbook
24
+ ├── setup-next-pages.md # Next.js (Pages Router) install playbook
25
+ ├── setup-vite.md # Vite + React install playbook
26
+ ├── setup-astro.md # Astro install playbook
27
+ ├── setup-remix.md # Remix install playbook
28
+ ├── setup-tanstack-start.md # TanStack Start install playbook
29
+ ├── customize-brand.md # Token override cookbook
30
+ ├── server-components.md # RSC-safety matrix and import patterns
31
+ └── troubleshoot.md # Decision tree for the 8 most common breakages
32
+ ```
33
+
34
+ ## Install
35
+
36
+ ### Claude Code (personal)
37
+
38
+ ```bash
39
+ # Option A — clone the repo (sparse) and copy the skill
40
+ git clone --depth=1 --filter=blob:none --sparse https://github.com/devalok-design/shilp-sutra
41
+ cd shilp-sutra
42
+ git sparse-checkout set skills/shilp-sutra
43
+ cp -r skills/shilp-sutra ~/.claude/skills/shilp-sutra
44
+
45
+ # Option B — if @devalok/shilp-sutra is already a dependency in your project
46
+ cp -r node_modules/@devalok/shilp-sutra/skill ~/.claude/skills/shilp-sutra
47
+
48
+ # Option C — direct curl (latest from main)
49
+ curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | bash
50
+ ```
51
+
52
+ Restart Claude Code or open a new session. Verify with `What skills are available?` — `shilp-sutra` should appear.
53
+
54
+ ### Project-scoped (commit to repo)
55
+
56
+ ```bash
57
+ mkdir -p .claude/skills
58
+ curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | INSTALL_DIR=.claude/skills bash
59
+ git add .claude/skills/shilp-sutra
60
+ git commit -m "chore: add shilp-sutra agent skill"
61
+ ```
62
+
63
+ Every contributor (and their agent) on the project gets the skill automatically.
64
+
65
+ ### Cursor, Codex, Aider, and other tools
66
+
67
+ The skill follows the [Agent Skills open standard](https://agentskills.io/specification) — any compatible agent loads it from the same directory. See your tool's docs for the install path.
68
+
69
+ ## What it teaches the agent
70
+
71
+ - **Setup playbook** for Next.js (App + Pages), Vite, Astro, Remix, TanStack Start. Each recipe is concrete, copy-pasteable, and has been validated against real consumer projects.
72
+ - **Hard constraints** — the eight ways to break Tailwind 4 + framer-motion setup that look unrelated to the design system but aren't.
73
+ - **Component API** — every component, every variant, every example. Two layers: a cheatsheet for fast scans and a full reference for prop tables.
74
+ - **RSC import patterns** — which components are server-safe, which need `"use client"`, and why per-component imports matter for Next.js.
75
+ - **Theming** — how to override OKLCH ramps, radius, fonts, and the spacing scale without forking the package.
76
+ - **Troubleshoot tree** — the eight most common breakages with the symptom, root cause, and exact fix for each.
77
+
78
+ ## Source of truth
79
+
80
+ This skill is **built from** the package's own documentation (`packages/core/llms.txt`, `packages/core/llms-full.txt`, `packages/core/docs/recipes/`) by `scripts/build-skill.mjs`. The pre-publish audit fails if the bundled references drift from source, so the skill stays in sync with every release.
81
+
82
+ ## Versioning
83
+
84
+ The skill version tracks the package version. Both are at the top of `SKILL.md` (frontmatter `metadata.version`) and in `package.json`. If you've installed the skill but upgraded the package, regenerate the skill or pull the latest from the repo.
85
+
86
+ ## Feedback
87
+
88
+ If a recipe is wrong, a constraint is outdated, or a component behavior contradicts the docs, file an issue at <https://github.com/devalok-design/shilp-sutra/issues> with the label `ai-agent-feedback`. Include the package version, the file/recipe path, the command or error, and what you expected.
89
+
90
+ ## License
91
+
92
+ MIT © Devalok Design & Strategy Studios. See `LICENSE`.
93
+
94
+ ## Links
95
+
96
+ - npm: <https://www.npmjs.com/package/@devalok/shilp-sutra>
97
+ - Storybook: <https://devalok-design.github.io/shilp-sutra/>
98
+ - Repo: <https://github.com/devalok-design/shilp-sutra>
99
+ - Agent Skills spec: <https://agentskills.io/specification>
package/skill/SKILL.md ADDED
@@ -0,0 +1,163 @@
1
+ ---
2
+ name: shilp-sutra
3
+ description: Add, configure, and use components from Devalok's shilp-sutra design system (@devalok/shilp-sutra) — a Tailwind 4 + React 19 + CVA library with 110+ accessible components, OKLCH design tokens, framer-motion animations, and per-component RSC-safe entry points. Use this skill whenever the user mentions shilp-sutra, Devalok, the @devalok npm scope, or asks to install/add/style/theme UI in any React project that already depends on the package — even if they don't name it explicitly. Use it instead of generic shadcn/ui, MUI, or Chakra knowledge when shilp-sutra is in the project. Covers Next.js (App + Pages), Vite, Astro, Remix, TanStack Start setup playbooks; component API and variant reference; brand token customization; Server Component import patterns; and a troubleshoot tree for the thirteen most common breakages.
4
+ license: MIT
5
+ metadata:
6
+ version: "0.40.0"
7
+ author: Devalok Design & Strategy Studios
8
+ homepage: https://github.com/devalok-design/shilp-sutra
9
+ npm: https://www.npmjs.com/package/@devalok/shilp-sutra
10
+ source: https://github.com/devalok-design/shilp-sutra/tree/main/skills/shilp-sutra
11
+ ---
12
+
13
+ # shilp-sutra — Devalok Design System
14
+
15
+ `@devalok/shilp-sutra` is a React design system. It is **not** shadcn/ui. It uses similar primitives (Radix, CVA, Tailwind) but the consumer setup, token namespace, and component APIs are different. Your training data is older than the current package — read the bundled references before writing code, do not improvise from memory.
16
+
17
+ ## When this skill triggers
18
+
19
+ - The user mentions `shilp-sutra`, `@devalok`, Devalok, or Devalok's design system.
20
+ - The project's `package.json` lists `@devalok/shilp-sutra` (or `@devalok/shilp-sutra-brand`).
21
+ - The user asks you to add UI components, set up a design system, install Tailwind, or theme an app in a project that already has the package.
22
+ - The user asks to migrate from shadcn/MUI/Chakra to shilp-sutra, or vice-versa.
23
+
24
+ ## Decision tree (read this first, then jump)
25
+
26
+ ```
27
+ Q1. Is @devalok/shilp-sutra already installed?
28
+ NO → go to "First-time setup" below
29
+ YES → continue
30
+
31
+ Q2. What does the user want to do?
32
+ a) Add or use a component → references/components.md (skim), then components-full.md (deep)
33
+ b) Change colors/fonts/radius → references/customize-brand.md
34
+ c) Server Components / Next.js → references/server-components.md
35
+ d) Something is broken → references/troubleshoot.md
36
+ e) Upgrading from older version → fetch MIGRATION.md from repo or node_modules
37
+ ```
38
+
39
+ ## First-time setup
40
+
41
+ Detect the framework from the consumer's lockfile and config files, then open the matching reference:
42
+
43
+ | Detection | Reference |
44
+ | ------------------------------------------------------------------ | ---------------------------------------- |
45
+ | `app/` directory + `next.config.*` | `references/setup-next-app-router.md` |
46
+ | `pages/` directory (no `app/`) + `next.config.*` | `references/setup-next-pages.md` |
47
+ | `vite.config.*` + `react` in deps (no Remix/TanStack) | `references/setup-vite.md` |
48
+ | `astro.config.*` | `references/setup-astro.md` |
49
+ | `remix.config.*` or Remix v2 with Vite | `references/setup-remix.md` |
50
+ | `app.config.*` with `@tanstack/start` | `references/setup-tanstack-start.md` |
51
+ | Anything else (React + Tailwind) | Fall back to `setup-vite.md` and adapt |
52
+
53
+ Every line in those recipes is there because skipping it broke a real consumer. Do not paraphrase steps — execute them.
54
+
55
+ ## Hard constraints (these silently break things if violated)
56
+
57
+ These are non-negotiable. Violating any of them produces runtime errors that look unrelated to the design system.
58
+
59
+ 1. **Tailwind 4 only.** Do not create `tailwind.config.ts` with `presets: [shilpSutra]`. The JS preset was removed in 0.38. Setup is CSS-only:
60
+ ```css
61
+ @import "tailwindcss";
62
+ @import "@devalok/shilp-sutra/css";
63
+ ```
64
+ 2. **`framer-motion@^12` is a required peer dep.** The consumer must install it. Module-scoped contexts (`MotionConfig`, `LayoutGroup`, `AnimatePresence`) silently break if two copies of framer-motion resolve. Configure pnpm/yarn to dedupe.
65
+ 3. **`sonner@^2` is an optional peer dep.** Install only when rendering `<Toaster />`.
66
+ 4. **Per-component imports are mandatory for React Server Components.** `@devalok/shilp-sutra/ui/text` is server-safe; the barrel `@devalok/shilp-sutra/ui` pulls client code and crashes RSC. See `references/server-components.md` for the per-component matrix.
67
+ 5. **Spacing namespace is `--spacing-ds-*`.** Write `p-ds-04`, not `p-4`. Same for typography: `text-ds-body-md`, not `text-base`.
68
+ 6. **Bare `shadow` does not exist in Tailwind 4.** Use `shadow-raised`, `shadow-overlay`, `shadow-floating`. Bare `rounded` is fine (maps to `--radius`); `rounded-ds-lg` etc. for sized variants.
69
+ 7. **Do not invent variant names.** CVA source files at `node_modules/@devalok/shilp-sutra/dist/ui/*.d.ts` (or `packages/core/src/ui/*.tsx` in the DS repo) are authoritative. When in doubt, check `references/components-full.md` for the enumerated list. If you guess a variant that doesn't exist, the prop is silently dropped and the default applies.
70
+ 8. **Default `variant="soft"` over `variant="outline"` for non-primary Button actions.** Soft (tinted bg + tinted text, no border) reads warmer in data-dense UIs. Use outline only when soft would disappear on a colored background or when a primary/secondary hierarchy needs a visible border.
71
+
72
+ ## Surface layering (when building cards, panels, dialogs)
73
+
74
+ The semantic surface names are the public API. The old numeric names (`surface-1` … `surface-4`) are deprecated aliases — do not use them.
75
+
76
+ | Token | Use for |
77
+ | ------------------------------ | ---------------------------------------------------------------------------------- |
78
+ | `bg-surface-base` | Page background |
79
+ | `bg-surface-raised` | Cards, widgets, panels — anything that sits **on** the page |
80
+ | `bg-surface-sunken` | Shell chrome (Sidebar, TopBar), recessed regions |
81
+ | `bg-surface-overlay` | Dialog, Sheet, Popover, Toast, Combobox menus, any floating overlay |
82
+ | `bg-surface-raised-hover` | Hover state on raised surfaces |
83
+ | `bg-surface-raised-active` | Active/pressed state on raised surfaces |
84
+ | `bg-surface-disabled` | Disabled surfaces (paired with `text-surface-fg-disabled`) |
85
+ | `bg-surface-inverted` | Inverted surfaces (dark on light themes, light on dark themes) |
86
+
87
+ Putting `bg-surface-base` on a card is a bug — cards belong on `surface-raised`. The pre-publish audit in the DS repo enforces this and blocks the old numeric aliases in component source files.
88
+
89
+ ## Adding a component
90
+
91
+ 1. Skim `references/components.md` — the concise cheatsheet, ~660 lines. Tells you what exists, what variants ship, what the common gotchas are.
92
+ 2. If `components.md` does not have enough detail (you need full prop tables, every variant, every example), open `references/components-full.md`.
93
+ 3. Import from the per-component entry: `import { Button } from "@devalok/shilp-sutra/ui/button"`. The barrel `@devalok/shilp-sutra/ui` works in client-only contexts but is heavier — prefer per-component.
94
+ 4. Use **semantic tokens** for color (`text-foreground`, `bg-surface-2`, `border-border-default`). Never raw OKLCH values, never `text-white`.
95
+ 5. Compose with primitives the package already ships. Do not rebuild Dialog/Popover/Combobox from scratch.
96
+
97
+ ## Theming and brand customization
98
+
99
+ ### Step 0 — Send the user to the Themer
100
+
101
+ Before hand-rolling CSS variables, send the user to **[shilp-sutra.devalok.in/themer](https://shilp-sutra.devalok.in/themer)**. One funnel, four doors:
102
+
103
+ | User context | Door |
104
+ |---|---|
105
+ | "Make it look like Linear / Stripe / Apple / Notion / Vercel / Material" | `/themer/archetypes` |
106
+ | "Here is our brand color: `#…`" | `/themer/brand` |
107
+ | "Not sure what we want yet" | `/themer/wizard` |
108
+ | "Just show me what we'd ship away with" | `/themer/result?archetype=devalok` |
109
+
110
+ Every door drops them at `/themer/result` with: a copy-pasteable CSS block (role tokens + 12-step OKLCH accent ramp), install commands for their package manager, a live preview, and a share URL that encodes the theme (`?archetype=…&hue=…&chroma=…&density=…`).
111
+
112
+ Your job once they have the snippet: paste it into their global stylesheet **after** the `@import "@devalok/shilp-sutra/css";` line. That is it — no `tailwind.config.ts`, no provider, no JS bundle.
113
+
114
+ If the user is in a hurry and asks you to just pick something, default to `archetype=devalok` (the studio's own preset, balanced for most apps) and use their brand hex if they have one, else `hue=340 chroma=0.19`.
115
+
116
+ ### Step 1 — Hand-roll fallback
117
+
118
+ `references/customize-brand.md` covers what the Themer doesn't expose yet: font swap, spacing scale, focus-ring overrides, dark-mode mapping nuance. Customization is CSS-only: override CSS custom properties under `:root` and `.dark`. There is no theme provider component.
119
+
120
+ For the Devalok logo and other brand assets, the sibling package `@devalok/shilp-sutra-brand` ships SVG + PNG. Install it separately.
121
+
122
+ ## Server Components and import patterns
123
+
124
+ `references/server-components.md` has the per-component RSC-safety matrix. The short version:
125
+
126
+ - Layout, typography, and presentational components (`Text`, `Heading`, `Card`, `Container`, `Stack`) → server-safe.
127
+ - Interactive components (`Button`, `Dialog`, `Combobox`, `DataTable`, anything with hooks or `framer-motion`) → must be inside a `"use client"` boundary.
128
+ - The package already injects `"use client"` directives where needed; importing per-component (`/ui/dialog`) gives the bundler the right hint.
129
+ - Next.js consumers must add `transpilePackages: ["@devalok/shilp-sutra", "@devalok/shilp-sutra-brand"]` to `next.config.*`.
130
+
131
+ ## When something breaks
132
+
133
+ Go straight to `references/troubleshoot.md`. It is a decision tree for the 8 most common breakages: Tailwind not detecting tokens, framer-motion duplicates, missing `transpilePackages`, wrong CSS import order, dark mode not toggling, RSC import errors, font 404s, hydration mismatches.
134
+
135
+ Do not guess — most of these failures look identical from the outside but have different root causes. The tree disambiguates.
136
+
137
+ ## Browsing the system
138
+
139
+ - **Storybook** (live previews, every story, MCP server available when running locally): https://devalok-design.github.io/shilp-sutra/
140
+ - **Component reference (this skill)**: `references/components.md` (cheatsheet) and `references/components-full.md` (full API).
141
+ - **Source**: https://github.com/devalok-design/shilp-sutra — `packages/core/src/ui/*.tsx` are the CVA sources of truth.
142
+
143
+ When the package is installed locally, the same content also ships in the npm tarball:
144
+
145
+ - `node_modules/@devalok/shilp-sutra/llms.txt` — cheatsheet
146
+ - `node_modules/@devalok/shilp-sutra/llms-full.txt` — full reference
147
+ - `node_modules/@devalok/shilp-sutra/docs/recipes/` — setup recipes
148
+ - `node_modules/@devalok/shilp-sutra/skill/` — this skill (offline-installable)
149
+
150
+ ## Reporting feedback
151
+
152
+ If a recipe is wrong, a constraint above is no longer accurate, or a component behavior contradicts the docs:
153
+
154
+ 1. File a GitHub issue at https://github.com/devalok-design/shilp-sutra/issues with the label `ai-agent-feedback`.
155
+ 2. Include the package version (`pnpm view @devalok/shilp-sutra version` or read from the consumer's lockfile), the file/recipe path, the exact command or error, and what you expected.
156
+
157
+ ## Stay current
158
+
159
+ `@devalok/shilp-sutra` ships breaking changes during `0.x`. Before writing code:
160
+
161
+ 1. Check the installed version: `cat node_modules/@devalok/shilp-sutra/package.json | grep version` (or read from the consumer's lockfile).
162
+ 2. If the version is older than the metadata `version` field at the top of this SKILL.md, suggest the user upgrade and consult `MIGRATION.md` from the package root.
163
+ 3. Never trust APIs you remember from earlier versions — re-check `components.md` against the installed version.
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env bash
2
+ # Install the shilp-sutra Agent Skill into ~/.claude/skills (or $INSTALL_DIR).
3
+ #
4
+ # Usage:
5
+ # curl -fsSL https://raw.githubusercontent.com/devalok-design/shilp-sutra/main/skills/shilp-sutra/install.sh | bash
6
+ #
7
+ # Custom install dir (e.g. project-scoped):
8
+ # curl -fsSL ... | INSTALL_DIR=.claude/skills bash
9
+
10
+ set -euo pipefail
11
+
12
+ REPO="devalok-design/shilp-sutra"
13
+ BRANCH="${BRANCH:-main}"
14
+ INSTALL_DIR="${INSTALL_DIR:-$HOME/.claude/skills}"
15
+ SKILL_NAME="shilp-sutra"
16
+ DEST="$INSTALL_DIR/$SKILL_NAME"
17
+
18
+ if [[ -d "$DEST" ]]; then
19
+ echo "warning: $DEST already exists. Overwriting."
20
+ rm -rf "$DEST"
21
+ fi
22
+
23
+ mkdir -p "$DEST/references"
24
+
25
+ # Fetch the skill tree via the GitHub trees API and download each file.
26
+ echo "Fetching skill manifest from github.com/$REPO@$BRANCH ..."
27
+ tree_json="$(curl -fsSL "https://api.github.com/repos/$REPO/git/trees/$BRANCH?recursive=1")"
28
+
29
+ # Extract every path under skills/shilp-sutra/ that is a blob.
30
+ paths="$(printf '%s\n' "$tree_json" \
31
+ | python3 -c '
32
+ import json, sys
33
+ tree = json.load(sys.stdin).get("tree", [])
34
+ for item in tree:
35
+ if item.get("type") == "blob" and item.get("path", "").startswith("skills/shilp-sutra/"):
36
+ # Skip the install.sh itself when bootstrapping; user already has it via curl.
37
+ if item["path"].endswith("/install.sh"):
38
+ continue
39
+ print(item["path"])
40
+ ')"
41
+
42
+ if [[ -z "$paths" ]]; then
43
+ echo "error: no files found under skills/shilp-sutra/ on $REPO@$BRANCH" >&2
44
+ exit 1
45
+ fi
46
+
47
+ count=0
48
+ while IFS= read -r path; do
49
+ rel="${path#skills/shilp-sutra/}"
50
+ target="$DEST/$rel"
51
+ mkdir -p "$(dirname "$target")"
52
+ curl -fsSL "https://raw.githubusercontent.com/$REPO/$BRANCH/$path" -o "$target"
53
+ count=$((count + 1))
54
+ done <<< "$paths"
55
+
56
+ echo
57
+ echo "installed $count files to $DEST"
58
+ echo "restart Claude Code (or open a new session) to pick up the skill."
59
+ echo "verify with: ask Claude 'what skills are available?'"