@raybase/create 0.0.1 → 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.
- package/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/assets/apple-touch-icons/0.png +0 -0
- package/assets/apple-touch-icons/1.png +0 -0
- package/assets/apple-touch-icons/2.png +0 -0
- package/assets/apple-touch-icons/3.png +0 -0
- package/assets/apple-touch-icons/4.png +0 -0
- package/assets/apple-touch-icons/5.png +0 -0
- package/assets/apple-touch-icons/6.png +0 -0
- package/assets/apple-touch-icons/7.png +0 -0
- package/assets/apple-touch-icons/8.png +0 -0
- package/assets/apple-touch-icons/9.png +0 -0
- package/assets/apple-touch-icons/A.png +0 -0
- package/assets/apple-touch-icons/B.png +0 -0
- package/assets/apple-touch-icons/C.png +0 -0
- package/assets/apple-touch-icons/D.png +0 -0
- package/assets/apple-touch-icons/E.png +0 -0
- package/assets/apple-touch-icons/F.png +0 -0
- package/assets/apple-touch-icons/G.png +0 -0
- package/assets/apple-touch-icons/H.png +0 -0
- package/assets/apple-touch-icons/I.png +0 -0
- package/assets/apple-touch-icons/J.png +0 -0
- package/assets/apple-touch-icons/K.png +0 -0
- package/assets/apple-touch-icons/L.png +0 -0
- package/assets/apple-touch-icons/M.png +0 -0
- package/assets/apple-touch-icons/N.png +0 -0
- package/assets/apple-touch-icons/O.png +0 -0
- package/assets/apple-touch-icons/P.png +0 -0
- package/assets/apple-touch-icons/Q.png +0 -0
- package/assets/apple-touch-icons/R.png +0 -0
- package/assets/apple-touch-icons/S.png +0 -0
- package/assets/apple-touch-icons/T.png +0 -0
- package/assets/apple-touch-icons/U.png +0 -0
- package/assets/apple-touch-icons/V.png +0 -0
- package/assets/apple-touch-icons/W.png +0 -0
- package/assets/apple-touch-icons/X.png +0 -0
- package/assets/apple-touch-icons/Y.png +0 -0
- package/assets/apple-touch-icons/Z.png +0 -0
- package/assets/apple-touch-icons/default.png +0 -0
- package/dist/.source-hash +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2351 -0
- package/dist/index.js.map +1 -0
- package/dist/raybase-package-ranges.d.ts +11 -0
- package/dist/raybase-package-ranges.d.ts.map +1 -0
- package/dist/raybase-package-ranges.js +11 -0
- package/dist/raybase-package-ranges.js.map +1 -0
- package/dist/source-fetch.d.ts +91 -0
- package/dist/source-fetch.d.ts.map +1 -0
- package/dist/source-fetch.js +325 -0
- package/dist/source-fetch.js.map +1 -0
- package/dist/source-hash.d.ts +2 -0
- package/dist/source-hash.d.ts.map +1 -0
- package/dist/source-hash.js +23 -0
- package/dist/source-hash.js.map +1 -0
- package/dist/starter-description.d.ts +44 -0
- package/dist/starter-description.d.ts.map +1 -0
- package/dist/starter-description.js +273 -0
- package/dist/starter-description.js.map +1 -0
- package/dist/starter-source.d.ts +43 -0
- package/dist/starter-source.d.ts.map +1 -0
- package/dist/starter-source.js +156 -0
- package/dist/starter-source.js.map +1 -0
- package/dist/store-app-apply.d.ts +27 -0
- package/dist/store-app-apply.d.ts.map +1 -0
- package/dist/store-app-apply.js +100 -0
- package/dist/store-app-apply.js.map +1 -0
- package/dist/store-app-manifest.d.ts +86 -0
- package/dist/store-app-manifest.d.ts.map +1 -0
- package/dist/store-app-manifest.js +110 -0
- package/dist/store-app-manifest.js.map +1 -0
- package/dist/store-app-registry.d.ts +30 -0
- package/dist/store-app-registry.d.ts.map +1 -0
- package/dist/store-app-registry.js +232 -0
- package/dist/store-app-registry.js.map +1 -0
- package/models/recommended.json +42 -0
- package/modules/api/templates/react-router/app/api/operations.ts +8 -0
- package/modules/api/templates/tanstack-start/src/api/operations.ts +15 -0
- package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
- package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
- package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
- package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
- package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
- package/modules/docs/templates/react-router/source.config.ts +5 -0
- package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
- package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
- package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
- package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
- package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
- package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
- package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
- package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
- package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
- package/package.json +34 -8
- package/skills/README.md +122 -0
- package/skills/raybase-actions/SKILL.md +223 -0
- package/skills/raybase-actions/references/action-patterns.md +190 -0
- package/skills/raybase-actions/references/adapting-actions.md +93 -0
- package/skills/raybase-actions/references/testing-actions.md +48 -0
- package/skills/raybase-agent-debugging/SKILL.md +230 -0
- package/skills/raybase-ai/SKILL.md +1310 -0
- package/skills/raybase-api/SKILL.md +45 -0
- package/skills/raybase-astro-emdash/SKILL.md +143 -0
- package/skills/raybase-astro-emdash-content-model/SKILL.md +217 -0
- package/skills/raybase-astro-emdash-content-model/references/LICENSE-emdash +9 -0
- package/skills/raybase-astro-emdash-content-model/references/emdash-collections.md +265 -0
- package/skills/raybase-astro-emdash-design/LICENSE-impeccable +60 -0
- package/skills/raybase-astro-emdash-design/SKILL.md +170 -0
- package/skills/raybase-astro-emdash-design/reference/color.md +91 -0
- package/skills/raybase-astro-emdash-design/reference/copy.md +73 -0
- package/skills/raybase-astro-emdash-design/reference/direction.md +115 -0
- package/skills/raybase-astro-emdash-design/reference/imagery.md +84 -0
- package/skills/raybase-astro-emdash-design/reference/layout.md +69 -0
- package/skills/raybase-astro-emdash-design/reference/motion.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/polish.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/typography.md +72 -0
- package/skills/raybase-astro-emdash-galley/SKILL.md +265 -0
- package/skills/raybase-astro-emdash-migration/SKILL.md +218 -0
- package/skills/raybase-astro-emdash-migration/references/inventory-and-conversion.md +242 -0
- package/skills/raybase-astro-emdash-security-review/SKILL.md +68 -0
- package/skills/raybase-astro-emdash-theme-selection/SKILL.md +216 -0
- package/skills/raybase-auth/SKILL.md +358 -0
- package/skills/raybase-background-jobs/SKILL.md +774 -0
- package/skills/raybase-building/SKILL.md +409 -0
- package/skills/raybase-building/references/interview-and-spec.md +87 -0
- package/skills/raybase-building/references/planning-docs.md +26 -0
- package/skills/raybase-building/references/schema-and-config.md +70 -0
- package/skills/raybase-changing-a-live-app/SKILL.md +119 -0
- package/skills/raybase-data-and-policies/SKILL.md +377 -0
- package/skills/raybase-deploy/SKILL.md +136 -0
- package/skills/raybase-docs-writing/SKILL.md +119 -0
- package/skills/raybase-guide/SKILL.md +235 -0
- package/skills/raybase-mcp/SKILL.md +309 -0
- package/skills/raybase-mcp/agents/openai.yaml +4 -0
- package/skills/raybase-notifications/SKILL.md +138 -0
- package/skills/raybase-pro-migration/SKILL.md +28 -0
- package/skills/raybase-react-router/SKILL.md +241 -0
- package/skills/raybase-react-router-design/LICENSE-impeccable +60 -0
- package/skills/raybase-react-router-design/SKILL.md +135 -0
- package/skills/raybase-react-router-design/reference/color.md +87 -0
- package/skills/raybase-react-router-design/reference/copy.md +83 -0
- package/skills/raybase-react-router-design/reference/delight.md +48 -0
- package/skills/raybase-react-router-design/reference/interaction.md +91 -0
- package/skills/raybase-react-router-design/reference/layout.md +82 -0
- package/skills/raybase-react-router-design/reference/motion.md +86 -0
- package/skills/raybase-react-router-design/reference/polish.md +79 -0
- package/skills/raybase-react-router-design/reference/typography.md +71 -0
- package/skills/raybase-react-router-security-review/LICENSE +22 -0
- package/skills/raybase-react-router-security-review/SKILL.md +190 -0
- package/skills/raybase-react-router-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-react-router-security-review/references/api-security.md +519 -0
- package/skills/raybase-react-router-security-review/references/authentication.md +353 -0
- package/skills/raybase-react-router-security-review/references/authorization.md +372 -0
- package/skills/raybase-react-router-security-review/references/business-logic.md +443 -0
- package/skills/raybase-react-router-security-review/references/cryptography.md +329 -0
- package/skills/raybase-react-router-security-review/references/csrf.md +398 -0
- package/skills/raybase-react-router-security-review/references/data-protection.md +378 -0
- package/skills/raybase-react-router-security-review/references/deserialization.md +410 -0
- package/skills/raybase-react-router-security-review/references/error-handling.md +436 -0
- package/skills/raybase-react-router-security-review/references/file-security.md +457 -0
- package/skills/raybase-react-router-security-review/references/injection.md +259 -0
- package/skills/raybase-react-router-security-review/references/logging.md +433 -0
- package/skills/raybase-react-router-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-react-router-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-react-router-security-review/references/raybase-react-router-security.md +235 -0
- package/skills/raybase-react-router-security-review/references/ssrf.md +413 -0
- package/skills/raybase-react-router-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-react-router-security-review/references/xss.md +336 -0
- package/skills/raybase-realtime/SKILL.md +158 -0
- package/skills/raybase-realtime/agents/openai.yaml +4 -0
- package/skills/raybase-schema/SKILL.md +209 -0
- package/skills/raybase-search/SKILL.md +137 -0
- package/skills/raybase-search/agents/openai.yaml +4 -0
- package/skills/raybase-settings/SKILL.md +139 -0
- package/skills/raybase-settings/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start/SKILL.md +166 -0
- package/skills/raybase-tanstack-start-design/LICENSE-impeccable +60 -0
- package/skills/raybase-tanstack-start-design/SKILL.md +140 -0
- package/skills/raybase-tanstack-start-design/reference/color.md +80 -0
- package/skills/raybase-tanstack-start-design/reference/copy.md +83 -0
- package/skills/raybase-tanstack-start-design/reference/delight.md +48 -0
- package/skills/raybase-tanstack-start-design/reference/interaction.md +91 -0
- package/skills/raybase-tanstack-start-design/reference/layout.md +82 -0
- package/skills/raybase-tanstack-start-design/reference/motion.md +86 -0
- package/skills/raybase-tanstack-start-design/reference/polish.md +79 -0
- package/skills/raybase-tanstack-start-design/reference/typography.md +71 -0
- package/skills/raybase-tanstack-start-security-review/LICENSE +22 -0
- package/skills/raybase-tanstack-start-security-review/SKILL.md +194 -0
- package/skills/raybase-tanstack-start-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start-security-review/references/api-security.md +519 -0
- package/skills/raybase-tanstack-start-security-review/references/authentication.md +353 -0
- package/skills/raybase-tanstack-start-security-review/references/authorization.md +372 -0
- package/skills/raybase-tanstack-start-security-review/references/business-logic.md +443 -0
- package/skills/raybase-tanstack-start-security-review/references/cryptography.md +329 -0
- package/skills/raybase-tanstack-start-security-review/references/csrf.md +398 -0
- package/skills/raybase-tanstack-start-security-review/references/data-protection.md +378 -0
- package/skills/raybase-tanstack-start-security-review/references/deserialization.md +410 -0
- package/skills/raybase-tanstack-start-security-review/references/error-handling.md +436 -0
- package/skills/raybase-tanstack-start-security-review/references/file-security.md +457 -0
- package/skills/raybase-tanstack-start-security-review/references/injection.md +259 -0
- package/skills/raybase-tanstack-start-security-review/references/logging.md +433 -0
- package/skills/raybase-tanstack-start-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-tanstack-start-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-tanstack-start-security-review/references/raybase-tanstack-security.md +208 -0
- package/skills/raybase-tanstack-start-security-review/references/ssrf.md +413 -0
- package/skills/raybase-tanstack-start-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-tanstack-start-security-review/references/xss.md +336 -0
- package/skills-manifest.json +41 -0
- package/templates/astro-emdash/.dev.vars.example +7 -0
- package/templates/astro-emdash/AGENTS.md +122 -0
- package/templates/astro-emdash/DESIGN.md +90 -0
- package/templates/astro-emdash/components.json +21 -0
- package/templates/astro-emdash/content/docs/getting-started.mdx +20 -0
- package/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/templates/astro-emdash/content/docs/meta.json +4 -0
- package/templates/astro-emdash/content/docs/site-templates.mdx +62 -0
- package/templates/astro-emdash/dev/CODEBASE-MAP.md +46 -0
- package/templates/astro-emdash/dev/SPEC-OVERVIEW.md +15 -0
- package/templates/astro-emdash/dev/SPEC.md +84 -0
- package/templates/astro-emdash/dev/features/archive/.gitkeep +1 -0
- package/templates/astro-emdash/docs/theme-previews/base.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/steel.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/zen.svg +24 -0
- package/templates/astro-emdash/docs/themes.md +106 -0
- package/templates/astro-emdash/drizzle.config.ts +5 -0
- package/templates/astro-emdash/gitignore +11 -0
- package/templates/astro-emdash/migrations/app/meta/_journal.json +5 -0
- package/templates/astro-emdash/package.json +79 -0
- package/templates/astro-emdash/pnpm-workspace.yaml +71 -0
- package/templates/astro-emdash/public/_headers +4 -0
- package/templates/astro-emdash/site/astro.config.mjs +120 -0
- package/templates/astro-emdash/site/demo/README.md +72 -0
- package/templates/astro-emdash/site/demo/content/collection.json +43 -0
- package/templates/astro-emdash/site/demo/content/entries.json +120 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/template.liquid +48 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/host.json +9 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/manifest.json +38 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/sample-content.json +34 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/template.liquid +84 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/manifest.json +64 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/page.json +7 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/sample-content.json +24 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/template.liquid +100 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/template.liquid +70 -0
- package/templates/astro-emdash/site/gitignore +1 -0
- package/templates/astro-emdash/site/package.json +56 -0
- package/templates/astro-emdash/site/scripts/apply-site-templates.mjs +560 -0
- package/templates/astro-emdash/site/scripts/galley-demo.mjs +298 -0
- package/templates/astro-emdash/site/scripts/seed-galley-starter.mjs +360 -0
- package/templates/astro-emdash/site/scripts/site-origin.mjs +45 -0
- package/templates/astro-emdash/site/seed/seed.json +154 -0
- package/templates/astro-emdash/site/seed/templates/.gitkeep +1 -0
- package/templates/astro-emdash/site/src/components/RaybaseSignedInMenu.astro +163 -0
- package/templates/astro-emdash/site/src/components/blocks/RaybaseActionIsland.astro +41 -0
- package/templates/astro-emdash/site/src/content-door/raybase-routes.ts +738 -0
- package/templates/astro-emdash/site/src/content-door/resolve-page.ts +142 -0
- package/templates/astro-emdash/site/src/content-door/seed.ts +85 -0
- package/templates/astro-emdash/site/src/env.d.ts +12 -0
- package/templates/astro-emdash/site/src/layouts/SiteLayout.astro +68 -0
- package/templates/astro-emdash/site/src/lib/palettes.gen.ts +7 -0
- package/templates/astro-emdash/site/src/lib/site-motion.ts +169 -0
- package/templates/astro-emdash/site/src/lib/site-shell.ts +294 -0
- package/templates/astro-emdash/site/src/live.config.ts +8 -0
- package/templates/astro-emdash/site/src/middleware.ts +20 -0
- package/templates/astro-emdash/site/src/pages/[...slug].astro +113 -0
- package/templates/astro-emdash/site/src/pages/_raybase/handoff/consume.ts +6 -0
- package/templates/astro-emdash/site/src/pages/_raybase/islands/action.ts +8 -0
- package/templates/astro-emdash/site/src/pages/_raybase/sign-out/index.ts +6 -0
- package/templates/astro-emdash/site/src/styles/palette-fonts.gen.css +1 -0
- package/templates/astro-emdash/site/src/styles/palettes.gen.css +3 -0
- package/templates/astro-emdash/site/src/styles.css +607 -0
- package/templates/astro-emdash/site/tsconfig.json +12 -0
- package/templates/astro-emdash/site/wrangler.jsonc +34 -0
- package/templates/astro-emdash/source.config.ts +10 -0
- package/templates/astro-emdash/src/actions.ts +58 -0
- package/templates/astro-emdash/src/ai/agents.ts +20 -0
- package/templates/astro-emdash/src/ai/retrieval.ts +36 -0
- package/templates/astro-emdash/src/auth-door.ts +18 -0
- package/templates/astro-emdash/src/client.tsx +25 -0
- package/templates/astro-emdash/src/components/.gitkeep +1 -0
- package/templates/astro-emdash/src/components/account-menu.tsx +91 -0
- package/templates/astro-emdash/src/components/auth-shell.tsx +69 -0
- package/templates/astro-emdash/src/components/mode-toggle.tsx +32 -0
- package/templates/astro-emdash/src/components/search-command-palette.tsx +107 -0
- package/templates/astro-emdash/src/components/setup-token-page.tsx +196 -0
- package/templates/astro-emdash/src/components/ui/avatar.tsx +107 -0
- package/templates/astro-emdash/src/components/ui/badge.tsx +52 -0
- package/templates/astro-emdash/src/components/ui/button.tsx +69 -0
- package/templates/astro-emdash/src/components/ui/checkbox.tsx +29 -0
- package/templates/astro-emdash/src/components/ui/dialog.tsx +158 -0
- package/templates/astro-emdash/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/astro-emdash/src/components/ui/input.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/label.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/scroll-area.tsx +53 -0
- package/templates/astro-emdash/src/components/ui/select.tsx +215 -0
- package/templates/astro-emdash/src/components/ui/separator.tsx +23 -0
- package/templates/astro-emdash/src/components/ui/sheet.tsx +138 -0
- package/templates/astro-emdash/src/components/ui/sidebar.tsx +728 -0
- package/templates/astro-emdash/src/components/ui/skeleton.tsx +13 -0
- package/templates/astro-emdash/src/components/ui/textarea.tsx +18 -0
- package/templates/astro-emdash/src/components/ui/tooltip.tsx +66 -0
- package/templates/astro-emdash/src/db/migrations.gen.ts +6 -0
- package/templates/astro-emdash/src/db/schema.ts +6 -0
- package/templates/astro-emdash/src/db/seed.ts +16 -0
- package/templates/astro-emdash/src/db/storage.ts +32 -0
- package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/templates/astro-emdash/src/docs/source.ts +7 -0
- package/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/templates/astro-emdash/src/hooks/use-mobile.ts +19 -0
- package/templates/astro-emdash/src/jobs.example.ts +48 -0
- package/templates/astro-emdash/src/lib/account.ts +12 -0
- package/templates/astro-emdash/src/lib/auth-client.ts +181 -0
- package/templates/astro-emdash/src/lib/utils.ts +6 -0
- package/templates/astro-emdash/src/mcp-app.ts +57 -0
- package/templates/astro-emdash/src/notifications.example.ts +37 -0
- package/templates/astro-emdash/src/raybase.auth.ts +70 -0
- package/templates/astro-emdash/src/raybase.config.ts +49 -0
- package/templates/astro-emdash/src/raybase.server.ts +56 -0
- package/templates/astro-emdash/src/realtime.example.ts +18 -0
- package/templates/astro-emdash/src/router.tsx +19 -0
- package/templates/astro-emdash/src/routes/__root.tsx +56 -0
- package/templates/astro-emdash/src/routes/_app/admin.tsx +13 -0
- package/templates/astro-emdash/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/astro-emdash/src/routes/_app/index.tsx +169 -0
- package/templates/astro-emdash/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/login.tsx +193 -0
- package/templates/astro-emdash/src/routes/_app/profile.tsx +98 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.tsx +115 -0
- package/templates/astro-emdash/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/signup.tsx +141 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.tsx +154 -0
- package/templates/astro-emdash/src/routes/_app.tsx +33 -0
- package/templates/astro-emdash/src/routes/admin/$.ts +20 -0
- package/templates/astro-emdash/src/routes/api/$.ts +19 -0
- package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/templates/astro-emdash/src/search.ts +6 -0
- package/templates/astro-emdash/src/settings.ts +12 -0
- package/templates/astro-emdash/src/styles-docs.css +3 -0
- package/templates/astro-emdash/src/styles.css +101 -0
- package/templates/astro-emdash/src/themes/base.css +76 -0
- package/templates/astro-emdash/src/themes/carbon.css +76 -0
- package/templates/astro-emdash/src/themes/fonts.css +25 -0
- package/templates/astro-emdash/src/themes/sage.css +76 -0
- package/templates/astro-emdash/src/themes/sand.css +76 -0
- package/templates/astro-emdash/src/themes/slate.css +81 -0
- package/templates/astro-emdash/src/themes/ultra.css +76 -0
- package/templates/astro-emdash/src/themes/zen.css +76 -0
- package/templates/astro-emdash/src/worker-entry.ts +31 -0
- package/templates/astro-emdash/tests/raybase-patterns.test.ts +29 -0
- package/templates/astro-emdash/tsconfig.json +36 -0
- package/templates/astro-emdash/vite.config.ts +130 -0
- package/templates/astro-emdash/vitest.config.ts +8 -0
- package/templates/astro-emdash/wrangler.jsonc +112 -0
- package/templates/react-router/.dev.vars.example +5 -0
- package/templates/react-router/.editorconfig +15 -0
- package/templates/react-router/AGENTS.md +54 -0
- package/templates/react-router/README.md +52 -0
- package/templates/react-router/app/app.css +44 -0
- package/templates/react-router/app/components/mdx.tsx +79 -0
- package/templates/react-router/app/components/ui/button.tsx +45 -0
- package/templates/react-router/app/components/ui/card.tsx +87 -0
- package/templates/react-router/app/components/ui/separator.tsx +22 -0
- package/templates/react-router/app/db/migrations.gen.ts +6 -0
- package/templates/react-router/app/db/schema.ts +56 -0
- package/templates/react-router/app/db/seed.ts +14 -0
- package/templates/react-router/app/entry.server.tsx +41 -0
- package/templates/react-router/app/globals.d.ts +1 -0
- package/templates/react-router/app/lib/layout.shared.tsx +52 -0
- package/templates/react-router/app/lib/source.ts +7 -0
- package/templates/react-router/app/lib/utils.ts +6 -0
- package/templates/react-router/app/raybase.server.ts +65 -0
- package/templates/react-router/app/root.tsx +23 -0
- package/templates/react-router/app/routes/_index.tsx +53 -0
- package/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/templates/react-router/app/routes/docs.tsx +13 -0
- package/templates/react-router/app/routes.ts +3 -0
- package/templates/react-router/components.json +22 -0
- package/templates/react-router/content/docs/getting-started.mdx +15 -0
- package/templates/react-router/content/docs/index.mdx +8 -0
- package/templates/react-router/content/docs/mcp.mdx +121 -0
- package/templates/react-router/content/docs/meta.json +4 -0
- package/templates/react-router/dev/CODEBASE-MAP.md +48 -0
- package/templates/react-router/dev/SPEC-OVERVIEW.md +35 -0
- package/templates/react-router/dev/SPEC.md +93 -0
- package/templates/react-router/dev/features/archive/.gitkeep +1 -0
- package/templates/react-router/drizzle.config.ts +5 -0
- package/templates/react-router/env.d.ts +53 -0
- package/templates/react-router/gitignore +23 -0
- package/templates/react-router/migrations/app/meta/_journal.json +1 -0
- package/templates/react-router/package.json +70 -0
- package/templates/react-router/public/_headers +4 -0
- package/templates/react-router/public/favicon.ico +0 -0
- package/templates/react-router/react-router.config.ts +9 -0
- package/templates/react-router/source.config.ts +5 -0
- package/templates/react-router/tests/raybase-patterns.test.ts +23 -0
- package/templates/react-router/tsconfig.json +27 -0
- package/templates/react-router/vite.config.ts +59 -0
- package/templates/react-router/vitest.config.ts +8 -0
- package/templates/react-router/workers/app.ts +40 -0
- package/templates/react-router/wrangler.jsonc +111 -0
- package/templates/tanstack-start/.dev.vars.example +5 -0
- package/templates/tanstack-start/AGENTS.md +95 -0
- package/templates/tanstack-start/DESIGN.md +65 -0
- package/templates/tanstack-start/components.json +21 -0
- package/templates/tanstack-start/content/docs/getting-started.mdx +65 -0
- package/templates/tanstack-start/content/docs/index.mdx +10 -0
- package/templates/tanstack-start/content/docs/mcp.mdx +122 -0
- package/templates/tanstack-start/content/docs/meta.json +4 -0
- package/templates/tanstack-start/dev/CODEBASE-MAP.md +84 -0
- package/templates/tanstack-start/dev/SPEC-OVERVIEW.md +46 -0
- package/templates/tanstack-start/dev/SPEC.md +213 -0
- package/templates/tanstack-start/dev/features/archive/.gitkeep +1 -0
- package/templates/tanstack-start/docs/theme-previews/base.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/steel.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/zen.svg +24 -0
- package/templates/tanstack-start/docs/themes.md +116 -0
- package/templates/tanstack-start/drizzle.config.ts +5 -0
- package/templates/tanstack-start/gitignore +11 -0
- package/templates/tanstack-start/migrations/app/0000_low_karen_page.sql +26 -0
- package/templates/tanstack-start/migrations/app/meta/0000_snapshot.json +196 -0
- package/templates/tanstack-start/migrations/app/meta/_journal.json +13 -0
- package/templates/tanstack-start/package.json +77 -0
- package/templates/tanstack-start/public/_headers +8 -0
- package/templates/tanstack-start/public/icons/app-icon-maskable.svg +1 -0
- package/templates/tanstack-start/public/icons/app-icon.svg +1 -0
- package/templates/tanstack-start/public/icons/apple-touch-icon.png +0 -0
- package/templates/tanstack-start/public/manifest.webmanifest +14 -0
- package/templates/tanstack-start/public/raybase-push-sw.js +32 -0
- package/templates/tanstack-start/source.config.ts +10 -0
- package/templates/tanstack-start/src/actions.ts +560 -0
- package/templates/tanstack-start/src/ai/agents.ts +78 -0
- package/templates/tanstack-start/src/ai/retrieval.ts +36 -0
- package/templates/tanstack-start/src/auth-door.ts +18 -0
- package/templates/tanstack-start/src/client.tsx +25 -0
- package/templates/tanstack-start/src/components/.gitkeep +1 -0
- package/templates/tanstack-start/src/components/account-menu.tsx +127 -0
- package/templates/tanstack-start/src/components/auth-shell.tsx +69 -0
- package/templates/tanstack-start/src/components/install-app.tsx +35 -0
- package/templates/tanstack-start/src/components/mode-toggle.tsx +32 -0
- package/templates/tanstack-start/src/components/search-command-palette.tsx +107 -0
- package/templates/tanstack-start/src/components/setup-token-page.tsx +197 -0
- package/templates/tanstack-start/src/components/ui/avatar.tsx +107 -0
- package/templates/tanstack-start/src/components/ui/badge.tsx +52 -0
- package/templates/tanstack-start/src/components/ui/button.tsx +69 -0
- package/templates/tanstack-start/src/components/ui/checkbox.tsx +29 -0
- package/templates/tanstack-start/src/components/ui/dialog.tsx +158 -0
- package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/scroll-area.tsx +53 -0
- package/templates/tanstack-start/src/components/ui/select.tsx +215 -0
- package/templates/tanstack-start/src/components/ui/separator.tsx +23 -0
- package/templates/tanstack-start/src/components/ui/sheet.tsx +138 -0
- package/templates/tanstack-start/src/components/ui/sidebar.tsx +728 -0
- package/templates/tanstack-start/src/components/ui/skeleton.tsx +13 -0
- package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
- package/templates/tanstack-start/src/components/ui/tooltip.tsx +66 -0
- package/templates/tanstack-start/src/db/migrations.gen.ts +6 -0
- package/templates/tanstack-start/src/db/schema.ts +90 -0
- package/templates/tanstack-start/src/db/seed.ts +106 -0
- package/templates/tanstack-start/src/db/storage.ts +32 -0
- package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/templates/tanstack-start/src/docs/source.ts +7 -0
- package/templates/tanstack-start/src/hooks/use-mobile.ts +19 -0
- package/templates/tanstack-start/src/hooks/use-pwa-install.ts +77 -0
- package/templates/tanstack-start/src/jobs.example.ts +56 -0
- package/templates/tanstack-start/src/lib/account.ts +13 -0
- package/templates/tanstack-start/src/lib/auth-client.ts +187 -0
- package/templates/tanstack-start/src/lib/push-client.ts +98 -0
- package/templates/tanstack-start/src/lib/utils.ts +6 -0
- package/templates/tanstack-start/src/mcp-app.ts +74 -0
- package/templates/tanstack-start/src/notifications.example.ts +37 -0
- package/templates/tanstack-start/src/raybase.auth.ts +86 -0
- package/templates/tanstack-start/src/raybase.config.ts +86 -0
- package/templates/tanstack-start/src/raybase.server.ts +155 -0
- package/templates/tanstack-start/src/realtime.example.ts +46 -0
- package/templates/tanstack-start/src/router.tsx +19 -0
- package/templates/tanstack-start/src/routes/__root.tsx +73 -0
- package/templates/tanstack-start/src/routes/_app/admin.tsx +13 -0
- package/templates/tanstack-start/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/tanstack-start/src/routes/_app/index.tsx +1316 -0
- package/templates/tanstack-start/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/login.tsx +193 -0
- package/templates/tanstack-start/src/routes/_app/profile.tsx +98 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.$token.tsx +16 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.tsx +115 -0
- package/templates/tanstack-start/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/signup.tsx +141 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.tsx +154 -0
- package/templates/tanstack-start/src/routes/_app.tsx +33 -0
- package/templates/tanstack-start/src/routes/admin/$.ts +20 -0
- package/templates/tanstack-start/src/routes/api/$.ts +19 -0
- package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/templates/tanstack-start/src/search.ts +26 -0
- package/templates/tanstack-start/src/settings.ts +12 -0
- package/templates/tanstack-start/src/styles-docs.css +3 -0
- package/templates/tanstack-start/src/styles.css +73 -0
- package/templates/tanstack-start/src/themes/base.css +76 -0
- package/templates/tanstack-start/src/themes/carbon.css +76 -0
- package/templates/tanstack-start/src/themes/fonts.css +18 -0
- package/templates/tanstack-start/src/themes/sage.css +76 -0
- package/templates/tanstack-start/src/themes/sand.css +76 -0
- package/templates/tanstack-start/src/themes/slate.css +76 -0
- package/templates/tanstack-start/src/themes/ultra.css +76 -0
- package/templates/tanstack-start/src/themes/zen.css +76 -0
- package/templates/tanstack-start/src/worker-entry.ts +30 -0
- package/templates/tanstack-start/tests/raybase-patterns.test.ts +247 -0
- package/templates/tanstack-start/tsconfig.json +33 -0
- package/templates/tanstack-start/vite.config.ts +132 -0
- package/templates/tanstack-start/vitest.config.ts +8 -0
- package/templates/tanstack-start/wrangler.jsonc +112 -0
- package/README.md +0 -3
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raybase-changing-a-live-app
|
|
3
|
+
description: Safely change a previously deployed Raybase app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raybase Changing a Live App Skill
|
|
7
|
+
|
|
8
|
+
Day-8 work is riskier than greenfield work because real users, data, docs,
|
|
9
|
+
operator expectations, and deploy history already exist. Update intent before
|
|
10
|
+
implementation when behavior changes, and avoid destructive migrations or
|
|
11
|
+
deploys until the human has seen the risk. When a requested change leaves the
|
|
12
|
+
why unclear, clarify what problem it solves and what success looks like before
|
|
13
|
+
turning it into spec or code.
|
|
14
|
+
|
|
15
|
+
Day-8 sequence:
|
|
16
|
+
|
|
17
|
+
1. Re-read `dev/SPEC.md`.
|
|
18
|
+
2. Also read `dev/SPEC-OVERVIEW.md` and `dev/CODEBASE-MAP.md` when present
|
|
19
|
+
before substantial design, architecture, schema, route, integration,
|
|
20
|
+
workflow, AI/MCP, or data-model work.
|
|
21
|
+
3. Update `dev/SPEC.md` first with the requested change when approved product
|
|
22
|
+
behavior, business goals, success criteria, access mode, roles, data,
|
|
23
|
+
permissions, workflows, integrations, AI/MCP, docs expectations, or
|
|
24
|
+
non-goals change.
|
|
25
|
+
4. Update `dev/SPEC-OVERVIEW.md` when the product story, business outcome,
|
|
26
|
+
target user, workflow feel, important tradeoffs, or explicit exclusions
|
|
27
|
+
change.
|
|
28
|
+
5. Update `dev/CODEBASE-MAP.md` when substantial route boundaries, schema/data
|
|
29
|
+
ownership, integrations, runtime handlers, app modules, generated files, or
|
|
30
|
+
architectural workflows change.
|
|
31
|
+
6. Skip planning-doc churn for tiny bug fixes, pure styling polish, copy
|
|
32
|
+
tweaks, refactors that do not change boundaries, dependency bumps with no
|
|
33
|
+
app behavior change, or generated-file noise.
|
|
34
|
+
7. Ask the human to confirm the updated spec.
|
|
35
|
+
- Confirmation matters when behavior, access, data shape, or destructive
|
|
36
|
+
migration risk changed. For tiny fixes, say why no spec confirmation was
|
|
37
|
+
needed.
|
|
38
|
+
8. Change schema, policies, seed, and screens.
|
|
39
|
+
- Read the installed template skill first. It owns screen paths, route
|
|
40
|
+
conventions, local dev workflow, and template-specific framework seams.
|
|
41
|
+
- TanStack Start apps use `.agents/skills/raybase-tanstack-start/SKILL.md`.
|
|
42
|
+
- React Router apps use `.agents/skills/raybase-react-router/SKILL.md`.
|
|
43
|
+
- Apps created from an outside starter: also read the skills the starter
|
|
44
|
+
installed.
|
|
45
|
+
- astro-emdash apps use `.agents/skills/raybase-astro-emdash/SKILL.md`;
|
|
46
|
+
public page sections change through Galley templates
|
|
47
|
+
(`.agents/skills/raybase-astro-emdash-galley/SKILL.md`), not new Astro
|
|
48
|
+
components.
|
|
49
|
+
- Use the template's established UI and styling system.
|
|
50
|
+
- Raybase-owned auth/admin/server API routes should keep delegating to `@raybase/core`.
|
|
51
|
+
- Edit schema only in the template's app-owned schema source; there is no
|
|
52
|
+
admin UI schema editor.
|
|
53
|
+
- Keep data that another system owns in that system unless the spec
|
|
54
|
+
explicitly calls for app-owned projections.
|
|
55
|
+
- Keep app policies in business-role terms. Do not use generic `admin` or `owner` app roles.
|
|
56
|
+
- Use Raybase Kits for technical capabilities, not domain-specific business
|
|
57
|
+
workflows. Good Kit searches are things like `slack`, `email`,
|
|
58
|
+
`data grid`, `charts`, `files`, `ai chat`, or provider integrations. Do
|
|
59
|
+
not search Kits expecting employee leave, approval queues, procurement,
|
|
60
|
+
recruiting, or other business-domain workflows; implement those in app
|
|
61
|
+
code unless a Store app fits a larger rebuild. For a plausible
|
|
62
|
+
technical capability, check `raybase kits search <capability>` and
|
|
63
|
+
`raybase kits info <kit-id>` before hand-rolling source. Installed kits
|
|
64
|
+
are app-owned source; review and adapt them like any other app code.
|
|
65
|
+
9. Keep Docs current when Docs are enabled.
|
|
66
|
+
- If `.agents/skills/raybase-docs-writing/SKILL.md` is installed, read it
|
|
67
|
+
and update `content/docs` for the changed behavior before demoing or
|
|
68
|
+
deploying.
|
|
69
|
+
- Document only real behavior that now exists. Do not create separate docs
|
|
70
|
+
surfaces when Docs were disabled by request.
|
|
71
|
+
10. Run:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
raybase migrate
|
|
75
|
+
raybase kits doctor
|
|
76
|
+
raybase doctor
|
|
77
|
+
raybase dev
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
11. Run the template security review before demoing or deploying.
|
|
81
|
+
- For TanStack Start apps, read `.agents/skills/raybase-tanstack-start-security-review/SKILL.md` and follow it.
|
|
82
|
+
- For React Router apps, read `.agents/skills/raybase-react-router-security-review/SKILL.md` and follow it.
|
|
83
|
+
- For apps created from an outside starter, also follow the security review skill the starter installed, if any.
|
|
84
|
+
- For astro-emdash apps, read `.agents/skills/raybase-astro-emdash-security-review/SKILL.md` and follow it.
|
|
85
|
+
- Fix high-confidence findings, then rerun `raybase doctor` and the focused review.
|
|
86
|
+
12. Demo locally, including `/docs` when Docs are enabled.
|
|
87
|
+
13. If a schema change could drop data, ask the human before using `--allow-destructive`.
|
|
88
|
+
14. Report in handoff what planning docs changed, or state that no planning-doc
|
|
89
|
+
update was needed. When a feature proposal is implemented, archive
|
|
90
|
+
`dev/features/<feature-slug>/` under `dev/features/archive/` after folding
|
|
91
|
+
durable facts into the root living docs.
|
|
92
|
+
15. End the local-change handoff by offering to set the verified change live
|
|
93
|
+
next. Deploy only after explicit confirmation:
|
|
94
|
+
Production deploy changes the owner-facing app, not just local code. Wait
|
|
95
|
+
for explicit confirmation after local demo and verification.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
raybase deploy
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Notes:
|
|
102
|
+
- Schema changes are Drizzle migrations generated by `raybase migrate` into `migrations/app/` and compiled into `src/db/migrations.gen.ts` for TanStack Start and astro-emdash apps or `app/db/migrations.gen.ts` for React Router apps. Do not edit `migrations.gen.ts` by hand; doctor fails when it is stale.
|
|
103
|
+
- The Raybase Durable Object applies the new bundle lazily on first database access after deploy.
|
|
104
|
+
- For a production backup, use `raybase backup --url <app-url> --cookie <admin-cookie>`; it downloads an envelope-encrypted whole-database `.rbb` archive from the deployed app.
|
|
105
|
+
- Point-in-time restore rewinds app rows and Raybase users/sessions together. This is intentional whole-database consistency.
|
|
106
|
+
- Multi-tenancy, one app installed by many customer organizations, and SSO across apps are provided by Raybase Pro. Core is single-tenant by design; converting it yourself means re-architecting the control plane and is not a supported path.
|
|
107
|
+
- Operator MCP is the operator-scoped production evidence and narrow typed
|
|
108
|
+
admin-action endpoint at `/mcp/operator`; it should usually stay enabled
|
|
109
|
+
alongside app MCP with `mcp: { enabled: true }`. Disable all MCP with
|
|
110
|
+
`mcp: { enabled: false }`; keep app MCP but disable only Operator MCP with
|
|
111
|
+
`mcp: { enabled: true, operator: { enabled: false } }`.
|
|
112
|
+
- Never bypass policies with raw database access or `unsafeDb`; app server code must go through Raybase database helpers.
|
|
113
|
+
- Raybase package updates do not silently update installed kit source. Use
|
|
114
|
+
`raybase kits update --dry-run` to review source updates and conflicts.
|
|
115
|
+
- Package updates also do not refresh the installed `.agents/skills` set.
|
|
116
|
+
When `raybase doctor` reports a `skills-freshness` warning, run
|
|
117
|
+
`raybase skills sync` (preview with `--dry-run`) to refresh the installed
|
|
118
|
+
skills in place for the app's framework and enabled modules before leaning on
|
|
119
|
+
skill guidance; it overwrites local edits to Raybase-installed skills.
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raybase-data-and-policies
|
|
3
|
+
description: Model Raybase schema and permissions safely.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raybase Data and Policies Skill
|
|
7
|
+
|
|
8
|
+
Tables live in the template's app-owned schema file and use `raybaseTable`.
|
|
9
|
+
TanStack Start and astro-emdash apps use `src/db/schema.ts` (the astro-emdash
|
|
10
|
+
spine follows the TanStack Start layout); React Router apps use
|
|
11
|
+
`app/db/schema.ts`. Raybase turns those declarations into Drizzle SQLite tables
|
|
12
|
+
for migrations while keeping policy metadata for runtime enforcement.
|
|
13
|
+
|
|
14
|
+
File buckets live in the template's storage declaration file
|
|
15
|
+
(`src/db/storage.ts` in TanStack Start and astro-emdash apps) and use
|
|
16
|
+
`raybaseBucket` plus `raybaseStorage`. File policy actions are the same four
|
|
17
|
+
actions as tables: `read`, `create`, `update`, and `delete`.
|
|
18
|
+
|
|
19
|
+
Schema declarations describe the data shape, and policies describe who can
|
|
20
|
+
reach that shape through Raybase-owned surfaces. The installed
|
|
21
|
+
`raybase-schema` skill owns the schema-change workflow boundary; this skill is
|
|
22
|
+
the rationale companion for modeling data and permissions. When in doubt,
|
|
23
|
+
start from an explicit decision for each operation rather than a permissive
|
|
24
|
+
default.
|
|
25
|
+
|
|
26
|
+
Recommended columns:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
id: id(),
|
|
30
|
+
createdBy: createdBy(),
|
|
31
|
+
createdAt: createdAt(),
|
|
32
|
+
updatedAt: updatedAt()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Define business roles once in the template app config and reuse that tuple in
|
|
36
|
+
policies. `user` is built in; `appRoles` should contain only additional
|
|
37
|
+
business roles from the spec.
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { defineRoles, type RaybaseConfig } from "@raybase/core";
|
|
41
|
+
|
|
42
|
+
export const appRoles = defineRoles(["manager", "operations"] as const);
|
|
43
|
+
|
|
44
|
+
export const appConfig = {
|
|
45
|
+
appName: "Example",
|
|
46
|
+
roles: appRoles,
|
|
47
|
+
auth: { signupMode: "invite-only", publicRoutes: [] }
|
|
48
|
+
} satisfies RaybaseConfig;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Policy vocabulary:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
role(appRoles, "user")
|
|
55
|
+
role(appRoles, "manager")
|
|
56
|
+
role(appRoles, "operations")
|
|
57
|
+
owns("createdBy")
|
|
58
|
+
owns("employeeId")
|
|
59
|
+
anyOf(role(appRoles, "manager"), owns("createdBy"))
|
|
60
|
+
allOf(role(appRoles, "user"), owns("createdBy"))
|
|
61
|
+
fromService("briefings")
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Rules:
|
|
65
|
+
- A table with no policies is deny-all and `raybase doctor` fails it.
|
|
66
|
+
- Every app table must declare `read`, `create`, `update`, and `delete`.
|
|
67
|
+
- Use Raybase column helpers instead of importing Drizzle directly in generated app schemas.
|
|
68
|
+
- Store third-party credentials in `secret()` columns, never `text()`. Reads
|
|
69
|
+
redact them everywhere; only an audited `revealSecret()` in an action or job
|
|
70
|
+
returns plaintext.
|
|
71
|
+
- The keys passed to `raybaseSchema({ ... })` are the public table identifiers
|
|
72
|
+
used by `ctx.db`, `/api/data`, generated MCP, and admin surfaces. Use the
|
|
73
|
+
same string as the table name, for example
|
|
74
|
+
`raybaseSchema({ leave_requests: leaveRequests })` for
|
|
75
|
+
`raybaseTable("leave_requests", ...)`.
|
|
76
|
+
- Use `userRef()` for app data that points at a signed-in Raybase user. It
|
|
77
|
+
stores the Raybase user id for relationships such as requester, employee,
|
|
78
|
+
manager, approver, owner, or assignee.
|
|
79
|
+
- If the app needs a picker/search for invited login identities, expose a
|
|
80
|
+
deliberate read-only action that calls `listAppUsers(raybaseAuthExecutor(ctx.env), { appRoles: ... })`
|
|
81
|
+
and returns only the fields the UI should show. Any user allowed to call the
|
|
82
|
+
action can enumerate that role-scoped directory, so set the narrowest policy
|
|
83
|
+
that matches the workflow.
|
|
84
|
+
- Verify selected `userRef()` values at mutation time with
|
|
85
|
+
`getAppUserById()` or `getAppUserByEmail()` and the required `appRoles`
|
|
86
|
+
filter. Do not trust an old picker result after invites, disables, or role
|
|
87
|
+
changes.
|
|
88
|
+
- Do not read Core auth user tables, Better Auth tables, sessions, accounts,
|
|
89
|
+
invites, or `operatorRole` from generated app code. If assignable people are
|
|
90
|
+
not Raybase login identities, model them as app-owned domain rows instead.
|
|
91
|
+
- `owns("<column>")` works with any user reference column, not only
|
|
92
|
+
`createdBy`. Use it for relationships like `employeeId`, `managerId`,
|
|
93
|
+
`assigneeId`, or `requesterId`.
|
|
94
|
+
- Do not create custom user/session/password tables.
|
|
95
|
+
- Use `role(appRoles, "user")` for data any signed-in colleague may see.
|
|
96
|
+
- Use named business roles such as `role(appRoles, "manager")`,
|
|
97
|
+
`role(appRoles, "approver")`, or `role(appRoles, "operations")` for
|
|
98
|
+
destructive actions and sensitive tables. When `appRoles` comes from
|
|
99
|
+
`defineRoles([...] as const)`, misspelled role names fail at compile time.
|
|
100
|
+
- Do not use generic `role("admin")` or `role("owner")` in app policies. Admin access to `/admin` is separate and cannot be expressed in app policies.
|
|
101
|
+
- Align policies with product UI. Every non-admin create, update, delete, or
|
|
102
|
+
state-transition permission should have a visible main-app workflow, and
|
|
103
|
+
every implemented workflow should be allowed by the matching policy.
|
|
104
|
+
- Do not grant broad update/delete permissions to a business role just because
|
|
105
|
+
an operator could edit the same row in `/admin`.
|
|
106
|
+
Broad app policies also affect `/api/data`, generated MCP tools, and any UI
|
|
107
|
+
using the data client; for state-machine fields this can expose transitions
|
|
108
|
+
that were supposed to live behind one validated server function.
|
|
109
|
+
- Use `owns("createdBy")` only when the table has a `createdBy()` column. Use
|
|
110
|
+
the matching user reference column for relationship-owned records.
|
|
111
|
+
- Use `owns("createdBy")` for user-owned file buckets. Raybase file metadata
|
|
112
|
+
has `createdBy` automatically.
|
|
113
|
+
- Use named business roles in file policies, for example
|
|
114
|
+
`anyOf(role(appRoles, "manager"), owns("createdBy"))` for updates or deletes.
|
|
115
|
+
- Do not store raw R2 keys in app rows. Store Raybase file IDs or model a
|
|
116
|
+
domain-specific relationship in app data.
|
|
117
|
+
- Do not expose direct R2 URLs or presigned URLs. Use `/api/files` or
|
|
118
|
+
`createRaybaseStorage()` so policies and safe download headers apply.
|
|
119
|
+
- Schema changes happen in source code and migrations. Do not use raw SQL,
|
|
120
|
+
runtime DDL, app routes, MCP tools, admin shortcuts, or model-generated SQL to
|
|
121
|
+
mutate app schema.
|
|
122
|
+
- Before serious schema work, run `raybase check-updates` and apply printed
|
|
123
|
+
Raybase updates when relevant. If the release index cannot be fetched, treat
|
|
124
|
+
the check as inconclusive rather than proof that everything is current; note
|
|
125
|
+
the warning in handoff and continue only when no version-sensitive fix is
|
|
126
|
+
needed.
|
|
127
|
+
- Keep `dev/SPEC.md` and app config aligned: `Signup mode: invite-only` maps to
|
|
128
|
+
`auth.signupMode: "invite-only"`, `Signup mode: public self-signup` maps to
|
|
129
|
+
`auth.signupMode: "public"`, and `Signup mode: provider-only self-signup`
|
|
130
|
+
maps to `auth.signupMode: "provider-only"`.
|
|
131
|
+
- Keep the spec's `Cloudflare email capability`, `Auth email features`,
|
|
132
|
+
`Invite delivery`, and `Password recovery` lines aligned with
|
|
133
|
+
`appConfig.auth.email`; run `raybase doctor` after auth email changes.
|
|
134
|
+
- Destructive migrations require human approval, rollback or backup awareness,
|
|
135
|
+
and verification of what data will be dropped before using
|
|
136
|
+
`--allow-destructive`.
|
|
137
|
+
- After schema or storage changes, run `raybase migrate` and `raybase doctor`.
|
|
138
|
+
- Prefer soft-delete status fields when humans may need recovery.
|
|
139
|
+
|
|
140
|
+
Common patterns:
|
|
141
|
+
|
|
142
|
+
user-owned records:
|
|
143
|
+
|
|
144
|
+
```ts
|
|
145
|
+
policies: {
|
|
146
|
+
read: anyOf(role(appRoles, "manager"), owns("createdBy")),
|
|
147
|
+
create: role(appRoles, "user"),
|
|
148
|
+
update: anyOf(role(appRoles, "manager"), owns("createdBy")),
|
|
149
|
+
delete: role(appRoles, "manager"),
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Company-wide reference data:
|
|
154
|
+
|
|
155
|
+
```ts
|
|
156
|
+
policies: {
|
|
157
|
+
read: role(appRoles, "user"),
|
|
158
|
+
create: role(appRoles, "operations"),
|
|
159
|
+
update: role(appRoles, "operations"),
|
|
160
|
+
delete: role(appRoles, "operations"),
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Relationship-scoped routing data:
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
policies: {
|
|
168
|
+
read: anyOf(owns("employeeId"), owns("managerId"), role(appRoles, "people-ops")),
|
|
169
|
+
create: role(appRoles, "people-ops"),
|
|
170
|
+
update: role(appRoles, "people-ops"),
|
|
171
|
+
delete: role(appRoles, "people-ops"),
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Workflow table with module-only writes:
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
const workflowActions = new Set([
|
|
179
|
+
"requests.submit",
|
|
180
|
+
"requests.approve",
|
|
181
|
+
"requests.cancel",
|
|
182
|
+
"seed.requests"
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
function workflowOnlyWrite() {
|
|
186
|
+
return rowInvariant({
|
|
187
|
+
name: "requests.workflow_only_write",
|
|
188
|
+
on: ["create", "update"],
|
|
189
|
+
message: "Request changes must use the request workflow.",
|
|
190
|
+
check: ({ source, user }) =>
|
|
191
|
+
Boolean(user.operatorRole) || workflowActions.has(String(source?.actionName ?? ""))
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export const requests = raybaseTable("requests", columns, {
|
|
196
|
+
invariants: [workflowOnlyWrite()],
|
|
197
|
+
policies: {
|
|
198
|
+
read: anyOf(owns("employeeId"), owns("managerId"), role(appRoles, "people-ops")),
|
|
199
|
+
create: denyAll,
|
|
200
|
+
update: denyAll,
|
|
201
|
+
delete: denyAll,
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Minimum policy shape:
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
policies: {
|
|
210
|
+
read: anyOf(owns("employeeId"), owns("managerId"), role(appRoles, "people-ops")),
|
|
211
|
+
create: denyAll,
|
|
212
|
+
update: denyAll,
|
|
213
|
+
delete: denyAll,
|
|
214
|
+
}
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Use this pattern for approvals, reviews, cancellations, inventory reservations,
|
|
218
|
+
and other state machines where fields such as `status`, `managerId`,
|
|
219
|
+
`approverId`, totals, or decision comments must be server-controlled. Implement
|
|
220
|
+
the mutation once in a domain route/action/module, validate ownership, role,
|
|
221
|
+
input, and allowed state transitions there, and only then use an audited
|
|
222
|
+
service context or `adminOverride` for the final write.
|
|
223
|
+
|
|
224
|
+
For high-risk workflow tables, pair `denyAll` write policies with a
|
|
225
|
+
`rowInvariant()` that allows only known `source.actionName` values. This stops
|
|
226
|
+
future service/adminOverride writes unless the new workflow action is
|
|
227
|
+
deliberately added to the allowlist. Include the operator-role bypass only when
|
|
228
|
+
Raybase `/admin` repair writes should remain possible.
|
|
229
|
+
|
|
230
|
+
## Table Denials Refuse; Row Policies Filter
|
|
231
|
+
|
|
232
|
+
Raybase distinguishes a principal-level table denial from a row-dependent read.
|
|
233
|
+
A caller that cannot satisfy a table's role, operator, or service-principal
|
|
234
|
+
policy receives `RaybaseDataReadDeniedError` with HTTP status `403` and stable
|
|
235
|
+
code `data_read_denied`; `db.list()` and `db.get()` refuse before querying the
|
|
236
|
+
table. `owns(...)` and mixed policies that still depend on a row continue to
|
|
237
|
+
filter normally, so an empty list or `null` remains a truthful visible-subset
|
|
238
|
+
result. Result length is therefore still not an ownership test.
|
|
239
|
+
|
|
240
|
+
Most application code should let the refusal propagate. Catch it only when a
|
|
241
|
+
surface deliberately translates the refusal while preserving its meaning:
|
|
242
|
+
|
|
243
|
+
```ts
|
|
244
|
+
try {
|
|
245
|
+
return await db.list("partner_updates");
|
|
246
|
+
} catch (error) {
|
|
247
|
+
if (error instanceof RaybaseDataReadDeniedError) {
|
|
248
|
+
throw new Response("Forbidden", { status: error.status });
|
|
249
|
+
}
|
|
250
|
+
throw error;
|
|
251
|
+
}
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
When the surface is legitimately privileged server code that must read across
|
|
255
|
+
user ownership, grant a named service principal on that table's `read` policy
|
|
256
|
+
and use `.forService(name)` as shown below. Keep the name and table grant narrow;
|
|
257
|
+
do not use `adminOverride` merely to make a denied read return data.
|
|
258
|
+
|
|
259
|
+
## Named Service-Principal Reads
|
|
260
|
+
|
|
261
|
+
Use a named service principal when trusted server code needs a narrow
|
|
262
|
+
cross-user read. Grant that exact name on only the necessary table action:
|
|
263
|
+
|
|
264
|
+
```ts
|
|
265
|
+
policies: {
|
|
266
|
+
read: anyOf(owns("userId"), fromService("briefings")),
|
|
267
|
+
create: role(appRoles, "user"),
|
|
268
|
+
update: owns("userId"),
|
|
269
|
+
delete: owns("userId")
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Server code opts in explicitly:
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
const briefingDb = createRaybaseDb(env, schema, migrations)
|
|
277
|
+
.forService("briefings");
|
|
278
|
+
const rows = await briefingDb.list("partner_updates");
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`forService(name)` is a server-runtime constructor, not a browser client
|
|
282
|
+
feature. It does not bypass policies: only matching
|
|
283
|
+
`fromService("name")` terms pass, and data audit rows carry
|
|
284
|
+
`actorKind: "service"`.
|
|
285
|
+
|
|
286
|
+
Agent turn-state loaders must declare every allowed service name:
|
|
287
|
+
|
|
288
|
+
```ts
|
|
289
|
+
turnState: {
|
|
290
|
+
servicePrincipals: ["briefings"],
|
|
291
|
+
async load({ dataAsService }) {
|
|
292
|
+
const db = dataAsService!("briefings");
|
|
293
|
+
return { updates: (await db.list("partner_updates")).rows };
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`dataAsService` is absent when no names are declared and rejects any
|
|
299
|
+
undeclared name. Prefer this narrow grant over `adminOverride` for assembly
|
|
300
|
+
reads that legitimately cross user ownership.
|
|
301
|
+
|
|
302
|
+
## Revealing Secret Columns
|
|
303
|
+
|
|
304
|
+
`secret()` columns (see `raybase-schema`) are write-only on every generic
|
|
305
|
+
surface. Server code that needs the plaintext, to call the provider the token
|
|
306
|
+
belongs to, reveals it explicitly inside an action or job:
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
handler: async (ctx, input) => {
|
|
310
|
+
const token = await ctx.db.revealSecret("cloudflare_accounts", input.accountId, "apiToken");
|
|
311
|
+
if (!token) throw new Error("Connect a Cloudflare account first.");
|
|
312
|
+
const response = await fetch("https://api.cloudflare.com/client/v4/zones", {
|
|
313
|
+
headers: { authorization: `Bearer ${token}` }
|
|
314
|
+
});
|
|
315
|
+
return { zoneCount: ((await response.json()) as { result: unknown[] }).result.length };
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
- `revealSecret()` applies the table's read policy to the row exactly like
|
|
320
|
+
`get()`: a caller who cannot read the row gets `null`, as does an unset
|
|
321
|
+
secret. Before returning it records a `data.secret.reveal` audit event with
|
|
322
|
+
the column and key id, never the value.
|
|
323
|
+
- The read policy is therefore the reveal policy. Keep tables holding secrets
|
|
324
|
+
on `owns(...)`, a business role, or `fromService(...)`; `raybase doctor`
|
|
325
|
+
warns when every signed-in user satisfies it.
|
|
326
|
+
- Use the value for the outbound call and drop it. Never return it, write it
|
|
327
|
+
to another column, a job input, logs, settings, or a notification. An action
|
|
328
|
+
an Agent calls hands its output to the model.
|
|
329
|
+
- `revealSecret()` is typed on `ctx.db` for action, job, and app MCP-tool
|
|
330
|
+
handlers. Agent turn-state loaders, request contexts, and
|
|
331
|
+
`createRaybaseDb(...).forService(name)` clients do not offer it.
|
|
332
|
+
|
|
333
|
+
## Policy-Aware Pagination
|
|
334
|
+
|
|
335
|
+
`db.list()` applies table read policies before `LIMIT`/`OFFSET` and returns
|
|
336
|
+
`total` as the full filtered count, not the current page length. `owns`,
|
|
337
|
+
`role`, `fromService`, `allowAll`, `denyAll`, `operator`, and
|
|
338
|
+
`anyOf`/`allOf`/`not` are compiled into the SQL predicate. Policy scope is
|
|
339
|
+
classified structurally before SQL; an unknown runtime policy primitive fails
|
|
340
|
+
loudly instead of being guessed from generated SQL or converted to an empty
|
|
341
|
+
result.
|
|
342
|
+
|
|
343
|
+
`allowAll` and `denyAll` are frozen policy constants, not functions. Write
|
|
344
|
+
`read: allowAll` and `delete: denyAll`, without parentheses.
|
|
345
|
+
|
|
346
|
+
Manager-only table:
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
policies: {
|
|
350
|
+
read: role(appRoles, "manager"),
|
|
351
|
+
create: role(appRoles, "manager"),
|
|
352
|
+
update: role(appRoles, "manager"),
|
|
353
|
+
delete: role(appRoles, "manager"),
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
User-owned file bucket:
|
|
358
|
+
|
|
359
|
+
```ts
|
|
360
|
+
export const attachments = raybaseBucket("attachments", {
|
|
361
|
+
maxSizeBytes: 10 * 1024 * 1024,
|
|
362
|
+
accept: ["image/png", "image/jpeg", "application/pdf"],
|
|
363
|
+
policies: {
|
|
364
|
+
read: owns("createdBy"),
|
|
365
|
+
create: role(appRoles, "user"),
|
|
366
|
+
update: owns("createdBy"),
|
|
367
|
+
delete: owns("createdBy"),
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Routes that authenticate through something other than a Raybase session
|
|
373
|
+
(for example a starter for an app embedded in another platform's admin) may
|
|
374
|
+
reach app tables through an audited service context. A service context
|
|
375
|
+
bypasses policies, so those routes must scope every read and write to the
|
|
376
|
+
caller themselves. Policies are still mandatory on every table — they govern
|
|
377
|
+
`/admin`, `/api/data`, and any future membership-mapped access.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raybase-deploy
|
|
3
|
+
description: Deploy and operate Raybase apps with doctor, Cloudflare connection, owner setup, backups, and safe production changes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raybase Deploy
|
|
7
|
+
|
|
8
|
+
Before deployment or production maintenance, run:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
raybase check-updates
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If update commands are printed, run them before continuing.
|
|
15
|
+
|
|
16
|
+
Deploy only after local verification succeeds:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
raybase kits doctor
|
|
20
|
+
raybase doctor
|
|
21
|
+
raybase connect
|
|
22
|
+
raybase deploy
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`raybase doctor` and `raybase kits doctor` are non-optional. They encode
|
|
26
|
+
deterministic correctness checks for config, handlers, migrations, modules,
|
|
27
|
+
kits, secrets, public routes, stale generated files, and unsafe wiring. Skills
|
|
28
|
+
explain the sequence; doctor decides whether known machine-checkable contracts
|
|
29
|
+
are satisfied.
|
|
30
|
+
|
|
31
|
+
`raybase deploy` is more than `wrangler deploy`: it coordinates identity
|
|
32
|
+
collision checks, secrets, migrations, build output, health checks, and owner
|
|
33
|
+
setup. Raw deploy commands skip those guardrails.
|
|
34
|
+
|
|
35
|
+
Raybase apps usually keep MCP enabled in production. App MCP exposes declared
|
|
36
|
+
app tools at `/mcp`; Operator MCP exposes read-only production
|
|
37
|
+
visibility at `/mcp/operator` for authorized operators. Disable all MCP with
|
|
38
|
+
`mcp: { enabled: false }`, or disable only Operator MCP with
|
|
39
|
+
`mcp: { enabled: true, operator: { enabled: false } }`.
|
|
40
|
+
|
|
41
|
+
Rules:
|
|
42
|
+
|
|
43
|
+
- Do not deploy if `raybase doctor` reports errors.
|
|
44
|
+
- Do not deploy with unresolved `raybase kits doctor` warnings about missing
|
|
45
|
+
secrets, missing dependencies, or kit file drift unless the human accepts the
|
|
46
|
+
risk and the deploy notes call it out.
|
|
47
|
+
- Do not treat an app as production-ready with starter or stale docs when
|
|
48
|
+
`raybase.modules.docs.enabled` is true. Use
|
|
49
|
+
`.agents/skills/raybase-docs-writing/SKILL.md` and call out any intentional
|
|
50
|
+
Docs opt-out in the deploy notes.
|
|
51
|
+
- For substantial product or architecture changes, deployment handoff should
|
|
52
|
+
say whether `dev/SPEC.md`, `dev/SPEC-OVERVIEW.md`, or `dev/CODEBASE-MAP.md`
|
|
53
|
+
changed, or explicitly state that no planning-doc update was needed. Do not
|
|
54
|
+
churn those files for tiny fixes, styling polish, copy-only edits, or
|
|
55
|
+
generated-file noise.
|
|
56
|
+
- Relay Cloudflare login or account setup instructions exactly when
|
|
57
|
+
`raybase connect` prints them. These are valid human handoff points, not
|
|
58
|
+
failures to work around.
|
|
59
|
+
- On first deploy, deliver the owner setup URL prominently. It is single-use
|
|
60
|
+
and expires in 24 hours.
|
|
61
|
+
- Do not run raw `wrangler` for actions covered by `raybase`; it can skip app
|
|
62
|
+
identity checks, migrations, generated config, secrets, and health evidence.
|
|
63
|
+
- Never run `raybase destroy --confirm` unless the user has explicitly approved
|
|
64
|
+
the destructive warning.
|
|
65
|
+
|
|
66
|
+
Worker identity and name collisions:
|
|
67
|
+
|
|
68
|
+
- The first deploy claims a worker name. If the directory-derived name is taken
|
|
69
|
+
by another Raybase app, deploy automatically falls back to `<name>-2`,
|
|
70
|
+
`<name>-3`, and so on, then saves the result in `wrangler.jsonc`. Relay the
|
|
71
|
+
chosen name and URL; do not change it back.
|
|
72
|
+
- If deploy stops because a same-named worker exists with no Raybase app id, it
|
|
73
|
+
cannot tell whether that worker is this app's old deployment or someone
|
|
74
|
+
else's. Relay the printed options to the human and wait: `--claim-existing`,
|
|
75
|
+
`--name <other>`, or `raybase destroy` then redeploy.
|
|
76
|
+
- `raybase destroy` permanently deletes the worker and its entire database
|
|
77
|
+
(Durable Objects). Never run it with `--confirm` unless the human has read
|
|
78
|
+
its warning output and explicitly approved; there is no undo and no automatic
|
|
79
|
+
backup.
|
|
80
|
+
|
|
81
|
+
Expected first deploy result:
|
|
82
|
+
|
|
83
|
+
- A live `*.workers.dev` URL.
|
|
84
|
+
- `/docs` loads with current app-specific docs when this project has
|
|
85
|
+
`raybase.modules.docs.enabled`.
|
|
86
|
+
- App migration bundle compiled into the worker.
|
|
87
|
+
- The singleton Raybase Durable Object applies runtime and app schema lazily on
|
|
88
|
+
first database access.
|
|
89
|
+
- Health check passed, including a ping of the Raybase Durable Object.
|
|
90
|
+
- Owner setup URL printed.
|
|
91
|
+
|
|
92
|
+
For deployed production data, use:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
raybase backup --url <app-url> --cookie <operator-cookie>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Use restore or destructive deployment paths only after the user confirms the
|
|
99
|
+
risk.
|
|
100
|
+
|
|
101
|
+
Notes:
|
|
102
|
+
|
|
103
|
+
- `raybase deploy` builds the app before `wrangler deploy`.
|
|
104
|
+
- Raybase stores auth state in Better Auth tables inside the Durable Object and
|
|
105
|
+
uses `BETTER_AUTH_SECRET`; do not create or set `RAYBASE_AUTH_SECRET`.
|
|
106
|
+
- External auth provider credentials belong in Worker secrets for deployment
|
|
107
|
+
and local `.dev.vars` for development. Core external auth remains
|
|
108
|
+
invite-only app login, not suite SSO; run `raybase doctor` after changing
|
|
109
|
+
`src/raybase.auth.ts` or `auth.externalProviders`.
|
|
110
|
+
- Point-in-time restore rewinds app rows and Raybase users/sessions together.
|
|
111
|
+
This is intentional whole-database consistency.
|
|
112
|
+
- Multi-tenancy, one app installed by many customer organizations, and SSO
|
|
113
|
+
across apps are provided by Raybase Pro. Core is single-tenant by design;
|
|
114
|
+
converting it yourself means re-architecting the control plane and is not a
|
|
115
|
+
supported path.
|
|
116
|
+
- Feed-only notifications do not require queues. External notification channels
|
|
117
|
+
require `raybase doctor` to pass queue, handler, and secret checks before
|
|
118
|
+
deploy; use `raybase jobs enable` for that queue wiring.
|
|
119
|
+
- Cloudflare Email Service auth email requires `raybase email enable`,
|
|
120
|
+
`appConfig.auth.email`, `Cloudflare email capability: transactional-email`
|
|
121
|
+
in `dev/SPEC.md`, Workers Paid for arbitrary recipients, and completed
|
|
122
|
+
Cloudflare DNS/domain onboarding. Read `.agents/skills/raybase-auth/SKILL.md`
|
|
123
|
+
before enabling password reset, invite email, welcome email, public signup
|
|
124
|
+
email verification, or magic links.
|
|
125
|
+
|
|
126
|
+
## Building for another host, or for leaving
|
|
127
|
+
|
|
128
|
+
`raybase build` builds the app without touching Cloudflare: it declares the
|
|
129
|
+
secrets the app needs in the built Wrangler config (`secrets.required`) and
|
|
130
|
+
writes `raybase.requirements.json` beside it, the plain list of bindings,
|
|
131
|
+
triggers, vars and secrets. `raybase secrets list` explains each secret and
|
|
132
|
+
`raybase secrets new` prints fresh values as JSON for `wrangler deploy
|
|
133
|
+
--secrets-file`. `wrangler deploy` of the build then works on any account.
|
|
134
|
+
The app applies its own database changes on first use. See the hosting
|
|
135
|
+
guide (`docs/hosting.md` on the Raybase site) for the full contract.
|
|
136
|
+
|