@raybase/create 0.0.2 → 0.3.3

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 (644) hide show
  1. package/LICENSE +21 -0
  2. package/THIRD_PARTY_NOTICES.md +38 -0
  3. package/assets/apple-touch-icons/0.png +0 -0
  4. package/assets/apple-touch-icons/1.png +0 -0
  5. package/assets/apple-touch-icons/2.png +0 -0
  6. package/assets/apple-touch-icons/3.png +0 -0
  7. package/assets/apple-touch-icons/4.png +0 -0
  8. package/assets/apple-touch-icons/5.png +0 -0
  9. package/assets/apple-touch-icons/6.png +0 -0
  10. package/assets/apple-touch-icons/7.png +0 -0
  11. package/assets/apple-touch-icons/8.png +0 -0
  12. package/assets/apple-touch-icons/9.png +0 -0
  13. package/assets/apple-touch-icons/A.png +0 -0
  14. package/assets/apple-touch-icons/B.png +0 -0
  15. package/assets/apple-touch-icons/C.png +0 -0
  16. package/assets/apple-touch-icons/D.png +0 -0
  17. package/assets/apple-touch-icons/E.png +0 -0
  18. package/assets/apple-touch-icons/F.png +0 -0
  19. package/assets/apple-touch-icons/G.png +0 -0
  20. package/assets/apple-touch-icons/H.png +0 -0
  21. package/assets/apple-touch-icons/I.png +0 -0
  22. package/assets/apple-touch-icons/J.png +0 -0
  23. package/assets/apple-touch-icons/K.png +0 -0
  24. package/assets/apple-touch-icons/L.png +0 -0
  25. package/assets/apple-touch-icons/M.png +0 -0
  26. package/assets/apple-touch-icons/N.png +0 -0
  27. package/assets/apple-touch-icons/O.png +0 -0
  28. package/assets/apple-touch-icons/P.png +0 -0
  29. package/assets/apple-touch-icons/Q.png +0 -0
  30. package/assets/apple-touch-icons/R.png +0 -0
  31. package/assets/apple-touch-icons/S.png +0 -0
  32. package/assets/apple-touch-icons/T.png +0 -0
  33. package/assets/apple-touch-icons/U.png +0 -0
  34. package/assets/apple-touch-icons/V.png +0 -0
  35. package/assets/apple-touch-icons/W.png +0 -0
  36. package/assets/apple-touch-icons/X.png +0 -0
  37. package/assets/apple-touch-icons/Y.png +0 -0
  38. package/assets/apple-touch-icons/Z.png +0 -0
  39. package/assets/apple-touch-icons/default.png +0 -0
  40. package/dist/.source-hash +1 -0
  41. package/dist/index.d.ts +56 -0
  42. package/dist/index.d.ts.map +1 -0
  43. package/dist/index.js +2351 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/raybase-package-ranges.d.ts +11 -0
  46. package/dist/raybase-package-ranges.d.ts.map +1 -0
  47. package/dist/raybase-package-ranges.js +11 -0
  48. package/dist/raybase-package-ranges.js.map +1 -0
  49. package/dist/source-fetch.d.ts +91 -0
  50. package/dist/source-fetch.d.ts.map +1 -0
  51. package/dist/source-fetch.js +325 -0
  52. package/dist/source-fetch.js.map +1 -0
  53. package/dist/source-hash.d.ts +2 -0
  54. package/dist/source-hash.d.ts.map +1 -0
  55. package/dist/source-hash.js +23 -0
  56. package/dist/source-hash.js.map +1 -0
  57. package/dist/starter-description.d.ts +44 -0
  58. package/dist/starter-description.d.ts.map +1 -0
  59. package/dist/starter-description.js +273 -0
  60. package/dist/starter-description.js.map +1 -0
  61. package/dist/starter-source.d.ts +43 -0
  62. package/dist/starter-source.d.ts.map +1 -0
  63. package/dist/starter-source.js +156 -0
  64. package/dist/starter-source.js.map +1 -0
  65. package/dist/store-app-apply.d.ts +27 -0
  66. package/dist/store-app-apply.d.ts.map +1 -0
  67. package/dist/store-app-apply.js +100 -0
  68. package/dist/store-app-apply.js.map +1 -0
  69. package/dist/store-app-manifest.d.ts +86 -0
  70. package/dist/store-app-manifest.d.ts.map +1 -0
  71. package/dist/store-app-manifest.js +110 -0
  72. package/dist/store-app-manifest.js.map +1 -0
  73. package/dist/store-app-registry.d.ts +30 -0
  74. package/dist/store-app-registry.d.ts.map +1 -0
  75. package/dist/store-app-registry.js +232 -0
  76. package/dist/store-app-registry.js.map +1 -0
  77. package/models/recommended.json +42 -0
  78. package/modules/api/templates/react-router/app/api/operations.ts +8 -0
  79. package/modules/api/templates/tanstack-start/src/api/operations.ts +15 -0
  80. package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
  81. package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
  82. package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
  83. package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
  84. package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
  85. package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
  86. package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
  87. package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
  88. package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
  89. package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
  90. package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
  91. package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
  92. package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
  93. package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
  94. package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
  95. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
  96. package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
  97. package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
  98. package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
  99. package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
  100. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
  101. package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
  102. package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
  103. package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
  104. package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
  105. package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
  106. package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
  107. package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
  108. package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
  109. package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
  110. package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
  111. package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
  112. package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
  113. package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
  114. package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
  115. package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
  116. package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
  117. package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
  118. package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
  119. package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
  120. package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
  121. package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
  122. package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
  123. package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
  124. package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
  125. package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
  126. package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
  127. package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
  128. package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
  129. package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
  130. package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
  131. package/modules/docs/templates/react-router/source.config.ts +5 -0
  132. package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
  133. package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
  134. package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
  135. package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
  136. package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
  137. package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
  138. package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
  139. package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
  140. package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
  141. package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
  142. package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
  143. package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
  144. package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
  145. package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
  146. package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
  147. package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
  148. package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
  149. package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
  150. package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
  151. package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
  152. package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
  153. package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
  154. package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
  155. package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
  156. package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
  157. package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
  158. package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
  159. package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
  160. package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
  161. package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
  162. package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
  163. package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
  164. package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
  165. package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
  166. package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
  167. package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
  168. package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
  169. package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
  170. package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
  171. package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
  172. package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
  173. package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
  174. package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
  175. package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
  176. package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
  177. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  178. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  179. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  180. package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  181. package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
  182. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  183. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  184. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  185. package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  186. package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
  187. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
  188. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
  189. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
  190. package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
  191. package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
  192. package/package.json +34 -8
  193. package/skills/README.md +122 -0
  194. package/skills/raybase-actions/SKILL.md +223 -0
  195. package/skills/raybase-actions/references/action-patterns.md +190 -0
  196. package/skills/raybase-actions/references/adapting-actions.md +93 -0
  197. package/skills/raybase-actions/references/testing-actions.md +48 -0
  198. package/skills/raybase-agent-debugging/SKILL.md +230 -0
  199. package/skills/raybase-ai/SKILL.md +1310 -0
  200. package/skills/raybase-api/SKILL.md +45 -0
  201. package/skills/raybase-astro-emdash/SKILL.md +143 -0
  202. package/skills/raybase-astro-emdash-content-model/SKILL.md +217 -0
  203. package/skills/raybase-astro-emdash-content-model/references/LICENSE-emdash +9 -0
  204. package/skills/raybase-astro-emdash-content-model/references/emdash-collections.md +265 -0
  205. package/skills/raybase-astro-emdash-design/LICENSE-impeccable +60 -0
  206. package/skills/raybase-astro-emdash-design/SKILL.md +170 -0
  207. package/skills/raybase-astro-emdash-design/reference/color.md +91 -0
  208. package/skills/raybase-astro-emdash-design/reference/copy.md +73 -0
  209. package/skills/raybase-astro-emdash-design/reference/direction.md +115 -0
  210. package/skills/raybase-astro-emdash-design/reference/imagery.md +84 -0
  211. package/skills/raybase-astro-emdash-design/reference/layout.md +69 -0
  212. package/skills/raybase-astro-emdash-design/reference/motion.md +75 -0
  213. package/skills/raybase-astro-emdash-design/reference/polish.md +75 -0
  214. package/skills/raybase-astro-emdash-design/reference/typography.md +72 -0
  215. package/skills/raybase-astro-emdash-galley/SKILL.md +265 -0
  216. package/skills/raybase-astro-emdash-migration/SKILL.md +218 -0
  217. package/skills/raybase-astro-emdash-migration/references/inventory-and-conversion.md +242 -0
  218. package/skills/raybase-astro-emdash-security-review/SKILL.md +68 -0
  219. package/skills/raybase-astro-emdash-theme-selection/SKILL.md +216 -0
  220. package/skills/raybase-auth/SKILL.md +358 -0
  221. package/skills/raybase-background-jobs/SKILL.md +774 -0
  222. package/skills/raybase-building/SKILL.md +409 -0
  223. package/skills/raybase-building/references/interview-and-spec.md +87 -0
  224. package/skills/raybase-building/references/planning-docs.md +26 -0
  225. package/skills/raybase-building/references/schema-and-config.md +70 -0
  226. package/skills/raybase-changing-a-live-app/SKILL.md +119 -0
  227. package/skills/raybase-data-and-policies/SKILL.md +377 -0
  228. package/skills/raybase-deploy/SKILL.md +136 -0
  229. package/skills/raybase-docs-writing/SKILL.md +119 -0
  230. package/skills/raybase-guide/SKILL.md +235 -0
  231. package/skills/raybase-mcp/SKILL.md +309 -0
  232. package/skills/raybase-mcp/agents/openai.yaml +4 -0
  233. package/skills/raybase-notifications/SKILL.md +138 -0
  234. package/skills/raybase-pro-migration/SKILL.md +28 -0
  235. package/skills/raybase-react-router/SKILL.md +241 -0
  236. package/skills/raybase-react-router-design/LICENSE-impeccable +60 -0
  237. package/skills/raybase-react-router-design/SKILL.md +135 -0
  238. package/skills/raybase-react-router-design/reference/color.md +87 -0
  239. package/skills/raybase-react-router-design/reference/copy.md +83 -0
  240. package/skills/raybase-react-router-design/reference/delight.md +48 -0
  241. package/skills/raybase-react-router-design/reference/interaction.md +91 -0
  242. package/skills/raybase-react-router-design/reference/layout.md +82 -0
  243. package/skills/raybase-react-router-design/reference/motion.md +86 -0
  244. package/skills/raybase-react-router-design/reference/polish.md +79 -0
  245. package/skills/raybase-react-router-design/reference/typography.md +71 -0
  246. package/skills/raybase-react-router-security-review/LICENSE +22 -0
  247. package/skills/raybase-react-router-security-review/SKILL.md +190 -0
  248. package/skills/raybase-react-router-security-review/agents/openai.yaml +4 -0
  249. package/skills/raybase-react-router-security-review/references/api-security.md +519 -0
  250. package/skills/raybase-react-router-security-review/references/authentication.md +353 -0
  251. package/skills/raybase-react-router-security-review/references/authorization.md +372 -0
  252. package/skills/raybase-react-router-security-review/references/business-logic.md +443 -0
  253. package/skills/raybase-react-router-security-review/references/cryptography.md +329 -0
  254. package/skills/raybase-react-router-security-review/references/csrf.md +398 -0
  255. package/skills/raybase-react-router-security-review/references/data-protection.md +378 -0
  256. package/skills/raybase-react-router-security-review/references/deserialization.md +410 -0
  257. package/skills/raybase-react-router-security-review/references/error-handling.md +436 -0
  258. package/skills/raybase-react-router-security-review/references/file-security.md +457 -0
  259. package/skills/raybase-react-router-security-review/references/injection.md +259 -0
  260. package/skills/raybase-react-router-security-review/references/logging.md +433 -0
  261. package/skills/raybase-react-router-security-review/references/misconfiguration.md +435 -0
  262. package/skills/raybase-react-router-security-review/references/modern-threats.md +475 -0
  263. package/skills/raybase-react-router-security-review/references/raybase-react-router-security.md +235 -0
  264. package/skills/raybase-react-router-security-review/references/ssrf.md +413 -0
  265. package/skills/raybase-react-router-security-review/references/supply-chain.md +405 -0
  266. package/skills/raybase-react-router-security-review/references/xss.md +336 -0
  267. package/skills/raybase-realtime/SKILL.md +158 -0
  268. package/skills/raybase-realtime/agents/openai.yaml +4 -0
  269. package/skills/raybase-schema/SKILL.md +209 -0
  270. package/skills/raybase-search/SKILL.md +137 -0
  271. package/skills/raybase-search/agents/openai.yaml +4 -0
  272. package/skills/raybase-settings/SKILL.md +139 -0
  273. package/skills/raybase-settings/agents/openai.yaml +4 -0
  274. package/skills/raybase-tanstack-start/SKILL.md +166 -0
  275. package/skills/raybase-tanstack-start-design/LICENSE-impeccable +60 -0
  276. package/skills/raybase-tanstack-start-design/SKILL.md +140 -0
  277. package/skills/raybase-tanstack-start-design/reference/color.md +80 -0
  278. package/skills/raybase-tanstack-start-design/reference/copy.md +83 -0
  279. package/skills/raybase-tanstack-start-design/reference/delight.md +48 -0
  280. package/skills/raybase-tanstack-start-design/reference/interaction.md +91 -0
  281. package/skills/raybase-tanstack-start-design/reference/layout.md +82 -0
  282. package/skills/raybase-tanstack-start-design/reference/motion.md +86 -0
  283. package/skills/raybase-tanstack-start-design/reference/polish.md +79 -0
  284. package/skills/raybase-tanstack-start-design/reference/typography.md +71 -0
  285. package/skills/raybase-tanstack-start-security-review/LICENSE +22 -0
  286. package/skills/raybase-tanstack-start-security-review/SKILL.md +194 -0
  287. package/skills/raybase-tanstack-start-security-review/agents/openai.yaml +4 -0
  288. package/skills/raybase-tanstack-start-security-review/references/api-security.md +519 -0
  289. package/skills/raybase-tanstack-start-security-review/references/authentication.md +353 -0
  290. package/skills/raybase-tanstack-start-security-review/references/authorization.md +372 -0
  291. package/skills/raybase-tanstack-start-security-review/references/business-logic.md +443 -0
  292. package/skills/raybase-tanstack-start-security-review/references/cryptography.md +329 -0
  293. package/skills/raybase-tanstack-start-security-review/references/csrf.md +398 -0
  294. package/skills/raybase-tanstack-start-security-review/references/data-protection.md +378 -0
  295. package/skills/raybase-tanstack-start-security-review/references/deserialization.md +410 -0
  296. package/skills/raybase-tanstack-start-security-review/references/error-handling.md +436 -0
  297. package/skills/raybase-tanstack-start-security-review/references/file-security.md +457 -0
  298. package/skills/raybase-tanstack-start-security-review/references/injection.md +259 -0
  299. package/skills/raybase-tanstack-start-security-review/references/logging.md +433 -0
  300. package/skills/raybase-tanstack-start-security-review/references/misconfiguration.md +435 -0
  301. package/skills/raybase-tanstack-start-security-review/references/modern-threats.md +475 -0
  302. package/skills/raybase-tanstack-start-security-review/references/raybase-tanstack-security.md +208 -0
  303. package/skills/raybase-tanstack-start-security-review/references/ssrf.md +413 -0
  304. package/skills/raybase-tanstack-start-security-review/references/supply-chain.md +405 -0
  305. package/skills/raybase-tanstack-start-security-review/references/xss.md +336 -0
  306. package/skills-manifest.json +41 -0
  307. package/templates/astro-emdash/.dev.vars.example +7 -0
  308. package/templates/astro-emdash/AGENTS.md +122 -0
  309. package/templates/astro-emdash/DESIGN.md +90 -0
  310. package/templates/astro-emdash/components.json +21 -0
  311. package/templates/astro-emdash/content/docs/getting-started.mdx +20 -0
  312. package/templates/astro-emdash/content/docs/index.mdx +13 -0
  313. package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
  314. package/templates/astro-emdash/content/docs/meta.json +4 -0
  315. package/templates/astro-emdash/content/docs/site-templates.mdx +62 -0
  316. package/templates/astro-emdash/dev/CODEBASE-MAP.md +46 -0
  317. package/templates/astro-emdash/dev/SPEC-OVERVIEW.md +15 -0
  318. package/templates/astro-emdash/dev/SPEC.md +84 -0
  319. package/templates/astro-emdash/dev/features/archive/.gitkeep +1 -0
  320. package/templates/astro-emdash/docs/theme-previews/base.svg +24 -0
  321. package/templates/astro-emdash/docs/theme-previews/steel.svg +24 -0
  322. package/templates/astro-emdash/docs/theme-previews/zen.svg +24 -0
  323. package/templates/astro-emdash/docs/themes.md +106 -0
  324. package/templates/astro-emdash/drizzle.config.ts +5 -0
  325. package/templates/astro-emdash/gitignore +11 -0
  326. package/templates/astro-emdash/migrations/app/meta/_journal.json +5 -0
  327. package/templates/astro-emdash/package.json +79 -0
  328. package/templates/astro-emdash/pnpm-workspace.yaml +71 -0
  329. package/templates/astro-emdash/public/_headers +4 -0
  330. package/templates/astro-emdash/site/astro.config.mjs +120 -0
  331. package/templates/astro-emdash/site/demo/README.md +72 -0
  332. package/templates/astro-emdash/site/demo/content/collection.json +43 -0
  333. package/templates/astro-emdash/site/demo/content/entries.json +120 -0
  334. package/templates/astro-emdash/site/demo/templates/demo-article-card/manifest.json +51 -0
  335. package/templates/astro-emdash/site/demo/templates/demo-article-card/sample-content.json +5 -0
  336. package/templates/astro-emdash/site/demo/templates/demo-article-card/template.liquid +48 -0
  337. package/templates/astro-emdash/site/demo/templates/demo-article-page/host.json +9 -0
  338. package/templates/astro-emdash/site/demo/templates/demo-article-page/manifest.json +38 -0
  339. package/templates/astro-emdash/site/demo/templates/demo-article-page/sample-content.json +34 -0
  340. package/templates/astro-emdash/site/demo/templates/demo-article-page/template.liquid +84 -0
  341. package/templates/astro-emdash/site/demo/templates/demo-articles-index/manifest.json +64 -0
  342. package/templates/astro-emdash/site/demo/templates/demo-articles-index/page.json +7 -0
  343. package/templates/astro-emdash/site/demo/templates/demo-articles-index/sample-content.json +24 -0
  344. package/templates/astro-emdash/site/demo/templates/demo-articles-index/template.liquid +100 -0
  345. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/manifest.json +51 -0
  346. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/sample-content.json +5 -0
  347. package/templates/astro-emdash/site/demo/templates/demo-menu-nav/template.liquid +70 -0
  348. package/templates/astro-emdash/site/gitignore +1 -0
  349. package/templates/astro-emdash/site/package.json +56 -0
  350. package/templates/astro-emdash/site/scripts/apply-site-templates.mjs +560 -0
  351. package/templates/astro-emdash/site/scripts/galley-demo.mjs +298 -0
  352. package/templates/astro-emdash/site/scripts/seed-galley-starter.mjs +360 -0
  353. package/templates/astro-emdash/site/scripts/site-origin.mjs +45 -0
  354. package/templates/astro-emdash/site/seed/seed.json +154 -0
  355. package/templates/astro-emdash/site/seed/templates/.gitkeep +1 -0
  356. package/templates/astro-emdash/site/src/components/RaybaseSignedInMenu.astro +163 -0
  357. package/templates/astro-emdash/site/src/components/blocks/RaybaseActionIsland.astro +41 -0
  358. package/templates/astro-emdash/site/src/content-door/raybase-routes.ts +738 -0
  359. package/templates/astro-emdash/site/src/content-door/resolve-page.ts +142 -0
  360. package/templates/astro-emdash/site/src/content-door/seed.ts +85 -0
  361. package/templates/astro-emdash/site/src/env.d.ts +12 -0
  362. package/templates/astro-emdash/site/src/layouts/SiteLayout.astro +68 -0
  363. package/templates/astro-emdash/site/src/lib/palettes.gen.ts +7 -0
  364. package/templates/astro-emdash/site/src/lib/site-motion.ts +169 -0
  365. package/templates/astro-emdash/site/src/lib/site-shell.ts +294 -0
  366. package/templates/astro-emdash/site/src/live.config.ts +8 -0
  367. package/templates/astro-emdash/site/src/middleware.ts +20 -0
  368. package/templates/astro-emdash/site/src/pages/[...slug].astro +113 -0
  369. package/templates/astro-emdash/site/src/pages/_raybase/handoff/consume.ts +6 -0
  370. package/templates/astro-emdash/site/src/pages/_raybase/islands/action.ts +8 -0
  371. package/templates/astro-emdash/site/src/pages/_raybase/sign-out/index.ts +6 -0
  372. package/templates/astro-emdash/site/src/styles/palette-fonts.gen.css +1 -0
  373. package/templates/astro-emdash/site/src/styles/palettes.gen.css +3 -0
  374. package/templates/astro-emdash/site/src/styles.css +607 -0
  375. package/templates/astro-emdash/site/tsconfig.json +12 -0
  376. package/templates/astro-emdash/site/wrangler.jsonc +34 -0
  377. package/templates/astro-emdash/source.config.ts +10 -0
  378. package/templates/astro-emdash/src/actions.ts +58 -0
  379. package/templates/astro-emdash/src/ai/agents.ts +20 -0
  380. package/templates/astro-emdash/src/ai/retrieval.ts +36 -0
  381. package/templates/astro-emdash/src/auth-door.ts +18 -0
  382. package/templates/astro-emdash/src/client.tsx +25 -0
  383. package/templates/astro-emdash/src/components/.gitkeep +1 -0
  384. package/templates/astro-emdash/src/components/account-menu.tsx +91 -0
  385. package/templates/astro-emdash/src/components/auth-shell.tsx +69 -0
  386. package/templates/astro-emdash/src/components/mode-toggle.tsx +32 -0
  387. package/templates/astro-emdash/src/components/search-command-palette.tsx +107 -0
  388. package/templates/astro-emdash/src/components/setup-token-page.tsx +196 -0
  389. package/templates/astro-emdash/src/components/ui/avatar.tsx +107 -0
  390. package/templates/astro-emdash/src/components/ui/badge.tsx +52 -0
  391. package/templates/astro-emdash/src/components/ui/button.tsx +69 -0
  392. package/templates/astro-emdash/src/components/ui/checkbox.tsx +29 -0
  393. package/templates/astro-emdash/src/components/ui/dialog.tsx +158 -0
  394. package/templates/astro-emdash/src/components/ui/dropdown-menu.tsx +303 -0
  395. package/templates/astro-emdash/src/components/ui/input.tsx +20 -0
  396. package/templates/astro-emdash/src/components/ui/label.tsx +20 -0
  397. package/templates/astro-emdash/src/components/ui/scroll-area.tsx +53 -0
  398. package/templates/astro-emdash/src/components/ui/select.tsx +215 -0
  399. package/templates/astro-emdash/src/components/ui/separator.tsx +23 -0
  400. package/templates/astro-emdash/src/components/ui/sheet.tsx +138 -0
  401. package/templates/astro-emdash/src/components/ui/sidebar.tsx +728 -0
  402. package/templates/astro-emdash/src/components/ui/skeleton.tsx +13 -0
  403. package/templates/astro-emdash/src/components/ui/textarea.tsx +18 -0
  404. package/templates/astro-emdash/src/components/ui/tooltip.tsx +66 -0
  405. package/templates/astro-emdash/src/db/migrations.gen.ts +6 -0
  406. package/templates/astro-emdash/src/db/schema.ts +6 -0
  407. package/templates/astro-emdash/src/db/seed.ts +16 -0
  408. package/templates/astro-emdash/src/db/storage.ts +32 -0
  409. package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
  410. package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
  411. package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
  412. package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
  413. package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
  414. package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
  415. package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
  416. package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
  417. package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
  418. package/templates/astro-emdash/src/docs/source.ts +7 -0
  419. package/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
  420. package/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
  421. package/templates/astro-emdash/src/hooks/use-mobile.ts +19 -0
  422. package/templates/astro-emdash/src/jobs.example.ts +48 -0
  423. package/templates/astro-emdash/src/lib/account.ts +12 -0
  424. package/templates/astro-emdash/src/lib/auth-client.ts +181 -0
  425. package/templates/astro-emdash/src/lib/utils.ts +6 -0
  426. package/templates/astro-emdash/src/mcp-app.ts +57 -0
  427. package/templates/astro-emdash/src/notifications.example.ts +37 -0
  428. package/templates/astro-emdash/src/raybase.auth.ts +70 -0
  429. package/templates/astro-emdash/src/raybase.config.ts +49 -0
  430. package/templates/astro-emdash/src/raybase.server.ts +56 -0
  431. package/templates/astro-emdash/src/realtime.example.ts +18 -0
  432. package/templates/astro-emdash/src/router.tsx +19 -0
  433. package/templates/astro-emdash/src/routes/__root.tsx +56 -0
  434. package/templates/astro-emdash/src/routes/_app/admin.tsx +13 -0
  435. package/templates/astro-emdash/src/routes/_app/forgot-password.tsx +97 -0
  436. package/templates/astro-emdash/src/routes/_app/index.tsx +169 -0
  437. package/templates/astro-emdash/src/routes/_app/invite.$token.tsx +11 -0
  438. package/templates/astro-emdash/src/routes/_app/login.tsx +193 -0
  439. package/templates/astro-emdash/src/routes/_app/profile.tsx +98 -0
  440. package/templates/astro-emdash/src/routes/_app/reset-password.$token.tsx +15 -0
  441. package/templates/astro-emdash/src/routes/_app/reset-password.tsx +115 -0
  442. package/templates/astro-emdash/src/routes/_app/setup.$token.tsx +11 -0
  443. package/templates/astro-emdash/src/routes/_app/signup.tsx +141 -0
  444. package/templates/astro-emdash/src/routes/_app/verify-email.$token.tsx +15 -0
  445. package/templates/astro-emdash/src/routes/_app/verify-email.tsx +154 -0
  446. package/templates/astro-emdash/src/routes/_app.tsx +33 -0
  447. package/templates/astro-emdash/src/routes/admin/$.ts +20 -0
  448. package/templates/astro-emdash/src/routes/api/$.ts +19 -0
  449. package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
  450. package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
  451. package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
  452. package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
  453. package/templates/astro-emdash/src/routes/docs.tsx +22 -0
  454. package/templates/astro-emdash/src/search.ts +6 -0
  455. package/templates/astro-emdash/src/settings.ts +12 -0
  456. package/templates/astro-emdash/src/styles-docs.css +3 -0
  457. package/templates/astro-emdash/src/styles.css +101 -0
  458. package/templates/astro-emdash/src/themes/base.css +76 -0
  459. package/templates/astro-emdash/src/themes/carbon.css +76 -0
  460. package/templates/astro-emdash/src/themes/fonts.css +25 -0
  461. package/templates/astro-emdash/src/themes/sage.css +76 -0
  462. package/templates/astro-emdash/src/themes/sand.css +76 -0
  463. package/templates/astro-emdash/src/themes/slate.css +81 -0
  464. package/templates/astro-emdash/src/themes/ultra.css +76 -0
  465. package/templates/astro-emdash/src/themes/zen.css +76 -0
  466. package/templates/astro-emdash/src/worker-entry.ts +31 -0
  467. package/templates/astro-emdash/tests/raybase-patterns.test.ts +29 -0
  468. package/templates/astro-emdash/tsconfig.json +36 -0
  469. package/templates/astro-emdash/vite.config.ts +130 -0
  470. package/templates/astro-emdash/vitest.config.ts +8 -0
  471. package/templates/astro-emdash/wrangler.jsonc +112 -0
  472. package/templates/react-router/.dev.vars.example +5 -0
  473. package/templates/react-router/.editorconfig +15 -0
  474. package/templates/react-router/AGENTS.md +54 -0
  475. package/templates/react-router/README.md +52 -0
  476. package/templates/react-router/app/app.css +44 -0
  477. package/templates/react-router/app/components/mdx.tsx +79 -0
  478. package/templates/react-router/app/components/ui/button.tsx +45 -0
  479. package/templates/react-router/app/components/ui/card.tsx +87 -0
  480. package/templates/react-router/app/components/ui/separator.tsx +22 -0
  481. package/templates/react-router/app/db/migrations.gen.ts +6 -0
  482. package/templates/react-router/app/db/schema.ts +56 -0
  483. package/templates/react-router/app/db/seed.ts +14 -0
  484. package/templates/react-router/app/entry.server.tsx +41 -0
  485. package/templates/react-router/app/globals.d.ts +1 -0
  486. package/templates/react-router/app/lib/layout.shared.tsx +52 -0
  487. package/templates/react-router/app/lib/source.ts +7 -0
  488. package/templates/react-router/app/lib/utils.ts +6 -0
  489. package/templates/react-router/app/raybase.server.ts +65 -0
  490. package/templates/react-router/app/root.tsx +23 -0
  491. package/templates/react-router/app/routes/_index.tsx +53 -0
  492. package/templates/react-router/app/routes/docs.$.tsx +49 -0
  493. package/templates/react-router/app/routes/docs.api.search.ts +10 -0
  494. package/templates/react-router/app/routes/docs.tsx +13 -0
  495. package/templates/react-router/app/routes.ts +3 -0
  496. package/templates/react-router/components.json +22 -0
  497. package/templates/react-router/content/docs/getting-started.mdx +15 -0
  498. package/templates/react-router/content/docs/index.mdx +8 -0
  499. package/templates/react-router/content/docs/mcp.mdx +121 -0
  500. package/templates/react-router/content/docs/meta.json +4 -0
  501. package/templates/react-router/dev/CODEBASE-MAP.md +48 -0
  502. package/templates/react-router/dev/SPEC-OVERVIEW.md +35 -0
  503. package/templates/react-router/dev/SPEC.md +93 -0
  504. package/templates/react-router/dev/features/archive/.gitkeep +1 -0
  505. package/templates/react-router/drizzle.config.ts +5 -0
  506. package/templates/react-router/env.d.ts +53 -0
  507. package/templates/react-router/gitignore +23 -0
  508. package/templates/react-router/migrations/app/meta/_journal.json +1 -0
  509. package/templates/react-router/package.json +70 -0
  510. package/templates/react-router/public/_headers +4 -0
  511. package/templates/react-router/public/favicon.ico +0 -0
  512. package/templates/react-router/react-router.config.ts +9 -0
  513. package/templates/react-router/source.config.ts +5 -0
  514. package/templates/react-router/tests/raybase-patterns.test.ts +23 -0
  515. package/templates/react-router/tsconfig.json +27 -0
  516. package/templates/react-router/vite.config.ts +59 -0
  517. package/templates/react-router/vitest.config.ts +8 -0
  518. package/templates/react-router/workers/app.ts +40 -0
  519. package/templates/react-router/wrangler.jsonc +111 -0
  520. package/templates/tanstack-start/.dev.vars.example +5 -0
  521. package/templates/tanstack-start/AGENTS.md +95 -0
  522. package/templates/tanstack-start/DESIGN.md +65 -0
  523. package/templates/tanstack-start/components.json +21 -0
  524. package/templates/tanstack-start/content/docs/getting-started.mdx +65 -0
  525. package/templates/tanstack-start/content/docs/index.mdx +10 -0
  526. package/templates/tanstack-start/content/docs/mcp.mdx +122 -0
  527. package/templates/tanstack-start/content/docs/meta.json +4 -0
  528. package/templates/tanstack-start/dev/CODEBASE-MAP.md +84 -0
  529. package/templates/tanstack-start/dev/SPEC-OVERVIEW.md +46 -0
  530. package/templates/tanstack-start/dev/SPEC.md +213 -0
  531. package/templates/tanstack-start/dev/features/archive/.gitkeep +1 -0
  532. package/templates/tanstack-start/docs/theme-previews/base.svg +24 -0
  533. package/templates/tanstack-start/docs/theme-previews/steel.svg +24 -0
  534. package/templates/tanstack-start/docs/theme-previews/zen.svg +24 -0
  535. package/templates/tanstack-start/docs/themes.md +116 -0
  536. package/templates/tanstack-start/drizzle.config.ts +5 -0
  537. package/templates/tanstack-start/gitignore +11 -0
  538. package/templates/tanstack-start/migrations/app/0000_low_karen_page.sql +26 -0
  539. package/templates/tanstack-start/migrations/app/meta/0000_snapshot.json +196 -0
  540. package/templates/tanstack-start/migrations/app/meta/_journal.json +13 -0
  541. package/templates/tanstack-start/package.json +77 -0
  542. package/templates/tanstack-start/public/_headers +8 -0
  543. package/templates/tanstack-start/public/icons/app-icon-maskable.svg +1 -0
  544. package/templates/tanstack-start/public/icons/app-icon.svg +1 -0
  545. package/templates/tanstack-start/public/icons/apple-touch-icon.png +0 -0
  546. package/templates/tanstack-start/public/manifest.webmanifest +14 -0
  547. package/templates/tanstack-start/public/raybase-push-sw.js +32 -0
  548. package/templates/tanstack-start/source.config.ts +10 -0
  549. package/templates/tanstack-start/src/actions.ts +560 -0
  550. package/templates/tanstack-start/src/ai/agents.ts +78 -0
  551. package/templates/tanstack-start/src/ai/retrieval.ts +36 -0
  552. package/templates/tanstack-start/src/auth-door.ts +18 -0
  553. package/templates/tanstack-start/src/client.tsx +25 -0
  554. package/templates/tanstack-start/src/components/.gitkeep +1 -0
  555. package/templates/tanstack-start/src/components/account-menu.tsx +127 -0
  556. package/templates/tanstack-start/src/components/auth-shell.tsx +69 -0
  557. package/templates/tanstack-start/src/components/install-app.tsx +35 -0
  558. package/templates/tanstack-start/src/components/mode-toggle.tsx +32 -0
  559. package/templates/tanstack-start/src/components/search-command-palette.tsx +107 -0
  560. package/templates/tanstack-start/src/components/setup-token-page.tsx +197 -0
  561. package/templates/tanstack-start/src/components/ui/avatar.tsx +107 -0
  562. package/templates/tanstack-start/src/components/ui/badge.tsx +52 -0
  563. package/templates/tanstack-start/src/components/ui/button.tsx +69 -0
  564. package/templates/tanstack-start/src/components/ui/checkbox.tsx +29 -0
  565. package/templates/tanstack-start/src/components/ui/dialog.tsx +158 -0
  566. package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +303 -0
  567. package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
  568. package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
  569. package/templates/tanstack-start/src/components/ui/scroll-area.tsx +53 -0
  570. package/templates/tanstack-start/src/components/ui/select.tsx +215 -0
  571. package/templates/tanstack-start/src/components/ui/separator.tsx +23 -0
  572. package/templates/tanstack-start/src/components/ui/sheet.tsx +138 -0
  573. package/templates/tanstack-start/src/components/ui/sidebar.tsx +728 -0
  574. package/templates/tanstack-start/src/components/ui/skeleton.tsx +13 -0
  575. package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
  576. package/templates/tanstack-start/src/components/ui/tooltip.tsx +66 -0
  577. package/templates/tanstack-start/src/db/migrations.gen.ts +6 -0
  578. package/templates/tanstack-start/src/db/schema.ts +90 -0
  579. package/templates/tanstack-start/src/db/seed.ts +106 -0
  580. package/templates/tanstack-start/src/db/storage.ts +32 -0
  581. package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
  582. package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
  583. package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
  584. package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
  585. package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
  586. package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
  587. package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
  588. package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
  589. package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
  590. package/templates/tanstack-start/src/docs/source.ts +7 -0
  591. package/templates/tanstack-start/src/hooks/use-mobile.ts +19 -0
  592. package/templates/tanstack-start/src/hooks/use-pwa-install.ts +77 -0
  593. package/templates/tanstack-start/src/jobs.example.ts +56 -0
  594. package/templates/tanstack-start/src/lib/account.ts +13 -0
  595. package/templates/tanstack-start/src/lib/auth-client.ts +187 -0
  596. package/templates/tanstack-start/src/lib/push-client.ts +98 -0
  597. package/templates/tanstack-start/src/lib/utils.ts +6 -0
  598. package/templates/tanstack-start/src/mcp-app.ts +74 -0
  599. package/templates/tanstack-start/src/notifications.example.ts +37 -0
  600. package/templates/tanstack-start/src/raybase.auth.ts +86 -0
  601. package/templates/tanstack-start/src/raybase.config.ts +86 -0
  602. package/templates/tanstack-start/src/raybase.server.ts +155 -0
  603. package/templates/tanstack-start/src/realtime.example.ts +46 -0
  604. package/templates/tanstack-start/src/router.tsx +19 -0
  605. package/templates/tanstack-start/src/routes/__root.tsx +73 -0
  606. package/templates/tanstack-start/src/routes/_app/admin.tsx +13 -0
  607. package/templates/tanstack-start/src/routes/_app/forgot-password.tsx +97 -0
  608. package/templates/tanstack-start/src/routes/_app/index.tsx +1316 -0
  609. package/templates/tanstack-start/src/routes/_app/invite.$token.tsx +11 -0
  610. package/templates/tanstack-start/src/routes/_app/login.tsx +193 -0
  611. package/templates/tanstack-start/src/routes/_app/profile.tsx +98 -0
  612. package/templates/tanstack-start/src/routes/_app/reset-password.$token.tsx +16 -0
  613. package/templates/tanstack-start/src/routes/_app/reset-password.tsx +115 -0
  614. package/templates/tanstack-start/src/routes/_app/setup.$token.tsx +11 -0
  615. package/templates/tanstack-start/src/routes/_app/signup.tsx +141 -0
  616. package/templates/tanstack-start/src/routes/_app/verify-email.$token.tsx +15 -0
  617. package/templates/tanstack-start/src/routes/_app/verify-email.tsx +154 -0
  618. package/templates/tanstack-start/src/routes/_app.tsx +33 -0
  619. package/templates/tanstack-start/src/routes/admin/$.ts +20 -0
  620. package/templates/tanstack-start/src/routes/api/$.ts +19 -0
  621. package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
  622. package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
  623. package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
  624. package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
  625. package/templates/tanstack-start/src/routes/docs.tsx +22 -0
  626. package/templates/tanstack-start/src/search.ts +26 -0
  627. package/templates/tanstack-start/src/settings.ts +12 -0
  628. package/templates/tanstack-start/src/styles-docs.css +3 -0
  629. package/templates/tanstack-start/src/styles.css +73 -0
  630. package/templates/tanstack-start/src/themes/base.css +76 -0
  631. package/templates/tanstack-start/src/themes/carbon.css +76 -0
  632. package/templates/tanstack-start/src/themes/fonts.css +18 -0
  633. package/templates/tanstack-start/src/themes/sage.css +76 -0
  634. package/templates/tanstack-start/src/themes/sand.css +76 -0
  635. package/templates/tanstack-start/src/themes/slate.css +76 -0
  636. package/templates/tanstack-start/src/themes/ultra.css +76 -0
  637. package/templates/tanstack-start/src/themes/zen.css +76 -0
  638. package/templates/tanstack-start/src/worker-entry.ts +30 -0
  639. package/templates/tanstack-start/tests/raybase-patterns.test.ts +247 -0
  640. package/templates/tanstack-start/tsconfig.json +33 -0
  641. package/templates/tanstack-start/vite.config.ts +132 -0
  642. package/templates/tanstack-start/vitest.config.ts +8 -0
  643. package/templates/tanstack-start/wrangler.jsonc +112 -0
  644. package/README.md +0 -3
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: raybase-docs-writing
3
+ description: Write and maintain generated app-user Fumadocs documentation in content/docs or site/content/docs. Use before changing Guide-indexed app help, docs pages, docs navigation, or generated app documentation.
4
+ ---
5
+
6
+ # Raybase Docs Writing Skill
7
+
8
+ Use this skill before changing app-user docs.
9
+
10
+ When `raybase.modules.docs.enabled` is true, current app-specific docs are a
11
+ required deliverable before the app is called ready. The scaffold may start with
12
+ placeholder pages; replace them with docs for behavior that actually exists. If
13
+ Docs are disabled because the human requested that, do not create a separate
14
+ docs surface.
15
+
16
+ Docs are part of product continuity. They give app users and future agents a
17
+ checked-in source of truth after the original build chat is gone, and Guide may
18
+ index them for help. Skip docs churn for tiny fixes, styling polish, or
19
+ implementation-only changes that do not alter user-visible behavior.
20
+
21
+ If Guide docs mode is enabled, also use `raybase-guide` and run
22
+ `raybase guide index` after changing docs.
23
+
24
+ The active docs root is app-user help. It is indexed by Guide, so it must read like
25
+ documentation for the generated app as a standalone product, not for the
26
+ platform it was built with.
27
+
28
+ Planning and orientation docs are separate. `dev/SPEC-OVERVIEW.md` and
29
+ `dev/CODEBASE-MAP.md` are agent-facing living docs; the active docs root is
30
+ user-facing product help. Update the `dev/` planning docs only when product
31
+ story or architecture changed, and never copy implementation notes into
32
+ app-user docs.
33
+
34
+ Before editing docs, resolve the docs root:
35
+
36
+ 1. Read `dev/SPEC.md` and its exact `Public Surface / Documentation` lines.
37
+ Docs are public by default (`Docs exposure: public`): anyone can read
38
+ them, so write nothing in them that signed-out visitors should not see.
39
+ Only `Docs exposure: signed-in only`, with its sign-in check in place,
40
+ keeps them behind sign-in.
41
+ 2. Read `package.json` and check `raybase.modules.docs.placement` when present.
42
+ 3. Read `.raybase/modules.json` and check `modules.docs.placement` when present.
43
+ 4. Treat missing placement as `spine`.
44
+ 5. Use `content/docs` for `spine` placement and `site/content/docs` for `site` placement.
45
+
46
+ Then follow the writing flow:
47
+
48
+ 1. Read `dev/SPEC.md` first.
49
+ - Treat it as the source of truth for what the app is supposed to do.
50
+ - If the spec and implementation disagree, stop and resolve that before documenting behavior as fact.
51
+ - Read `dev/SPEC-OVERVIEW.md` and `dev/CODEBASE-MAP.md` when present for
52
+ orientation, but do not treat them as more authoritative than `dev/SPEC.md`.
53
+
54
+ 2. Define the reader and doc map.
55
+ - Treat `index.mdx`, `getting-started.mdx`, and ordinary task pages as app-user docs.
56
+ - When the user App MCP server is enabled, keep an `mcp.mdx`
57
+ page titled `Connecting to <app name> with AI`. The scaffolded page
58
+ already covers ChatGPT, Claude, and generic MCP-capable agent setup; fill
59
+ in the exact app URL and tool-scope summary instead of rewriting the whole
60
+ setup process.
61
+ - Inventory user-visible screens, navigation, roles, forms, filters, states, and workflows from the actual implementation.
62
+ - Prefer focused task pages over one mixed page. Each page should be one kind of document: overview, getting-started/tutorial, how-to, reference, or troubleshooting.
63
+ - Keep operator runbooks, admin maintenance, deployment, backups, raw data repair, and API/MCP integration notes outside the active docs root unless the app deliberately exposes a domain-specific user UI for that task.
64
+
65
+ 3. Keep docs in the active docs root.
66
+ - Preserve Fumadocs frontmatter and `meta.json` page-tree conventions.
67
+ - Add focused pages instead of rewriting all docs on every app change.
68
+ - Keep headings, titles, and descriptions plain and specific.
69
+ - Ensure every page is reachable from `meta.json` or a linked parent page.
70
+
71
+ 4. Write app-user documentation.
72
+ - Start `index.mdx` with what the app helps the reader do, who uses it, and where to start.
73
+ - Put a 3-5 step first workflow near the top of `getting-started.mdx`.
74
+ - For `mcp.mdx`, preserve the setup sections for ChatGPT, Claude, and a
75
+ generic "Add MCP server" flow unless the actual client requirements have
76
+ changed. Replace placeholder server URLs with the deployed app MCP URL
77
+ (`/mcp`; an app using `mcp.hostApproval` keeps the same URL, and the client's
78
+ sign-in asks which host account to connect).
79
+ - In `mcp.mdx`, explain the scope of the available tools in product terms:
80
+ what `mcp:read` lets the AI read, what `mcp:write` lets it change or
81
+ perform, any important per-tool permissions users may see during consent,
82
+ and what is intentionally not available through AI. Do not duplicate full
83
+ tool schemas or argument references; MCP clients discover detailed tool
84
+ docs from the server.
85
+ - For each workflow page, cover: what the reader will see, what they can do, how to complete the task, what visible statuses or errors mean, and what happens next.
86
+ - Use second person, active voice, present tense, concrete UI labels, and sentence-case headings.
87
+ - Put UI text in bold and code/file names in code font.
88
+ - Use numbered lists for sequential steps and bullets for non-sequential lists.
89
+
90
+ 5. Document only real behavior.
91
+ - Do not promise screens, permissions, automations, integrations, data exports, or AI behavior that has not been implemented.
92
+ - Do not describe raw schema, database tables, package names, generated files, deployment config, admin screens, platform APIs, or implementation internals in app-user docs.
93
+ - Use product language instead of table names: "leave categories" rather than `leaveTypes`, "team routing" rather than `teamAssignments`.
94
+ - Keep placeholder pages only until real documentation replaces them.
95
+
96
+ 6. Audit app-user boundaries.
97
+ - Remove Raybase, Cloudflare, Durable Object, D1, Workers, wrangler, package names, `/admin`, `/api`, `/mcp`, operator MCP, raw table names, and similar platform/admin terms from the active docs root.
98
+ - `mcp.mdx` is the narrow exception for user App MCP setup:
99
+ it may mention `/mcp`, MCP, ChatGPT, Claude, OAuth/authorization, and
100
+ `mcp:*` scopes. Keep Raybase internals, operator MCP, `/admin`, raw table
101
+ names, deployment details, and implementation jargon out of that page too.
102
+ - The AI connection page covers the user App MCP surface only. Operator
103
+ MCP is for admin evidence and belongs in operator runbooks, not app-user
104
+ docs.
105
+ - Do not send app users to `/admin` for normal product work.
106
+ - If the only way to perform a task is through admin/data repair, omit it from app-user docs and surface it as implementation follow-up instead of documenting it as product behavior.
107
+ - Treat `raybase doctor` docs-leakage findings as warning-only prompts to review and rewrite the docs, not as deployment blockers. If a flagged term is genuinely product-domain language, keep it and treat the warning as a false positive. The `/mcp` leakage warning is suppressed for `mcp.mdx`; do not suppress other platform/admin terms by putting them on that page.
108
+
109
+ 7. Validate after docs changes.
110
+ - Run `raybase doctor`.
111
+ - Run the relevant app check/build command (`pnpm run check`, or `pnpm run typecheck` plus the framework build when that is what the template uses).
112
+ - When a dev server is available, open `/docs` and verify the docs page and search UI load. Search is served at `/docs/api/search`.
113
+
114
+ Forbidden:
115
+ - Do not document generated demo tables, demo dashboards, or sample permissions as the app's product behavior unless the human explicitly chose to keep them.
116
+ - Do not move docs outside the active docs root (`content/docs` for spine placement, `site/content/docs` for site placement).
117
+ - Do not route docs search through `/api/search`; Raybase owns `/api/*` ahead of the router in React Router apps. Keep search at `/docs/api/search`.
118
+ - Do not mention Raybase, Raybase admin, `/admin`, `/api`, Cloudflare, Durable Objects, wrangler, package names, or raw table names in the active docs root.
119
+ - Do not mention `/mcp` outside the active docs root's `mcp.mdx`.
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: raybase-guide
3
+ description: Configure and maintain the Raybase Guide end-user companion for app and docs surfaces.
4
+ ---
5
+
6
+ # Raybase Guide Skill
7
+
8
+ Use this skill before changing Guide configuration, `src/guide`, `app/guide`,
9
+ Guide workflow actions, or the Guide widget in a Raybase Core or Pro app.
10
+
11
+ Guide helps end users use the app. It does not operate the app, administer the
12
+ app, change source code, run SQL, or bypass Raybase permissions.
13
+
14
+ ## Investment Frame
15
+
16
+ Minimum Guide work is app-specific capability context when Guide is enabled.
17
+ That usually means a private `content/guide/capability-map.md` that explains
18
+ what the app does, where important workflows live, what Guide can answer, and
19
+ which actions it can safely perform.
20
+
21
+ Richer Guide actions are worthwhile when conversational help, support capture,
22
+ search, or a narrow declared action materially helps the workflow. When the app
23
+ defines user-facing actions and Guide is enabled, decide explicitly whether
24
+ Guide should use a narrow subset of those actions. Do not leave that decision
25
+ implicit: either populate `src/guide/actions.ts` or `app/guide/actions.ts` and
26
+ pass `guideActions` to `guideModule`, or set `mode: "knowledge-only"` in
27
+ `guideModule` when Guide should deliberately answer only from knowledge.
28
+
29
+ When Guide is enabled, treating `content/guide/capability-map.md` as
30
+ placeholder-only is incomplete. Every implemented app should leave Guide with
31
+ enough checked-in Markdown context to explain the app and enough explicit,
32
+ policy-checked actions to perform the workflows the owner expects Guide to
33
+ perform.
34
+
35
+ Required context:
36
+
37
+ 1. Read `dev/SPEC.md`.
38
+ 2. Read `dev/SPEC-OVERVIEW.md` and `dev/CODEBASE-MAP.md` when present for
39
+ product, architecture, and organization-model orientation. `dev/SPEC.md`
40
+ remains authoritative.
41
+ 3. Resolve the docs root when docs mode is enabled:
42
+ - read `dev/SPEC.md` and its exact `Public Surface / Documentation` lines
43
+ - read `package.json` `raybase.modules.docs.placement` when present
44
+ - read `.raybase/modules.json` `modules.docs.placement` when present
45
+ - treat missing placement as `spine`
46
+ - use `content/docs` for `spine` and `site/content/docs` for `site`
47
+ 4. If docs mode is enabled, read relevant files in the active docs root.
48
+ 5. Check `package.json` under `raybase.modules.guide`.
49
+ 6. Check `guideConfig` in `src/guide/config.ts` or `app/guide/config.ts`, the
50
+ `guideModule({ config: guideConfig, ... })` registration, and `appConfig.ai`.
51
+ 7. Check `appConfig.ai.enabled`, the `RAYBASE_AI_CHAT_AGENT` Durable Object
52
+ binding, and the `@raybase/agent-ui` / `@assistant-ui/react` dependencies.
53
+ 8. Read Guide-only Markdown in `content/guide` and any configured resources in
54
+ `src/guide/resources.json` or `app/guide/resources.json`.
55
+ 9. In Pro apps, check the organization mode and resolution strategy.
56
+
57
+ Raybase Sites (astro-emdash) apps: Guide lives on the TanStack Start spine.
58
+ Guide config, corpus, actions, and the widget mount (`src/guide/*`,
59
+ `src/components/guide-widget.tsx`, the `raybase:guide-widget` region in
60
+ `src/routes/__root.tsx`) are all spine files, and the widget renders on the
61
+ spine app surface. The public Astro site (`site/` — EmDash pages and Galley
62
+ sections) is not a Guide surface; do not mount `RaybaseAgentWidget` or agent
63
+ chat on public site pages. With `site` docs placement, `site/content/docs` is
64
+ still the active docs root Guide indexes for knowledge.
65
+
66
+ Apps embedded in another platform's admin (usually created from an outside
67
+ starter) may sign people in through the host rather than Raybase. The
68
+ signed-in Guide works for them through `createRaybaseApp({ hostAuth })`
69
+ (`defineRaybaseHostAuth({ provider, resolve })`): on agent routes, and only
70
+ when the request has no Raybase session, `resolve` verifies the host's token
71
+ and returns `{ subject, name }`, and Raybase makes or reuses a plain user for
72
+ that person (`user` role, never an operator; banning them in `/admin` cuts
73
+ them off). The widget sends the host's token through the `fetch` option it
74
+ passes to the agent client. Do not remove either, and do not "fix" a 401 by
75
+ making the app surface public.
76
+
77
+ Rules:
78
+
79
+ - Keep Guide opt-in. Enabling Guide means model calls may consume Workers AI.
80
+ - Public Guide is conversational help/support only. It must not read app data, organization
81
+ app data in Pro, prior private support, schema summaries, policy internals,
82
+ or workflow actions.
83
+ - Signed-in Guide may call only explicit Guide-owned or agent-declared
84
+ `defineAction()` actions. In Pro, those actions run inside the current
85
+ resolved organization.
86
+ - Generated apps should keep Guide's allow-list in `src/guide/actions.ts` or
87
+ `app/guide/actions.ts`:
88
+ `export const guideActions = [actions.someUserWorkflow];`. Import that
89
+ allow-list in `raybase.server.ts` and pass
90
+ `guideModule({ config: guideConfig, corpus: guideCorpus, actions: guideActions })`.
91
+ - If a workflow should be available through Guide, define a narrow
92
+ `defineAction()` with a clear description, strict input schema, policy,
93
+ idempotency/destructive annotations, and a user-facing result. Pass only the
94
+ intended allow-list to `guideModule({ ..., actions: [...] })`.
95
+ - When Guide can act on a CRUD-like resource by internal id, also give it a
96
+ domain-specific read-only discovery action for that resource, such as
97
+ `leave_requests.list_my_requests` or `invoices.search_payable`. Mark the
98
+ internal-id action with `resource.inputRefs` metadata so `raybase doctor` can
99
+ warn if Guide can update/delete/cancel a record but cannot help the user find
100
+ it.
101
+ - Read `.agents/skills/raybase-actions/SKILL.md` before giving Guide workflow
102
+ tools. Guide should receive only narrow, intentional actions, not every app
103
+ action.
104
+ - Public Guide is conversational help/support only. Do not expose public Guide
105
+ actions to `jobFromAction()`; action-backed jobs reject public-audience
106
+ actions and should run signed-in or service-owned business workflows.
107
+ - Do not let Guide imply it can perform a workflow unless that workflow is
108
+ documented in Guide context and exposed as an explicit action.
109
+ - If Guide is intentionally knowledge-only while the app has actions, pass
110
+ `mode: "knowledge-only"` to `guideModule` and say that Guide cannot perform
111
+ those workflows in `content/guide/capability-map.md`.
112
+ - Never expose generic CRUD, raw SQL, service principals, operator contexts, or
113
+ admin overrides to Guide.
114
+ - For support captures, handoffs, or operator escalations, read
115
+ `raybase-notifications` and send a feed notification with a stable
116
+ `dedupeKey`. In Pro, send it in the resolved organization. Do not create
117
+ custom support outbox tables or provider webhooks.
118
+ - Route and surface values from the client are hints. They can narrow corpus,
119
+ but must not grant access to private data. A spoofed route such as `/admin`
120
+ must not change authority.
121
+ - Use public docs or Guide entries only when they are marked public.
122
+ - Guide UI must use `@raybase/agent-ui` through `RaybaseAgentWidget` or
123
+ `useRaybaseAgentChat`, and the `/api/raybase/agents` bootstrap path. Keep the
124
+ stock send/poll/subscription/cancel transport; do not wire generic
125
+ Cloudflare Agent routes or a Guide-only transport.
126
+
127
+ Common commands:
128
+
129
+ - `raybase guide enable --surface app`
130
+ - `raybase guide enable --surface docs --public`
131
+ - `raybase guide enable --surface both --public`
132
+ - `raybase guide index`
133
+ - `raybase guide status`
134
+ - `raybase doctor`
135
+
136
+ When adding Guide knowledge:
137
+
138
+ 1. Read `dev/SPEC.md` and the implemented screens/actions. Add a concise Guide
139
+ capability map to `content/guide/capability-map.md`. Use frontmatter with
140
+ `guideContext: app-capability-map` so `raybase doctor` can verify Guide has
141
+ app-specific context from the generated manifest without scanning prose.
142
+ Keep it private unless it is deliberately safe for public Guide. Cover:
143
+ - what the app is for and who uses it
144
+ - important routes/screens and where users should go
145
+ - common workflows, states, approvals, limits, and policy boundaries
146
+ - what Guide can answer, what Guide can perform through actions, and what it
147
+ must hand off or decline
148
+ 2. Put reusable public or private Guide knowledge in `content/guide` as `.md`,
149
+ `.mdx`, or `.txt`; mark public entries with `public: true` only when safe.
150
+ 3. Add extra local text sources through `src/guide/resources.json` or
151
+ `app/guide/resources.json`. Paths must be project-relative and should point
152
+ to `.md`, `.mdx`, or `.txt` files or directories. Do not configure
153
+ `source: "docs"` there; app-user help belongs in the active docs root.
154
+ 4. Update docs in the active docs root (`content/docs` or `site/content/docs`) when docs mode should answer from docs.
155
+ 5. For useful user-requested workflows, add narrow actions, export them from
156
+ `src/guide/actions.ts` or `app/guide/actions.ts`, and pass `guideActions` to
157
+ `guideModule({ config: guideConfig, corpus: guideCorpus, actions: guideActions })`.
158
+ Pair internal-id update/delete/cancel actions with read-only list/search
159
+ actions for the same resource.
160
+ If no app action should be exposed to Guide, set `mode: "knowledge-only"`
161
+ deliberately instead of omitting actions by accident.
162
+ 6. Run `raybase manifest write` when changing `raybase.server.ts`, Guide module
163
+ wiring, or Guide action allow-lists. `raybase doctor` refreshes the same
164
+ manifest and warns when app actions exist but Guide has no explicit actions.
165
+ 7. Run `raybase guide index` after docs, Guide Markdown, or resource config
166
+ changes.
167
+ 8. Run `raybase doctor`.
168
+ 9. Verify the configured surfaces locally:
169
+ - app surface: open the app Guide widget, send a message, and confirm it
170
+ resumes the Raybase Agent conversation.
171
+ - capability question: ask what Guide can do in this app and confirm it
172
+ describes only the documented context and registered actions.
173
+ - docs surface: open `/docs`, send a message, and confirm the public
174
+ Raybase Agent token remains conversation-scoped.
175
+ - Pro path org mode: prefix the API URL with `/o/<slug>` when testing from a
176
+ specific organization.
177
+
178
+ ## Guide conversation transport
179
+
180
+ Use the transport already owned by `@raybase/agent-ui`; do not make Guide a
181
+ wire-protocol fork:
182
+
183
+ - Bootstrap returns the conversation id and conversation-scoped bearer token.
184
+ A send is `POST .../messages` with a client-minted `requestKey`. Success is
185
+ only `202 { messageId, requestKey, seq }`; the POST never waits for or
186
+ contains the Agent answer. Reusing the same key for the same conversation is
187
+ idempotent while its Agent's `retention.runEvidenceTtl` evidence exists.
188
+ - The client reads `GET .../requests/:requestKey` with the conversation token,
189
+ starting at 250 ms and backing off to 2 s with a bounded deadline. The
190
+ receipt distinguishes an unresolved request, a run, a coalesced turn, an
191
+ ignored message, and a completed delivery-gate drop.
192
+ - One receive-only conversation WebSocket carries committed, sequenced events
193
+ plus ephemeral deltas and room presence. Mint its short-lived credential
194
+ through `POST .../ws-token`; never send user messages over the socket. If
195
+ an observed event `seq` is not the next dense value, resubscribe with the
196
+ last applied sequence so the server replays durable events. Reload the
197
+ authoritative snapshot only when the server says replay cannot satisfy the
198
+ cursor.
199
+ - `POST .../cancel` cooperatively cancels the conversation's live run. It
200
+ records `cancelled`, leaves already-committed tool effects intact, and
201
+ suspends accumulated tail work until the next accepted send resumes it.
202
+
203
+ When trusted in-process code deliberately binds a direct invocation to an
204
+ existing chat, pass the user text first-class:
205
+
206
+ ```ts
207
+ await ctx.agents.run("guide", {
208
+ conversation: { mode: "chat", conversationId },
209
+ userMessage: message
210
+ });
211
+ ```
212
+
213
+ Do not hide a browser send behind this call: interactive Guide UI should still
214
+ use the stock client so idempotency, polling, replay, and cancel stay aligned.
215
+
216
+ Room-enabled chat Agents use the same stock transport without custom code.
217
+ The socket additionally exposes presence and membership snapshots through
218
+ `useRaybaseAgentChat`; the widget labels messages from other room members, centers
219
+ app notices, and marks a visible room read. Custom UIs can call
220
+ `chat.markRead()` directly. There is intentionally no invite, removal, or
221
+ roster-management UI in the stock widget; keep those product-specific
222
+ controls in trusted app surfaces.
223
+
224
+ Security checks:
225
+
226
+ - Anonymous public calls cannot use non-Guide app actions.
227
+ - Anonymous public calls cannot receive app-table records or private corpus.
228
+ - Spoofing `route: "/admin"` does not reveal private route, schema, policy, or
229
+ support snippets.
230
+ - Signed-in action calls still enforce `defineAction()` policy.
231
+ - Public request and output-token rate limits are non-zero.
232
+ - The Agent Durable Object binding is configured before shipping Guide,
233
+ including public docs Guide.
234
+ - Pro multi-org requests resolve to the intended organization before actions or
235
+ budget windows run.
@@ -0,0 +1,309 @@
1
+ ---
2
+ name: raybase-mcp
3
+ description: Build and review Raybase App MCP, Operator MCP, and MCP Apps UI integrations. Use when adding MCP tools/resources, using withMcpAppUi(), createMcpAppResource(), _meta.ui.visibility, the text/html;profile=mcp-app MIME type, OAuth grant scopes, or deciding between App MCP and Operator MCP.
4
+ ---
5
+
6
+ # Raybase MCP
7
+
8
+ Use this skill when adding MCP access to app workflows, exposing an embedded MCP
9
+ Apps UI, changing OAuth scopes, or reviewing whether a tool belongs on App MCP
10
+ or Operator MCP.
11
+
12
+ ## Threat Model
13
+
14
+ App MCP is user-scoped workflow authority. Operator MCP is elevated
15
+ read-only evidence. Putting writes on Operator MCP turns an inspection grant
16
+ into a privilege-escalation path, and putting generic writes on App MCP can
17
+ bypass a domain server function that was supposed to validate state
18
+ transitions, field allowlists, or side effects.
19
+
20
+ MCP is appropriate for agent/integration workflows, declared tool flows, and
21
+ operator evidence. Ordinary repeated human workflows still need app UI unless
22
+ the approved spec explicitly says the workflow is agent-only.
23
+
24
+ ## Choose The Surface
25
+
26
+ - App MCP is the user/app workflow surface at `/mcp`. Use it for declared
27
+ app tools, app resources, generated app-data CRUD, and business actions that
28
+ should run as the current user through Raybase policies.
29
+ - App MCP tools are agent and integration surfaces. They do not replace the
30
+ main app UI for regular human workflows unless the approved spec explicitly
31
+ says that workflow is agent-only.
32
+ - Generated App MCP CRUD should be disabled or narrowed when a table uses
33
+ domain-specific server functions for mutations. Policy checks are necessary,
34
+ but they do not replace workflow validation.
35
+ - Operator MCP is the operator-scoped evidence and narrow admin-action surface
36
+ at `/mcp/operator`. Use read grants for health, schema, policy, audit,
37
+ imports, jobs, storage, search, retrieval, grants, Agent evidence, and other
38
+ operator inspection. App-data inspection uses schema-validated tools such as
39
+ `app_data_query`, which accepts a bounded relational JSON AST and compiles
40
+ internally to parameterized `SELECT` SQL; clients never send raw SQL. Write
41
+ grants are split and should stay limited to typed, audited app-data,
42
+ app-setting, invite, and user-lifecycle operations. Do not put app business
43
+ workflow mutations on Operator MCP.
44
+ - Keep `mcp: { enabled: true }` unless the owner explicitly disables MCP.
45
+ Disable all MCP with `mcp: { enabled: false }`; keep App MCP but disable only
46
+ Operator MCP with `mcp: { enabled: true, operator: { enabled: false } }`.
47
+ Disable Operator MCP only when the owner accepts losing production evidence
48
+ and narrow operator action grants; disable all MCP only when the app should
49
+ have no agent/integration surface.
50
+
51
+ ## Connecting A Person's Agent
52
+
53
+ What an agent product (a chat app, a coding agent) does when someone adds the
54
+ app's connector, and what the app controls:
55
+
56
+ - **The addresses.** The product reads `/.well-known/oauth-protected-resource`
57
+ (or `/.well-known/oauth-protected-resource/mcp`) and
58
+ `/.well-known/oauth-authorization-server`, then talks to `/mcp`. Each
59
+ announces only that connector's scopes (`mcp:read mcp:write`); the operator
60
+ connector's are at the `/mcp/operator` forms of the same addresses. A
61
+ TanStack Start or Sites worker entry must hand these to Raybase before the
62
+ framework: `if (isRaybaseConnectorRequest(request, appConfig)) return
63
+ raybaseHandler.fetch(request, env, ctx);` (from `@raybase/core/worker`, or
64
+ `@raybase/pro/worker` after `prepareOrgPathRequest` in Pro). The starters do;
65
+ `raybase doctor` warns (`mcp-routing`) when an entry does not. React Router
66
+ apps route them in `app/raybase.server.ts`.
67
+ - **Signing in.** A person who is not signed in is sent to
68
+ `mcp.oauth.signInPath` (default `/login`) with the whole request as
69
+ `?next=`, and returns to consent after signing in. An app with its own
70
+ sign-in page must honour `next` and navigate with a full page load.
71
+ - **The consent page.** `mcp.name` names the connector (default the app's
72
+ name). `mcp.consent.stylesheet` (a root-relative path or HTTPS URL) and
73
+ `mcp.consent.css` style the built-in page; its classes start `rb-consent`
74
+ and its colours are `--rb-consent-*` custom properties. For a page of the
75
+ app's own, set `mcp.consent.path`: consent is sent there with the request's
76
+ query, the page reads `GET /api/auth/oauth/consent` with the same query
77
+ (client and connector names, scopes, a description, an optional `choice`,
78
+ and the `fields` to post) and posts the fields plus `decision=approve` or
79
+ `deny` to `/api/auth/oauth/authorize`. Unsigned visitors get 401 with
80
+ `signIn`, the address to send them to.
81
+ - **Standing instructions.** `mcp.instructions` is returned from
82
+ `initialize`. Products keep only the start (512 to 4,096 characters), so
83
+ put what matters first and make the first sentences stand alone.
84
+ - **Pictures.** A tool may return `{ type: "image", data: <base64>, mimeType }`
85
+ in `content`; products that show pictures to their model read it.
86
+ - **Clients that name themselves by address.** A product may send an HTTPS
87
+ address as its `client_id` (a Client ID Metadata Document) instead of
88
+ registering; the authorization server announces that it accepts these,
89
+ and the redirect from consent carries `iss`.
90
+
91
+ ## Production OAuth Hardening
92
+
93
+ Fresh Raybase apps keep MCP enabled, including OAuth Dynamic Client
94
+ Registration. `raybase doctor` warns in production-shaped apps until the OAuth
95
+ client metadata and redirect hosts are constrained.
96
+
97
+ For known MCP clients, set explicit host allowlists in the template's Raybase
98
+ config file. TanStack Start apps use `src/raybase.config.ts`; React Router
99
+ apps define `appConfig` in `app/db/schema.ts`.
100
+
101
+ ```ts
102
+ export const appConfig = {
103
+ mcp: {
104
+ enabled: true,
105
+ oauth: {
106
+ allowedClientRedirectHosts: ["mcp-client.example.com", "client.example.com"],
107
+ allowedClientMetadataHosts: ["client.example.com"]
108
+ }
109
+ }
110
+ };
111
+ ```
112
+
113
+ Use hostnames, not full redirect URLs. Include only clients the owner intends
114
+ to trust. For internal apps that should not accept new OAuth clients at
115
+ runtime, disable Dynamic Client Registration instead:
116
+
117
+ ```ts
118
+ export const appConfig = {
119
+ mcp: {
120
+ enabled: true,
121
+ oauth: {
122
+ dynamicClientRegistration: false
123
+ }
124
+ }
125
+ };
126
+ ```
127
+
128
+ Do not silence the doctor warning by adding broad wildcard-style hosts or
129
+ unreviewed metadata domains. Keep Operator MCP read-only regardless of the
130
+ OAuth registration mode.
131
+
132
+ ## Machine Credentials
133
+
134
+ Browser-less clients (CLIs on remote machines, CI, bring-your-own agents) use
135
+ the `client_credentials` grant. A signed-in user registers a confidential
136
+ client at `/api/auth/oauth/register` with `grant_types: ["client_credentials"]`
137
+ and the `scope` it may hold; the one-time `client_secret` in the response is
138
+ the only time the secret is shown. The client mints access tokens with
139
+ `grant_type=client_credentials` and HTTP Basic (`client_secret_basic`, the
140
+ default) or form (`client_secret_post`) authentication, may narrow but never
141
+ widen the registered scope, and gets no refresh token. Tokens act as the
142
+ registering user, carry the organization that user was acting in, and die with
143
+ the client (`DELETE /api/auth/oauth/clients/:clientId`, or an admin revoking the
144
+ grant at `/api/admin/mcp/grants/:id`). Operator MCP credentials need
145
+ `resource` set to the operator endpoint and an owner/admin registrant. Set
146
+ `mcp.oauth.clientCredentials: false` for apps that must never hold machine
147
+ credentials.
148
+
149
+ ## Organization Selection
150
+
151
+ A client acting in one organization of a multi-organization app passes
152
+ `org=<organization id or slug>` on the authorization request. The hint is
153
+ carried through consent and pins the grant: tokens from it refuse every other
154
+ organization. Without the hint, Raybase Pro asks a person who belongs to more
155
+ than one organization which one on the consent page (the choice is named by
156
+ `organizations.label`, default "Organization"), and the answer pins the grant
157
+ the same way. Without the hint, a layered runtime may select the organization
158
+ per request (Raybase Pro reads `x-raybase-org` on `/mcp` in header mode and
159
+ checks the token's identity is a member). Tools read `ctx.mcp.organizationId`
160
+ for the selected organization; Core apps always see null because they have
161
+ one implicit organization.
162
+
163
+ ## Host-Account Grants
164
+
165
+ An app embedded in another platform's admin can bind grants to one of the
166
+ host's accounts instead of a Raybase user, with
167
+ `createRaybaseApp({ mcp: { hostApproval: { enabled: true, approvalUrl,
168
+ normalizeHostAccount, subject } } })`. When enabled it owns the authorization
169
+ endpoint: the client names a host account (the `host_account` parameter by
170
+ default, or the `/mcp/connect` page asks), `approvalUrl` sends the person to the
171
+ app's approval page inside the host's admin, and that page verifies the host's
172
+ session itself before calling `createMcpApprovalTicket(db, hostApproval, {
173
+ pendingAuthId, hostAccount })`. Tools read `ctx.mcp.hostAccount`; an MCP request
174
+ naming a different host account than its token gets 403. Call
175
+ `revokeMcpGrantsForHostAccount(db, hostApproval, hostAccount)` when the host
176
+ account uninstalls the app; it returns how many grants it revoked. Pass both the
177
+ same `hostApproval` options the app configures (only `normalizeHostAccount` is
178
+ read): they normalise the account themselves, so any accepted form works, and a
179
+ value `normalizeHostAccount` rejects throws instead of matching nothing.
180
+
181
+ ## MCP Apps UI
182
+
183
+ Use the real helpers from `@raybase/core`, not hand-written `_meta` objects:
184
+
185
+ ```ts
186
+ import { createMcpAppResource, withMcpAppUi } from "@raybase/core";
187
+ import { z } from "zod";
188
+
189
+ const dashboardPanel = createMcpAppResource({
190
+ uri: "ui://app/dashboard-panel",
191
+ name: "Dashboard panel",
192
+ description: "Interactive dashboard controls for the MCP client.",
193
+ html: dashboardHtml,
194
+ _meta: {
195
+ ui: {
196
+ prefersBorder: true,
197
+ csp: {
198
+ connectDomains: ["https://api.example.com"],
199
+ resourceDomains: ["https://cdn.example.com"]
200
+ },
201
+ permissions: {
202
+ clipboardWrite: {}
203
+ }
204
+ }
205
+ }
206
+ });
207
+
208
+ const refreshDashboard = withMcpAppUi(
209
+ {
210
+ name: "refresh_dashboard",
211
+ description: "Refresh dashboard data.",
212
+ inputSchema: z.object({}).strict(),
213
+ annotations: { readOnlyHint: true },
214
+ handler: async (_args, ctx) => {
215
+ const snapshot = await loadDashboardSnapshot(ctx);
216
+ return { structuredContent: snapshot };
217
+ }
218
+ },
219
+ { resourceUri: "ui://app/dashboard-panel", visibility: ["app"] }
220
+ );
221
+ ```
222
+
223
+ Rules:
224
+
225
+ - MCP Apps resources must use a `ui://` URI and the
226
+ `text/html;profile=mcp-app` MIME type. `createMcpAppResource()` sets the MIME
227
+ type and validates the URI, content, CSP, permissions, and read result.
228
+ - Provide `html`, `blob`, or `read`. A `read` result must return text or blob
229
+ content for the same URI.
230
+ - Put CSP domains under `_meta.ui.csp.*`; do not use legacy top-level
231
+ `connectDomains`, `resourceDomains`, `frameDomains`, or `baseUriDomains`.
232
+ - Permissions are object keys with empty objects: `camera`, `microphone`,
233
+ `geolocation`, or `clipboardWrite`.
234
+
235
+ ## Visibility
236
+
237
+ `_meta.ui.visibility` controls MCP Apps tool exposure:
238
+
239
+ - Omitted or empty means `["model", "app"]`.
240
+ - `["model"]` means the model sees the tool in `tools/list`.
241
+ - `["app"]` means the embedded app UI can use the tool, but the model should
242
+ not be prompted with it.
243
+ - Use `withMcpAppUi(tool, { resourceUri, visibility })` so visibility is
244
+ normalized and merged with existing tool metadata.
245
+
246
+ Only register UI resources when at least one tool uses MCP Apps UI. Raybase
247
+ returns UI resources only to clients that signal MCP Apps UI support through
248
+ the `io.modelcontextprotocol/ui` extension and accept
249
+ `text/html;profile=mcp-app`.
250
+
251
+ ## Scopes
252
+
253
+ - App MCP scopes are `mcp:read`, `mcp:write`, and per-tool scopes such as
254
+ `mcp:tool:<name>`.
255
+ - Read-only tools default to `mcp:read` plus `mcp:tool:<name>` when
256
+ `annotations.readOnlyHint` is true.
257
+ - Mutating tools default to `mcp:write` plus `mcp:tool:<name>`.
258
+ - Resources default to `mcp:read`.
259
+ - Set explicit `scopes` only when a narrower or custom grant is required.
260
+ - Operator scopes must stay on Operator MCP. App MCP grants must never request
261
+ `operator:*` scopes.
262
+
263
+ ## Action-Backed Business Tools
264
+
265
+ User business mutations exposed through App MCP should usually be declared
266
+ once with `defineAction()` and adapted with `mcpToolFromAction()`. Read
267
+ `.agents/skills/raybase-actions/SKILL.md` for full action design examples.
268
+
269
+ ```ts
270
+ import { mcpToolFromAction } from "@raybase/core";
271
+ import { actions } from "./actions";
272
+
273
+ export const mcpTools = [
274
+ mcpToolFromAction(actions.approveRequest)
275
+ ];
276
+ ```
277
+
278
+ Use raw MCP handlers for read-only dashboard snapshots, MCP Apps UI resource
279
+ helpers, introspection-style tools, and UI-only controls that do not own a
280
+ shared business mutation. Do not duplicate state-transition rules in both an
281
+ MCP handler and a server function.
282
+
283
+ `mcpToolFromAction()` uses the action input schema, description, policy,
284
+ idempotency, and annotations, and can apply adapter `rowAuthorization()`.
285
+ Read-only actions with `annotations.readOnlyHint` default to `mcp:read` plus
286
+ `mcp:tool:<name>`; mutating actions default to `mcp:write` plus
287
+ `mcp:tool:<name>`.
288
+
289
+ Mark destructive or irreversible actions with
290
+ `annotations.destructiveHint: true`, keep policy and `rowAuthorization()` tight,
291
+ and require stable idempotency keys for retried external side effects.
292
+
293
+ ## Implementation Checklist
294
+
295
+ 1. Define app tools/resources near the app feature, usually under `src/ai/`,
296
+ `src/mcp.ts`, or another app-owned module.
297
+ 2. Implement business mutations once with Raybase actions, then adapt them with
298
+ `mcpToolFromAction()` for user MCP tools and reuse the same actions from
299
+ UI, jobs, Guide, Agents, or API when needed.
300
+ 3. Pass `mcp: { tools, resources, generatedTools }` to
301
+ `createRaybaseApp`.
302
+ 4. Keep secrets in Worker env/secrets. Do not put tokens, private URLs, or raw
303
+ credentials in tool descriptions, resource HTML, `_meta`, or results.
304
+ 5. Minimize structured output. Read-only tools should return only the fields
305
+ the MCP workflow needs, especially for HR, support, finance, security, or
306
+ approval apps. Do not return full app rows when a count, status summary,
307
+ short label, or filtered projection is enough.
308
+ 6. Run `raybase doctor`, connect an MCP client, approve the least-privilege
309
+ grant, and test a user whose policies should both allow and deny access.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Raybase MCP"
3
+ short_description: "MCP app and operator surfaces"
4
+ default_prompt: "Use $raybase-mcp to add an MCP app UI tool to this Raybase app."