@donotdev/cli 0.0.37 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE.md +21 -48
  2. package/dependencies-matrix.json +108 -58
  3. package/dist/bin/commands/agent-setup.js +7196 -123
  4. package/dist/bin/commands/build.js +3341 -207
  5. package/dist/bin/commands/bump.js +268 -24
  6. package/dist/bin/commands/cacheout.js +262 -13
  7. package/dist/bin/commands/coach.js +365 -61
  8. package/dist/bin/commands/create-app.js +261 -14
  9. package/dist/bin/commands/create-project.js +270 -15
  10. package/dist/bin/commands/db.js +10743 -2346
  11. package/dist/bin/commands/deploy.js +4202 -776
  12. package/dist/bin/commands/dev.js +353 -38
  13. package/dist/bin/commands/doctor.js +412 -108
  14. package/dist/bin/commands/emu.js +392 -57
  15. package/dist/bin/commands/format.js +250 -15
  16. package/dist/bin/commands/get-demo.js +261 -14
  17. package/dist/bin/commands/make-admin.js +10022 -1552
  18. package/dist/bin/commands/preview.js +353 -38
  19. package/dist/bin/commands/seed.js +10743 -2346
  20. package/dist/bin/commands/setup-cicd.js +456 -133
  21. package/dist/bin/commands/setup.js +428 -125
  22. package/dist/bin/commands/staging.js +4202 -776
  23. package/dist/bin/commands/sync-secrets.js +250 -14
  24. package/dist/bin/commands/type-check.js +249 -13
  25. package/dist/bin/commands/wai.js +249 -13
  26. package/dist/bin/dndev.js +33 -4
  27. package/dist/bin/donotdev.js +33 -4
  28. package/dist/index.js +4278 -856
  29. package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
  30. package/package.json +3 -2
  31. package/templates/app-demo/src/themes.css.example +21 -0
  32. package/templates/app-dndev/index.html.example +0 -3
  33. package/templates/app-dndev/src/themes.css.example +21 -0
  34. package/templates/app-next/src/app/layout.tsx.example +13 -4
  35. package/templates/app-next/src/themes.css.example +21 -0
  36. package/templates/app-vite/csp.example.json +44 -0
  37. package/templates/app-vite/index.html.example +0 -3
  38. package/templates/app-vite/src/themes.css.example +21 -0
  39. package/templates/functions-supabase/supabase/functions/.env.example +12 -0
  40. package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
  41. package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
  42. package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
  43. package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
  44. package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
  45. package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
  46. package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
  47. package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
  48. package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
  49. package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
  50. package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
  51. package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
  52. package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
  53. package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
  54. package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
  55. package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
  56. package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
  57. package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
  58. package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
  59. package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
  60. package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
  61. package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
  62. package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
  63. package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
  64. package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
  65. package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
  66. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
  67. package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
  68. package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
  69. package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
  70. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
  71. package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
  72. package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
  73. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
  74. package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
  75. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
  76. package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
  77. package/templates/root-consumer/.claude/rules/git.md.example +14 -0
  78. package/templates/root-consumer/.claude/rules/security.md.example +13 -0
  79. package/templates/root-consumer/.claude/settings.json.example +123 -1
  80. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
  81. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
  82. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
  83. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +33 -16
  84. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
  85. package/templates/root-consumer/AI.md.example +2 -2
  86. package/templates/root-consumer/CLAUDE.md.example +33 -1
  87. package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
  88. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
  89. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +12 -6
  90. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
  91. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
  92. package/templates/app-demo/public/manifest.json.example +0 -10
  93. package/templates/app-dndev/public/manifest.json.example +0 -10
  94. package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -147
  95. package/templates/root-consumer/.claude/commands/build.md.example +0 -131
  96. package/templates/root-consumer/.claude/commands/design.md.example +0 -153
  97. package/templates/root-consumer/.claude/commands/grill.md.example +0 -108
  98. package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
  99. package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
  100. package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
  101. package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
  102. package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
  103. package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
  104. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
  105. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
  106. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
  107. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
  108. package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
  109. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
  110. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
  111. package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
  112. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
  113. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
  114. package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
  115. package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
  116. package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
  117. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
  118. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
  119. package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: grill
