@donotdev/cli 0.0.36 → 0.1.0

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 (64) hide show
  1. package/LICENSE.md +21 -48
  2. package/dependencies-matrix.json +24 -24
  3. package/dist/bin/commands/agent-setup.js +6965 -125
  4. package/dist/bin/commands/build.js +6 -3
  5. package/dist/bin/commands/bump.js +35 -15
  6. package/dist/bin/commands/cacheout.js +19 -3
  7. package/dist/bin/commands/coach.js +6 -3
  8. package/dist/bin/commands/create-app.js +18 -4
  9. package/dist/bin/commands/create-project.js +19 -5
  10. package/dist/bin/commands/db.js +1700 -3786
  11. package/dist/bin/commands/deploy.js +144 -98
  12. package/dist/bin/commands/dev.js +8 -7
  13. package/dist/bin/commands/doctor.js +6 -3
  14. package/dist/bin/commands/emu.js +8 -7
  15. package/dist/bin/commands/format.js +7 -5
  16. package/dist/bin/commands/get-demo.js +18 -4
  17. package/dist/bin/commands/make-admin.js +1809 -179
  18. package/dist/bin/commands/preview.js +8 -7
  19. package/dist/bin/commands/seed.js +1700 -3786
  20. package/dist/bin/commands/setup-cicd.js +6 -3
  21. package/dist/bin/commands/setup.js +23 -20
  22. package/dist/bin/commands/staging.js +144 -98
  23. package/dist/bin/commands/sync-secrets.js +6 -3
  24. package/dist/bin/commands/type-check.js +6 -3
  25. package/dist/bin/commands/wai.js +6 -3
  26. package/dist/bin/dndev.js +21 -1
  27. package/dist/bin/donotdev.js +21 -1
  28. package/dist/index.js +172 -107
  29. package/package.json +2 -2
  30. package/templates/app-next/src/locales/home_en.json.example +6 -6
  31. package/templates/app-vite/src/locales/home_en.json.example +6 -6
  32. package/templates/functions-supabase/supabase/functions/.env.example +12 -0
  33. package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
  34. package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
  35. package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
  36. package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
  37. package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
  38. package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
  39. package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
  40. package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
  41. package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
  42. package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
  43. package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
  44. package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
  45. package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
  46. package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
  47. package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
  48. package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
  49. package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
  50. package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
  51. package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
  52. package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
  53. package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
  54. package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
  55. package/templates/root-consumer/.claude/commands/brainstorm.md.example +28 -0
  56. package/templates/root-consumer/.claude/commands/design.md.example +31 -0
  57. package/templates/root-consumer/.claude/commands/grill.md.example +33 -6
  58. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
  59. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +50 -0
  60. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
  61. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +11 -5
  62. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +2 -1
  63. package/templates/root-consumer/guides/dndev/advanced/COOKIE_REFERENCE.md.example +252 -252
  64. package/templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example +174 -174
