@donotdev/cli 0.0.14 → 0.0.16
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/dependencies-matrix.json +372 -88
- package/dist/bin/commands/agent-setup.js +7 -1
- package/dist/bin/commands/build.js +141 -44
- package/dist/bin/commands/bump.js +81 -41
- package/dist/bin/commands/cacheout.js +37 -9
- package/dist/bin/commands/create-app.js +276 -121
- package/dist/bin/commands/create-project.js +506 -217
- package/dist/bin/commands/deploy.js +1785 -694
- package/dist/bin/commands/dev.js +177 -43
- package/dist/bin/commands/doctor.d.ts +6 -0
- package/dist/bin/commands/doctor.d.ts.map +1 -0
- package/dist/bin/commands/{lint.js → doctor.js} +1215 -156
- package/dist/bin/commands/doctor.js.map +1 -0
- package/dist/bin/commands/emu.js +451 -104
- package/dist/bin/commands/format.js +37 -9
- package/dist/bin/commands/make-admin.js +77499 -11
- package/dist/bin/commands/preview.js +181 -43
- package/dist/bin/commands/setup.d.ts +6 -0
- package/dist/bin/commands/setup.d.ts.map +1 -0
- package/dist/bin/commands/setup.js +11733 -0
- package/dist/bin/commands/setup.js.map +1 -0
- package/dist/bin/commands/supabase-setup.d.ts +6 -0
- package/dist/bin/commands/supabase-setup.d.ts.map +1 -0
- package/dist/bin/commands/supabase-setup.js +7 -0
- package/dist/bin/commands/supabase-setup.js.map +1 -0
- package/dist/bin/commands/sync-secrets.js +211 -34
- package/dist/bin/commands/type-check.d.ts +14 -0
- package/dist/bin/commands/type-check.d.ts.map +1 -0
- package/dist/bin/commands/type-check.js +2049 -0
- package/dist/bin/commands/type-check.js.map +1 -0
- package/dist/bin/commands/wai.js +3 -1
- package/dist/bin/dndev.js +73 -52
- package/dist/bin/donotdev.js +54 -45
- package/dist/index.js +4212 -3050
- package/package.json +3 -3
- package/templates/app-demo/src/App.tsx.example +1 -0
- package/templates/app-demo/src/pages/FullPage.tsx.example +2 -2
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +2 -2
- package/templates/app-demo/src/themes.css.example +5 -12
- package/templates/app-expo/.env.example +44 -0
- package/templates/app-expo/.expo/README.md.example +5 -0
- package/templates/app-expo/.gitignore.example +36 -0
- package/templates/app-expo/README.md.example +58 -0
- package/templates/app-expo/app/.gitkeep +2 -0
- package/templates/app-expo/app/_layout.tsx.example +41 -0
- package/templates/app-expo/app/form.tsx.example +52 -0
- package/templates/app-expo/app/index.tsx.example +89 -0
- package/templates/app-expo/app/list.tsx.example +32 -0
- package/templates/app-expo/app/profile.tsx.example +76 -0
- package/templates/app-expo/app/signin.tsx.example +53 -0
- package/templates/app-expo/app.json.example +39 -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 +10 -0
- package/templates/app-expo/eas.json.example +20 -0
- package/templates/app-expo/expo-env.d.ts.example +4 -0
- package/templates/app-expo/metro.config.js.example +20 -0
- package/templates/app-expo/service-account-key.json.example +12 -0
- package/templates/app-expo/src/config/app.ts.example +46 -0
- package/templates/app-expo/src/config/providers.ts.example +7 -0
- package/templates/app-expo/tsconfig.json.example +19 -0
- package/templates/app-next/.env.example +4 -33
- package/templates/app-next/src/app/ClientLayout.tsx.example +2 -0
- package/templates/app-next/src/app/layout.tsx.example +7 -6
- package/templates/app-next/src/config/providers.ts.example +7 -0
- package/templates/app-next/src/globals.css.example +2 -11
- package/templates/app-next/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-next/src/themes.css.example +10 -13
- package/templates/app-vite/.env.example +3 -32
- package/templates/app-vite/index.html.example +2 -24
- package/templates/app-vite/src/App.tsx.example +2 -0
- package/templates/app-vite/src/config/providers.ts.example +7 -0
- package/templates/app-vite/src/globals.css.example +2 -12
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +1 -2
- package/templates/app-vite/src/pages/HomePage.tsx.example +2 -2
- package/templates/app-vite/src/themes.css.example +109 -79
- package/templates/app-vite/vercel.json.example +11 -0
- package/templates/functions-firebase/README.md.example +1 -1
- package/templates/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/.env.example.example +24 -26
- package/templates/functions-firebase/functions-firebase/README.md.example +1 -1
- package/templates/functions-firebase/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
- package/templates/functions-firebase/functions.config.js.example +1 -1
- package/templates/functions-supabase/supabase/config.toml.example +59 -0
- package/templates/functions-supabase/supabase/functions/.env.example +13 -0
- package/templates/functions-supabase/supabase/functions/cancel-subscription/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-customer-portal/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/crud/index.ts.example +16 -0
- package/templates/functions-supabase/supabase/functions/delete-account/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/deno.json.example +8 -0
- package/templates/functions-supabase/supabase/functions/get-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-user-auth-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-subscription-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/remove-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/set-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +24 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +22 -0
- package/templates/functions-supabase/supabase/migrations/20250101000002_cleanup_jobs.sql +28 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +28 -0
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +1 -1
- package/templates/functions-vercel/functions-vercel/vercel.json.example +1 -1
- package/templates/functions-vercel/vercel.json.example +1 -1
- package/templates/github/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/overlay-firebase/env.fragment.example +34 -0
- package/templates/overlay-firebase/env.fragment.expo.example +34 -0
- package/templates/overlay-firebase/env.fragment.nextjs.example +34 -0
- package/templates/overlay-firebase/src/config/providers.expo.ts.example +49 -0
- package/templates/overlay-firebase/src/config/providers.ts.example +23 -0
- package/templates/overlay-supabase/env.fragment.example +12 -0
- package/templates/overlay-supabase/env.fragment.expo.example +12 -0
- package/templates/overlay-supabase/env.fragment.nextjs.example +12 -0
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +35 -0
- package/templates/overlay-supabase/src/config/providers.ts.example +33 -0
- package/templates/overlay-supabase/vercel.headers.example +23 -0
- package/templates/overlay-supabase/vercel.json.example +22 -0
- package/templates/overlay-vercel/env.fragment.example +34 -0
- package/templates/overlay-vercel/env.fragment.nextjs.example +34 -0
- package/templates/overlay-vercel/src/config/providers.ts.example +24 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +2 -310
- package/templates/root-consumer/.claude/agents/builder.md.example +2 -326
- package/templates/root-consumer/.claude/agents/coder.md.example +2 -83
- package/templates/root-consumer/.claude/agents/extractor.md.example +2 -231
- package/templates/root-consumer/.claude/agents/polisher.md.example +2 -132
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +2 -81
- package/templates/root-consumer/.claude/commands/grill.md.example +30 -0
- package/templates/root-consumer/.claude/commands/techdebt.md.example +28 -0
- package/templates/root-consumer/.clinerules.example +1 -0
- package/templates/root-consumer/.cursor/rules/no-docs.mdc.example +15 -0
- package/templates/root-consumer/.cursorrules.example +1 -0
- package/templates/root-consumer/.github/copilot-instructions.md.example +1 -0
- package/templates/root-consumer/.windsurfrules.example +1 -0
- package/templates/root-consumer/AI.md.example +44 -123
- package/templates/root-consumer/CLAUDE.md.example +1 -134
- package/templates/root-consumer/CONVENTIONS.md.example +1 -0
- package/templates/root-consumer/GEMINI.md.example +1 -0
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +22 -2
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +0 -18
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +1 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +101 -32
- package/templates/root-consumer/guides/dndev/INDEX.md.example +4 -2
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +241 -12
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +13 -7
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +60 -0
- package/templates/root-consumer/guides/dndev/SETUP_SOC2.md.example +234 -0
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +62 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -0
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +6 -2
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +176 -0
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +5 -9
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +174 -0
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +7 -8
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +10 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +25 -5
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +13 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +2 -2
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +55 -15
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +15 -4
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +7 -6
- package/dist/bin/commands/lint.d.ts +0 -11
- package/dist/bin/commands/lint.d.ts.map +0 -1
- package/dist/bin/commands/lint.js.map +0 -1
- package/dist/bin/commands/staging.d.ts +0 -11
- package/dist/bin/commands/staging.d.ts.map +0 -1
- package/dist/bin/commands/staging.js +0 -12
- package/dist/bin/commands/staging.js.map +0 -1
- package/templates/app-payload/.env.example +0 -28
- package/templates/app-payload/README.md.example +0 -233
- package/templates/app-payload/collections/Company.ts.example +0 -125
- package/templates/app-payload/collections/Hero.ts.example +0 -62
- package/templates/app-payload/collections/Media.ts.example +0 -41
- package/templates/app-payload/collections/Products.ts.example +0 -115
- package/templates/app-payload/collections/Services.ts.example +0 -104
- package/templates/app-payload/collections/Testimonials.ts.example +0 -92
- package/templates/app-payload/collections/Users.ts.example +0 -35
- package/templates/app-payload/src/server.ts.example +0 -79
- package/templates/app-payload/tsconfig.json.example +0 -24
|
@@ -4,147 +4,68 @@
|
|
|
4
4
|
|
|
5
5
|
## What To Do Right Now
|
|
6
6
|
|
|
7
|
-
1. **Verify MCP is working.**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
2. **Check environment setup.** Ask the user: "Have you run `bun install`? Run `dndev dev` and open the app — the homepage has setup steps for Git, Firebase, and .env."
|
|
11
|
-
3. Call `start_phase(0)` — begin **Phase 0: BRAINSTORM**
|
|
12
|
-
4. Follow each phase in order. Do not skip phases.
|
|
13
|
-
|
|
14
|
-
## Environment Variables — Where They Go
|
|
15
|
-
|
|
16
|
-
**Vite loads `.env` from the app directory only. NOT from the repo root.**
|
|
17
|
-
|
|
18
|
-
| File | What Goes Here |
|
|
19
|
-
|------|---------------|
|
|
20
|
-
| `apps/<app>/.env` | Firebase config, license key, Stripe publishable key, all `VITE_*` vars |
|
|
21
|
-
| `apps/<app>/.env.local` | Local overrides (gitignored) |
|
|
22
|
-
| `apps/<app>/.env.staging` | Staging Firebase config (used by `dndev staging`) |
|
|
23
|
-
| `functions/.env` | Server-side secrets: `STRIPE_SECRET_KEY`, OAuth client secrets |
|
|
24
|
-
| Root `.env` | **Not read by Vite.** Reference only. |
|
|
25
|
-
|
|
26
|
-
If the user says their license key or Firebase config "doesn't work", check which `.env` file they put it in. It must be in `apps/<app>/.env`, not the root.
|
|
7
|
+
1. **Verify MCP is working.** Call `list_features()`. If it fails, run `get_guide("AGENT_START_HERE")` for IDE-specific setup.
|
|
8
|
+
2. Call `start_phase(0)` — begin **Phase 0: BRAINSTORM**
|
|
9
|
+
3. Follow each phase in order. Do not skip phases.
|
|
27
10
|
|
|
28
11
|
## The 5 Phases
|
|
29
12
|
|
|
30
13
|
| Phase | Name | What Happens |
|
|
31
14
|
|-------|------|-------------|
|
|
32
|
-
| 0 | **BRAINSTORM** | Ask questions, understand requirements
|
|
15
|
+
| 0 | **BRAINSTORM** | Ask questions, understand requirements, produce validated spec |
|
|
33
16
|
| 1 | **SCAFFOLD** | Create all routes and page stubs from spec |
|
|
34
17
|
| 2 | **ENTITIES** | Define all data models (fields, access, visibility) |
|
|
35
18
|
| 3 | **COMPOSE** | Build pages with framework components (hardcode strings) |
|
|
36
|
-
| 4 | **CONFIGURE** | Config, test, polish,
|
|
37
|
-
|
|
38
|
-
Each phase has a blueprint in `guides/wai-way/blueprints/` — read it before starting the phase.
|
|
19
|
+
| 4 | **CONFIGURE** | Config, test, polish, i18n. Run `/grill` and `/techdebt` before shipping |
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## The Workflow Per Phase
|
|
21
|
+
## Workflow Per Phase
|
|
43
22
|
|
|
44
23
|
```
|
|
45
|
-
start_phase(N) → get blueprint + context + lessons
|
|
46
|
-
↓
|
|
47
|
-
work → follow blueprint, use lookup_symbol for every component
|
|
24
|
+
start_phase(N) → get blueprint + persona + context + lessons
|
|
48
25
|
↓
|
|
49
|
-
|
|
26
|
+
work → follow blueprint, lookup_symbol for every component
|
|
50
27
|
↓
|
|
51
|
-
|
|
28
|
+
complete_phase(files) → validate conventions + symbol usage → submit for review
|
|
52
29
|
↓
|
|
53
|
-
approve_phase() → phase
|
|
30
|
+
approve_phase() → phase done, move to next
|
|
54
31
|
```
|
|
55
32
|
|
|
56
|
-
##
|
|
33
|
+
## Component Usage — Non-Negotiable
|
|
57
34
|
|
|
58
|
-
**
|
|
35
|
+
**Never guess component props.** Call `lookup_symbol({ symbol: "ComponentName" })` before writing ANY `@donotdev` component. Every call is tracked — `complete_phase` flags components used without lookup.
|
|
59
36
|
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
lookup_symbol({ symbol: "DataTable" }) → returns real TypeScript interface
|
|
63
|
-
lookup_symbol({ symbol: "Card" }) → returns real TypeScript interface
|
|
64
|
-
```
|
|
37
|
+
Without MCP: read `.d.ts` files directly from `node_modules/@donotdev/*/dist/`.
|
|
65
38
|
|
|
66
|
-
|
|
39
|
+
## CLI Commands
|
|
67
40
|
|
|
68
|
-
**
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
41
|
+
`dndev` is an **installed CLI** (globally via `npm install -g @donotdev/cli`). Run it directly — **never** use `bunx dndev` or `npx dndev`.
|
|
42
|
+
|
|
43
|
+
| Command | What it does |
|
|
44
|
+
|---------|-------------|
|
|
45
|
+
| `dndev create-app` | Interactive wizard — creates a new app in the monorepo |
|
|
46
|
+
| `dndev dev` | Start the dev server (Vite/Next.js via Turbo) |
|
|
47
|
+
| `dndev emu start` | Start Firebase emulators |
|
|
48
|
+
| `dndev deploy` | Deploy to production |
|
|
49
|
+
| `dndev setup firebase` | Configure Firebase project + .env |
|
|
50
|
+
| `dndev setup supabase` | Configure Supabase project + .env |
|
|
51
|
+
|
|
52
|
+
`dndev create-app` is **interactive** — it prompts for builder (Vite/Next.js/Expo), backend (Firebase/Supabase/none), and features. There is no `--preset` flag.
|
|
53
|
+
|
|
54
|
+
## Rules
|
|
55
|
+
|
|
56
|
+
- **ESM only** — never `require()`
|
|
57
|
+
- **RTL safe** — use `start`/`end`, never `left`/`right`
|
|
58
|
+
- **Import order** — React → vendors → @donotdev → relative
|
|
59
|
+
- **Framework-first** — if something's missing, say what and stop
|
|
60
|
+
- **No .md file creation** — never create documentation/analysis/summary .md files unless explicitly asked. Session notes go in `.dndev/`
|
|
61
|
+
- **Follow existing patterns** — the scaffolded files ARE your documentation
|
|
62
|
+
|
|
63
|
+
## MCP Tools
|
|
64
|
+
|
|
65
|
+
Call `get_guide("AGENT_START_HERE")` for the full tool reference, IDE setup, env var guide, and fallback instructions.
|
|
66
|
+
|
|
67
|
+
Key tools: `start_phase` · `complete_phase` · `approve_phase` · `lookup_symbol` · `get_guide` · `get_guideline` · `search_framework` · `list_features` · `record_lesson`
|
|
68
|
+
|
|
69
|
+
## Security Gate
|
|
75
70
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
MCP gives the AI agent real TypeScript types instead of hallucinated props. Config files are auto-created by `dndev init`.
|
|
79
|
-
|
|
80
|
-
| IDE | Config | Setup |
|
|
81
|
-
|-----|--------|-------|
|
|
82
|
-
| **Claude Code** | `.mcp.json` | Auto-connects. Nothing to do. |
|
|
83
|
-
| **Windsurf** | `.mcp.json` | Auto-connects. Nothing to do. |
|
|
84
|
-
| **Cursor** | `.cursor/mcp.json` | Settings → Tools & MCP → toggle "donotdev" ON. **MCP only works in Composer mode** (`Cmd/Ctrl+I`). |
|
|
85
|
-
| **Gemini CLI** | `.gemini/settings.json` | Auto-connects. Nothing to do. |
|
|
86
|
-
|
|
87
|
-
**If MCP tools aren't available**, guide the user:
|
|
88
|
-
1. Check `bun` is in PATH (`which bun`)
|
|
89
|
-
2. **Cursor:** Must be in Composer mode (`Cmd/Ctrl+I`) and server toggled ON
|
|
90
|
-
3. Check MCP logs: `Cmd/Ctrl+Shift+U` → Output → "MCP Logs"
|
|
91
|
-
|
|
92
|
-
**Without MCP (ChatGPT, Copilot, etc.):** Read blueprints from `guides/wai-way/blueprints/` and types from `node_modules/@donotdev/*/dist/*.d.ts`. You lose symbol tracking and convention enforcement.
|
|
93
|
-
|
|
94
|
-
## MCP Tools (13 — Pre-Configured)
|
|
95
|
-
|
|
96
|
-
MCP config files are auto-created in `.mcp.json` / `.cursor/mcp.json` / `.gemini/settings.json`. **You must enable the server in your IDE settings** (see "Supported IDEs" above). Once enabled, your IDE connects automatically.
|
|
97
|
-
|
|
98
|
-
| Tool | What It Does |
|
|
99
|
-
|------|-------------|
|
|
100
|
-
| `start_phase(N)` | Begin a phase — returns blueprint, agent persona, context, and lessons |
|
|
101
|
-
| `complete_phase({ files })` | Validate conventions + symbol usage + submit for review (does NOT auto-advance) |
|
|
102
|
-
| `approve_phase()` | User approved — phase is done, advance to next |
|
|
103
|
-
| `get_phase_status()` | Current phase, symbols tracked, review status |
|
|
104
|
-
| `lookup_symbol("X")` | Get actual TypeScript types — tracked per phase |
|
|
105
|
-
| `get_guide("CRUD")` | Fetch framework setup guides |
|
|
106
|
-
| `get_guideline("styling:colors")` | Fetch architecture guidelines (supports sections) |
|
|
107
|
-
| `search_framework("keyword")` | Search across all guides and type definitions |
|
|
108
|
-
| `list_features()` | List all framework packages with summaries |
|
|
109
|
-
| `record_lesson("text")` | Save to project memory (returned on next start_phase) |
|
|
110
|
-
| `init_implementation({ from_spec: true })` | Create `.dndev/implementation.md` to track progress |
|
|
111
|
-
| `update_progress({ item: "...", done: true })` | Tick/untick items in implementation checklist |
|
|
112
|
-
| `get_progress()` | Read implementation progress stats |
|
|
113
|
-
| `get_project_history()` | Get captain's log with full session history |
|
|
114
|
-
|
|
115
|
-
## Convention Enforcement
|
|
116
|
-
|
|
117
|
-
`complete_phase` checks for:
|
|
118
|
-
- Inline styles (`style={{}}`) — use className
|
|
119
|
-
- fontSize/font-size — use Text levels or Card props
|
|
120
|
-
- textAlign left/right — use start/end for RTL
|
|
121
|
-
- require() — use ESM imports
|
|
122
|
-
- Manual date formatting — use formatDate() from @donotdev/core
|
|
123
|
-
- Import order — React > vendors > @donotdev > relative
|
|
124
|
-
- Unverified components — @donotdev components used without lookup_symbol
|
|
125
|
-
|
|
126
|
-
## Without MCP — Manual Fallback
|
|
127
|
-
|
|
128
|
-
Read the blueprints directly:
|
|
129
|
-
|
|
130
|
-
| Phase | Read This |
|
|
131
|
-
|-------|-----------|
|
|
132
|
-
| 0 | `guides/wai-way/blueprints/0_brainstorm.md` |
|
|
133
|
-
| 1 | `guides/wai-way/blueprints/1_scaffold.md` |
|
|
134
|
-
| 2 | `guides/wai-way/blueprints/2_entities.md` |
|
|
135
|
-
| 3 | `guides/wai-way/blueprints/3_compose.md` |
|
|
136
|
-
| 4 | `guides/wai-way/blueprints/4_configure.md` |
|
|
137
|
-
|
|
138
|
-
Agent personas: `guides/wai-way/agents/` (extractor, architect, builder, polisher)
|
|
139
|
-
|
|
140
|
-
## Golden Rule
|
|
141
|
-
|
|
142
|
-
> **The scaffolded files ARE your documentation.**
|
|
143
|
-
> Read the existing code. Follow the pattern. Extend it. Never invent from scratch.
|
|
144
|
-
|
|
145
|
-
## Key References
|
|
146
|
-
|
|
147
|
-
- `guides/wai-way/spec_template.md` — App specification template (Phase 0 output)
|
|
148
|
-
- `guides/wai-way/entity_patterns.md` — Common entity schemas
|
|
149
|
-
- `guides/wai-way/page_patterns.md` — Common page structures
|
|
150
|
-
- `guides/dndev/` — Framework setup guides (CRUD, Auth, Components, etc.)
|
|
71
|
+
Before production: run `dn soc2`. See `get_guide("SOC2")` for details.
|
|
@@ -1,134 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
**⚠️ CRITICAL: READ FIRST - ENFORCE ALWAYS ⚠️**
|
|
4
|
-
|
|
5
|
-
**NEVER act without explicit command. Questions = analysis only.**
|
|
6
|
-
**Commands = execute immediately. No assumptions, no auto-actions.**
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## ⚠️ WORKING MODE: Consumer App Development
|
|
11
|
-
|
|
12
|
-
**YOU ARE IN:** Consumer App Development Mode
|
|
13
|
-
|
|
14
|
-
**Location:** Consumer repository (scaffolded by `dndev init`)
|
|
15
|
-
|
|
16
|
-
**Your Role:**
|
|
17
|
-
- **Creating with framework** (Mode 3): Build new app features
|
|
18
|
-
- **Tweaking framework app** (Mode 4): Modify existing app features
|
|
19
|
-
|
|
20
|
-
**CLI:** `dndev` (public CLI, installed globally via `npm install -g @donotdev/cli`)
|
|
21
|
-
|
|
22
|
-
**Workflow:**
|
|
23
|
-
1. `/design [requirement]` → Architect designs solution
|
|
24
|
-
2. `/build [requirement]` → Prompt Engineer + Coder implement
|
|
25
|
-
3. Iterate with WAI-WAY agents
|
|
26
|
-
|
|
27
|
-
**Reference:** [Modes Guide](https://github.com/donotdev/framework/blob/main/docs/development/MODES.md) | Framework guides in `guides/dndev/`
|
|
28
|
-
|
|
29
|
-
**⚠️ IMPORTANT:**
|
|
30
|
-
- Use ONLY published `@donotdev/*` packages
|
|
31
|
-
- Cannot modify framework internals
|
|
32
|
-
- If framework needs changes, work in the framework monorepo (this repo)
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
**PRIME DIRECTIVE: PRECISION OVER SPEED.**
|
|
37
|
-
|
|
38
|
-
## **Correctness is non-negotiable. Concise, even at the cost of grammar. Never guess, every output must be verifiable. Check every assumption against actual codebase, documentation or user. If ambiguity exists, ask. No exceptions.**
|
|
39
|
-
|
|
40
|
-
## Identity & Persona Mandate
|
|
41
|
-
|
|
42
|
-
**Human user** - Architect, Product Owner, Product Manager
|
|
43
|
-
**AI assistant** - Lead Developer, UX/UI Designer, Expert Adviser
|
|
44
|
-
|
|
45
|
-
**Objective:** Multi-faceted, critical advisor applications. Blunt, on-point feedback driving applications quality. No sugarcoating.
|
|
46
|
-
|
|
47
|
-
Persona adapts to task:
|
|
48
|
-
|
|
49
|
-
- **Lead Developer:** Implementation, code quality, patterns respect
|
|
50
|
-
- **UX/UI Designer:** UX/UI considerations
|
|
51
|
-
- **Expert Adviser:** Strategic feedback, trade-offs
|
|
52
|
-
|
|
53
|
-
## Communication Style
|
|
54
|
-
|
|
55
|
-
Extremely concise. Sacrifice grammar for concision while maintaining correctness.
|
|
56
|
-
Never guess, always search (codebase, documentation, online) or ask.
|
|
57
|
-
|
|
58
|
-
**Response hygiene:**
|
|
59
|
-
|
|
60
|
-
- NO MIRRORING - never echo user's tone, mood, or phrasing
|
|
61
|
-
- ALWAYS DELIVER facts, analysis, decisions; no motivation or encouragement
|
|
62
|
-
- ALWAYS and ONLY execute the task at hand
|
|
63
|
-
|
|
64
|
-
**Examples:**
|
|
65
|
-
|
|
66
|
-
- ❌ "I will now proceed to update the configuration file"
|
|
67
|
-
- ✅ "Updating config"
|
|
68
|
-
- ❌ "Added support for dark mode theming"
|
|
69
|
-
- ✅ "add dark mode support"
|
|
70
|
-
- ❌ "I have implemented the feature you requested"
|
|
71
|
-
- ✅ "Done"
|
|
72
|
-
|
|
73
|
-
**ALWAYS DO**
|
|
74
|
-
|
|
75
|
-
- Brutal, blunt honest feedback
|
|
76
|
-
- Challenge ideas aggressively
|
|
77
|
-
- Provide pros/cons/trade-offs with evidence/research/studies
|
|
78
|
-
- Suggest better approaches
|
|
79
|
-
- Extremely concise
|
|
80
|
-
- **NEVER act without explicit command** - Questions are for analysis only
|
|
81
|
-
- **NEVER ask follow-up questions** like "Do you want me to...?" or "Should I...?"
|
|
82
|
-
|
|
83
|
-
## Plans
|
|
84
|
-
|
|
85
|
-
At end of each plan, list unresolved questions (if any). Extremely concise.
|
|
86
|
-
|
|
87
|
-
**Example:**
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
**Unresolved:**
|
|
91
|
-
- Auth strategy ? (google or more?)
|
|
92
|
-
- Backend target? (Vercel vs Firebase)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Environment Constraints
|
|
96
|
-
|
|
97
|
-
## General Principles
|
|
98
|
-
- **Code reading/writing:** Be critical and concise/precise. Question redundant systems, conflicting logic, unnecessary complexity. You need to **ANALYZE** code.
|
|
99
|
-
- **Conventions:** Always follow project's conventions when updating/adding/fixing files
|
|
100
|
-
|
|
101
|
-
## Component Usage - MCP REQUIRED
|
|
102
|
-
|
|
103
|
-
**BEFORE writing ANY @donotdev component:**
|
|
104
|
-
|
|
105
|
-
1. Call `lookup_symbol({ symbol: "ComponentName" })`
|
|
106
|
-
2. Read the actual props from the returned TypeScript interface
|
|
107
|
-
3. Use ONLY those props
|
|
108
|
-
|
|
109
|
-
**NEVER guess props. NEVER use props from memory/training.**
|
|
110
|
-
|
|
111
|
-
If MCP tools unavailable → STOP and tell user to enable MCP.
|
|
112
|
-
|
|
113
|
-
**Key MCP tools:**
|
|
114
|
-
- `lookup_symbol` — get actual TypeScript types from `.d.ts`
|
|
115
|
-
- `get_guide` — fetch framework setup guides (CRUD, Auth, etc.)
|
|
116
|
-
- `get_guideline` — fetch architecture guidelines
|
|
117
|
-
- `search_framework` — search across all guides and symbols
|
|
118
|
-
|
|
119
|
-
## Project Args & Gotchas
|
|
120
|
-
|
|
121
|
-
- **`.dndev/args.json`** — Per-project config (platform, strictness, features, region). All features ON by default. Phase 0 narrows down. Edit `strictness` to control validation: `enforced` (default) | `warnings` | `permissive`.
|
|
122
|
-
- **`guides/dndev/GOTCHAS.md`** — Common mistakes, phase-tagged. Read directly or loaded by MCP `start_phase()`.
|
|
123
|
-
- **Without MCP:** Both files are plain JSON/markdown — any agent reads them directly. MCP automates filtering + enforcement but is not required.
|
|
124
|
-
|
|
125
|
-
## WAI-WAY Workflow
|
|
126
|
-
|
|
127
|
-
**Read `AI.md` at the project root for the full workflow.**
|
|
128
|
-
|
|
129
|
-
For each phase (0=BRAINSTORM, 1=SCAFFOLD, 2=ENTITIES, 3=COMPOSE, 4=CONFIGURE):
|
|
130
|
-
|
|
131
|
-
1. `mcp:start_phase(N)` — returns blueprint, context, lessons, project args, and phase-relevant gotchas
|
|
132
|
-
2. Work — follow blueprint, call `lookup_symbol` before using any component
|
|
133
|
-
3. `mcp:complete_phase({ files })` — validates conventions + symbol usage (respects `strictness`), submits for review
|
|
134
|
-
4. `mcp:approve_phase()` — user approves, phase is done
|
|
1
|
+
Enforce AI.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Enforce AI.md
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Enforce AI.md
|
|
@@ -9,6 +9,26 @@
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## Getting Started (for humans)
|
|
13
|
+
|
|
14
|
+
**Canonical flow:** The showcase app’s **Get Started** page is the single source of truth: `apps/showcase/src/pages/GetStartedPage.tsx` and `apps/showcase/src/pages/locales/getstarted_*.json`. Below is the same flow in short form.
|
|
15
|
+
|
|
16
|
+
1. **P0 — Prerequisites**
|
|
17
|
+
- **Runtime:** **Node.js 24** (nodejs.org) and **Bun 1.3+** (bun.sh). Both required.
|
|
18
|
+
- **IDE:** Any IDE (Cursor, VS Code, Windsurf, etc.). Need help? Use the collapsible “Need help setting up?” on the Get Started page.
|
|
19
|
+
2. **Install our CLI and create your project’s monorepo**
|
|
20
|
+
- `npm install -g @donotdev/cli`
|
|
21
|
+
- `dndev init my-app`
|
|
22
|
+
3. **Open the repo in your IDE, terminal, bun install**
|
|
23
|
+
- Start your IDE in that repo, open the terminal: `cd my-app` → `bun install`
|
|
24
|
+
4. **Enable MCP, then read AI.md and follow the flow**
|
|
25
|
+
- Talk with your agent; ask it to load the MCP (Cursor: Ctrl+Shift+P → “MCP Server” → enable “donotdev”; other IDEs: see “How to enable MCP” collapsible on the Get Started page).
|
|
26
|
+
- Then have the agent read the root **`AI.md`** and this file (**`guides/dndev/AGENT_START_HERE.md`**). Follow the phases.
|
|
27
|
+
5. **AI helps with provider; cd there, bun install, run**
|
|
28
|
+
- AI helps you choose and set up your provider (Firebase, Supabase, or custom). Then `cd` into the app directory if needed, `bun install`, and `dndev dev` / `dndev build` / `dndev deploy`.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
12
32
|
## First Thing to Call: list_features()
|
|
13
33
|
|
|
14
34
|
Call **`list_features()`** before designing or coding. It lists all framework packages with a one-line summary from each README (templates, core, ui, auth, billing, etc.). Use it so you don't reinvent what the framework already provides (blog, CRUD, billing, legal pages, etc.).
|
|
@@ -26,7 +46,7 @@ Call `start_phase(N)` to begin each phase. It returns the blueprint, agent perso
|
|
|
26
46
|
|
|
27
47
|
### Phase 1: SCAFFOLD (Extractor)
|
|
28
48
|
- **MCP:** `start_phase(1)`
|
|
29
|
-
- **Goal:** Running skeleton.
|
|
49
|
+
- **Goal:** Running skeleton. Run `dndev create-app` (interactive wizard, run directly — never `bunx`) and create `*Page.tsx` stubs.
|
|
30
50
|
|
|
31
51
|
### Phase 2: ENTITIES (Architect)
|
|
32
52
|
- **MCP:** `start_phase(2)`
|
|
@@ -61,7 +81,7 @@ Check that the user has completed environment setup:
|
|
|
61
81
|
2. Service account key exists? (`service-account-key.json` in app root)
|
|
62
82
|
3. Emulators work? (`dndev emu start` runs without errors)
|
|
63
83
|
|
|
64
|
-
If not, coach them: "Run `dndev firebase
|
|
84
|
+
If not, coach them: "Run `dndev setup firebase` first, then follow the prompts." See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
|
|
65
85
|
|
|
66
86
|
---
|
|
67
87
|
|
|
@@ -335,24 +335,6 @@ import { StartChallengeForm } from '@donotdev/adv-comps';
|
|
|
335
335
|
/>
|
|
336
336
|
```
|
|
337
337
|
|
|
338
|
-
### Waterfall
|
|
339
|
-
|
|
340
|
-
Waterfall component with lazy loading built-in. Features clean cascade layout with diagonal staircase effect, perfect for step-by-step processes or feature showcases.
|
|
341
|
-
|
|
342
|
-
```tsx
|
|
343
|
-
import { Waterfall } from '@donotdev/adv-comps';
|
|
344
|
-
import type { WaterfallProps } from '@donotdev/adv-comps';
|
|
345
|
-
|
|
346
|
-
<Waterfall
|
|
347
|
-
items: ComponentData[]
|
|
348
|
-
className?: string
|
|
349
|
-
connectorClassName?: string
|
|
350
|
-
density?: 'compact' | 'comfortable'
|
|
351
|
-
ariaLabel?: string
|
|
352
|
-
direction?: 'horizontal' | 'descending'
|
|
353
|
-
/>
|
|
354
|
-
```
|
|
355
|
-
|
|
356
338
|
## Notes
|
|
357
339
|
|
|
358
340
|
- All components are lazy-loaded by default for optimal performance
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
- **usePrefetch** - Prefetch route data.
|
|
84
84
|
- **useLocation** - Get current location.
|
|
85
85
|
- **useParams** - Get route parameters.
|
|
86
|
-
- **useSearchParams** - Get URL search parameters.
|
|
86
|
+
- **useSearchParams** - Get URL search parameters. Returns `URLSearchParams` directly (NOT a tuple). Use `.get('key')` to read values.
|
|
87
87
|
- **useMatch** - Match current route pattern.
|
|
88
88
|
- **useQueryParams** - Get and set query parameters.
|
|
89
89
|
- **useRedirectGuard** - Guard against redirects.
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
**The complete onboarding flow — from `dndev init` to deployed app.**
|
|
4
4
|
|
|
5
|
+
If you haven’t run `dndev init` yet, see [AGENT_START_HERE.md](./AGENT_START_HERE.md) § **Getting started (for humans)** (P0 → Install CLI → Run AI.md → Enjoy).
|
|
6
|
+
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
## The Flow
|
|
8
10
|
|
|
9
11
|
```
|
|
10
|
-
bun install
|
|
11
|
-
bun dev
|
|
12
|
-
dndev firebase
|
|
13
|
-
|
|
14
|
-
dndev
|
|
12
|
+
bun install -> install dependencies
|
|
13
|
+
bun dev -> start app, read the homepage setup guide
|
|
14
|
+
dndev setup firebase -> configure Firebase project + .env
|
|
15
|
+
-- or --
|
|
16
|
+
dndev setup supabase -> configure Supabase project + .env
|
|
17
|
+
dndev emu start -> test locally with emulators (Firebase)
|
|
18
|
+
dndev deploy -> deploy to production
|
|
15
19
|
```
|
|
16
20
|
|
|
17
21
|
---
|
|
@@ -43,29 +47,45 @@ git push -u origin main
|
|
|
43
47
|
|
|
44
48
|
---
|
|
45
49
|
|
|
46
|
-
## Step 3:
|
|
50
|
+
## Step 3: Backend Setup
|
|
51
|
+
|
|
52
|
+
### Firebase
|
|
47
53
|
|
|
48
54
|
```bash
|
|
49
|
-
dndev firebase
|
|
55
|
+
dndev setup firebase
|
|
50
56
|
```
|
|
51
57
|
|
|
52
|
-
Automates: project selection/creation, web app, SDK config
|
|
58
|
+
Automates: project selection/creation, web app, SDK config -> `.env`, `.firebaserc`.
|
|
53
59
|
|
|
54
60
|
Then 2 manual steps (CLI gives you direct links):
|
|
55
|
-
1. Download service account key
|
|
61
|
+
1. Download service account key -> save as `service-account-key.json`
|
|
56
62
|
2. Enable Auth + Firestore in Firebase Console
|
|
57
63
|
|
|
58
64
|
See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) for full details.
|
|
59
65
|
|
|
66
|
+
### Supabase
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
dndev setup supabase
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Asks for your **public** project URL and anon key (both safe to share -- shipped in client bundle).
|
|
73
|
+
|
|
74
|
+
Get them from: https://supabase.com/dashboard -> your project -> Settings -> API
|
|
75
|
+
|
|
76
|
+
See [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) for full details (tables, RLS, `dn generate sql`). See [Secrets Philosophy](#secrets-philosophy) for how we handle secret keys.
|
|
77
|
+
|
|
60
78
|
---
|
|
61
79
|
|
|
62
80
|
## Step 4: Test Locally
|
|
63
81
|
|
|
64
82
|
```bash
|
|
65
|
-
dndev emu start
|
|
83
|
+
dndev emu start # Firebase emulators
|
|
66
84
|
```
|
|
67
85
|
|
|
68
|
-
Select Auth + Firestore + Functions.
|
|
86
|
+
Select services: Auth + Firestore + Functions. This starts Firebase emulators so you can develop without touching production.
|
|
87
|
+
|
|
88
|
+
For Supabase, development runs against your Supabase project directly (or use `supabase start` for local Supabase if installed).
|
|
69
89
|
|
|
70
90
|
---
|
|
71
91
|
|
|
@@ -74,11 +94,11 @@ Select Auth + Firestore + Functions. Develops against local emulators.
|
|
|
74
94
|
Open the project in **Cursor**, **Claude Code**, **Windsurf**, or **AntiGravity**.
|
|
75
95
|
|
|
76
96
|
The AI reads `AI.md` and follows the WAI-WAY protocol:
|
|
77
|
-
- Phase 0: Brainstorm
|
|
78
|
-
- Phase 1: Scaffold
|
|
79
|
-
- Phase 2: Entities
|
|
80
|
-
- Phase 3: Compose
|
|
81
|
-
- Phase 4: Configure
|
|
97
|
+
- Phase 0: Brainstorm -> produce a spec
|
|
98
|
+
- Phase 1: Scaffold -> create pages
|
|
99
|
+
- Phase 2: Entities -> define data models
|
|
100
|
+
- Phase 3: Compose -> build pages with components
|
|
101
|
+
- Phase 4: Configure -> generate tests, firestore rules, CI/CD
|
|
82
102
|
|
|
83
103
|
Read `guides/wai-way/WAI_WAY_CLI.md` for the full workflow.
|
|
84
104
|
|
|
@@ -90,7 +110,51 @@ Read `guides/wai-way/WAI_WAY_CLI.md` for the full workflow.
|
|
|
90
110
|
dndev deploy
|
|
91
111
|
```
|
|
92
112
|
|
|
93
|
-
Deploys hosting + functions + rules.
|
|
113
|
+
Deploys hosting + functions + rules. Syncs runtime secrets automatically before deploying functions.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Secrets Philosophy
|
|
118
|
+
|
|
119
|
+
**DoNotDev follows strict rules about credentials:**
|
|
120
|
+
|
|
121
|
+
### Tier 1: Public Keys -- We Ask Directly
|
|
122
|
+
|
|
123
|
+
These are safe to share, shipped in your client JS bundle. We ask for them during setup.
|
|
124
|
+
|
|
125
|
+
| Key | Where It Goes |
|
|
126
|
+
|-----|--------------|
|
|
127
|
+
| Firebase API key, project ID, auth domain, etc. | `apps/<app>/.env` as `VITE_FIREBASE_*` |
|
|
128
|
+
| Supabase project URL | `apps/<app>/.env` as `VITE_SUPABASE_URL` |
|
|
129
|
+
| Supabase anon key (public JWT) | `apps/<app>/.env` as `VITE_SUPABASE_ANON_KEY` |
|
|
130
|
+
| Stripe publishable key | `apps/<app>/.env` as `VITE_STRIPE_PUBLISHABLE_KEY` |
|
|
131
|
+
|
|
132
|
+
### Tier 2: Secret Keys -- We NEVER Ask, We Tell You Where To Put Them
|
|
133
|
+
|
|
134
|
+
These are server-side only. We never prompt for them, never store them in client code.
|
|
135
|
+
|
|
136
|
+
| Key | Where It Goes | How To Get It |
|
|
137
|
+
|-----|--------------|---------------|
|
|
138
|
+
| Stripe secret key | `functions/.env` as `STRIPE_SECRET_KEY` | https://dashboard.stripe.com/apikeys |
|
|
139
|
+
| Stripe webhook secret | `functions/.env` as `STRIPE_WEBHOOK_SECRET` | Stripe Dashboard -> Webhooks |
|
|
140
|
+
| Supabase service_role key | `functions/.env` as `SUPABASE_SERVICE_ROLE_KEY` | Supabase Dashboard -> Settings -> API |
|
|
141
|
+
| OAuth client secrets | `functions/.env` as `*_CLIENT_SECRET` | Provider dashboard |
|
|
142
|
+
|
|
143
|
+
Then sync to your runtime:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
dndev sync-secrets # -> Firebase Secret Manager or Vercel env
|
|
147
|
+
dndev sync-secrets --target github # -> GitHub Secrets (for CI/CD)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Tier 3: Service Account Files -- Download, Place, Gitignore
|
|
151
|
+
|
|
152
|
+
| File | Where It Goes | How To Get It |
|
|
153
|
+
|------|--------------|---------------|
|
|
154
|
+
| `service-account-key.json` | App root (next to firebase.json) | Firebase Console -> Settings -> Service Accounts |
|
|
155
|
+
| `service-account-key.staging.json` | Same location, for staging | Same, from staging project |
|
|
156
|
+
|
|
157
|
+
These files are `.gitignored`. Never commit them. For CI/CD, upload the file content as a GitHub Secret and decode it in your workflow.
|
|
94
158
|
|
|
95
159
|
---
|
|
96
160
|
|
|
@@ -100,18 +164,21 @@ Deploys hosting + functions + rules. Cloud Run IAM handled automatically.
|
|
|
100
164
|
|
|
101
165
|
```
|
|
102
166
|
my-project/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
167
|
+
+-- .env.example <-- NOT loaded by Vite (reference only)
|
|
168
|
+
+-- apps/
|
|
169
|
+
| +-- my-app/
|
|
170
|
+
| +-- .env <-- Vite reads THIS (public keys: VITE_*)
|
|
171
|
+
| +-- .env.local <-- Overrides .env (gitignored)
|
|
172
|
+
| +-- .env.staging <-- Used by dndev staging
|
|
173
|
+
| +-- .env.production <-- Production overrides
|
|
174
|
+
+-- functions/
|
|
175
|
+
+-- .env <-- Server secrets (Stripe, OAuth, service_role)
|
|
112
176
|
```
|
|
113
177
|
|
|
114
|
-
**
|
|
178
|
+
**Rules:**
|
|
179
|
+
- `VITE_*` / `NEXT_PUBLIC_*` vars -> `apps/<app>/.env` (public, shipped to browser)
|
|
180
|
+
- Server secrets -> `functions/.env` (never exposed to client)
|
|
181
|
+
- Service account files -> app root, gitignored
|
|
115
182
|
|
|
116
183
|
---
|
|
117
184
|
|
|
@@ -121,10 +188,12 @@ my-project/
|
|
|
121
188
|
|---------|-------------|
|
|
122
189
|
| `bun dev` | Start dev server |
|
|
123
190
|
| `dndev emu start` | Start Firebase emulators |
|
|
124
|
-
| `dndev firebase
|
|
125
|
-
| `dndev
|
|
191
|
+
| `dndev setup firebase` | Configure Firebase project + .env |
|
|
192
|
+
| `dndev setup supabase` | Configure Supabase project + .env |
|
|
193
|
+
| `dndev deploy` | **Firebase:** hosting + functions + rules. **Supabase:** deploys frontend to [Vercel](https://vercel.com) (via scaffolded vercel.json) and Edge Functions to Supabase. Set `VITE_SUPABASE_*` in Vercel project env. |
|
|
126
194
|
| `dndev staging` | Deploy to staging environment |
|
|
127
|
-
| `dndev sync-secrets` | Push functions/.env to Firebase
|
|
195
|
+
| `dndev sync-secrets` | Push functions/.env to runtime (Firebase/Vercel) |
|
|
196
|
+
| `dndev sync-secrets --target github` | Push secrets to GitHub Secrets (CI/CD) |
|
|
128
197
|
| `bun test` | Run tests (after Phase 4) |
|
|
129
198
|
| `bun run type-check` | TypeScript validation |
|
|
130
199
|
|
|
@@ -135,8 +204,8 @@ my-project/
|
|
|
135
204
|
| Feature | Required? | When to Set Up |
|
|
136
205
|
|---------|-----------|---------------|
|
|
137
206
|
| Git + GitHub | Recommended | Before starting development |
|
|
138
|
-
| Firebase
|
|
139
|
-
| Cloud Functions | If using
|
|
207
|
+
| Firebase or Supabase | Yes (pick one) | Before building any features |
|
|
208
|
+
| Cloud Functions | If using server logic | Before deploying functions |
|
|
140
209
|
| Stripe | If using billing | When adding payment features |
|
|
141
210
|
| GitHub Actions CI/CD | Optional | Phase 4 generates the workflow |
|
|
142
211
|
| Staging environment | Optional | When you want a test environment |
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
## Getting Started
|
|
10
10
|
|
|
11
|
-
-
|
|
11
|
+
- **Human flow:** P0 (Bun/Node + AI IDE) → Install CLI & `dndev init` → Run **AI.md** → Enjoy. See [AGENT_START_HERE.md](./AGENT_START_HERE.md) § Getting started (for humans).
|
|
12
|
+
- [ENV_SETUP.md](./ENV_SETUP.md) — After `dndev init`: env, Firebase/Supabase, deploy
|
|
12
13
|
- [GOTCHAS.md](./GOTCHAS.md) - **Common mistakes & pitfalls** (phase-tagged, read before coding)
|
|
13
|
-
- [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev firebase
|
|
14
|
+
- [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev setup firebase`)
|
|
15
|
+
- [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev setup supabase`, `dn generate sql`)
|
|
14
16
|
- [SETUP_TESTING.md](./SETUP_TESTING.md) - Test generation (Phase 4)
|
|
15
17
|
|
|
16
18
|
---
|
|
@@ -109,14 +109,14 @@ export default defineViteConfig({
|
|
|
109
109
|
|
|
110
110
|
**Vite loads `.env` from the app directory only.** Not the repo root.
|
|
111
111
|
|
|
112
|
-
Run `dndev firebase
|
|
112
|
+
Run `dndev setup firebase` to auto-populate Firebase config. See [SETUP_FIREBASE.md](./SETUP_FIREBASE.md).
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
# apps/<your-app>/.env — client-side variables (exposed to browser)
|
|
116
116
|
VITE_APP_URL=http://localhost:5173
|
|
117
117
|
VITE_DONOTDEV_LICENSE_KEY=dndev_your_key_here
|
|
118
|
-
VITE_FIREBASE_API_KEY=... # Written by dndev firebase
|
|
119
|
-
VITE_FIREBASE_PROJECT_ID=... # Written by dndev firebase
|
|
118
|
+
VITE_FIREBASE_API_KEY=... # Written by dndev setup firebase
|
|
119
|
+
VITE_FIREBASE_PROJECT_ID=... # Written by dndev setup firebase
|
|
120
120
|
VITE_AUTH_PARTNERS=github,google
|
|
121
121
|
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_...
|
|
122
122
|
|