3
- description: Critical staff-engineer code review — flags problems before shipping. Blocking review with high-signal findings only.
3
+ description: Critical staff-engineer code review - flags problems before shipping. Blocking review with high-signal findings only.
4
4
  disable-model-invocation: true
5
5
  argument-hint: [files, areas, or "full"]
6
6
  ---
@@ -9,31 +9,50 @@ argument-hint: [files, areas, or "full"]
9
9
 
10
10
  Skeptical staff engineer doing a blocking code review. Find things that will **break, lose data, or mislead**.
11
11
 
12
- ## Step 0 — Situational Awareness
12
+ ## Step 0 - Situational Awareness
13
13
 
14
- 1. Read `.dndev/grill-report.json` — last run's SHA, target, items
15
- 2. Read `.dndev/grill-ignore.json` — accepted deviations (SSOT for exclusions)
14
+ 1. Read `.dndev/grill-report.json` - last run's SHA, target, items
15
+ 2. Read `.dndev/grill-ignore.json` - accepted deviations (SSOT for exclusions)
16
16
  3. Check current `git rev-parse --short HEAD`
17
17
 
18
18
  **No-op:** Same perimeter + same SHA as last run → skip. Nothing changed.
19
19
 
20
- **If `$ARGUMENTS` provided** — use as perimeter.
21
- **If empty** — check what changed since last grill. Propose and proceed unless ambiguous.
20
+ **If `$ARGUMENTS` provided** - use as perimeter.
21
+ **If empty** - check what changed since last grill. Propose and proceed unless ambiguous.
22
22
 
23
- ## Step 1 — Archive
23
+ ## Step 1 - Archive
24
24
 
25
25
  If `.dndev/grill-report.json` has resolved items (`fixed`, `resolved`, `rejected`):
26
26
  - Archive to `.dndev/grill-history.json`
27
27
  - Keep surviving items for merge
28
28
 
29
- ## Step 2 — Scan
29
+ ## Step 2 - Three-Pass Scan
30
30
 
31
- Review target files for:
32
- - **BLOCKER** — breaks in production, loses data, security issues, breaking API changes
33
- - **WARN** — real problems users will hit (missing edge cases, misleading dead code)
34
- - **NOTE** — sparingly, genuine gotchas only
31
+ ### Pass 1 - CRITICAL (stops for user decision)
35
32
 
36
- What NOT to flag:
33
+ Items that must be resolved before shipping. After listing, present each individually: **Fix / Acknowledge / Skip**. One item = one question. Do NOT proceed to Pass 2 until resolved.
34
+
35
+ - **BLOCKER** - breaks in production, loses data, security issues, breaking API changes
36
+ - **WARN-CRITICAL** - auth bypass, data corruption on normal flows
37
+ - @donotdev component misuse without `lookup_symbol` verification
38
+
39
+ ### Pass 2 - INFORMATIONAL (listed, no action required)
40
+
41
+ - **WARN** - real problems users will hit (missing edge cases, misleading dead code)
42
+ - **NOTE** - sparingly, genuine gotchas only
43
+
44
+ ### Pass 3 - DEFINITION OF DONE (new)
45
+
46
+ For each changed file, verify completeness:
47
+
48
+ | Check | Severity | What to look for |
49
+ |-------|----------|-----------------|
50
+ | i18n | WARN | Hardcoded user-facing strings (should use `t('key')`) |
51
+ | Tests | WARN | New logic without corresponding test file |
52
+ | Spec compliance | BLOCKER | Feature in spec not implemented or partially done |
53
+ | Theme compliance | WARN | Hardcoded colors/sizes instead of theme tokens |
54
+
55
+ ### What NOT to flag:
37
56
  - Optimization suggestions, style, formatting
38
57
  - Hypothetical edge cases against TypeScript types
39
58
  - Dev-only code, harmless dead code
@@ -41,9 +60,7 @@ What NOT to flag:
41
60
 
42
61
  **Self-test:** "Would I block a PR for this?" No → skip.
43
62
 
44
- Also check: @donotdev component usage without `lookup_symbol` verification.
45
-
46
- ## Step 3 — Filter + Write
63
+ ## Step 3 - Filter + Write
47
64
 
48
65
  1. Filter out `grill-ignore.json` matches (fuzzy on issue text)
49
66
  2. Deduplicate against carried items
@@ -1,14 +1,19 @@
1
1
  ---