@@ -0,0 +1,292 @@
1
+ 'use client';
2
+ // {{appName}} - Settings Page
3
+
4
+ import {
5
+ Settings,
6
+ User,
7
+ Bell,
8
+ Lock,
9
+ Mail,
10
+ Smartphone,
11
+ ShieldCheck,
12
+ Key,
13
+ } from 'lucide-react';
14
+
15
+ import {
16
+ Alert,
17
+ Button,
18
+ BUTTON_VARIANT,
19
+ Card,
20
+ Grid,
21
+ Input,
22
+ Section,
23
+ Select,
24
+ Separator,
25
+ Stack,
26
+ Switch,
27
+ Tabs,
28
+ Text,
29
+ } from '@donotdev/components';
30
+ import { useTranslation } from '@donotdev/core';
31
+ import { PageContainer } from '@donotdev/ui';
32
+ import { useAuth } from '@donotdev/auth';
33
+
34
+ import type { PageMeta } from '@donotdev/core';
35
+
36
+ export const NAMESPACE = 'settings';
37
+
38
+ export const meta: PageMeta = {
39
+ namespace: NAMESPACE,
40
+ icon: <Settings />,
41
+ auth: true,
42
+ preset: 'admin',
43
+ };
44
+
45
+ function ProfileTab() {
46
+ const { t } = useTranslation(NAMESPACE);
47
+ const user = useAuth('user');
48
+
49
+ return (
50
+ <Stack gap="large">
51
+ <Card
52
+ title={t('settings.profile.personalInfo', 'Personal Information')}
53
+ subtitle={t('settings.profile.personalInfoDesc', 'Update your personal details and public profile.')}
54
+ content={
55
+ <Stack gap="medium">
56
+ <Grid cols={[1, 1, 2, 2]} gap="medium">
57
+ <Input
58
+ label={t('settings.profile.firstName', 'First Name')}
59
+ placeholder={t('settings.profile.firstNamePlaceholder', 'Enter your first name')}
60
+ icon={User}
61
+ />
62
+ <Input
63
+ label={t('settings.profile.lastName', 'Last Name')}
64
+ placeholder={t('settings.profile.lastNamePlaceholder', 'Enter your last name')}
65
+ />
66
+ </Grid>
67
+ <Input
68
+ label={t('settings.profile.email', 'Email Address')}
69
+ placeholder={user?.email ?? t('settings.profile.emailPlaceholder', 'your@email.com')}
70
+ icon={Mail}
71
+ />
72
+ <Select
73
+ label={t('settings.profile.language', 'Language')}
74
+ placeholder={t('settings.profile.languagePlaceholder', 'Select your language')}
75
+ options={[
76
+ { label: 'English', value: 'en' },
77
+ { label: 'Francais', value: 'fr' },
78
+ { label: 'Deutsch', value: 'de' },
79
+ { label: 'Espanol', value: 'es' },
80
+ ]}
81
+ value="en"
82
+ onValueChange={() => {}}
83
+ />
84
+ </Stack>
85
+ }
86
+ footer={
87
+ <Stack direction="row" justify="end" gap="medium">
88
+ <Button variant={BUTTON_VARIANT.GHOST}>
89
+ {t('settings.profile.cancel', 'Cancel')}
90
+ </Button>
91
+ <Button variant={BUTTON_VARIANT.PRIMARY}>
92
+ {t('settings.profile.save', 'Save Changes')}
93
+ </Button>
94
+ </Stack>
95
+ }
96
+ />
97
+ </Stack>
98
+ );
99
+ }
100
+
101
+ function NotificationsTab() {
102
+ const { t } = useTranslation(NAMESPACE);
103
+
104
+ const emailPreferences = [
105
+ {
106
+ label: t('settings.notifications.productUpdates', 'Product updates'),
107
+ description: t('settings.notifications.productUpdatesDesc', 'Receive emails about new features and improvements.'),
108
+ defaultChecked: true,
109
+ },
110
+ {
111
+ label: t('settings.notifications.securityAlerts', 'Security alerts'),
112
+ description: t('settings.notifications.securityAlertsDesc', 'Get notified about security events on your account.'),
113
+ defaultChecked: true,
114
+ },
115
+ {
116
+ label: t('settings.notifications.billing', 'Billing notifications'),
117
+ description: t('settings.notifications.billingDesc', 'Receive invoices and payment confirmations.'),
118
+ defaultChecked: true,
119
+ },
120
+ {
121
+ label: t('settings.notifications.marketing', 'Marketing emails'),
122
+ description: t('settings.notifications.marketingDesc', 'Tips, best practices, and promotional offers.'),
123
+ defaultChecked: false,
124
+ },
125
+ ];
126
+
127
+ const pushPreferences = [
128
+ {
129
+ label: t('settings.notifications.pushActivity', 'Activity notifications'),
130
+ description: t('settings.notifications.pushActivityDesc', 'Get push notifications for team activity and mentions.'),
131
+ defaultChecked: true,
132
+ },
133
+ {
134
+ label: t('settings.notifications.pushReminders', 'Reminders'),
135
+ description: t('settings.notifications.pushRemindersDesc', 'Receive reminders for upcoming deadlines and events.'),
136
+ defaultChecked: false,
137
+ },
138
+ ];
139
+
140
+ return (
141
+ <Stack gap="large">
142
+ <Card
143
+ title={t('settings.notifications.emailTitle', 'Email Notifications')}
144
+ subtitle={t('settings.notifications.emailSubtitle', 'Choose which emails you would like to receive.')}
145
+ icon={Mail}
146
+ content={
147
+ <Stack gap="medium">
148
+ {emailPreferences.map((pref) => (
149
+ <Stack key={pref.label} direction="row" justify="space-between" align="center" gap="medium">
150
+ <Stack gap="none">
151
+ <Text level="body" weight="medium">{pref.label}</Text>
152
+ <Text level="small" variant="muted">{pref.description}</Text>
153
+ </Stack>
154
+ <Switch checked={pref.defaultChecked} onCheckedChange={() => {}} />
155
+ </Stack>
156
+ ))}
157
+ </Stack>
158
+ }
159
+ />
160
+
161
+ <Card
162
+ title={t('settings.notifications.pushTitle', 'Push Notifications')}
163
+ subtitle={t('settings.notifications.pushSubtitle', 'Manage your mobile and desktop push notifications.')}
164
+ icon={Smartphone}
165
+ content={
166
+ <Stack gap="medium">
167
+ {pushPreferences.map((pref) => (
168
+ <Stack key={pref.label} direction="row" justify="space-between" align="center" gap="medium">
169
+ <Stack gap="none">
170
+ <Text level="body" weight="medium">{pref.label}</Text>
171
+ <Text level="small" variant="muted">{pref.description}</Text>
172
+ </Stack>
173
+ <Switch checked={pref.defaultChecked} onCheckedChange={() => {}} />
174
+ </Stack>
175
+ ))}
176
+ </Stack>
177
+ }
178
+ />
179
+ </Stack>
180
+ );
181
+ }
182
+
183
+ function SecurityTab() {
184
+ const { t } = useTranslation(NAMESPACE);
185
+
186
+ return (
187
+ <Stack gap="large">
188
+ <Card
189
+ title={t('settings.security.passwordTitle', 'Change Password')}
190
+ subtitle={t('settings.security.passwordSubtitle', 'Update your password to keep your account secure.')}
191
+ icon={Key}
192
+ content={
193
+ <Stack gap="medium">
194
+ <Input
195
+ label={t('settings.security.currentPassword', 'Current Password')}
196
+ placeholder="********"
197
+ icon={Lock}
198
+ />
199
+ <Input
200
+ label={t('settings.security.newPassword', 'New Password')}
201
+ placeholder="********"
202
+ icon={Lock}
203
+ />
204
+ <Input
205
+ label={t('settings.security.confirmPassword', 'Confirm New Password')}
206
+ placeholder="********"
207
+ icon={Lock}
208
+ />
209
+ </Stack>
210
+ }
211
+ footer={
212
+ <Stack direction="row" justify="end">
213
+ <Button variant={BUTTON_VARIANT.PRIMARY}>
214
+ {t('settings.security.updatePassword', 'Update Password')}
215
+ </Button>
216
+ </Stack>
217
+ }
218
+ />
219
+
220
+ <Card
221
+ title={t('settings.security.twoFactorTitle', 'Two-Factor Authentication')}
222
+ subtitle={t('settings.security.twoFactorSubtitle', 'Add an extra layer of security to your account.')}
223
+ icon={ShieldCheck}
224
+ content={
225
+ <Stack gap="medium">
226
+ <Alert
227
+ variant="info"
228
+ title={t('settings.security.twoFactorInfo', '2FA is currently disabled')}
229
+ description={t('settings.security.twoFactorInfoDesc', 'Enable two-factor authentication for enhanced account security. You will need an authenticator app like Google Authenticator or Authy.')}
230
+ />
231
+ <Stack direction="row" justify="space-between" align="center">
232
+ <Stack gap="none">
233
+ <Text level="body" weight="medium">
234
+ {t('settings.security.enable2FA', 'Enable 2FA')}
235
+ </Text>
236
+ <Text level="small" variant="muted">
237
+ {t('settings.security.enable2FADesc', 'Require a verification code on each sign-in.')}
238
+ </Text>
239
+ </Stack>
240
+ <Switch checked={false} onCheckedChange={() => {}} />
241
+ </Stack>
242
+ </Stack>
243
+ }
244
+ />
245
+
246
+ <Card
247
+ title={t('settings.security.sessionsTitle', 'Active Sessions')}
248
+ subtitle={t('settings.security.sessionsSubtitle', 'Manage your active sessions across devices.')}
249
+ content={
250
+ <Stack gap="medium">
251
+ <Text level="small" variant="muted">
252
+ {t('settings.security.sessionsDesc', 'You are currently signed in on this device. If you notice any suspicious activity, sign out of all other sessions immediately.')}
253
+ </Text>
254
+ <Button variant={BUTTON_VARIANT.DESTRUCTIVE}>
255
+ {t('settings.security.signOutAll', 'Sign Out of All Other Sessions')}
256
+ </Button>
257
+ </Stack>
258
+ }
259
+ />
260
+ </Stack>
261
+ );
262
+ }
263
+
264
+ export default function SettingsPage() {
265
+ const { t } = useTranslation(NAMESPACE);
266
+
267
+ const tabItems = [
268
+ {
269
+ value: 'profile',
270
+ label: t('settings.tabs.profile', 'Profile'),
271
+ content: <ProfileTab />,
272
+ },
273
+ {
274
+ value: 'notifications',
275
+ label: t('settings.tabs.notifications', 'Notifications'),
276
+ content: <NotificationsTab />,
277
+ },
278
+ {
279
+ value: 'security',
280
+ label: t('settings.tabs.security', 'Security'),
281
+ content: <SecurityTab />,
282
+ },
283
+ ];
284
+
285
+ return (
286
+ <PageContainer variant="standard">
287
+ <Section title={t('settings.title', 'Settings')}>
288
+ <Tabs items={tabItems} defaultValue="profile" />
289
+ </Section>
290
+ </PageContainer>
291
+ );
292
+ }
@@ -49,6 +49,34 @@ start_phase(0)
49
49
  ```
50
50
  This activates Phase 0: BRAINSTORM and loads the blueprint, persona, context, and lessons learned from previous sessions. **Do NOT proceed without this call.**
51
51
 
52
+ ### Step 0b: Vision Challenge (MANDATORY - before extraction)
53
+
54
+ Before asking a single requirements question, challenge the idea itself. This is not about feasibility - it's about whether the right thing is being built.
55
+
56
+ **Ask these 4 questions, one at a time. Wait for each answer.**
57
+
58
+ 1. **Job-to-be-done:** "Forget the app for a second. What's the actual outcome your users need? Not the feature - the result. What job are they hiring this app to do?"
59
+ - If the answer is a feature ("manage invoices"), push back: "Managing invoices is a task. What's the outcome? Getting paid faster? Reducing accounting errors? Tax compliance?"
60
+
61
+ 2. **10-star version:** "If this app were so good it felt like magic - what would that look like? Don't worry about feasibility. What's the dream?"
62
+ - This reveals the real ambition. Most people self-censor. Draw out the vision they're afraid to say.
63
+
64
+ 3. **What sucks today:** "How are your users solving this problem right now? What's broken about that solution?"
65
+ - If they say "nothing exists" - probe harder. There's always a current solution, even if it's Excel, WhatsApp, or paper.
66
+
67
+ 4. **Minimum switch trigger:** "What's the ONE thing this app must do on day one that would make someone stop using their current solution and switch to yours?"
68
+ - This is the MVP anchor. Everything else is V2.
69
+
70
+ **After all 4 answers, synthesize:**
71
+
72
+ > **Vision lock:** "[Job-to-be-done] by [minimum switch trigger]. Current solutions fail because [what sucks]. The 10-star version would [dream]."
73
+
74
+ Ask: "Is this right? Anything to adjust before we dive into requirements?"
75
+
76
+ Only proceed to Step 1 after user confirms.
77
+
78
+ ---
79
+
52
80
  ### Step 1: Activate EXTRACTOR Agent
53
81
 
54
82
  **Deploy:** `/agents extractor` (BMAD EXTRACTOR persona)
@@ -51,6 +51,37 @@ complete_phase({ files: ["...affected files..."], summary: "Description of what
51
51
  ```
