create-disposabl-app 0.1.0 → 0.1.1
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/dist/index.js +21 -22
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +5 -0
- package/dist/templates/default/apps/desktop/.oxlintrc.json +6 -0
- package/dist/templates/default/apps/desktop/README.md +58 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +90 -0
- package/dist/templates/default/apps/desktop/index.html +12 -0
- package/dist/templates/default/apps/desktop/package.json +55 -1
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +2 -0
- package/dist/templates/default/apps/desktop/src/index.css +8 -0
- package/dist/templates/default/apps/desktop/src/main.ts +58 -0
- package/dist/templates/default/apps/desktop/src/preload.ts +3 -0
- package/dist/templates/default/apps/desktop/src/renderer.ts +19 -0
- package/dist/templates/default/apps/desktop/tsconfig.json +14 -0
- package/dist/templates/default/apps/desktop/vite.main.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/agent-device/SKILL.md +22 -0
- package/dist/templates/default/apps/mobile/.agents/skills/android-emulator/SKILL.md +32 -0
- package/dist/templates/default/apps/mobile/.agents/skills/dogfood/SKILL.md +27 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/SKILL.md +176 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/app-store-metadata.md +497 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/ios-app-store.md +376 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/play-store.md +244 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/testflight.md +62 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/workflows.md +120 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-hosting/SKILL.md +431 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-hosting/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/SKILL.md +46 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/metrics.md +98 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/queries.md +444 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/setup.md +529 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/third-party.md +136 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/SKILL.md +237 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/controllers.md +139 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/logs-and-crashes.md +101 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/run-your-app.md +256 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/troubleshooting.md +56 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update/SKILL.md +146 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/SKILL.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/SKILL.md +99 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/scripts/fetch.js +109 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/scripts/package.json +6 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/LICENSE +21 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/RECIPES.md +385 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/SKILL.md +274 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/SKILL.md +290 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/references/native-module.md +96 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/SKILL.md +69 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/brownfield-integrated.md +551 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/brownfield-isolated.md +449 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/comparison.md +63 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/SKILL.md +478 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/references/expo-router-loaders.md +341 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/references/offline-and-cancellation.md +68 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/SKILL.md +376 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/references/audit.md +190 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dev-client/SKILL.md +184 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dev-client/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dom/SKILL.md +425 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dom/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/SKILL.md +106 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/references/catalog.md +105 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/SKILL.md +124 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/compatibility.md +130 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/example.md +212 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/migration-map.md +457 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/SKILL.md +151 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/config-plugin.md +90 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/create-expo-module.md +206 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/lifecycle.md +127 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/module-config.md +48 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/native-module.md +286 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/native-view.md +171 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/SKILL.md +201 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/controls.md +231 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/gradients.md +106 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/icons.md +232 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/media.md +193 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/storage.md +121 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/visual-effects.md +198 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/webgpu-three.md +605 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/SKILL.md +120 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/references/launch-without-dev-menu.md +24 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-project-structure/SKILL.md +114 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-project-structure/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/SKILL.md +240 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/form-sheet.md +253 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/route-structure.md +229 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/search.md +248 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/tabs.md +433 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/toolbar-and-headers.md +284 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/zoom-transitions.md +158 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/SKILL.md +314 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/agents/visual-grader.md +52 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/references/design-rubric.md +45 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/references/runtime-matrix.md +34 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/check-static.sh +64 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/SKILL.md +101 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/drop-in-replacements.md +27 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/jetpack-compose.md +73 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/swift-ui.md +73 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/universal.md +104 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/scripts/list-components.js +193 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/SKILL.md +150 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/expo-av-to-audio.md +132 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/expo-av-to-video.md +160 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/native-tabs.md +124 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/new-architecture.md +79 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-19.md +79 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-compiler.md +59 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-navigation-to-expo-router.md +61 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/SKILL.md +91 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/false-friends.md +119 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/native-patterns.md +39 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/run-as-goal.md +48 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/verify-on-device.md +45 -0
- package/dist/templates/default/apps/mobile/.agents/skills/ios-simulator/SKILL.md +32 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/POWER.md +172 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/SKILL.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-analyze-app.md +208 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-analyze-js.md +264 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-barrel-exports.md +250 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-code-splitting.md +255 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-hermes-mmap.md +167 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-library-size.md +164 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-native-assets.md +208 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-r8-android.md +231 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-tree-shaking.md +215 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/bundle-treemap-source-map-explorer.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/controlled-textinput-pingpong.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/devtools-flamegraph.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/emerge-xray-ios.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/expo-atlas-treemap.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/flashlight-flatlist-vs-flashlist.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/fps-drop-graph.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/memory-heap-snapshot.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/tti-warm-start-diagram.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/view-hierarchy-flattening.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/xcode-instruments-templates.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/xcode-thread-view.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-animations-reanimated.md +273 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-atomic-state.md +190 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-bottomsheet.md +339 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-concurrent-react.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-lists-flatlist-flashlist.md +223 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-measure-fps.md +178 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-memory-leaks.md +168 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-profile-react.md +138 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-react-compiler.md +261 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-uncontrolled-components.md +219 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-android-16kb-alignment.md +114 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-measure-tti.md +221 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-memory-leaks.md +206 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-memory-patterns.md +240 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-platform-setup.md +112 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-profiling.md +140 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-sdks-over-polyfills.md +192 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-threading-model.md +230 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-turbo-modules.md +210 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-view-flattening.md +180 -0
- package/dist/templates/default/apps/mobile/AGENTS.md +41 -0
- package/dist/templates/default/apps/mobile/app.json +38 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/Assets/grid.png +0 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/icon.json +40 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-background.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-foreground.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/icon.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/splash-icon.png +0 -0
- package/dist/templates/default/apps/mobile/eslint.config.js +10 -0
- package/dist/templates/default/apps/mobile/package.json +43 -1
- package/dist/templates/default/apps/mobile/skills-lock.json +185 -0
- package/dist/templates/default/apps/mobile/src/app/_layout.tsx +5 -0
- package/dist/templates/default/apps/mobile/src/app/index.tsx +17 -0
- package/dist/templates/default/apps/mobile/tsconfig.json +20 -0
- package/dist/templates/default/apps/web/.agents/skills/frontend-design/SKILL.md +71 -0
- package/dist/templates/default/apps/web/.agents/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/templates/default/apps/web/.env.example +3 -0
- package/dist/templates/default/apps/web/components.json +23 -0
- package/dist/templates/default/apps/web/eslint.config.ts +21 -0
- package/dist/templates/default/apps/web/package.json +39 -1
- package/dist/templates/default/apps/web/public/disposabl-logo.svg +8 -0
- package/dist/templates/default/apps/web/public/favicon.ico +0 -0
- package/dist/templates/default/apps/web/public/manifest.json +25 -0
- package/dist/templates/default/apps/web/skills-lock.json +17 -0
- package/dist/templates/default/apps/web/src/index.css +92 -0
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +282 -0
- package/dist/templates/default/apps/web/src/router/__root.tsx +63 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +9 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +27 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +33 -0
- package/dist/templates/default/apps/web/src/router/index.tsx +15 -0
- package/dist/templates/default/apps/web/src/router.tsx +20 -0
- package/dist/templates/default/apps/web/tsconfig.json +33 -0
- package/dist/templates/default/apps/web/tsr.config.json +6 -0
- package/dist/templates/default/apps/web/vite.config.ts +67 -0
- package/dist/templates/default/bun.lock +3932 -0
- package/dist/templates/default/bunfig.toml +5 -0
- package/dist/templates/default/disposabl.json +5 -0
- package/dist/templates/default/gitignore +9 -1
- package/dist/templates/default/package.json +29 -4
- package/dist/templates/default/packages/backend/.agents/skills/convex/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-add/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-advisor/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-agent/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-auth/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-authz/SKILL.md +36 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-backup/SKILL.md +33 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-billing/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-cost/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/SKILL.md +325 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/assets/icon.svg +3 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/advanced-patterns.md +146 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/hybrid-components.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/local-components.md +39 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/packaged-components.md +54 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-crons/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-deploy-guard/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-design/SKILL.md +30 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-docs/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-domains/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-env/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-expert/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-explain-app/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-improve-convex-plugin/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-insights/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-launch-readiness/SKILL.md +35 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-migrate/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-migrate-rehearse/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-monitor/SKILL.md +22 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-optimize/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/assets/icon.svg +4 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-reviewer/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-seed/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-self-heal/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-sentinel/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-suggest/SKILL.md +27 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-test/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-verify/SKILL.md +34 -0
- package/dist/templates/default/packages/backend/.prettierignore +4 -0
- package/dist/templates/default/packages/backend/AGENTS.md +18 -0
- package/dist/templates/default/packages/backend/CLAUDE.md +13 -0
- package/dist/templates/default/packages/backend/README.md +25 -0
- package/dist/templates/default/packages/backend/convex/_generated/ai/ai-files.state.json +6 -0
- package/dist/templates/default/packages/backend/convex/_generated/ai/guidelines.md +286 -0
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +66 -0
- package/dist/templates/default/packages/backend/convex/_generated/api.js +23 -0
- package/dist/templates/default/packages/backend/convex/_generated/dataModel.d.ts +60 -0
- package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +164 -0
- package/dist/templates/default/packages/backend/convex/_generated/server.js +101 -0
- package/dist/templates/default/packages/backend/convex/auth.config.ts +14 -0
- package/dist/templates/default/packages/backend/convex/auth.ts +15 -0
- package/dist/templates/default/packages/backend/convex/convex.config.ts +30 -0
- package/dist/templates/default/packages/backend/convex/http.ts +5 -0
- package/dist/templates/default/packages/backend/convex/mcp.ts +8 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +10 -0
- package/dist/templates/default/packages/backend/convex/todos/index.ts +26 -0
- package/dist/templates/default/packages/backend/convex/todos/internal.ts +43 -0
- package/dist/templates/default/packages/backend/convex/tsconfig.json +27 -0
- package/dist/templates/default/packages/backend/convex/users.ts +20 -0
- package/dist/templates/default/packages/backend/eslint.config.mjs +62 -0
- package/dist/templates/default/packages/backend/package.json +36 -0
- package/dist/templates/default/packages/backend/skills-lock.json +203 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +77 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +185 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +75 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +22 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +207 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +106 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +121 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +127 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/button.tsx +57 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +241 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/card.tsx +102 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +239 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +368 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +27 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +243 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +300 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +194 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +271 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +156 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +4 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +224 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +269 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +103 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/field.tsx +236 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +50 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +158 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +83 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +201 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +26 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/label.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +70 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +284 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +128 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +91 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +64 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +170 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +133 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +82 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +330 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +35 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +49 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +201 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/separator.tsx +22 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +132 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +723 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +13 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/spinner.tsx +16 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +31 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +113 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +81 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +17 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +229 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +42 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +65 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +161 -0
- package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +21 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +89 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/return-to.ts +12 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/utils.ts +1 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +114 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +120 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/route.tsx +38 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +137 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +30 -0
- package/dist/templates/default/packages/disposabl-kit/client/styles/globals.css +60 -0
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +32 -0
- package/dist/templates/default/packages/disposabl-kit/components.json +23 -0
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +21 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +60 -0
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +86 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +40 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/platforms.ts +20 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/static-routes.ts +56 -0
- package/dist/templates/default/packages/disposabl-kit/tsconfig.json +17 -0
- package/dist/templates/default/patches/@convex-dev%2Fauth@2.0.0-beta.0.patch +310 -0
- package/dist/templates/default/patches/@convex-dev%2Fstatic-hosting@0.2.1.patch +187 -0
- package/dist/templates/default/tsconfig.json +9 -0
- package/dist/templates/default/turbo.json +51 -0
- package/package.json +1 -2
package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/SKILL.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-create-component
|
|
3
|
+
description:
|
|
4
|
+
Builds reusable Convex components with isolated tables and app-facing APIs.
|
|
5
|
+
Use for new components, reusable backend modules, integrations, or component
|
|
6
|
+
boundary work.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Convex Create Component
|
|
10
|
+
|
|
11
|
+
Create reusable Convex components with clear boundaries and a small app-facing
|
|
12
|
+
API.
|
|
13
|
+
|
|
14
|
+
## When to Use
|
|
15
|
+
|
|
16
|
+
- Creating a new Convex component in an existing app
|
|
17
|
+
- Extracting reusable backend logic into a component
|
|
18
|
+
- Building a third-party integration that should own its own tables and
|
|
19
|
+
workflows
|
|
20
|
+
- Packaging Convex functionality for reuse across multiple apps
|
|
21
|
+
|
|
22
|
+
## When Not to Use
|
|
23
|
+
|
|
24
|
+
- One-off business logic that belongs in the main app
|
|
25
|
+
- Thin utilities that do not need Convex tables or functions
|
|
26
|
+
- App-level orchestration that should stay in `convex/`
|
|
27
|
+
- Cases where a normal TypeScript library is enough
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
1. Ask the user what they are building and what the end goal is. If the repo
|
|
32
|
+
already makes the answer obvious, say so and confirm before proceeding.
|
|
33
|
+
2. Choose the shape using the decision tree below and read the matching
|
|
34
|
+
reference file.
|
|
35
|
+
3. Decide whether a component is justified. Prefer normal app code or a regular
|
|
36
|
+
library if the feature does not need isolated tables, backend functions, or
|
|
37
|
+
reusable persistent state.
|
|
38
|
+
4. Make a short plan for:
|
|
39
|
+
- what tables the component owns
|
|
40
|
+
- what public functions it exposes
|
|
41
|
+
- what data must be passed in from the app (auth, env vars, parent IDs)
|
|
42
|
+
- what stays in the app as wrappers or HTTP mounts
|
|
43
|
+
5. Create the component structure with `convex.config.ts`, `schema.ts`, and
|
|
44
|
+
function files.
|
|
45
|
+
6. Implement functions using the component's own `./_generated/server` imports,
|
|
46
|
+
not the app's generated files.
|
|
47
|
+
7. Wire the component into the app with `app.use(...)`. If the app does not
|
|
48
|
+
already have `convex/convex.config.ts`, create it.
|
|
49
|
+
8. Call the component from the app through `components.<name>` using
|
|
50
|
+
`ctx.runQuery`, `ctx.runMutation`, or `ctx.runAction`.
|
|
51
|
+
9. If React clients, HTTP callers, or public APIs need access, create wrapper
|
|
52
|
+
functions in the app instead of exposing component functions directly.
|
|
53
|
+
10. Run `npx convex dev` and fix codegen, type, or boundary issues before
|
|
54
|
+
finishing.
|
|
55
|
+
|
|
56
|
+
## Choose the Shape
|
|
57
|
+
|
|
58
|
+
Ask the user, then pick one path:
|
|
59
|
+
|
|
60
|
+
| Goal | Shape | Reference |
|
|
61
|
+
| ------------------------------------------------- | ---------------- | ----------------------------------- |
|
|
62
|
+
| Component for this app only | Local | `references/local-components.md` |
|
|
63
|
+
| Publish or share across apps | Packaged | `references/packaged-components.md` |
|
|
64
|
+
| User explicitly needs local + shared library code | Hybrid | `references/hybrid-components.md` |
|
|
65
|
+
| Not sure | Default to local | `references/local-components.md` |
|
|
66
|
+
|
|
67
|
+
Read exactly one reference file before proceeding.
|
|
68
|
+
|
|
69
|
+
## Default Approach
|
|
70
|
+
|
|
71
|
+
Unless the user explicitly wants an npm package, default to a local component:
|
|
72
|
+
|
|
73
|
+
- Put it under `convex/components/<componentName>/`
|
|
74
|
+
- Define it with `defineComponent(...)` in its own `convex.config.ts`
|
|
75
|
+
- Install it from the app's `convex/convex.config.ts` with `app.use(...)`
|
|
76
|
+
- Let `npx convex dev` generate the component's own `_generated/` files
|
|
77
|
+
|
|
78
|
+
## Component Skeleton
|
|
79
|
+
|
|
80
|
+
A minimal local component with a table and two functions, plus the app wiring.
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
// convex/components/notifications/convex.config.ts
|
|
84
|
+
import { defineComponent } from "convex/server";
|
|
85
|
+
|
|
86
|
+
export default defineComponent("notifications");
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
// convex/components/notifications/schema.ts
|
|
91
|
+
import { defineSchema, defineTable } from "convex/server";
|
|
92
|
+
import { v } from "convex/values";
|
|
93
|
+
|
|
94
|
+
export default defineSchema({
|
|
95
|
+
notifications: defineTable({
|
|
96
|
+
userId: v.string(),
|
|
97
|
+
message: v.string(),
|
|
98
|
+
read: v.boolean(),
|
|
99
|
+
}).index("by_user_read", ["userId", "read"]),
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// convex/components/notifications/lib.ts
|
|
105
|
+
import { v } from "convex/values";
|
|
106
|
+
import { mutation, query } from "./_generated/server.js";
|
|
107
|
+
|
|
108
|
+
export const send = mutation({
|
|
109
|
+
args: { userId: v.string(), message: v.string() },
|
|
110
|
+
returns: v.id("notifications"),
|
|
111
|
+
handler: async (ctx, args) => {
|
|
112
|
+
return await ctx.db.insert("notifications", {
|
|
113
|
+
userId: args.userId,
|
|
114
|
+
message: args.message,
|
|
115
|
+
read: false,
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export const listUnread = query({
|
|
121
|
+
args: { userId: v.string() },
|
|
122
|
+
returns: v.array(
|
|
123
|
+
v.object({
|
|
124
|
+
_id: v.id("notifications"),
|
|
125
|
+
_creationTime: v.number(),
|
|
126
|
+
userId: v.string(),
|
|
127
|
+
message: v.string(),
|
|
128
|
+
read: v.boolean(),
|
|
129
|
+
}),
|
|
130
|
+
),
|
|
131
|
+
handler: async (ctx, args) => {
|
|
132
|
+
return await ctx.db
|
|
133
|
+
.query("notifications")
|
|
134
|
+
.withIndex("by_user_read", (q) =>
|
|
135
|
+
q.eq("userId", args.userId).eq("read", false),
|
|
136
|
+
)
|
|
137
|
+
.collect();
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
// convex/convex.config.ts
|
|
144
|
+
import { defineApp } from "convex/server";
|
|
145
|
+
import notifications from "./components/notifications/convex.config.js";
|
|
146
|
+
|
|
147
|
+
const app = defineApp();
|
|
148
|
+
app.use(notifications);
|
|
149
|
+
|
|
150
|
+
export default app;
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
// convex/notifications.ts (app-side wrapper)
|
|
155
|
+
import { v } from "convex/values";
|
|
156
|
+
import { mutation, query } from "./_generated/server";
|
|
157
|
+
import { components } from "./_generated/api";
|
|
158
|
+
import { getAuthUserId } from "@convex-dev/auth/server";
|
|
159
|
+
|
|
160
|
+
export const sendNotification = mutation({
|
|
161
|
+
args: { message: v.string() },
|
|
162
|
+
returns: v.null(),
|
|
163
|
+
handler: async (ctx, args) => {
|
|
164
|
+
const userId = await getAuthUserId(ctx);
|
|
165
|
+
if (!userId) throw new Error("Not authenticated");
|
|
166
|
+
|
|
167
|
+
await ctx.runMutation(components.notifications.lib.send, {
|
|
168
|
+
userId,
|
|
169
|
+
message: args.message,
|
|
170
|
+
});
|
|
171
|
+
return null;
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const myUnread = query({
|
|
176
|
+
args: {},
|
|
177
|
+
handler: async (ctx) => {
|
|
178
|
+
const userId = await getAuthUserId(ctx);
|
|
179
|
+
if (!userId) throw new Error("Not authenticated");
|
|
180
|
+
|
|
181
|
+
return await ctx.runQuery(components.notifications.lib.listUnread, {
|
|
182
|
+
userId,
|
|
183
|
+
});
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Note the reference path shape: a function in
|
|
189
|
+
`convex/components/notifications/lib.ts` is called as
|
|
190
|
+
`components.notifications.lib.send` from the app.
|
|
191
|
+
|
|
192
|
+
## Critical Rules
|
|
193
|
+
|
|
194
|
+
- Keep authentication in the app, because `ctx.auth` is not available inside
|
|
195
|
+
components.
|
|
196
|
+
- Keep environment access in the app, because component functions cannot read
|
|
197
|
+
`process.env`.
|
|
198
|
+
- Pass parent app IDs across the boundary as strings, because `Id` types become
|
|
199
|
+
plain strings in the app-facing `ComponentApi`.
|
|
200
|
+
- Do not use `v.id("parentTable")` for app-owned tables inside component args or
|
|
201
|
+
schema, because the component has no access to the app's table namespace.
|
|
202
|
+
- Import `query`, `mutation`, and `action` from the component's own
|
|
203
|
+
`./_generated/server`, not the app's generated files.
|
|
204
|
+
- Do not expose component functions directly to clients. Create app wrappers
|
|
205
|
+
when client access is needed, because components are internal and need
|
|
206
|
+
auth/env wiring the app provides.
|
|
207
|
+
- If the component defines HTTP handlers, mount the routes in the app's
|
|
208
|
+
`convex/http.ts`, because components cannot register their own HTTP routes.
|
|
209
|
+
- If the component needs pagination, use `paginator` from `convex-helpers`
|
|
210
|
+
instead of built-in `.paginate()`, because `.paginate()` does not work across
|
|
211
|
+
the component boundary.
|
|
212
|
+
- Define indexes for queried fields instead of using Convex `.filter()` after a
|
|
213
|
+
database query.
|
|
214
|
+
- Add `args` and `returns` validators to all public component functions, because
|
|
215
|
+
the component boundary requires explicit type contracts.
|
|
216
|
+
|
|
217
|
+
## Patterns
|
|
218
|
+
|
|
219
|
+
### Authentication and environment access
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
// Bad: component code cannot rely on app auth or env
|
|
223
|
+
const identity = await ctx.auth.getUserIdentity();
|
|
224
|
+
const apiKey = process.env.OPENAI_API_KEY;
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
// Good: the app resolves auth and env, then passes explicit values
|
|
229
|
+
const userId = await getAuthUserId(ctx);
|
|
230
|
+
if (!userId) throw new Error("Not authenticated");
|
|
231
|
+
|
|
232
|
+
await ctx.runAction(components.translator.translate, {
|
|
233
|
+
userId,
|
|
234
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
235
|
+
text: args.text,
|
|
236
|
+
});
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Client-facing API
|
|
240
|
+
|
|
241
|
+
```ts
|
|
242
|
+
// Bad: assuming a component function is directly callable by clients
|
|
243
|
+
export const send = components.notifications.send;
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
// Good: re-export through an app mutation or query
|
|
248
|
+
export const sendNotification = mutation({
|
|
249
|
+
args: { message: v.string() },
|
|
250
|
+
returns: v.null(),
|
|
251
|
+
handler: async (ctx, args) => {
|
|
252
|
+
const userId = await getAuthUserId(ctx);
|
|
253
|
+
if (!userId) throw new Error("Not authenticated");
|
|
254
|
+
|
|
255
|
+
await ctx.runMutation(components.notifications.lib.send, {
|
|
256
|
+
userId,
|
|
257
|
+
message: args.message,
|
|
258
|
+
});
|
|
259
|
+
return null;
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### IDs across the boundary
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
// Bad: parent app table IDs are not valid component validators
|
|
268
|
+
args: {
|
|
269
|
+
userId: v.id("users"),
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
```ts
|
|
274
|
+
// Good: treat parent-owned IDs as strings at the boundary
|
|
275
|
+
args: {
|
|
276
|
+
userId: v.string(),
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Advanced Patterns
|
|
281
|
+
|
|
282
|
+
For additional patterns including function handles for callbacks, deriving
|
|
283
|
+
validators from schema, static configuration with a globals table, and
|
|
284
|
+
class-based client wrappers, see `references/advanced-patterns.md`.
|
|
285
|
+
|
|
286
|
+
## Validation
|
|
287
|
+
|
|
288
|
+
Try validation in this order:
|
|
289
|
+
|
|
290
|
+
1. `npx convex codegen --component-dir convex/components/<name>`
|
|
291
|
+
2. `npx convex codegen`
|
|
292
|
+
3. `npx convex dev`
|
|
293
|
+
|
|
294
|
+
Important:
|
|
295
|
+
|
|
296
|
+
- Fresh repos may fail these commands until `CONVEX_DEPLOYMENT` is configured.
|
|
297
|
+
- Until codegen runs, component-local `./_generated/*` imports and app-side
|
|
298
|
+
`components.<name>...` references will not typecheck.
|
|
299
|
+
- If validation blocks on Convex login or deployment setup, stop and ask the
|
|
300
|
+
user for that exact step instead of guessing.
|
|
301
|
+
|
|
302
|
+
## Reference Files
|
|
303
|
+
|
|
304
|
+
Read exactly one of these after the user confirms the goal:
|
|
305
|
+
|
|
306
|
+
- `references/local-components.md`
|
|
307
|
+
- `references/packaged-components.md`
|
|
308
|
+
- `references/hybrid-components.md`
|
|
309
|
+
|
|
310
|
+
Official docs:
|
|
311
|
+
[Authoring Components](https://docs.convex.dev/components/authoring)
|
|
312
|
+
|
|
313
|
+
## Checklist
|
|
314
|
+
|
|
315
|
+
- [ ] Asked the user what they want to build and confirmed the shape
|
|
316
|
+
- [ ] Read the matching reference file
|
|
317
|
+
- [ ] Confirmed a component is the right abstraction
|
|
318
|
+
- [ ] Planned tables, public API, boundaries, and app wrappers
|
|
319
|
+
- [ ] Component lives under `convex/components/<name>/` (or package layout if
|
|
320
|
+
publishing)
|
|
321
|
+
- [ ] Component imports from its own `./_generated/server`
|
|
322
|
+
- [ ] Auth, env access, and HTTP routes stay in the app
|
|
323
|
+
- [ ] Parent app IDs cross the boundary as `v.string()`
|
|
324
|
+
- [ ] Public functions have `args` and `returns` validators
|
|
325
|
+
- [ ] Ran `npx convex dev` and fixed codegen or type issues
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Convex Create Component"
|
|
3
|
+
short_description:
|
|
4
|
+
"Design and build reusable Convex components with clear boundaries."
|
|
5
|
+
icon_small: "./assets/icon.svg"
|
|
6
|
+
icon_large: "./assets/icon.svg"
|
|
7
|
+
brand_color: "#14B8A6"
|
|
8
|
+
default_prompt:
|
|
9
|
+
"Help me create a Convex component for this feature. First check that a
|
|
10
|
+
component is actually justified, then design the tables, API surface, and
|
|
11
|
+
app-facing wrappers before implementing it."
|
|
12
|
+
|
|
13
|
+
policy:
|
|
14
|
+
allow_implicit_invocation: true
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true" data-slot="icon">
|
|
2
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Advanced Component Patterns
|
|
2
|
+
|
|
3
|
+
Additional patterns for Convex components that go beyond the basics covered in
|
|
4
|
+
the main skill file.
|
|
5
|
+
|
|
6
|
+
## Function Handles for callbacks
|
|
7
|
+
|
|
8
|
+
When the app needs to pass a callback function to the component, use function
|
|
9
|
+
handles. This is common for components that run app-defined logic on a schedule
|
|
10
|
+
or in a workflow.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
// App side: create a handle and pass it to the component
|
|
14
|
+
import { createFunctionHandle } from "convex/server";
|
|
15
|
+
|
|
16
|
+
export const startJob = mutation({
|
|
17
|
+
handler: async (ctx) => {
|
|
18
|
+
const handle = await createFunctionHandle(internal.myModule.processItem);
|
|
19
|
+
await ctx.runMutation(components.workpool.enqueue, {
|
|
20
|
+
callback: handle,
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
// Component side: accept and invoke the handle
|
|
28
|
+
import { v } from "convex/values";
|
|
29
|
+
import type { FunctionHandle } from "convex/server";
|
|
30
|
+
import { mutation } from "./_generated/server.js";
|
|
31
|
+
|
|
32
|
+
export const enqueue = mutation({
|
|
33
|
+
args: { callback: v.string() },
|
|
34
|
+
handler: async (ctx, args) => {
|
|
35
|
+
const handle = args.callback as FunctionHandle<"mutation">;
|
|
36
|
+
await ctx.scheduler.runAfter(0, handle, {});
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Deriving validators from schema
|
|
42
|
+
|
|
43
|
+
Instead of manually repeating field types in return validators, extend the
|
|
44
|
+
schema validator:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
import { v } from "convex/values";
|
|
48
|
+
import schema from "./schema.js";
|
|
49
|
+
|
|
50
|
+
const vNotification = schema.doc("notifications").omit("userId").extend({
|
|
51
|
+
user: v.string(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const getNotification = internalQuery({
|
|
55
|
+
args: { id: schema.id("notifications") },
|
|
56
|
+
returns: v.nullable(vNotification),
|
|
57
|
+
handler: async (ctx) => {
|
|
58
|
+
const notification = await ctx.db.get("notifications", args.id);
|
|
59
|
+
if (!notification) return null;
|
|
60
|
+
const { userId, ...rest } = notification;
|
|
61
|
+
const user = await ctx.db.get("users", userId);
|
|
62
|
+
return {
|
|
63
|
+
...rest,
|
|
64
|
+
user: user?.name ?? "Unknown",
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Static configuration with a globals table
|
|
71
|
+
|
|
72
|
+
A common pattern for component configuration is a single-document "globals"
|
|
73
|
+
table:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
// schema.ts
|
|
77
|
+
export default defineSchema({
|
|
78
|
+
globals: defineTable({
|
|
79
|
+
maxRetries: v.number(),
|
|
80
|
+
webhookUrl: v.optional(v.string()),
|
|
81
|
+
}),
|
|
82
|
+
// ... other tables
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// lib.ts
|
|
88
|
+
export const configure = mutation({
|
|
89
|
+
args: { maxRetries: v.number(), webhookUrl: v.optional(v.string()) },
|
|
90
|
+
returns: v.null(),
|
|
91
|
+
handler: async (ctx, args) => {
|
|
92
|
+
const existing = await ctx.db.query("globals").first();
|
|
93
|
+
if (existing) {
|
|
94
|
+
await ctx.db.patch(existing._id, args);
|
|
95
|
+
} else {
|
|
96
|
+
await ctx.db.insert("globals", args);
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Class-based client wrappers
|
|
104
|
+
|
|
105
|
+
For components with many functions or configuration options, a class-based
|
|
106
|
+
client provides a cleaner API. This pattern is common in published components.
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
// src/client/index.ts
|
|
110
|
+
import type { GenericMutationCtx, GenericDataModel } from "convex/server";
|
|
111
|
+
import type { ComponentApi } from "../component/_generated/component.js";
|
|
112
|
+
|
|
113
|
+
type MutationCtx = Pick<GenericMutationCtx<GenericDataModel>, "runMutation">;
|
|
114
|
+
|
|
115
|
+
export class Notifications {
|
|
116
|
+
constructor(
|
|
117
|
+
private component: ComponentApi,
|
|
118
|
+
private options?: { defaultChannel?: string },
|
|
119
|
+
) {}
|
|
120
|
+
|
|
121
|
+
async send(ctx: MutationCtx, args: { userId: string; message: string }) {
|
|
122
|
+
return await ctx.runMutation(this.component.lib.send, {
|
|
123
|
+
...args,
|
|
124
|
+
channel: this.options?.defaultChannel ?? "default",
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
// App usage
|
|
132
|
+
import { Notifications } from "@convex-dev/notifications";
|
|
133
|
+
import { components } from "./_generated/api";
|
|
134
|
+
|
|
135
|
+
const notifications = new Notifications(components.notifications, {
|
|
136
|
+
defaultChannel: "alerts",
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export const send = mutation({
|
|
140
|
+
args: { message: v.string() },
|
|
141
|
+
handler: async (ctx, args) => {
|
|
142
|
+
const userId = await getAuthUserId(ctx);
|
|
143
|
+
await notifications.send(ctx, { userId, message: args.message });
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Hybrid Convex Components
|
|
2
|
+
|
|
3
|
+
Read this file only when the user explicitly wants a hybrid setup.
|
|
4
|
+
|
|
5
|
+
## What This Means
|
|
6
|
+
|
|
7
|
+
A hybrid component combines a local Convex component with shared library code.
|
|
8
|
+
|
|
9
|
+
This can help when:
|
|
10
|
+
|
|
11
|
+
- the user wants a local install but also shared package logic
|
|
12
|
+
- the component needs extension points or override hooks
|
|
13
|
+
- some logic should live in normal TypeScript code outside the component
|
|
14
|
+
boundary
|
|
15
|
+
|
|
16
|
+
## Default Advice
|
|
17
|
+
|
|
18
|
+
Treat hybrid as an advanced option, not the default.
|
|
19
|
+
|
|
20
|
+
Before choosing it, ask:
|
|
21
|
+
|
|
22
|
+
- Why is a plain local component not enough?
|
|
23
|
+
- Why is a packaged component not enough?
|
|
24
|
+
- What exactly needs to stay overridable or shared?
|
|
25
|
+
|
|
26
|
+
If the answer is vague, fall back to local or packaged.
|
|
27
|
+
|
|
28
|
+
## Risks
|
|
29
|
+
|
|
30
|
+
- More moving parts
|
|
31
|
+
- Harder upgrades and backwards compatibility
|
|
32
|
+
- Easier to blur the component boundary
|
|
33
|
+
|
|
34
|
+
## Checklist
|
|
35
|
+
|
|
36
|
+
- [ ] User explicitly needs hybrid behavior
|
|
37
|
+
- [ ] Local-only and packaged-only options were considered first
|
|
38
|
+
- [ ] The extension points are clearly defined before coding
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Local Convex Components
|
|
2
|
+
|
|
3
|
+
Read this file when the component should live inside the current app and does
|
|
4
|
+
not need to be published as an npm package.
|
|
5
|
+
|
|
6
|
+
## When to Choose This
|
|
7
|
+
|
|
8
|
+
- The user wants the simplest path
|
|
9
|
+
- The component only needs to work in this repo
|
|
10
|
+
- The goal is extracting app logic into a cleaner boundary
|
|
11
|
+
|
|
12
|
+
## Default Layout
|
|
13
|
+
|
|
14
|
+
Use this structure unless the repo already has a clear alternative pattern:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
convex/
|
|
18
|
+
convex.config.ts
|
|
19
|
+
components/
|
|
20
|
+
<name>/
|
|
21
|
+
convex.config.ts
|
|
22
|
+
schema.ts
|
|
23
|
+
<feature>.ts
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Workflow Notes
|
|
27
|
+
|
|
28
|
+
- Define the component with `defineComponent("<name>")`
|
|
29
|
+
- Install it from the app with `defineApp()` and `app.use(...)`
|
|
30
|
+
- Keep auth, env access, public API wrappers, and HTTP route mounting in the app
|
|
31
|
+
- Let the component own isolated tables and reusable backend workflows
|
|
32
|
+
- Add app wrappers if clients need to call into the component
|
|
33
|
+
|
|
34
|
+
## Checklist
|
|
35
|
+
|
|
36
|
+
- [ ] Component is inside `convex/components/<name>/`
|
|
37
|
+
- [ ] App installs it with `app.use(...)`
|
|
38
|
+
- [ ] Component owns only its own tables
|
|
39
|
+
- [ ] App wrappers handle client-facing calls when needed
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Packaged Convex Components
|
|
2
|
+
|
|
3
|
+
Read this file when the user wants a reusable npm package or a component shared
|
|
4
|
+
across multiple apps.
|
|
5
|
+
|
|
6
|
+
## When to Choose This
|
|
7
|
+
|
|
8
|
+
- The user wants to publish the component
|
|
9
|
+
- The user wants a stable reusable package boundary
|
|
10
|
+
- The component will be shared across multiple apps or teams
|
|
11
|
+
|
|
12
|
+
## Default Approach
|
|
13
|
+
|
|
14
|
+
- Prefer starting from `npx create-convex@latest --component` when possible
|
|
15
|
+
- Keep the official authoring docs as the source of truth for package layout and
|
|
16
|
+
exports
|
|
17
|
+
- Validate the bundled package through an example app, not just the source files
|
|
18
|
+
|
|
19
|
+
## Build Flow
|
|
20
|
+
|
|
21
|
+
When building a packaged component, make sure the bundled output exists before
|
|
22
|
+
the example app tries to consume it.
|
|
23
|
+
|
|
24
|
+
Recommended order:
|
|
25
|
+
|
|
26
|
+
1. `npx convex codegen --component-dir ./path/to/component`
|
|
27
|
+
2. Run the package build command
|
|
28
|
+
3. Run `npx convex dev --typecheck-components` in the example app
|
|
29
|
+
|
|
30
|
+
Do not assume normal app codegen is enough for packaged component workflows.
|
|
31
|
+
|
|
32
|
+
## Package Exports
|
|
33
|
+
|
|
34
|
+
If publishing to npm, make sure the package exposes the entry points apps need:
|
|
35
|
+
|
|
36
|
+
- package root for client helpers, types, or classes
|
|
37
|
+
- `./convex.config.js` for installing the component
|
|
38
|
+
- `./_generated/component.js` for the app-facing `ComponentApi` type
|
|
39
|
+
- `./test` for testing helpers when applicable
|
|
40
|
+
|
|
41
|
+
## Testing
|
|
42
|
+
|
|
43
|
+
- Use `convex-test` for component logic
|
|
44
|
+
- Register the component schema and modules with the test instance
|
|
45
|
+
- Test app-side wrapper code from an example app that installs the package
|
|
46
|
+
- Export a small helper from `./test` if consumers need easy test registration
|
|
47
|
+
|
|
48
|
+
## Checklist
|
|
49
|
+
|
|
50
|
+
- [ ] Packaging is actually required
|
|
51
|
+
- [ ] Build order avoids bundle and codegen races
|
|
52
|
+
- [ ] Package exports include install and typing entry points
|
|
53
|
+
- [ ] Example app exercises the packaged component
|
|
54
|
+
- [ ] Core behavior is covered by tests
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-crons
|
|
3
|
+
description: "Add recurring scheduled jobs (crons) to the Convex app."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED from convex-agents content/capabilities/crons.json — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Add scheduled jobs (crons)
|
|
9
|
+
|
|
10
|
+
Define recurring jobs in convex/crons.ts targeting internal functions, with sane intervals and idempotent handlers.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Create convex/crons.ts with cronJobs().
|
|
15
|
+
2. Schedule internal functions (never public api.*) at the right interval.
|
|
16
|
+
3. Make handlers idempotent (safe to re-run); keep each run small.
|
|
17
|
+
4. Verify the job appears in the dashboard schedule.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
- Schedule internal.* functions, never api.*.
|
|
22
|
+
- Keep cron handlers small + idempotent.
|
|
23
|
+
- Don't poll tight intervals for things a subscription can push.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-deploy-guard
|
|
3
|
+
description: "Classify + announce the target Convex deployment before any deployment-affecting command; fresh explicit consent for prod actions; session read-only mode."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED from convex-agents content/capabilities/deploy-guard.json — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Deployment target guard
|
|
9
|
+
|
|
10
|
+
Deployments are not interchangeable, and most incidents start with a command aimed at the wrong one. Every Convex project has several (personal dev, preview, prod — often across multiple projects on one machine). This guard is the standing discipline: identify, announce, then act — and treat prod as consent-gated, per action, per session.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. IDENTIFY before you act: read `CONVEX_DEPLOYMENT` in .env.local, `convex.json`, and whether `CONVEX_DEPLOY_KEY` is set; or call the official Convex MCP `status` tool. Classify the target: local-anonymous | dev | preview | prod. If two sources disagree, resolve before proceeding.
|
|
15
|
+
2. ANNOUNCE in one line before any deployment-affecting command: `target: dev (joyful-capybara-123, personal dev)`. Never run the command in the same breath as discovering the target — announce first.
|
|
16
|
+
3. PROD needs a FRESH explicit yes: before `npx convex deploy` (when it resolves to prod), `npx convex run --prod`, `env set` on prod, snapshot `import`/`export` on prod, or starting the MCP with prod access — state exactly what will change on which deployment and get an explicit yes in THIS session. A yes given earlier, or for a different target, does not carry.
|
|
17
|
+
4. MCP safety defaults: start the official MCP scoped non-prod (`--deployment dev`). The two prod flags are DIFFERENT risk levels — keep them split: a read-only prod audit (advisor/insights reading data/logs/insights) passes ONLY `--cautiously-allow-production-pii` (read tools); `--dangerously-enable-production-deployments` (which enables MUTATING prod tools) stays OFF unless the user explicitly asked to CHANGE prod this session. Never pair them by default — 'look at prod' must not silently grant 'mutate prod'.
|
|
18
|
+
5. READ-ONLY session mode: when the user says 'read-only' / 'don't change anything', honor it absolutely for the rest of the session — no deploy, no env set/remove, no mutations via `run`, no imports; start the MCP with `--disable-tools run,envSet,envRemove`.
|
|
19
|
+
6. Wrong-deployment diagnosis: when a deploy 'didn't change anything', do NOT re-deploy harder. Re-run step 1 — the deploy almost certainly landed on a different deployment than the one being observed.
|
|
20
|
+
7. Ambiguity = stop: if you cannot determine which deployment a command will hit, find out (status tool) — never guess.
|
|
21
|
+
|
|
22
|
+
## Rules
|
|
23
|
+
|
|
24
|
+
- Classify and announce the target BEFORE every deployment-affecting command — identification and action are two separate steps.
|
|
25
|
+
- Prod consent is per-action, per-target, per-session: state what changes where, get a fresh explicit yes.
|
|
26
|
+
- Keep the two prod MCP flags split by risk: --cautiously-allow-production-pii (read-only) for an audit; --dangerously-enable-production-deployments (mutating) only when the user explicitly asks to change prod. Both are user-spoken-only; default every MCP start to a non-prod deployment selector.
|
|
27
|
+
- Read-only mode, once requested, is absolute for the session — including 'harmless' mutations.
|
|
28
|
+
- A deploy that seemed to do nothing means the WRONG deployment changed — diagnose the target, don't re-run.
|
|
29
|
+
- This guard composes: ship, env, migrate, and seed run it as their step 0; it is not itself a deploy tool.
|