2
2
  name: polish
3
- description: Generate tests, database rules, CI/CD, config, fix bugs, i18n (Phase 4). Use AFTER /build when the app works and needs production-readiness.
3
+ description: "QA audit against approved spec. Tests, security rules, CI/CD, deployment. Verify delivery matches contract. Consumer workflow only. Use AFTER /build."
4
4
  argument-hint: [task]
5
- disable-model-invocation: true
6
5
  ---
7
6
 
8
- # Polish — Production-Ready
7
+ # Polish — QA Audit Against Spec
9
8
 
10
9
  **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
10
 
11
+ ## Philosophy: Verify, Don't Add
12
+
13
+ `/build` delivers the complete app. `/polish` verifies it matches the spec. This is QA, not feature work.
14
+
15
+ If something is missing, it's a `/build` bug — go back and fix it there.
16
+
12
17
  ## Step 0 — Start Phase (MANDATORY)
13
18
 
14
19
  ```
@@ -16,61 +21,69 @@ start_phase(4)
16
21
  ```
17
22
  Do NOT proceed without this call.
18
23
 
19
- ## Step 1 — Read Context
24
+ ## Step 1 — Spec Compliance Audit
25
+
26
+ Read the approved spec and verify delivery:
27
+
28
+ | Check | Source | Pass Criteria |
29
+ |-------|--------|---------------|
30
+ | Pages exist | HLD page map | Every page in spec is implemented |
31
+ | Entities correct | LLD field specs | Fields, states, access match exactly |
32
+ | Auth works | HLD auth section | Correct providers, guards, roles |
33
+ | i18n complete | HLD features | All specified languages have translations |
34
+ | Theme applied | HLD essence/theme | Colors, fonts, density, radius match |
35
+ | Features enabled | HLD features | Every feature in spec is functional |
20
36
 
21
- - `guides/wai-way/spec_template.md` — validated spec (test plan)
22
- - `entities/index.ts` — all entity definitions
23
- - `src/pages/` — all page files
37
+ **Any mismatch = STOP, report, fix in `/build` first.**
24
38
 
25
- ## Steps 2-5 — Parallel-capable
39
+ ## Step 2 — Generate Tests
26
40
 
27
- These steps are independent. Launch them in parallel when possible:
41
+ Tests verify the SPEC, not the code. The spec is the test plan.
28
42
 
29
- ### Tests
30
- Call `get_guide("TESTING")` for patterns.
31
- - Entity tests → `tests/entities/[Entity].test.ts`
32
- - Page tests → `tests/pages/[Page].test.tsx`
33
- - Access control → `tests/access/access-rules.test.ts`
43
+ - **Entity tests** → `tests/entities/[Entity].test.ts`
44
+ - **Page tests** → `tests/pages/[Page].test.tsx`
45
+ - **Access control** → `tests/access/access-rules.test.ts`
34
46
 
35
- ### Database Rules
36
- Auto-detect provider (Firestore or Supabase RLS). Generate rules from entity access definitions.
47
+ ## Step 3 — Database Rules
37
48
 
38
- ### CI/CD
39
- Create `.github/workflows/ci.yml` — type-check → test → build → deploy.
49
+ Auto-detect provider (Supabase RLS or Firestore rules). Generate from entity access definitions.
40
50
 
41
- ### Config
42
- - `src/config/app.ts` — APP_NAME, preset, footer
43
- - `src/config/legal.ts` — company, contacts, jurisdiction
44
- - `.env` — provider config, license key
51
+ ## Step 4 — CI/CD
52
+
53
+ Create `.github/workflows/ci.yml`: type-check → test → build → deploy.
54
+
55
+ ## Step 5 — Security Review
56
+
57
+ - No secrets in code
58
+ - Auth guards on protected routes
59
+ - Database rules cover all entities
60
+ - Input validated at boundaries
45
61
 
46
62
  ## Step 6 — Validate
47
63
 
48
64
  ```bash
49
- bun test
65
+ dndev tc # Type-check
66
+ bun test # All tests pass
50
67
  ```
51
- All tests must pass. Fix failures.
52
68
 
53
69
  ## Step 7 — Mobile Check
54
70
 