52
52
  Wait for user to call `approve_phase()` before moving on.
53
53
 
54
+ ### Step 0b: Scope Challenge (MANDATORY - before any design)
55
+
56
+ Before designing anything, challenge the scope. This prevents over-engineering and ensures we're not building what already exists.
57
+
58
+ **Run these checks silently (no user interaction needed):**
59
+
60
+ 1. **What already exists?** Search the framework with `search_framework()` and `lookup_symbol()`. List everything that already solves part of this requirement. If 80%+ exists, the design might just be "compose existing pieces."
61
+
62
+ 2. **Minimum viable change?** What is the absolute smallest change that solves the requirement? One file? One function? A config change?
63
+
64
+ 3. **File count smell test:** If the design would touch 8+ files, flag it:
65
+ > "This design touches N files. That's a smell. Is there a simpler approach, or is this genuinely complex?"
66
+
67
+ **Then present the scope assessment and ask user to pick a mode:**
68
+
69
+ > **Scope assessment:**
70
+ > - Already exists: [what we found]
71
+ > - Minimum viable: [smallest possible change]
72
+ > - Files affected: [count + list]
73
+ >
74
+ > **Mode:**
75
+ > - **REDUCTION** - Compose existing pieces, minimal new code
76
+ > - **HOLD SCOPE** - Build exactly what's requested, nothing more
77
+ > - **EXPANSION** - Solve the broader problem (more files, new abstractions)
78
+ >
79
+ > Recommend: [REDUCTION/HOLD/EXPANSION] because [reason].
80
+
81
+ **After user picks a mode, commit to it fully.** Your job becomes making the chosen scope succeed, not lobbying for a different one.
82
+
83
+ ---
84
+
54
85
  ### Step 1: Architect Phase
