@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.
- package/LICENSE.md +21 -48
- package/dependencies-matrix.json +108 -58
- package/dist/bin/commands/agent-setup.js +7196 -123
- package/dist/bin/commands/build.js +3341 -207
- package/dist/bin/commands/bump.js +268 -24
- package/dist/bin/commands/cacheout.js +262 -13
- package/dist/bin/commands/coach.js +365 -61
- package/dist/bin/commands/create-app.js +261 -14
- package/dist/bin/commands/create-project.js +270 -15
- package/dist/bin/commands/db.js +10743 -2346
- package/dist/bin/commands/deploy.js +4202 -776
- package/dist/bin/commands/dev.js +353 -38
- package/dist/bin/commands/doctor.js +412 -108
- package/dist/bin/commands/emu.js +392 -57
- package/dist/bin/commands/format.js +250 -15
- package/dist/bin/commands/get-demo.js +261 -14
- package/dist/bin/commands/make-admin.js +10022 -1552
- package/dist/bin/commands/preview.js +353 -38
- package/dist/bin/commands/seed.js +10743 -2346
- package/dist/bin/commands/setup-cicd.js +456 -133
- package/dist/bin/commands/setup.js +428 -125
- package/dist/bin/commands/staging.js +4202 -776
- package/dist/bin/commands/sync-secrets.js +250 -14
- package/dist/bin/commands/type-check.js +249 -13
- package/dist/bin/commands/wai.js +249 -13
- package/dist/bin/dndev.js +33 -4
- package/dist/bin/donotdev.js +33 -4
- package/dist/index.js +4278 -856
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +3 -2
- package/templates/app-demo/src/themes.css.example +21 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/themes.css.example +21 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/themes.css.example +21 -0
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/src/themes.css.example +21 -0
- package/templates/functions-supabase/supabase/functions/.env.example +12 -0
- package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -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/20250101000003_operation_metrics.sql +3 -0
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
- package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
- package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
- package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
- package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
- package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
- package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
- package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -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 +123 -1
- package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
- package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +33 -16
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/AI.md.example +2 -2
- package/templates/root-consumer/CLAUDE.md.example +33 -1
- package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +12 -6
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
- 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 -147
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -153
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -108
- 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/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/SETUP_APP_CONFIG.md.example +0 -132
- 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_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_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- 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/essences_reference.css.example +0 -288
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: grill
|
|
3
|
-
description: Critical staff-engineer code review
|
|
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
|
|
12
|
+
## Step 0 - Situational Awareness
|
|
13
13
|
|
|
14
|
-
1. Read `.dndev/grill-report.json`
|
|
15
|
-
2. Read `.dndev/grill-ignore.json`
|
|
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**
|
|
21
|
-
**If empty**
|
|
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
|
|
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
|
|
29
|
+
## Step 2 - Three-Pass Scan
|
|
30
30
|
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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 —
|
|
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 —
|
|
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
|
-
|
|
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
|
-
##
|
|
39
|
+
## Step 2 — Generate Tests
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
Tests verify the SPEC, not the code. The spec is the test plan.
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
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
|
-
|
|
36
|
-
Auto-detect provider (Firestore or Supabase RLS). Generate rules from entity access definitions.
|
|
47
|
+
## Step 3 — Database Rules
|
|
37
48
|
|
|
38
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
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: [
|
|
86
|
+
complete_phase({ files: [...], summary: "QA passed, spec-compliant, ready to ship" })
|
|
74
87
|
```
|
|
75
88
|
|
|
76
|
-
Wait for user `approve_phase()`. Then →
|
|
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
|
-
- **
|
|
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** —
|
|
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
|
-
|
|
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)
|
|
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)
|
|
12
|
-
- [
|
|
13
|
-
- [
|
|
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
|
-
- [
|
|
39
|
-
- [
|
|
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
|
-
- [
|
|
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/
|
|
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:
|
|
21
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
-
-
|
|
18
|
-
-
|
|
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
|
|
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
|
-
##
|
|
124
|
+
## i18n FROM DAY 1
|
|
125
125
|
|
|
126
126
|
```tsx
|
|
127
|
-
//
|
|
128
|
-
|
|
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
|
-
|
|
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
|
|
147
|
+
- [ ] All strings via t() with locale files created
|
|
150
148
|
- [ ] App is fully functional
|