55
- DevTools → 375px → navigation, forms, text, buttons (44px min).
56
-
57
- ## Step 8 — i18n (Optional)
58
-
59
- Extract strings to `src/locales/`, replace with `useTranslation()`.
71
+ 375px width: navigation, forms, text, buttons > 44px, no horizontal scroll.
60
72
 
61
73
  ## Ship Readiness
62
74
 
63
- - `dndev tc` passes
64
- - `bun test` passes
65
- - Database rules generated
66
- - CI/CD created
67
- - No critical bugs
68
- - Mobile works at 375px
75
+ - [ ] Spec compliance: every spec item delivered
76
+ - [ ] Type-check passes
77
+ - [ ] Tests pass
78
+ - [ ] Database rules generated
79
+ - [ ] CI/CD created
80
+ - [ ] Security reviewed
81
+ - [ ] Mobile works
69
82
 
70
83
  ## Complete Phase
71
84
 
72
85
  ```
73
- complete_phase({ files: ["...all test/config files..."], summary: "Tests passing, config complete, ready to ship" })
86
+ complete_phase({ files: [...], summary: "QA passed, spec-compliant, ready to ship" })
74
87
  ```
75
88
 
76
- Wait for user `approve_phase()`. Then → `dndev deploy`.
89
+ Wait for user `approve_phase()`. Then → deploy.
@@ -90,9 +90,9 @@ Run `dndev --help` for the full command list.
90
90
  - **Import convention** — always `@donotdev/<pkg>` top-level, never sub-paths
91
91
  - **NO native HTML elements** — never use `<div>`, `<span>`, `<p>`, `<h1-6>`, `<button>`, `<a>`, `<input>`, `<textarea>`, `<select>`, `<form>`, `<table>`, `<ul>`, `<ol>`, `<li>`, `<img>`, `<section>`, `<nav>`, `<header>`, `<footer>` in @donotdev files. Use framework components: Stack, Card, Text, Button, Link, TextInput, Select, Form, DataTable, List, Image, Section, Navigation, Header, Footer. See `get_guide("COMPONENTS_ATOMIC")`
92
92
  - **NO custom CSS** — never create `.css`, `.module.css`, `.scss`, `.sass`, or `.less` files. All styling is done through framework component props, variant tokens, and theme configuration
93
- - **NO custom components** — never create files in `components/`. Compose pages using framework components only. If a component is missing, say what you need and STOP
93
+ - **Custom components as last resort** — first `lookup_symbol()` + `search_framework()`. If nothing fits, build in `src/components/` with JSDoc `@custom-component - framework gap, see issue #XX`. The guard hook auto-creates a GitHub issue tagged `framework-evolution`
94
94
  - **NO inventing props** — only use props returned by `lookup_symbol()`. Common hallucination traps that DO NOT exist: `size`, `tone`, `color`, `padding`, `margin`, `spacing`, `columns`, `background`, `fields`
95
- - **Framework-first** — if something's missing, say what and stop
95
+ - **Framework-first** — compose from existing components before creating custom ones
96
96
  - **No .md file creation** — never create documentation/analysis/summary .md files unless explicitly asked. Session notes go in `.dndev/`
97
97
  - **Follow existing patterns** — the scaffolded files ARE your documentation
98
98
 
@@ -1 +1,33 @@
1
- Enforce AI.md
1
+ # Project Instructions
2
+
3
+ > Built with the DoNotDev framework. Guardrails are hook-enforced - quality is automatic.
4
+
5
+ ## How to work with you
6
+
7
+ Just tell me what you want. "I need a dashboard page" or "add a contact form" - I'll handle the rest.
8
+
9
+ I use the DoNotDev framework's component library which covers 99% of what apps need. I verify every component via MCP before using it, so props and APIs are always correct.
10
+
11
+ ## What happens behind the scenes (you don't need to know this)
12
+
13
+ Quality hooks run automatically on every change I make. They catch mistakes before they reach you. If something is wrong, I fix it silently and move on.
14
+
15
+ ## What you'll see
16
+
17
+ - I build features incrementally, committing at milestones
18
+ - I'll ask clarifying questions if your request is ambiguous
19
+ - When done, I'll show you what was built and how to verify it
20
+ - `dndev tc` verifies type safety, `dndev dev` runs the app locally
21
+
22
+ ## Adding dependencies
23
+
24
+ Need a library the framework doesn't cover? Just ask - I can add packages with `bun add`.
25
+
26
+ ## Conventions I follow
27
+
28
+ - All text is translatable (i18n-ready from day one)
29
+ - Framework components for UI (no raw HTML, no custom CSS)
30
+ - Clean, simple code a junior developer can read
31
+ - Typecheck passes before any work is considered complete
32
+
33
+ Read `AI.md` for project-specific instructions.
@@ -1,6 +1,6 @@
1
1
  # DoNotDev Framework Guides