55
86
 
56
87
  **Deploy:** `/agents architect` (WAI-WAY architect role)
@@ -8,15 +8,42 @@ Act as a skeptical staff engineer doing a blocking code review.
8
8
 
9
9
  Target: the last modified files in this session, or files passed as argument.
10
10
 
11
- Evaluate for:
12
- - Architectural anti-patterns (coupling, wrong abstraction layer, violation of existing conventions)
13
- - Missing edge cases (null/undefined, empty arrays, concurrent updates, auth failure paths)
11
+ ## Execution — Two-Pass Review
12
+
13
+ Run Pass 1, then Pass 2. Pass 1 items require user decision before proceeding. Pass 2 items are informational only.
14
+
15
+ ### Pass 1 — CRITICAL (stops for user decision)
16
+
17
+ Items that **must be resolved before shipping**. After listing all Pass 1 items, present each one individually and ask: **Fix / Acknowledge / Skip**.
18
+
19
+ - One item = one question. Never batch decisions.
20
+ - Do NOT proceed to Pass 2 until all Pass 1 items are resolved.
21
+ - If zero Pass 1 items, proceed directly to Pass 2.
22
+
23
+ **BLOCKER** - breaks in production or loses data:
14
24
  - Security issues (injection, unvalidated input at system boundaries, exposed secrets)
