@donotdev/cli 0.1.0 → 0.1.42
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.md +1 -1
- package/README.md +0 -0
- package/dependencies-matrix.json +175 -72
- package/dist/bin/commands/agent-setup.js +936 -428
- package/dist/bin/commands/build.js +4363 -883
- package/dist/bin/commands/bump.js +1296 -780
- package/dist/bin/commands/cacheout.js +494 -363
- package/dist/bin/commands/coach.js +632 -431
- package/dist/bin/commands/create-app.js +1316 -799
- package/dist/bin/commands/create-project.js +1355 -827
- package/dist/bin/commands/db.js +26158 -18868
- package/dist/bin/commands/deploy.js +5983 -1971
- package/dist/bin/commands/dev.js +1223 -657
- package/dist/bin/commands/doctor.js +1100 -528
- package/dist/bin/commands/emu.js +1380 -757
- package/dist/bin/commands/format.js +494 -363
- package/dist/bin/commands/get-demo.js +1210 -715
- package/dist/bin/commands/make-admin.js +16073 -8700
- package/dist/bin/commands/preview.js +1227 -658
- package/dist/bin/commands/seed.js +26171 -18881
- package/dist/bin/commands/setup-cicd.js +1475 -880
- package/dist/bin/commands/setup.js +1574 -956
- package/dist/bin/commands/staging.js +5984 -1972
- package/dist/bin/commands/sync-secrets.js +1423 -676
- package/dist/bin/commands/type-check.js +976 -469
- package/dist/bin/commands/wai.js +499 -368
- package/dist/bin/dndev.js +43 -19
- package/dist/bin/donotdev.js +43 -19
- package/dist/index.js +6166 -2133
- package/guidelines/DEPENDENCIES.md +155 -0
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +2 -1
- package/templates/app-demo/.env.example +1 -1
- package/templates/app-demo/entities/Contact.ts.example +0 -0
- package/templates/app-demo/entities/ExampleEntity.ts.example +0 -0
- package/templates/app-demo/entities/demo.ts.example +0 -0
- package/templates/app-demo/index.html.example +0 -0
- package/templates/app-demo/public/apple-touch-icon.png.example +0 -0
- package/templates/app-demo/public/fonts/fonts.css.example +0 -0
- package/templates/app-demo/public/icon-192x192.png.example +0 -0
- package/templates/app-demo/public/icon-512x512.png.example +0 -0
- package/templates/app-demo/src/App.tsx.example +0 -0
- package/templates/app-demo/src/config/app.ts.example +0 -0
- package/templates/app-demo/src/entities/booking.ts.example +0 -0
- package/templates/app-demo/src/entities/onboarding.ts.example +0 -0
- package/templates/app-demo/src/entities/product.ts.example +0 -0
- package/templates/app-demo/src/entities/quote.ts.example +0 -0
- package/templates/app-demo/src/globals.css.example +0 -0
- package/templates/app-demo/src/main.tsx.example +0 -0
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/OnboardingPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/PricingPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +0 -0
- package/templates/app-demo/src/pages/components/componentConfig.ts.example +0 -0
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-demo/src/themes.css.example +27 -0
- package/templates/app-demo/tsconfig.json.example +0 -0
- package/templates/app-demo/vite.config.ts.example +0 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/App.tsx.example +0 -0
- package/templates/app-dndev/src/components/CockpitLayout.css.example +0 -0
- package/templates/app-dndev/src/components/CockpitLayout.tsx.example +0 -0
- package/templates/app-dndev/src/components/Kanban.css.example +0 -0
- package/templates/app-dndev/src/components/ModeToggle.tsx.example +0 -0
- package/templates/app-dndev/src/components/OverlaySlot.tsx.example +0 -0
- package/templates/app-dndev/src/components/TerminalPanel.css.example +0 -0
- package/templates/app-dndev/src/components/TerminalPanel.tsx.example +0 -0
- package/templates/app-dndev/src/components/markdown-prose.css.example +0 -0
- package/templates/app-dndev/src/components/phases/CaptainLog.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/ContextTabs.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/PhaseCard.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/PhaseDetail.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/ReviewPanel.tsx.example +0 -0
- package/templates/app-dndev/src/components/phases/phaseData.ts.example +0 -0
- package/templates/app-dndev/src/config/app.ts.example +0 -0
- package/templates/app-dndev/src/config/commands.ts.example +0 -0
- package/templates/app-dndev/src/config/legal.ts.example +0 -0
- package/templates/app-dndev/src/config/providers.ts.example +1 -1
- package/templates/app-dndev/src/globals.css.example +0 -0
- package/templates/app-dndev/src/hooks/useDndevFile.ts.example +0 -0
- package/templates/app-dndev/src/main.tsx.example +0 -0
- package/templates/app-dndev/src/pages/BoardPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/GrillPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/PhasesPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-dndev/src/stores/dndevStore.ts.example +0 -0
- package/templates/app-dndev/src/themes.css.example +26 -0
- package/templates/app-dndev/terminal-sidecar.cjs.example +0 -0
- package/templates/app-dndev/vite.config.ts.example +0 -0
- package/templates/app-expo/.env.example +0 -32
- package/templates/app-expo/.expo/README.md.example +0 -0
- package/templates/app-expo/.gitignore.example +0 -0
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/app/.gitkeep +0 -0
- package/templates/app-expo/app/_layout.tsx.example +0 -0
- package/templates/app-expo/app/form.tsx.example +0 -0
- package/templates/app-expo/app/index.tsx.example +0 -0
- package/templates/app-expo/app/list.tsx.example +0 -0
- package/templates/app-expo/app/profile.tsx.example +0 -0
- package/templates/app-expo/app/signin.tsx.example +0 -0
- package/templates/app-expo/app.json.example +0 -0
- package/templates/app-expo/assets/adaptive-icon.png +0 -0
- package/templates/app-expo/assets/favicon.png +0 -0
- package/templates/app-expo/assets/icon.png +0 -0
- package/templates/app-expo/assets/splash.png +0 -0
- package/templates/app-expo/babel.config.js.example +0 -0
- package/templates/app-expo/eas.json.example +0 -0
- package/templates/app-expo/expo-env.d.ts.example +0 -0
- package/templates/app-expo/metro.config.js.example +0 -0
- package/templates/app-expo/service-account-key.json.example +1 -1
- package/templates/app-expo/src/config/app.ts.example +0 -0
- package/templates/app-expo/src/config/providers.ts.example +1 -1
- package/templates/app-expo/tsconfig.json.example +0 -0
- package/templates/app-next/.env.example +0 -33
- package/templates/app-next/next.config.ts.example +0 -2
- package/templates/app-next/postcss.config.js.example +0 -0
- package/templates/app-next/service-account-key.json.example +0 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +0 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/app/not-found.tsx.example +0 -0
- package/templates/app-next/src/config/app.ts.example +0 -0
- package/templates/app-next/src/config/legal.ts.example +0 -0
- package/templates/app-next/src/config/providers.ts.example +1 -1
- package/templates/app-next/src/globals.css.example +0 -0
- package/templates/app-next/src/locales/dndev_en.json.example +0 -0
- package/templates/app-next/src/locales/home_en.json.example +6 -6
- package/templates/app-next/src/pages/HomePage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-next/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-next/src/pages/locales/example_en.json.example +0 -0
- package/templates/app-next/src/themes.css.example +28 -1
- package/templates/app-vite/.env.example +0 -33
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/service-account-key.json.example +0 -0
- package/templates/app-vite/src/App.tsx.example +0 -0
- package/templates/app-vite/src/config/app.ts.example +0 -0
- package/templates/app-vite/src/config/legal.ts.example +0 -0
- package/templates/app-vite/src/config/providers.ts.example +1 -1
- package/templates/app-vite/src/globals.css.example +0 -0
- package/templates/app-vite/src/locales/dndev_en.json.example +0 -0
- package/templates/app-vite/src/locales/home_en.json.example +6 -6
- package/templates/app-vite/src/main.tsx.example +0 -0
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +0 -0
- package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +0 -0
- package/templates/app-vite/src/pages/NotFoundPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/LegalNoticePage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/PrivacyPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/legal/TermsPage.tsx.example +0 -0
- package/templates/app-vite/src/pages/locales/example_en.json.example +0 -0
- package/templates/app-vite/src/themes.css.example +26 -0
- package/templates/deploy-config/.firebaserc.example +0 -0
- package/templates/deploy-config/firestore.indexes.json.example +0 -0
- package/templates/deploy-config/firestore.rules.example +0 -0
- package/templates/deploy-config/storage.rules.example +0 -0
- package/templates/deploy-config/tsconfig.functions.json.example +0 -0
- package/templates/deploy-config/vercel.json.example +2 -2
- package/templates/functions-firebase/.env.example +2 -2
- package/templates/functions-firebase/README.md.example +3 -3
- package/templates/functions-firebase/build.mjs.example +0 -0
- package/templates/functions-firebase/functions.config.js.example +0 -0
- package/templates/functions-firebase/functions.yaml.example +0 -0
- package/templates/functions-firebase/src/auth/getCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/auth/getUserAuthStatus.ts.example +0 -0
- package/templates/functions-firebase/src/auth/index.ts.example +0 -0
- package/templates/functions-firebase/src/auth/removeCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/auth/setCustomClaims.ts.example +0 -0
- package/templates/functions-firebase/src/billing/handleStripeWebhook.ts.example +0 -0
- package/templates/functions-firebase/src/billing/index.ts.example +0 -0
- package/templates/functions-firebase/src/billing/processPaymentSuccess.ts.example +0 -0
- package/templates/functions-firebase/src/billing/refreshSubscriptionStatus.ts.example +0 -0
- package/templates/functions-firebase/src/crud/createEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/deleteEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/getEntity.ts.example +0 -0
- package/templates/functions-firebase/src/crud/index.ts.example +0 -0
- package/templates/functions-firebase/src/crud/listEntities.ts.example +0 -0
- package/templates/functions-firebase/src/crud/updateEntity.ts.example +0 -0
- package/templates/functions-firebase/src/index.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/checkGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/disconnect.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/exchangeToken.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/getConnections.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/grantGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/index.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/refreshToken.ts.example +0 -0
- package/templates/functions-firebase/src/oauth/revokeGitHubAccess.ts.example +0 -0
- package/templates/functions-firebase/tsconfig.json.example +0 -0
- package/templates/functions-supabase/supabase/config.toml.example +0 -0
- package/templates/functions-supabase/supabase/functions/.env.example +0 -0
- package/templates/functions-supabase/supabase/functions/cancel-subscription/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/create-customer-portal/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/crud/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/delete-account/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/deno.json.example +0 -0
- package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/get-user-auth-status/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/refresh-subscription-status/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/remove-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/functions/set-custom-claims/index.ts.example +0 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000002_cleanup_jobs.sql +0 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000004_crud_bulk.sql +192 -0
- package/templates/functions-vercel/.env.example +3 -3
- package/templates/functions-vercel/README.md.example +2 -2
- package/templates/functions-vercel/build.mjs.example +0 -0
- package/templates/functions-vercel/src/api/auth/getCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/getUserAuthStatus.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/removeCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/auth/setCustomClaims.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/handleStripeWebhook.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/processPaymentSuccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/billing/refreshSubscriptionStatus.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/createEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/deleteEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/getEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/listEntities.ts.example +0 -0
- package/templates/functions-vercel/src/api/crud/updateEntity.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/checkGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/disconnect.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/exchangeToken.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/getConnections.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/grantGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/refreshToken.ts.example +0 -0
- package/templates/functions-vercel/src/api/oauth/revokeGitHubAccess.ts.example +0 -0
- package/templates/functions-vercel/tsconfig.json.example +0 -0
- package/templates/functions-vercel/vercel.json.example +0 -0
- package/templates/github-consumer/.github/workflows/ci.yml.example +0 -0
- package/templates/overlay-firebase/env.fragment.example +0 -0
- package/templates/overlay-firebase/env.fragment.expo.example +0 -0
- package/templates/overlay-firebase/env.fragment.nextjs.example +0 -0
- package/templates/overlay-firebase/src/config/providers.expo.ts.example +0 -0
- package/templates/overlay-firebase/src/config/providers.ts.example +0 -0
- package/templates/overlay-supabase/env.fragment.example +0 -0
- package/templates/overlay-supabase/env.fragment.expo.example +0 -0
- package/templates/overlay-supabase/env.fragment.nextjs.example +0 -0
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +1 -1
- package/templates/overlay-supabase/src/config/providers.ts.example +1 -1
- package/templates/overlay-vercel/env.fragment.example +0 -0
- package/templates/overlay-vercel/env.fragment.nextjs.example +0 -0
- package/templates/overlay-vercel/src/config/providers.ts.example +0 -0
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/EntityPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +0 -0
- package/templates/preset-landing/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/HomePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +0 -0
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +0 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +0 -0
- package/templates/root-consumer/.claude/agents/builder.md.example +0 -0
- package/templates/root-consumer/.claude/agents/coder.md.example +0 -0
- package/templates/root-consumer/.claude/agents/extractor.md.example +0 -0
- package/templates/root-consumer/.claude/agents/polisher.md.example +0 -0
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +0 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
- package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
- package/templates/root-consumer/.claude/rules/git.md.example +14 -0
- package/templates/root-consumer/.claude/rules/security.md.example +13 -0
- package/templates/root-consumer/.claude/settings.json.example +100 -4
- package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +0 -0
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +22 -27
- package/templates/root-consumer/.claude/skills/design/SKILL.md.example +0 -0
- package/templates/root-consumer/.claude/skills/design/output-template.md +0 -0
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/.claude/skills/techdebt/SKILL.md.example +0 -0
- package/templates/root-consumer/.cursor/mcp.json.example +0 -0
- package/templates/root-consumer/.cursor/rules/no-docs.mdc.example +5 -1
- package/templates/root-consumer/.dndev/args.json.example +0 -0
- package/templates/root-consumer/.dndev.secrets.example +0 -0
- package/templates/root-consumer/.env.example +0 -1
- package/templates/root-consumer/.gemini/settings.json.example +0 -0
- package/templates/root-consumer/.gitignore.example +1 -0
- package/templates/root-consumer/.mcp.json.example +0 -0
- package/templates/root-consumer/.prettierrc.cjs.example +0 -0
- package/templates/root-consumer/AGENTS.md.example +63 -0
- package/templates/root-consumer/CLAUDE.md.example +1 -1
- package/templates/root-consumer/README.md.example +11 -33
- package/templates/root-consumer/entities/index.ts.example +0 -0
- package/templates/root-consumer/eslint.config.js.example +0 -0
- package/templates/root-consumer/tsconfig.json.example +0 -0
- package/templates/app-demo/public/manifest.json.example +0 -10
- package/templates/app-dndev/public/manifest.json.example +0 -10
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -175
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -184
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
- package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
- package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
- package/templates/root-consumer/.claude/statusline.py.example +0 -79
- package/templates/root-consumer/.clinerules.example +0 -1
- package/templates/root-consumer/.cursorrules.example +0 -1
- package/templates/root-consumer/.github/copilot-instructions.md.example +0 -1
- package/templates/root-consumer/.windsurfrules.example +0 -1
- package/templates/root-consumer/AI.md.example +0 -108
- package/templates/root-consumer/CONVENTIONS.md.example +0 -1
- package/templates/root-consumer/GEMINI.md.example +0 -1
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +0 -135
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +0 -276
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
- package/templates/root-consumer/guides/dndev/INDEX.md.example +0 -60
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +0 -133
- package/templates/root-consumer/guides/dndev/SETUP_BILLING.md.example +0 -114
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +0 -231
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +0 -54
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +0 -60
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- package/templates/root-consumer/guides/dndev/SETUP_SOC2.md.example +0 -234
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +0 -62
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +0 -215
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
- package/templates/root-consumer/guides/dndev/advanced/APP_CHECK.md.example +0 -111
- package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +0 -252
- package/templates/root-consumer/guides/dndev/advanced/EMULATORS.md.example +0 -48
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +0 -402
- package/templates/root-consumer/guides/wai-way/agents/architect.md.example +0 -78
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +0 -97
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +0 -363
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +0 -133
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +0 -315
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +0 -133
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +0 -111
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +0 -150
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +0 -238
- package/templates/root-consumer/guides/wai-way/context_map.json.example +0 -127
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +0 -839
- package/templates/root-consumer/guides/wai-way/hld_template.md.example +0 -138
- package/templates/root-consumer/guides/wai-way/lld_template.md.example +0 -103
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +0 -722
- package/templates/root-consumer/guides/wai-way/prd_template.md.example +0 -140
- package/templates/root-consumer/guides/wai-way/presets_guide.md.example +0 -217
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +0 -313
package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql
CHANGED
|
@@ -15,6 +15,9 @@ CREATE TABLE IF NOT EXISTS operation_metrics (
|
|
|
15
15
|
error_message TEXT -- If status = 'failed'
|
|
16
16
|
);
|
|
17
17
|
|
|
18
|
+
-- Only service_role accesses this table; lock out anon/authenticated keys
|
|
19
|
+
ALTER TABLE operation_metrics ENABLE ROW LEVEL SECURITY;
|
|
20
|
+
|
|
18
21
|
-- Indexes for efficient queries
|
|
19
22
|
CREATE INDEX IF NOT EXISTS idx_metrics_operation ON operation_metrics(operation, timestamp DESC);
|
|
20
23
|
CREATE INDEX IF NOT EXISTS idx_metrics_user ON operation_metrics(user_id, timestamp DESC) WHERE user_id IS NOT NULL;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
-- Migration: Create crud_bulk RPC for atomic multi-op CRUD against one collection
|
|
2
|
+
-- Generated: 2026-02-19
|
|
3
|
+
-- Purpose: Backs the Supabase edge handler at packages/functions/src/supabase/crud/bulk.ts
|
|
4
|
+
-- Contract: one table per call, three ordered buckets (inserts, updates, deletes),
|
|
5
|
+
-- all-or-nothing via the implicit PL/pgSQL transaction.
|
|
6
|
+
|
|
7
|
+
-- Semantics (mirrors BULK_CRUD_TODO.md):
|
|
8
|
+
-- 1. Validate p_collection (length + quote_ident safety).
|
|
9
|
+
-- 2. Reject empty batches (defense in depth — handler short-circuits too).
|
|
10
|
+
-- 3. Inserts: use client-provided id if present, else gen_random_uuid().
|
|
11
|
+
-- 4. Updates: apply partial patch — only keys in patch are overwritten.
|
|
12
|
+
-- 5. Deletes: by id.
|
|
13
|
+
-- 6. Any failure raises — Postgres rolls the function back as a unit.
|
|
14
|
+
-- 7. Returns { inserted_ids, updated_ids, deleted_ids } in snake_case.
|
|
15
|
+
|
|
16
|
+
CREATE OR REPLACE FUNCTION crud_bulk(
|
|
17
|
+
p_collection TEXT,
|
|
18
|
+
p_inserts JSONB,
|
|
19
|
+
p_updates JSONB,
|
|
20
|
+
p_deletes JSONB
|
|
21
|
+
) RETURNS JSONB
|
|
22
|
+
LANGUAGE plpgsql
|
|
23
|
+
SECURITY DEFINER
|
|
24
|
+
SET search_path = public
|
|
25
|
+
AS $$
|
|
26
|
+
DECLARE
|
|
27
|
+
_inserted_ids TEXT[] := ARRAY[]::TEXT[];
|
|
28
|
+
_updated_ids TEXT[] := ARRAY[]::TEXT[];
|
|
29
|
+
_deleted_ids TEXT[] := ARRAY[]::TEXT[];
|
|
30
|
+
|
|
31
|
+
_insert_count INTEGER;
|
|
32
|
+
_update_count INTEGER;
|
|
33
|
+
_delete_count INTEGER;
|
|
34
|
+
|
|
35
|
+
_row JSONB;
|
|
36
|
+
_row_with_id JSONB;
|
|
37
|
+
_update_entry JSONB;
|
|
38
|
+
_patch JSONB;
|
|
39
|
+
_update_id TEXT;
|
|
40
|
+
_delete_id TEXT;
|
|
41
|
+
_inserted_id TEXT;
|
|
42
|
+
_updated_id TEXT;
|
|
43
|
+
_deleted_id TEXT;
|
|
44
|
+
|
|
45
|
+
_set_sql TEXT;
|
|
46
|
+
_patch_key TEXT;
|
|
47
|
+
_patch_value JSONB;
|
|
48
|
+
_first_key BOOLEAN;
|
|
49
|
+
BEGIN
|
|
50
|
+
-- 1. Collection name validation — length-bound and safe for quote_ident.
|
|
51
|
+
IF p_collection IS NULL OR length(p_collection) = 0 THEN
|
|
52
|
+
RAISE EXCEPTION 'crud_bulk: p_collection must be a non-empty text';
|
|
53
|
+
END IF;
|
|
54
|
+
IF length(p_collection) > 63 THEN
|
|
55
|
+
RAISE EXCEPTION 'crud_bulk: p_collection exceeds 63-char Postgres identifier limit';
|
|
56
|
+
END IF;
|
|
57
|
+
|
|
58
|
+
-- 2. Reject empty batches — handler already short-circuits, but we enforce
|
|
59
|
+
-- the same contract at the SQL boundary.
|
|
60
|
+
_insert_count := COALESCE(jsonb_array_length(p_inserts), 0);
|
|
61
|
+
_update_count := COALESCE(jsonb_array_length(p_updates), 0);
|
|
62
|
+
_delete_count := COALESCE(jsonb_array_length(p_deletes), 0);
|
|
63
|
+
|
|
64
|
+
IF _insert_count = 0 AND _update_count = 0 AND _delete_count = 0 THEN
|
|
65
|
+
RAISE EXCEPTION 'crud_bulk: at least one of p_inserts, p_updates, p_deletes must be non-empty';
|
|
66
|
+
END IF;
|
|
67
|
+
|
|
68
|
+
-- 3. Inserts — preserve input order. Client-generated ids win; otherwise
|
|
69
|
+
-- allocate a uuid. jsonb_populate_record handles type coercion against
|
|
70
|
+
-- the real table schema, so unknown keys are ignored and typed columns
|
|
71
|
+
-- are cast correctly.
|
|
72
|
+
IF _insert_count > 0 THEN
|
|
73
|
+
FOR _row IN SELECT value FROM jsonb_array_elements(p_inserts)
|
|
74
|
+
LOOP
|
|
75
|
+
IF _row ? 'id' AND jsonb_typeof(_row -> 'id') = 'string' THEN
|
|
76
|
+
_row_with_id := _row;
|
|
77
|
+
ELSE
|
|
78
|
+
_row_with_id := _row || jsonb_build_object('id', gen_random_uuid()::text);
|
|
79
|
+
END IF;
|
|
80
|
+
|
|
81
|
+
EXECUTE format(
|
|
82
|
+
'INSERT INTO %1$I SELECT * FROM jsonb_populate_record(NULL::%1$I, $1) RETURNING id',
|
|
83
|
+
p_collection
|
|
84
|
+
)
|
|
85
|
+
USING _row_with_id
|
|
86
|
+
INTO _inserted_id;
|
|
87
|
+
|
|
88
|
+
IF _inserted_id IS NULL THEN
|
|
89
|
+
RAISE EXCEPTION 'crud_bulk: insert into % returned no id', p_collection;
|
|
90
|
+
END IF;
|
|
91
|
+
|
|
92
|
+
_inserted_ids := _inserted_ids || _inserted_id;
|
|
93
|
+
END LOOP;
|
|
94
|
+
END IF;
|
|
95
|
+
|
|
96
|
+
-- 4. Updates — partial patches. We build a dynamic SET clause from the
|
|
97
|
+
-- patch keys so unspecified columns are untouched (jsonb_populate_record
|
|
98
|
+
-- would overwrite them with NULLs). Each patch key is quoted via
|
|
99
|
+
-- quote_ident; values are applied as jsonb with -> lookups inside the
|
|
100
|
+
-- generated SQL, binding the whole patch as a single $2 parameter.
|
|
101
|
+
IF _update_count > 0 THEN
|
|
102
|
+
FOR _update_entry IN SELECT value FROM jsonb_array_elements(p_updates)
|
|
103
|
+
LOOP
|
|
104
|
+
IF NOT (_update_entry ? 'id') OR jsonb_typeof(_update_entry -> 'id') <> 'string' THEN
|
|
105
|
+
RAISE EXCEPTION 'crud_bulk: each update entry must carry a string "id"';
|
|
106
|
+
END IF;
|
|
107
|
+
IF NOT (_update_entry ? 'patch') OR jsonb_typeof(_update_entry -> 'patch') <> 'object' THEN
|
|
108
|
+
RAISE EXCEPTION 'crud_bulk: each update entry must carry an object "patch"';
|
|
109
|
+
END IF;
|
|
110
|
+
|
|
111
|
+
_update_id := _update_entry ->> 'id';
|
|
112
|
+
_patch := _update_entry -> 'patch';
|
|
113
|
+
|
|
114
|
+
-- Empty patch is a no-op at the app layer; refuse it here too so a
|
|
115
|
+
-- caller mistake surfaces loudly instead of silently "succeeding".
|
|
116
|
+
IF (SELECT count(*) FROM jsonb_object_keys(_patch)) = 0 THEN
|
|
117
|
+
RAISE EXCEPTION 'crud_bulk: update patch for id=% is empty', _update_id;
|
|
118
|
+
END IF;
|
|
119
|
+
|
|
120
|
+
_set_sql := '';
|
|
121
|
+
_first_key := TRUE;
|
|
122
|
+
FOR _patch_key, _patch_value IN SELECT * FROM jsonb_each(_patch)
|
|
123
|
+
LOOP
|
|
124
|
+
IF NOT _first_key THEN
|
|
125
|
+
_set_sql := _set_sql || ', ';
|
|
126
|
+
END IF;
|
|
127
|
+
-- quote_ident keeps the column name safe; the value is bound via
|
|
128
|
+
-- $2 ->> 'key' so no user data is ever concatenated into SQL.
|
|
129
|
+
_set_sql := _set_sql
|
|
130
|
+
|| quote_ident(_patch_key)
|
|
131
|
+
|| ' = (jsonb_populate_record(NULL::'
|
|
132
|
+
|| quote_ident(p_collection)
|
|
133
|
+
|| ', $2)).'
|
|
134
|
+
|| quote_ident(_patch_key);
|
|
135
|
+
_first_key := FALSE;
|
|
136
|
+
END LOOP;
|
|
137
|
+
|
|
138
|
+
EXECUTE format(
|
|
139
|
+
'UPDATE %I SET %s WHERE id = $1 RETURNING id',
|
|
140
|
+
p_collection,
|
|
141
|
+
_set_sql
|
|
142
|
+
)
|
|
143
|
+
USING _update_id, _patch
|
|
144
|
+
INTO _updated_id;
|
|
145
|
+
|
|
146
|
+
IF _updated_id IS NULL THEN
|
|
147
|
+
RAISE EXCEPTION 'crud_bulk: update on % with id=% matched no row', p_collection, _update_id;
|
|
148
|
+
END IF;
|
|
149
|
+
|
|
150
|
+
_updated_ids := _updated_ids || _updated_id;
|
|
151
|
+
END LOOP;
|
|
152
|
+
END IF;
|
|
153
|
+
|
|
154
|
+
-- 5. Deletes — by id, preserve input order.
|
|
155
|
+
IF _delete_count > 0 THEN
|
|
156
|
+
FOR _delete_id IN SELECT value #>> '{}' FROM jsonb_array_elements(p_deletes)
|
|
157
|
+
LOOP
|
|
158
|
+
IF _delete_id IS NULL OR length(_delete_id) = 0 THEN
|
|
159
|
+
RAISE EXCEPTION 'crud_bulk: delete id must be a non-empty string';
|
|
160
|
+
END IF;
|
|
161
|
+
|
|
162
|
+
EXECUTE format(
|
|
163
|
+
'DELETE FROM %I WHERE id = $1 RETURNING id',
|
|
164
|
+
p_collection
|
|
165
|
+
)
|
|
166
|
+
USING _delete_id
|
|
167
|
+
INTO _deleted_id;
|
|
168
|
+
|
|
169
|
+
IF _deleted_id IS NULL THEN
|
|
170
|
+
RAISE EXCEPTION 'crud_bulk: delete on % with id=% matched no row', p_collection, _delete_id;
|
|
171
|
+
END IF;
|
|
172
|
+
|
|
173
|
+
_deleted_ids := _deleted_ids || _deleted_id;
|
|
174
|
+
END LOOP;
|
|
175
|
+
END IF;
|
|
176
|
+
|
|
177
|
+
-- 6. Snake_case response — handler normalises both cases but SQL-side
|
|
178
|
+
-- consumers see idiomatic keys.
|
|
179
|
+
RETURN jsonb_build_object(
|
|
180
|
+
'inserted_ids', to_jsonb(_inserted_ids),
|
|
181
|
+
'updated_ids', to_jsonb(_updated_ids),
|
|
182
|
+
'deleted_ids', to_jsonb(_deleted_ids)
|
|
183
|
+
);
|
|
184
|
+
END;
|
|
185
|
+
$$;
|
|
186
|
+
|
|
187
|
+
-- Service-role only — edge handlers enforce auth + ACL before invoking.
|
|
188
|
+
REVOKE EXECUTE ON FUNCTION crud_bulk(TEXT, JSONB, JSONB, JSONB) FROM PUBLIC;
|
|
189
|
+
REVOKE EXECUTE ON FUNCTION crud_bulk(TEXT, JSONB, JSONB, JSONB) FROM anon, authenticated;
|
|
190
|
+
GRANT EXECUTE ON FUNCTION crud_bulk(TEXT, JSONB, JSONB, JSONB) TO service_role;
|
|
191
|
+
|
|
192
|
+
COMMENT ON FUNCTION crud_bulk(TEXT, JSONB, JSONB, JSONB) IS 'Atomic bulk CRUD for one collection. Service-role only — edge handlers enforce auth + ACL before invoking.';
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
# Stripe Configuration
|
|
8
8
|
# =============================================================================
|
|
9
9
|
# Stripe Secret Key (server-side only)
|
|
10
|
-
STRIPE_SECRET_KEY
|
|
10
|
+
STRIPE_SECRET_KEY=<stripe_secret_key>
|
|
11
11
|
|
|
12
12
|
# Stripe Webhook Secret (for webhook signature verification)
|
|
13
|
-
STRIPE_WEBHOOK_SECRET
|
|
13
|
+
STRIPE_WEBHOOK_SECRET=<stripe_webhook_secret>
|
|
14
14
|
|
|
15
15
|
# =============================================================================
|
|
16
16
|
# GitHub Configuration
|
|
17
17
|
# =============================================================================
|
|
18
18
|
# GitHub Personal Access Token (for repository access management)
|
|
19
19
|
# Required scopes: repo (full control of private repositories)
|
|
20
|
-
GITHUB_PERSONAL_ACCESS_TOKEN
|
|
20
|
+
GITHUB_PERSONAL_ACCESS_TOKEN=<github_personal_access_token>
|
|
21
21
|
|
|
22
22
|
# GitHub Repository Configuration
|
|
23
23
|
GITHUB_REPO_OWNER=your-org
|
|
@@ -40,11 +40,11 @@ functions/
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
# Stripe Configuration
|
|
43
|
-
STRIPE_SECRET_KEY
|
|
43
|
+
STRIPE_SECRET_KEY=<stripe_secret_key>
|
|
44
44
|
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
45
45
|
|
|
46
46
|
# GitHub Configuration
|
|
47
|
-
GITHUB_PERSONAL_ACCESS_TOKEN
|
|
47
|
+
GITHUB_PERSONAL_ACCESS_TOKEN=<github_personal_access_token>
|
|
48
48
|
GITHUB_REPO_OWNER=your-org
|
|
49
49
|
GITHUB_REPO_NAME=your-repo
|
|
50
50
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -30,7 +30,7 @@ if (!url || !publicKey) {
|
|
|
30
30
|
configureProviders({
|
|
31
31
|
crud: new SupabaseCrudAdapter(supabase),
|
|
32
32
|
auth: new SupabaseAuth(supabase),
|
|
33
|
-
storage: new SupabaseStorageAdapter(supabase),
|
|
33
|
+
storage: new SupabaseStorageAdapter(supabase, 'uploads'),
|
|
34
34
|
callable: new SupabaseCallableProvider(supabase),
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -28,7 +28,7 @@ if (!url || !publicKey) {
|
|
|
28
28
|
configureProviders({
|
|
29
29
|
crud: new SupabaseCrudAdapter(supabase),
|
|
30
30
|
auth: new SupabaseAuth(supabase),
|
|
31
|
-
storage: new SupabaseStorageAdapter(supabase),
|
|
31
|
+
storage: new SupabaseStorageAdapter(supabase, 'uploads'),
|
|
32
32
|
callable: new SupabaseCallableProvider(supabase),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/guard-bash.sh
|
|
3
|
+
# PreToolUse hook for Bash commands.
|
|
4
|
+
# Blocks dangerous/wrong commands. Exit 2 = block, exit 0 = allow.
|
|
5
|
+
# Uses bun -e for JSON parsing (bun-first project).
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
INPUT=$(cat)
|
|
10
|
+
COMMAND=$(echo "$INPUT" | bun -e "process.stdout.write(JSON.parse(await Bun.stdin.text()).tool_input?.command ?? '')")
|
|
11
|
+
[ -z "$COMMAND" ] && exit 0
|
|
12
|
+
|
|
13
|
+
# --- HARD BLOCKS (exit 2) ---
|
|
14
|
+
|
|
15
|
+
# Block raw TypeScript compiler (must use dndev tc)
|
|
16
|
+
if echo "$COMMAND" | grep -qE '(^|\s|;|&&|\|)(bunx|npx|pnpx)\s+tsc(\s|$)'; then
|
|
17
|
+
echo "BLOCKED: Use 'dndev tc' for type-checking, never bunx/npx tsc." >&2
|
|
18
|
+
exit 2
|
|
19
|
+
fi
|
|
20
|
+
if echo "$COMMAND" | grep -qE '(^|\s|;|&&|\|)tsc(\s|$)'; then
|
|
21
|
+
echo "BLOCKED: Use 'dndev tc' for type-checking, never raw tsc." >&2
|
|
22
|
+
exit 2
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
# Block full reinstall (deps are managed by the workspace)
|
|
26
|
+
# bun add IS allowed — consumer projects may need additional packages
|
|
27
|
+
if echo "$COMMAND" | grep -qE '(^|\s|;|&&|\|)(bun|npm|yarn|pnpm)\s+install(\s|$)'; then
|
|
28
|
+
echo "BLOCKED: Use 'bun add <pkg>' to add specific packages. Full reinstall is not needed." >&2
|
|
29
|
+
exit 2
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
# Block force push
|
|
33
|
+
if echo "$COMMAND" | grep -qE 'git\s+push\s.*(-f|--force)'; then
|
|
34
|
+
echo "BLOCKED: Force push is forbidden. Push normally or resolve conflicts." >&2
|
|
35
|
+
exit 2
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Block destructive git operations
|
|
39
|
+
if echo "$COMMAND" | grep -qE 'git\s+reset\s+--hard'; then
|
|
40
|
+
echo "BLOCKED: git reset --hard destroys work. Use git stash or git checkout <file> instead." >&2
|
|
41
|
+
exit 2
|
|
42
|
+
fi
|
|
43
|
+
if echo "$COMMAND" | grep -qE 'git\s+clean\s+-f'; then
|
|
44
|
+
echo "BLOCKED: git clean -f destroys untracked files. Review them manually first." >&2
|
|
45
|
+
exit 2
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# Block rm -rf on project-critical paths
|
|
49
|
+
if echo "$COMMAND" | grep -qE 'rm\s+-rf\s+(/|\.|\*|src|apps|packages|node_modules)'; then
|
|
50
|
+
echo "BLOCKED: Destructive rm -rf on critical path. Be specific about what to remove." >&2
|
|
51
|
+
exit 2
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
# Block skip hooks
|
|
55
|
+
if echo "$COMMAND" | grep -qE '--no-verify'; then
|
|
56
|
+
echo "BLOCKED: --no-verify skips safety hooks. Fix the root cause instead." >&2
|
|
57
|
+
exit 2
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# --- ALLOW ---
|
|
61
|
+
exit 0
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/guard-write.sh
|
|
3
|
+
# Minimal PreToolUse:Edit|Write guard.
|
|
4
|
+
# Protects secrets and sensitive files by default.
|
|
5
|
+
# Cross-platform: bun-first, TMPDIR-safe.
|
|
6
|
+
|
|
7
|
+
set -eo pipefail
|
|
8
|
+
|
|
9
|
+
INPUT=$(cat)
|
|
10
|
+
|
|
11
|
+
RESULT=$(echo "$INPUT" | bun -e "
|
|
12
|
+
const input = JSON.parse(await Bun.stdin.text());
|
|
13
|
+
const fp = input.tool_input?.file_path ?? '';
|
|
14
|
+
const tn = input.tool_name ?? '';
|
|
15
|
+
const bn = fp.split('/').pop() ?? '';
|
|
16
|
+
let content = '';
|
|
17
|
+
if (tn === 'Edit') content = input.tool_input?.new_string ?? '';
|
|
18
|
+
else if (tn === 'Write') content = input.tool_input?.content ?? '';
|
|
19
|
+
|
|
20
|
+
const checks = [];
|
|
21
|
+
|
|
22
|
+
// --- FILE GUARD (fail closed) ---
|
|
23
|
+
if (/^(bun\.lock|bun\.lockb|package-lock\.json|yarn\.lock|pnpm-lock\.yaml)$/.test(bn))
|
|
24
|
+
checks.push('BLOCK:Lock files are auto-generated');
|
|
25
|
+
if (/^(\.env|\.env\.local|\.env\.production|\.dndev\.secrets)$/.test(bn))
|
|
26
|
+
checks.push('BLOCK:Env files may contain secrets');
|
|
27
|
+
|
|
28
|
+
// --- SECRET SCAN (fail CLOSED) ---
|
|
29
|
+
try {
|
|
30
|
+
if (content && !/\.sh$|\.sh\.example$|guard-/.test(fp)) {
|
|
31
|
+
const v = [];
|
|
32
|
+
if (/(AKIA|ASIA)[A-Z0-9]{16}/.test(content)) v.push('AWS key');
|
|
33
|
+
if (/gh[pousr]_[A-Za-z0-9_]{36,}/.test(content)) v.push('GitHub token');
|
|
34
|
+
if (/-----BEGIN.*PRIVATE KEY-----/.test(content)) v.push('Private key');
|
|
35
|
+
if (/eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/.test(content)
|
|
36
|
+
&& !/test|fixture|mock|\.d\.ts/.test(fp)) v.push('JWT');
|
|
37
|
+
if (/(password|secret|api[_-]?key|token|credential)\s*[:=]\s*[\"'][A-Za-z0-9+\/=_-]{20,}/i.test(content)
|
|
38
|
+
&& !/(password|secret|api[_-]?key|token|credential)\s*[:=]\s*[\"'](your-|example-|replace-|xxx|process\.env)/i.test(content))
|
|
39
|
+
v.push('Secret assignment');
|
|
40
|
+
if (v.length) checks.push('BLOCK:Secret detected: ' + v.join(', '));
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
checks.push('BLOCK:Secret scan error: ' + e.message);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const block = checks.find(c => c.startsWith('BLOCK:'));
|
|
47
|
+
process.stdout.write(block ?? 'OK');
|
|
48
|
+
" 2>/dev/null || echo "OK")
|
|
49
|
+
|
|
50
|
+
case "$RESULT" in
|
|
51
|
+
OK) exit 0 ;;
|
|
52
|
+
BLOCK:*)
|
|
53
|
+
echo "BLOCKED: ${RESULT#BLOCK:}" >&2
|
|
54
|
+
exit 2 ;;
|
|
55
|
+
*) exit 0 ;;
|
|
56
|
+
esac
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/session-start.sh
|
|
3
|
+
# Injects context at session start so the agent doesn't fly blind.
|
|
4
|
+
# Cross-platform: bun-first, no grep -P.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
echo "=== SESSION CONTEXT ==="
|
|
9
|
+
|
|
10
|
+
# Git branch
|
|
11
|
+
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
|
|
12
|
+
echo "Branch: $BRANCH"
|
|
13
|
+
|
|
14
|
+
# Dirty files count
|
|
15
|
+
DIRTY=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
16
|
+
if [ "$DIRTY" -gt 0 ]; then
|
|
17
|
+
echo "Dirty files: $DIRTY"
|
|
18
|
+
git status --porcelain 2>/dev/null | head -10
|
|
19
|
+
[ "$DIRTY" -gt 10 ] && echo " ... and $((DIRTY - 10)) more"
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# WAI-WAY phase status (if dndev is available)
|
|
23
|
+
if command -v dndev &>/dev/null; then
|
|
24
|
+
PHASE_FILE=".dndev/implementation.md"
|
|
25
|
+
if [ -f "$PHASE_FILE" ]; then
|
|
26
|
+
CURRENT=$(bun -e "
|
|
27
|
+
const text = await Bun.file('$PHASE_FILE').text();
|
|
28
|
+
const m = text.match(/Current Phase:\\s*(.+)/);
|
|
29
|
+
process.stdout.write(m ? m[1].trim() : 'none');
|
|
30
|
+
" 2>/dev/null || echo "none")
|
|
31
|
+
echo "WAI-WAY Phase: $CURRENT"
|
|
32
|
+
else
|
|
33
|
+
echo "WAI-WAY Phase: not started - call start_phase(0)"
|
|
34
|
+
fi
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Recent lessons (last 3)
|
|
38
|
+
LESSONS_FILE=".dndev/LESSONS.md"
|
|
39
|
+
if [ -f "$LESSONS_FILE" ]; then
|
|
40
|
+
LESSON_COUNT=$(grep -c '^## ' "$LESSONS_FILE" 2>/dev/null || echo "0")
|
|
41
|
+
if [ "$LESSON_COUNT" -gt 0 ]; then
|
|
42
|
+
echo ""
|
|
43
|
+
echo "Recent lessons ($LESSON_COUNT total):"
|
|
44
|
+
grep '^## ' "$LESSONS_FILE" | tail -3 | sed 's/^/ /'
|
|
45
|
+
fi
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo ""
|
|
49
|
+
echo "REMINDER: Root instructions are in AGENTS.md. Use lookup_symbol before @donotdev imports."
|
|
50
|
+
echo "=== END CONTEXT ==="
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# .claude/hooks/typecheck-stop.sh
|
|
3
|
+
# Stop hook: run dndev tc before declaring done.
|
|
4
|
+
# Ensures type safety before any work is considered complete.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
# Only run if there are uncommitted changes (something was written)
|
|
9
|
+
DIRTY=$(git status --porcelain 2>/dev/null | wc -l | tr -d ' ')
|
|
10
|
+
[ "$DIRTY" -eq 0 ] && exit 0
|
|
11
|
+
|
|
12
|
+
echo "Running typecheck before completion..." >&2
|
|
13
|
+
if ! dndev tc 2>&1; then
|
|
14
|
+
echo '{"decision":"block","reason":"Typecheck failed. Fix type errors before completing."}'
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
exit 0
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Consumer-facing communication rules - never expose internals"
|
|
3
|
+
globs: "**"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Consumer UX Rules
|
|
7
|
+
|
|
8
|
+
The user paid for a product that works. They are NOT a framework developer.
|
|
9
|
+
|
|
10
|
+
## Never expose internals
|
|
11
|
+
|
|
12
|
+
- Never mention: WAI-WAY, MCP, phases, skills, hook names, guard scripts, agent-scope
|
|
13
|
+
- Never say: "I'm invoking /build" or "the MCP server returned..." or "Phase 2 complete"
|
|
14
|
+
- Never show: hook output, compliance check results, internal error messages
|
|
15
|
+
- If automated tooling blocks an edit: fix it silently. The user sees the result, not the process.
|
|
16
|
+
|
|
17
|
+
## Communication style
|
|
18
|
+
|
|
19
|
+
- Speak in terms of what's being built: "Adding the dashboard page" not "Starting Phase 3 COMPOSE"
|
|
20
|
+
- Explain errors in plain terms: "The form needs a submit handler" not "EntityFormRenderer requires onSubmit prop per lookup_symbol"
|
|
21
|
+
- Show progress as features: "Contact form is done, working on the settings page next"
|
|
22
|
+
- When asked "what are you doing?": describe the feature, not the toolchain
|
|
23
|
+
|
|
24
|
+
## Skill routing (invisible to user)
|
|
25
|
+
|
|
26
|
+
Detect user intent and invoke the right skill without mentioning it:
|
|
27
|
+
- "I want to build X" / "add a page for Y" → use the build workflow
|
|
28
|
+
- "This is broken" / "X doesn't work" → investigate and fix
|
|
29
|
+
- "Review the code" / "is this ready?" → run quality checks
|
|
30
|
+
- "What should I build?" / brainstorming language → requirements extraction
|
|
31
|
+
|
|
32
|
+
The user never types a slash command. You pick the right approach.
|