2
2
 
3
- **For AI Agents:** See [AGENT_START_HERE.md](./AGENT_START_HERE.md) ← **START HERE**
3
+ **For AI Agents:** See [AGENT_START_HERE.md](./AGENT_START_HERE.md) - **START HERE**
4
4
 
5
5
  **AI System:** Commands in `.claude/commands/`, agents in `.claude/agents/` (synced via `dndev bump`)
6
6
 
@@ -8,44 +8,26 @@
8
8
 
9
9
  ## Getting Started
10
10
 
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
13
- - [GOTCHAS.md](./GOTCHAS.md) - **Common mistakes & pitfalls** (phase-tagged, read before coding)
14
- - [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev coach` → `dndev setup`)
15
- - [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev coach` → `dndev setup`)
16
- - [SETUP_TESTING.md](./SETUP_TESTING.md) - Test generation (Phase 4)
17
- - [SETUP_CICD.md](./SETUP_CICD.md) - CI/CD setup (`dndev setup-cicd` → GitHub Actions)
18
-
19
- ---
20
-
21
- ## Core Setup
22
-
23
- - [SETUP_PAGES.md](./SETUP_PAGES.md) - Pages & routing (pre-configured)
24
- - [USE_ROUTING.md](./USE_ROUTING.md) - **Routing components & hooks (CRITICAL)**
25
- - [SETUP_APP_CONFIG.md](./SETUP_APP_CONFIG.md) - App + Vite configuration
26
- - [SETUP_I18N.md](./SETUP_I18N.md) - Translations (pre-configured)
27
- - [SETUP_THEMES.md](./SETUP_THEMES.md) - Themes & CSS variables (pre-configured)
28
- - [SETUP_LAYOUTS.md](./SETUP_LAYOUTS.md) - Layout presets (pre-configured)
11
+ - **Human flow:** P0 (Bun/Node + AI IDE) -> Install CLI & `dndev init` -> Run **AI.md** -> Enjoy.
12
+ - [SETUP_FIREBASE.md](./SETUP_FIREBASE.md) - Firebase project setup (`dndev coach` -> `dndev setup`)
13
+ - [SETUP_SUPABASE.md](./SETUP_SUPABASE.md) - Supabase project setup (`dndev coach` -> `dndev setup`)
29
14
 
30
15
  ---
31
16
 
32
17
  ## Feature Setup
33
18
 
34
- - [SETUP_CRUD.md](./SETUP_CRUD.md) - CRUD operations & data access (critical)
35
19
  - [SETUP_AUTH.md](./SETUP_AUTH.md) - Authentication (pre-configured)
36
20
  - [SETUP_OAUTH.md](./SETUP_OAUTH.md) - OAuth connections (pre-configured)
21
+ - [SETUP_OAUTH_PROVIDERS.md](./SETUP_OAUTH_PROVIDERS.md) - OAuth provider configuration
37
22
  - [SETUP_BILLING.md](./SETUP_BILLING.md) - Stripe subscriptions (pre-configured)
38
- - [SETUP_BLOG.md](./SETUP_BLOG.md) - Convention-based markdown blog with i18n
39
- - [SETUP_PWA.md](./SETUP_PWA.md) - Progressive Web App setup
40
- - [SETUP_FUNCTIONS.md](./SETUP_FUNCTIONS.md) - Functions overview (redirects to provider guides)
23
+ - [SETUP_STRIPE.md](./SETUP_STRIPE.md) - Stripe integration details
24
+ - [SETUP_SOC2.md](./SETUP_SOC2.md) - SOC2 compliance
41
25
 
42
26
  ---
43
27
 
44
28
  ## Component Reference
45
29
 