15
- - Over-engineering (abstractions not earned by current requirements)
25
+ - Logic bugs producing wrong results
26
+ - Data loss paths (silent overwrites, missing error handling on writes)
27
+ - Breaking API contract changes
28
+ - @donotdev component misuse without `lookup_symbol` verification
29
+
30
+ **WARN-CRITICAL** - real problem users WILL hit soon:
31
+ - Auth/authz bypass on common paths
32
+ - Data corruption on normal usage flows
33
+
34
+ ### Pass 2 — INFORMATIONAL (listed, no action required)
35
+
36
+ Listed for awareness. No user decision needed. No fixes during review.
37
+
38
+ **WARN** - real problem, won't explode immediately:
39
+ - Missing edge cases (null/undefined, empty arrays, concurrent updates, auth failure paths)
40
+ - Architectural anti-patterns with concrete consequences
16
41
  - Missing or incorrect TypeScript types
17
- - @donotdev component usage without `lookup_symbol` verification
18
42
 
19
- Rules:
43
+ **NOTE** - sparingly. Only genuine maintainer gotchas.
44
+
45
+ ### Rules
46
+
20
47
  - NEVER suggest fixes. Report problems only.
21
48
  - NEVER skip BLOCKER items to be polite.
22
49
  - If there are no issues at a severity level, omit that level entirely.