46
- - [COMPONENTS_ATOMIC.md](./COMPONENTS_ATOMIC.md) - Atomic components (@donotdev/components)
47
- - [COMPONENTS_UI.md](./COMPONENTS_UI.md) - Layout/composition components (@donotdev/ui)
48
- - [COMPONENTS_CRUD.md](./COMPONENTS_CRUD.md) - CRUD components (@donotdev/crud)
30
+ - [COMPONENTS_ADV.md](./COMPONENTS_ADV.md) - Advanced components (@donotdev/components)
49
31
 
50
32
  ---
51
33
 
@@ -53,7 +35,21 @@
53
35
 
54
36
  - [advanced/APP_CHECK.md](./advanced/APP_CHECK.md) - Abuse protection
55
37
  - [advanced/EMULATORS.md](./advanced/EMULATORS.md) - Local emulator setup
56
- - [advanced/VERSION_CONTROL.md](./advanced/VERSION_CONTROL.md) - Package upgrades
38
+ - [advanced/COOKIE_REFERENCE.md](./advanced/COOKIE_REFERENCE.md) - Cookie consent reference
39
+
40
+ ---
41
+
42
+ ## Covered by Package Guidelines (MCP)
43
+
44
+ The following topics are maintained as package guidelines and served via MCP `get_guideline()`. They are not duplicated here:
45
+
46
+ **Core:** App Config, CI/CD, Env Setup, I18n, PWA, Testing, Themes, Essences
47
+ **UI:** Components, Gotchas, Layouts, Pages, Routing, SEO
48
+ **Components:** Atomic Components, API Reference
49
+ **Templates:** Blog
50
+ **Functions:** Functions, Vercel
51
+ **CRUD:** CRUD Setup, CRUD Components
52
+ **CLI:** Version Control
57
53
 
58
54
  ---
59
55
 
@@ -17,8 +17,9 @@ VITE_AUTH_PARTNERS=password,emailLink,google,github,facebook
17
17
  // src/config/app.ts
18
18
  export const appConfig: AppConfig = {
19
19
  auth: {
20
- authRoute: '/login',
21
- loginPath: '/login', // Optional: undefined = header providers
20
+ // authRoute: null, // Default: show sign-in in-place (no redirect)
21
+ // authRoute: '/signin', // Optional: redirect to custom login page
22
+ // loginPath: '/login', // Optional: undefined = header providers
22
23
  profilePath: '/profile',
23
24
  },
24
25
  };
@@ -8,12 +8,17 @@
8
8
 
9
9
  **Environment:**
10
10
  ```bash
11
- # .env
11
+ # .env (client-side, exposed to browser)
12
12
  VITE_OAUTH_PARTNERS=github,google,spotify,discord
13
- VITE_OAUTH_GITHUB_CLIENT_ID=your_github_client_id
14
- VITE_OAUTH_GOOGLE_CLIENT_ID=your_google_client_id
15
- VITE_OAUTH_SPOTIFY_CLIENT_ID=your_spotify_client_id
16
- VITE_OAUTH_DISCORD_CLIENT_ID=your_discord_client_id
13
+ VITE_GITHUB_CLIENT_ID=your_github_client_id
14
+ VITE_GOOGLE_CLIENT_ID=your_google_client_id
15
+
16
+ # Server-side secrets (edge functions / cloud functions)
17
+ # Convention: {PROVIDER}_CLIENT_ID, {PROVIDER}_CLIENT_SECRET
18
+ GITHUB_CLIENT_ID=your_github_client_id
19
+ GITHUB_CLIENT_SECRET=your_github_client_secret
20
+ GOOGLE_CLIENT_ID=your_google_client_id
21
+ GOOGLE_CLIENT_SECRET=your_google_client_secret
17
22
  ```
18
23
 
19
24
  **Available:** `github`, `google`, `spotify`, `discord`, `twitch`, `reddit`, `linkedin`, `slack`, `notion`, `medium`, `twitter`, `mastodon`, `youtube`
@@ -36,7 +41,8 @@ const isConnected = useOAuth('isConnected');
36
41
  const loading = useOAuth('loading');
37
42
  const error = useOAuth('error');
38
43
 
39
- await connect('github', 'api-access'); // Purpose: 'authentication' | 'api-access'
44
+ await connect('github', { purpose: 'api-access' }); // Purpose: 'authentication' | 'api-access'
45
+ await connect('github', { purpose: 'api-access', scopes: ['repo', 'user:email'] }); // Custom scopes
40
46
  await disconnect('github');