@@ -16,6 +16,22 @@ start_phase(0)
16
16
  ```
17
17
  Do NOT proceed without this call.
18
18
 
19
+ ## Step 0b — Vision Challenge (MANDATORY - before extraction)
20
+
21
+ Before asking requirements questions, challenge the idea. 4 questions, one at a time:
22
+
23
+ 1. **Job-to-be-done:** "What's the actual outcome your users need? Not the feature - the result."
24
+ - Push back on feature-answers: "Managing invoices is a task. What's the outcome?"
25
+ 2. **10-star version:** "If this app were magic - what would it look like?"
26
+ 3. **What sucks today:** "How do users solve this now? What's broken?"
27
+ 4. **Minimum switch trigger:** "What ONE thing must it do on day one to make someone switch?"
28
+
29
+ Synthesize: **Vision lock:** "[Job] by [switch trigger]. Current solutions fail because [sucks]. 10-star = [dream]."
30
+
31
+ Confirm with user before proceeding.
32
+
33
+ ---
34
+
19
35
  ## Step 1 — Extract
20
36
 
21
37
  **Input:** $ARGUMENTS
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: build
3
+ description: Implement features using framework defaults. Use AFTER /design. Activates WAI-WAY Phase 3 COMPOSE.
4
+ argument-hint: [requirement or LLD reference]
5
+ disable-model-invocation: true
6
+ ---
7
+
8
+ # Build — Compose the App
9
+
10
+ **WORKFLOW:** `/brainstorm` → `/design` → `/build` → `/polish`
11
+
12
+ ## Step 0 — Start Phase (MANDATORY)
13
+
14
+ ```
15
+ start_phase(3)
16
+ ```
17
+ Do NOT write code without this call.
18
+
19
+ ## Step 1 — Prepare
20
+
21
+ **Input:** $ARGUMENTS (LLD from `/design` or direct requirement)
22
+
23
+ 1. Read LLD if it exists
24
+ 2. **STOP before every `@donotdev` import** → call `lookup_symbol({ symbol: "Name" })`. No exceptions. Do NOT guess props, hooks, or APIs.
25
+ 3. Import convention: always `@donotdev/<package>` — never sub-paths. Only exceptions: `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`.
26
+
27
+ ## Step 2 — Build in phases
28
+
29
+ 1. **Entities** — create entity files
30
+ 2. **Routes** — create route config
31
+ 3. **Auth** — if needed
32
+ 4. **Pages** — using framework defaults only (no styling, no customization)
33
+ 5. **Custom components** — if any
34
+ 6. **Integration** — wire everything together
35
+
36
+ Rules:
37
+ - Framework defaults ONLY — styling deferred to `/polish`
38
+ - Hardcode all strings — i18n deferred to `/polish`
39
+ - Run `dndev tc` after every file change — fix errors immediately
40
+ - Validate each phase before proceeding
41
+
42
+ ## Step 3 — Complete Phase
43
+
44
+ When all pages built and `dndev tc` passes:
45
+
46
+ ```
47
+ complete_phase({ files: ["src/pages/...all files..."], summary: "N pages composed, all type-checking" })
48
+ ```
49
+
50
+ Wait for user `approve_phase()` → then proceed to `/polish`.
@@ -17,6 +17,23 @@ start_phase(2) # ENTITIES (data models, fields, access)
17
17
  ```
18
18
  Pick the appropriate phase. Do NOT proceed without this call.
19
19
 
20
+ ## Step 0b — Scope Challenge (MANDATORY)
21
+
22
+ Before designing, challenge scope silently:
23
+
24
+ 1. **What already exists?** `search_framework()` + `lookup_symbol()`. If 80%+ exists → "compose existing pieces"
25
+ 2. **Minimum viable change?** Smallest change that solves it
26
+ 3. **File count smell:** 8+ files → flag it
27
+
28
+ Present scope assessment + mode choice:
29
+ - **REDUCTION** - Compose existing, minimal new code
30
+ - **HOLD SCOPE** - Exactly what's requested
31
+ - **EXPANSION** - Broader problem, new abstractions
32
+
33
+ Recommend one. After user picks, commit fully.
34
+
35
+ ---
36
+
20
37
  ## Step 1 — Analyze
21
38
 
22
39
  **Input:** $ARGUMENTS
@@ -26,14 +26,22 @@ 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 — Two-Pass Scan
30
+
31
+ ### Pass 1 — CRITICAL (stops for user decision)
32
+
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.
30
34
 
31
- Review target files for:
32
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
+
33
41
  - **WARN** — real problems users will hit (missing edge cases, misleading dead code)
34
42
  - **NOTE** — sparingly, genuine gotchas only
35
43
 
36
- What NOT to flag:
44
+ ### What NOT to flag:
37
45
  - Optimization suggestions, style, formatting
38
46
  - Hypothetical edge cases against TypeScript types
39
47
  - Dev-only code, harmless dead code
@@ -41,8 +49,6 @@ What NOT to flag:
41
49
 
42
50
  **Self-test:** "Would I block a PR for this?" No → skip.
43
51
 
44
- Also check: @donotdev component usage without `lookup_symbol` verification.
45
-
46
52
  ## Step 3 — Filter + Write
47
53
 
48
54
  1. Filter out `grill-ignore.json` matches (fuzzy on issue text)
@@ -36,7 +36,8 @@ const isConnected = useOAuth('isConnected');
36
36
  const loading = useOAuth('loading');
37
37
  const error = useOAuth('error');
38
38
 
39
- await connect('github', 'api-access'); // Purpose: 'authentication' | 'api-access'
39
+ await connect('github', { purpose: 'api-access' }); // Purpose: 'authentication' | 'api-access'
40
+ await connect('github', { purpose: 'api-access', scopes: ['repo', 'user:email'] }); // Custom scopes
40
41
  await disconnect('github');
41
42
  const connected = isConnected('github');
42
43