41
47
  const connected = isConnected('github');
42
48
 
@@ -91,7 +91,9 @@ Deno.serve(serve);
91
91
 
92
92
  **Result:** Auto-generates create, get, list, update, delete handlers for each entity. The dispatcher routes via `_functionName` in the request body.
93
93
 
94
- ### Custom Functions
94
+ ### Custom Functions (typed)
95
+
96
+ For single-operation, schema-validated endpoints (one handler, one schema):
95
97
 
96
98
  ```typescript
97
99
  // supabase/functions/my-function/index.ts
@@ -115,9 +117,47 @@ export default createSupabaseHandler(
115
117
  );
116
118
  ```
117
119
 
118
- **Context available in handler:** `ctx.uid` (authenticated user ID), `ctx.userRole`, `ctx.supabaseAdmin` (admin client with full access).
120
+ **Context:** `ctx.uid`, `ctx.userRole`, `ctx.supabaseAdmin`. Rate limiting, metrics, auth, schema validation included.
121
+
122
+ ### Custom Functions (lightweight)
123
+
124
+ For multi-action functions, webhooks, AI chat, or anything that needs raw `Request` access:
119
125
 
120
- Rate limiting, metrics, auth, schema validation — all included by default.
126
+ ```typescript
127
+ // supabase/functions/my-function/index.ts
128
+ import { createEdgeFunction } from '@donotdev/functions/supabase';
129
+
130
+ // Auth required (default)
131
+ Deno.serve(createEdgeFunction(async (req, ctx) => {
132
+ const body = await req.json();
133
+
134
+ if (body.action === 'list') {
135
+ const { data } = await ctx.supabaseAdmin.from('items').select('*');
136
+ return ctx.json({ items: data });
137
+ }
138
+
139
+ return ctx.error('Unknown action');
140
+ }));
141
+ ```
142
+
143
+ **Context:** `ctx.user` (`{ id, email }` or null), `ctx.supabaseAdmin` (service role), `ctx.userClient` (RLS-scoped), `ctx.json()`, `ctx.error()`, `ctx.respond()`.
144
+
145
+ ```typescript
146
+ // No auth (public endpoint)
147
+ Deno.serve(createEdgeFunction(async (req, ctx) => {
148
+ return ctx.json({ public: true });
149
+ }, { requireAuth: false }));
150
+
151
+ // Webhook with custom auth header
152
+ Deno.serve(createEdgeFunction(async (req, ctx) => {
153
+ const sig = req.headers.get('stripe-signature');
154
+ if (!sig) return ctx.error('Missing signature', 401);
155
+ // verify signature, handle event...
156
+ return ctx.json({ received: true });
157
+ }, { requireAuth: false, extraHeaders: ['stripe-signature'] }));
158
+ ```
159
+
160
+ Both `createSupabaseHandler` and `createEdgeFunction` handle CORS, OPTIONS preflight, and method checking. Never manually define `CORS_HEADERS` in edge functions.
121
161
 
122
162
  ### Deploy Edge Functions
123
163
 
@@ -159,6 +199,13 @@ You never set timestamps in app code — the DB owns them.
159
199
 
160
200
  **Server (Edge Functions, API routes):** use the same URL and `SUPABASE_SECRET_KEY` for admin operations. Never expose the service_role key to the client. Put it in `.dndev.secrets` at project root (or your host's env for production).
161
201
 
202
+ | Variable | Purpose |
203
+ |----------|---------|
204
+ | `SUPABASE_URL` | Project URL (set automatically by Supabase) |
205
+ | `SUPABASE_SERVICE_ROLE_KEY` | Admin key (set automatically by Supabase) |
206
+ | `SUPABASE_ANON_KEY` | Public key (set automatically by Supabase) |
207
+ | `ALLOWED_ORIGIN` | CORS origin for edge functions (default: `*`). Set to your frontend URL in production for credentialed requests (e.g. `https://myapp.com`) |
208
+
162
209
  See [ENV_SETUP.md](./ENV_SETUP.md) for the full secrets policy.
163
210
 
164
211
  ---
@@ -1,9 +1,9 @@
1
1
  # BLUEPRINT: 3_COMPOSE
2
2
 
3
- **Goal:** Build pages with components. HARDCODE ALL STRINGS.
3
+ **Goal:** Build pages with components. i18n from day 1 — ALL strings via `t()`.
4
4
 
5
5
  **MCP:** `start_phase(3)` to begin. Use `lookup_symbol(component_name)` for types. `complete_phase()` when done.
6
- **Done when:** All pages functional with content. CRUD pages use EntityList/EntityFormRenderer. All strings hardcoded.
6
+ **Done when:** All pages functional with content. CRUD pages use EntityList/EntityFormRenderer. All strings via `t()` with locale files.
7
7
 
8
8
  **Prerequisite:** Phase 0-2 complete. PRD + HLD + LLD validated, entities defined.
9
9
 
@@ -13,9 +13,9 @@
13
13
 
14
14
  **Every page must follow the Designer Mandate:**
15
15
  1. **70/30 Hierarchy:** Only ONE `primary` variant button/card per view. Use `outline` or `muted` for everything else to direct the user's eye to the North Star.
16
- 2. **Benefit-First Copy:** Do not use technical titles for Heros/Cards.
17
- - ❌ "User Management" → ✅ "Empower Your Team"
18
- - ❌ "Car List" → ✅ "Explore the Fleet"
16
+ 2. **Benefit-First Copy:** Do not use technical titles for Heros/Cards.
17
+ - No "User Management" -> "Empower Your Team"
18
+ - No "Car List" -> "Explore the Fleet"
19
19
  3. **Success Intent:** Ensure framework default toasts are working. Only add a custom celebratory view or Redirect for the **North Star** goal completion.
20
20
 
21
21
  ---
@@ -26,7 +26,7 @@
26
26
 
27
27
  It shows the canonical pattern:
28
28
  - Thin page wrappers (~5 lines) that import templates
29
- - `PageMeta.preset` for per-route layout switching (landing → admin → docs)
29
+ - `PageMeta.preset` for per-route layout switching (landing -> admin -> docs)
30
30
  - CRUD with `ProductCardListTemplate` + `defineEntity()`
31
31
  - Component showcase with filterable grid
32
32
 
@@ -121,23 +121,21 @@ Copy Landing pattern from `page_patterns.md`:
121
121
 
122
122
  ---
123
123
 
124
- ## CRITICAL: HARDCODE FIRST
124
+ ## i18n FROM DAY 1
125
125
 
126
126
  ```tsx
127
- // ✅ GOOD - Start with hardcoded strings
128
- <HeroSection
129
- title="Welcome to My App"
130
- subtitle="The best app ever"
131
- />
127
+ // ALWAYS use t() — even with one language
128
+ const { t } = useTranslation('home');
132
129
 
133
- // ❌ BAD - Don't start with i18n
134
130
  <HeroSection
135
131
  title={t('hero.title')}
136
132
  subtitle={t('hero.subtitle')}
137
133
  />
138
134
  ```
139
135
 
140
- Validate UX in one language. Add i18n in Phase 4 (CONFIGURE) after validation.
136
+ Create locale files alongside pages: `src/locales/{namespace}_{lang}.json`
137
+
138
+ Adding a language later must be zero-cost. No hardcoded user-facing strings, ever.
141
139
 
142
140
  ---
143
141
 
@@ -146,5 +144,5 @@ Validate UX in one language. Add i18n in Phase 4 (CONFIGURE) after validation.
146
144
  - [ ] All CRUD pages use EntityList/EntityFormRenderer
147
145
  - [ ] Dashboard uses pattern from page_patterns.md
148
146
  - [ ] Landing pages use framework components
149
- - [ ] All strings are HARDCODED (not i18n)
147
+ - [ ] All strings via t() with locale files created
150
148
  - [ ] App is fully functional
@@ -1,10 +0,0 @@
1
- {
2
- "name": "DoNotDev App",
3
- "short_name": "DoNotDev",
4
- "description": "Built with DoNotDev Framework ©",
5
- "start_url": "/",
6
- "display": "standalone",
7
- "background_color": "#ffffff",
8
- "theme_color": "#000000",
9
- "icons": []
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "DoNotDev App",
3
- "short_name": "DoNotDev",
4
- "description": "Built with DoNotDev Framework ©",
5
- "start_url": "/",
6
- "display": "standalone",
7
- "background_color": "#ffffff",
8
- "theme_color": "#000000",
9
- "icons": []
10
- }