@donotdev/cli 0.0.19 → 0.0.21
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/README.md +31 -0
- package/dependencies-matrix.json +205 -50
- package/dist/bin/commands/agent-setup.js +2 -2
- package/dist/bin/commands/build.js +6 -6
- package/dist/bin/commands/bump.js +495 -70
- package/dist/bin/commands/cacheout.js +6 -6
- package/dist/bin/commands/coach.js +6 -6
- package/dist/bin/commands/create-app.js +24 -16
- package/dist/bin/commands/create-project.js +114 -18
- package/dist/bin/commands/db.js +142136 -0
- package/dist/bin/commands/deploy.js +354 -126
- package/dist/bin/commands/dev.js +6 -6
- package/dist/bin/commands/doctor.js +140 -33
- package/dist/bin/commands/emu.js +6 -6
- package/dist/bin/commands/format.js +6 -6
- package/dist/bin/commands/get-demo.js +11 -6
- package/dist/bin/commands/make-admin.js +14210 -13770
- package/dist/bin/commands/preview.js +6 -6
- package/dist/bin/commands/seed.js +142426 -0
- package/dist/bin/commands/setup-cicd.js +8904 -0
- package/dist/bin/commands/setup.js +259 -212
- package/dist/bin/commands/staging.js +361 -127
- package/dist/bin/commands/sync-secrets.js +55 -33
- package/dist/bin/commands/type-check.js +16 -10
- package/dist/bin/commands/wai.js +6 -6
- package/dist/bin/dndev.js +194 -188
- package/dist/bin/donotdev.js +139 -189
- package/dist/index.js +468 -144
- package/package.json +1 -1
- package/templates/app-demo/.env.example +1 -0
- package/templates/{root-consumer → app-demo}/entities/ExampleEntity.ts.example +15 -9
- package/templates/app-demo/index.html.example +1 -1
- package/templates/app-demo/public/apple-touch-icon.png.example +0 -0
- package/templates/app-demo/public/favicon.svg.example +1 -0
- package/templates/app-demo/public/icon-192x192.png.example +0 -0
- package/templates/app-demo/public/icon-512x512.png.example +0 -0
- package/templates/app-demo/src/App.tsx.example +3 -1
- package/templates/app-demo/src/config/app.ts.example +1 -0
- package/templates/app-demo/src/entities/booking.ts.example +75 -0
- package/templates/app-demo/src/entities/onboarding.ts.example +160 -0
- package/templates/app-demo/src/entities/product.ts.example +12 -0
- package/templates/app-demo/src/entities/quote.ts.example +70 -0
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +28 -1
- package/templates/app-demo/src/pages/ConditionalFormPage.tsx.example +88 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +355 -2
- package/templates/app-demo/src/pages/OnboardingPage.tsx.example +47 -0
- package/templates/app-demo/src/pages/PricingPage.tsx.example +28 -1
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +2 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +2 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +22 -16
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +3 -1
- package/templates/app-demo/src/pages/components/ComponentRenderer.tsx.example +147 -51
- package/templates/app-demo/src/pages/components/ComponentsData.tsx.example +103 -21
- package/templates/app-demo/src/pages/components/componentConfig.ts.example +139 -59
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +12 -1
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +10 -1
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +10 -1
- package/templates/app-demo/src/themes.css.example +289 -77
- package/templates/app-demo/stats.html.example +4949 -0
- package/templates/app-dndev/index.html.example +164 -0
- package/templates/app-dndev/public/logo.svg.example +1 -0
- package/templates/app-dndev/public/manifest.json.example +10 -0
- package/templates/app-dndev/src/App.tsx.example +35 -0
- package/templates/app-dndev/src/components/CockpitLayout.css.example +181 -0
- package/templates/app-dndev/src/components/CockpitLayout.tsx.example +209 -0
- package/templates/app-dndev/src/components/Kanban.css.example +385 -0
- package/templates/app-dndev/src/components/ModeToggle.tsx.example +32 -0
- package/templates/app-dndev/src/components/OverlaySlot.tsx.example +68 -0
- package/templates/app-dndev/src/components/TerminalPanel.css.example +228 -0
- package/templates/app-dndev/src/components/TerminalPanel.tsx.example +714 -0
- package/templates/app-dndev/src/components/markdown-prose.css.example +49 -0
- package/templates/app-dndev/src/components/phases/CaptainLog.tsx.example +107 -0
- package/templates/app-dndev/src/components/phases/ContextTabs.tsx.example +352 -0
- package/templates/app-dndev/src/components/phases/PhaseCard.tsx.example +126 -0
- package/templates/app-dndev/src/components/phases/PhaseDetail.tsx.example +147 -0
- package/templates/app-dndev/src/components/phases/ReviewPanel.tsx.example +115 -0
- package/templates/app-dndev/src/components/phases/phaseData.ts.example +366 -0
- package/templates/app-dndev/src/config/app.ts.example +103 -0
- package/templates/app-dndev/src/config/commands.ts.example +171 -0
- package/templates/app-dndev/src/config/legal.ts.example +170 -0
- package/templates/app-dndev/src/config/providers.ts.example +7 -0
- package/templates/app-dndev/src/globals.css.example +10 -0
- package/templates/app-dndev/src/hooks/useDndevFile.ts.example +144 -0
- package/templates/app-dndev/src/main.tsx.example +21 -0
- package/templates/app-dndev/src/pages/BoardPage.tsx.example +640 -0
- package/templates/app-dndev/src/pages/GrillPage.tsx.example +658 -0
- package/templates/app-dndev/src/pages/HomePage.tsx.example +347 -0
- package/templates/app-dndev/src/pages/NotFoundPage.tsx.example +33 -0
- package/templates/app-dndev/src/pages/PhasesPage.tsx.example +137 -0
- package/templates/app-dndev/src/pages/SettingsPage.tsx.example +64 -0
- package/templates/app-dndev/src/pages/legal/LegalNoticePage.tsx.example +75 -0
- package/templates/app-dndev/src/pages/legal/PrivacyPage.tsx.example +69 -0
- package/templates/app-dndev/src/pages/legal/TermsPage.tsx.example +71 -0
- package/templates/app-dndev/src/stores/dndevStore.ts.example +386 -0
- package/templates/app-dndev/src/themes.css.example +161 -0
- package/templates/app-dndev/terminal-sidecar.cjs.example +341 -0
- package/templates/app-dndev/tsconfig.json.example +9 -0
- package/templates/app-dndev/vite.config.ts.example +24 -0
- package/templates/app-vite/index.html.example +1 -1
- package/templates/functions-supabase/supabase/functions/.env.example +0 -2
- package/templates/root-consumer/.claude/commands/grill.md.example +86 -8
- package/templates/root-consumer/.dndev.secrets.example +32 -0
- package/templates/root-consumer/.gitignore.example +3 -0
- package/templates/root-consumer/AI.md.example +4 -0
- package/templates/root-consumer/entities/index.ts.example +2 -5
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +4 -0
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +23 -20
- package/templates/root-consumer/guides/dndev/INDEX.md.example +1 -0
- package/templates/root-consumer/guides/dndev/SETUP_BILLING.md.example +3 -7
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +115 -0
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +41 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +13 -18
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +17 -12
- package/templates/root-consumer/guides/wai-way/WAI_WAY_CLI.md.example +185 -251
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +26 -8
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +66 -49
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +6 -5
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +9 -9
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +1 -1
- package/templates/root-consumer/guides/wai-way/blueprints/4_configure.md.example +7 -6
- package/templates/root-consumer/guides/wai-way/context_map.json.example +51 -20
- package/templates/root-consumer/guides/wai-way/hld_template.md.example +138 -0
- package/templates/root-consumer/guides/wai-way/lld_template.md.example +103 -0
- package/templates/root-consumer/guides/wai-way/prd_template.md.example +140 -0
- /package/templates/{root-consumer → app-demo}/entities/Contact.ts.example +0 -0
- /package/templates/{root-consumer → app-demo}/entities/demo.ts.example +0 -0
|
@@ -22,101 +22,58 @@ Your project is pre-configured with a **Knowledge Engine** (MCP Server) in `.mcp
|
|
|
22
22
|
1. **Phase Tracking:** `start_phase(N)` returns the blueprint, agent persona, and files to read for each phase.
|
|
23
23
|
2. **Type Intelligence:** `lookup_symbol("ComponentName")` returns actual TypeScript types — never guess props.
|
|
24
24
|
3. **Knowledge Retrieval:** `get_guide("CRUD")`, `get_guideline("styling")`, `search_framework("keyword")`.
|
|
25
|
-
4. **Implementation Tracking:** `init_implementation()` creates a persistent checklist. `update_progress()` ticks items. `get_progress()` reads status. Survives across sessions.
|
|
26
|
-
5. **Captain's Log:** Session history auto-recorded on `approve_phase()`. `get_project_history()` for metrics and post-mortem.
|
|
27
|
-
6. **Lessons:** `record_lesson("gotcha", { tags: ["stripe", "billing"] })` saves tagged gotchas to `.dndev/LESSONS.md`. Filtered by phase + module on next `start_phase`.
|
|
25
|
+
4. **Implementation Tracking:** `init_implementation()` creates a persistent checklist. `update_progress()` ticks items. `get_progress()` reads status. Survives across sessions. Versioned per project version.
|
|
26
|
+
5. **Captain's Log:** Session history auto-recorded on `approve_phase()`. `get_project_history()` for metrics and post-mortem. Never deleted — carries across all project versions.
|
|
27
|
+
6. **Lessons:** `record_lesson("gotcha", { tags: ["stripe", "billing"] })` saves tagged gotchas to `.dndev/LESSONS.md`. Filtered by phase + module on next `start_phase`. Never deleted — carries across all project versions.
|
|
28
28
|
|
|
29
29
|
The IDE (Cursor, Claude Code, etc.) handles file write approval natively. No MCP-level gating.
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
##
|
|
34
|
-
|
|
35
|
-
For projects that span multiple AI sessions, `.dndev/implementation.md` tracks what's done and what's pending.
|
|
36
|
-
|
|
37
|
-
### Setup (after Phase 0)
|
|
38
|
-
|
|
39
|
-
```
|
|
40
|
-
# Auto-generate from spec
|
|
41
|
-
init_implementation({ from_spec: true })
|
|
42
|
-
|
|
43
|
-
# Or manual sections
|
|
44
|
-
init_implementation({ sections: [
|
|
45
|
-
{ title: "Auth Module", items: ["Login page", "Registration", "Password reset"] },
|
|
46
|
-
{ title: "Dashboard", items: ["Stats cards", "Activity feed", "Charts"] }
|
|
47
|
-
] })
|
|
48
|
-
```
|
|
33
|
+
## Document Chain
|
|
49
34
|
|
|
50
|
-
|
|
35
|
+
Phase 0 (BRAINSTORM) produces three specification documents from a conversation guided by `spec_template.md`:
|
|
51
36
|
|
|
52
37
|
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Cross-Session Continuity
|
|
63
|
-
|
|
64
|
-
When you start a new session:
|
|
65
|
-
1. `start_phase(N)` automatically includes implementation progress
|
|
66
|
-
2. The agent sees what's done and picks up where it left off
|
|
67
|
-
3. No repeated work, no drift
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Captain's Log (Project History)
|
|
72
|
-
|
|
73
|
-
Every `approve_phase()` auto-records a session entry to `.dndev/captain-log.json`. No manual action needed.
|
|
38
|
+
spec_template.md (FORMAT — empty shell for conversation)
|
|
39
|
+
↓ P0: Extractor fills through questions
|
|
40
|
+
↓ User validates
|
|
41
|
+
↓ Agent splits into:
|
|
42
|
+
├── docs/PRD.md (Product Requirements — journeys, rules, permissions)
|
|
43
|
+
├── docs/HLD.md (High-Level Design — preset, auth, pages, features)
|
|
44
|
+
└── docs/LLD.md (Low-Level Design — per-entity specs, state machines, access)
|
|
74
45
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
- Date + timestamps (started/completed)
|
|
78
|
-
- Phase number and name
|
|
79
|
-
- Module (if scoped)
|
|
80
|
-
- Files touched + symbols used
|
|
81
|
-
- Outcome summary (from `complete_phase({ summary: "..." })`)
|
|
82
|
-
|
|
83
|
-
### Viewing History
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
get_project_history()
|
|
46
|
+
init_implementation({ from_spec: true })
|
|
47
|
+
└── .dndev/implementation.md (active macro plan — checklist per phase)
|
|
87
48
|
```
|
|
88
49
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
### Post-Mortem
|
|
50
|
+
| Document | Purpose | Audience |
|
|
51
|
+
|----------|---------|----------|
|
|
52
|
+
| **`PRD.md`** | The WHAT — user journeys, business rules, permissions, edge cases | Product owner, stakeholders, agents |
|
|
53
|
+
| **`HLD.md`** | The HOW (big picture) — preset, auth, pages, features, architecture | Architect, senior dev, agents |
|
|
54
|
+
| **`LLD.md`** | The HOW (detailed) — per-entity fields, state machines, access matrices | Builder agent, dev |
|
|
95
55
|
|
|
96
|
-
|
|
97
|
-
- Phase velocity analysis (how many sessions per phase)
|
|
98
|
-
- Issue tracking across the project lifecycle
|
|
99
|
-
- Team-level comparison across projects
|
|
56
|
+
All three live in `docs/` and are versioned via git history.
|
|
100
57
|
|
|
101
58
|
---
|
|
102
59
|
|
|
103
60
|
## The Flow
|
|
104
61
|
|
|
105
62
|
```
|
|
106
|
-
BRAINSTORM (→
|
|
63
|
+
BRAINSTORM (→ PRD + HLD + LLD) → SCAFFOLD → ENTITIES → COMPOSE → CONFIGURE
|
|
107
64
|
```
|
|
108
65
|
|
|
109
|
-
**Critical:**
|
|
66
|
+
**Critical:** `spec_template.md` is the FORMAT, not an output. P0 uses it to guide conversation, then produces three separate documents.
|
|
110
67
|
|
|
111
68
|
---
|
|
112
69
|
|
|
113
|
-
## Phase 0: BRAINSTORM →
|
|
70
|
+
## Phase 0: BRAINSTORM → PRD + HLD + LLD
|
|
114
71
|
|
|
115
|
-
**Goal:** Through conversation, gather requirements and produce
|
|
72
|
+
**Goal:** Through conversation, gather requirements and produce validated specification documents.
|
|
116
73
|
|
|
117
74
|
**The flow:**
|
|
118
75
|
```
|
|
119
|
-
User provides idea → Agent asks questions → Agent
|
|
76
|
+
User provides idea → Agent asks questions → User validates → Agent produces PRD + HLD + LLD
|
|
120
77
|
```
|
|
121
78
|
|
|
122
79
|
### Step 1: User Provides Initial Idea
|
|
@@ -138,34 +95,46 @@ User describes the app informally:
|
|
|
138
95
|
|
|
139
96
|
**Features:** Billing? i18n? PWA? OAuth?
|
|
140
97
|
|
|
141
|
-
### Step 3: Agent Fills Spec Template
|
|
98
|
+
### Step 3: Agent Fills Spec Template (internally)
|
|
142
99
|
|
|
143
|
-
Using answers, agent
|
|
100
|
+
Using answers, agent follows `guides/wai-way/spec_template.md` format:
|
|
144
101
|
|
|
145
102
|
**READ these to make decisions:**
|
|
146
103
|
- `guides/wai-way/presets_guide.md` - Choose preset
|
|
147
104
|
- `guides/wai-way/entity_patterns.md` - Common entity schemas
|
|
148
105
|
- `guides/wai-way/page_patterns.md` - Common page structures
|
|
149
106
|
|
|
150
|
-
### Step 4: User Validates
|
|
107
|
+
### Step 4: User Validates Summary
|
|
108
|
+
|
|
109
|
+
Agent presents completed specification summary. User confirms or iterates.
|
|
110
|
+
|
|
111
|
+
### Step 5: Agent Produces Documents
|
|
112
|
+
|
|
113
|
+
**User confirms → Agent splits into three documents:**
|
|
114
|
+
|
|
115
|
+
**`docs/PRD.md`** (from `prd_template.md`):
|
|
116
|
+
- Identity, user journeys, business rules, permissions, edge cases, overrides
|
|
151
117
|
|
|
152
|
-
|
|
153
|
-
-
|
|
154
|
-
- Entities with access rules
|
|
155
|
-
- Pages with auth requirements
|
|
156
|
-
- Features
|
|
118
|
+
**`docs/HLD.md`** (from `hld_template.md`):
|
|
119
|
+
- Preset, auth model, billing, aesthetic essence, page map, entity relationships, features, architecture decisions
|
|
157
120
|
|
|
158
|
-
|
|
121
|
+
**`docs/LLD.md`** (from `lld_template.md`):
|
|
122
|
+
- Per-entity field definitions, state machines, relationships, access matrices, cross-entity rules
|
|
159
123
|
|
|
160
|
-
**
|
|
124
|
+
**Then:** `init_implementation({ from_spec: true })` → `.dndev/implementation.md`
|
|
125
|
+
|
|
126
|
+
**Documents validated? Move to Phase 1.**
|
|
127
|
+
**User has changes? Iterate until validated.**
|
|
161
128
|
|
|
162
129
|
---
|
|
163
130
|
|
|
164
131
|
## Phase 1: SCAFFOLD
|
|
165
132
|
|
|
166
|
-
**Goal:** Running app skeleton with all routes.
|
|
133
|
+
**Goal:** Running app skeleton with all routes as interactive prototype stubs.
|
|
167
134
|
|
|
168
135
|
**READ:**
|
|
136
|
+
- `docs/HLD.md` - Page map (routes, purpose, journeys)
|
|
137
|
+
- `docs/PRD.md` - User journeys (for navigation flow)
|
|
169
138
|
- `guides/wai-way/page_patterns.md` - Page structure patterns
|
|
170
139
|
|
|
171
140
|
**`dndev` is an installed CLI — run directly, never via `bunx` or `npx`.**
|
|
@@ -183,93 +152,38 @@ dndev dev
|
|
|
183
152
|
|
|
184
153
|
### Step 1.1: Create Page Files
|
|
185
154
|
|
|
186
|
-
For each page from
|
|
187
|
-
|
|
188
|
-
```bash
|
|
189
|
-
touch src/pages/AboutPage.tsx
|
|
190
|
-
touch src/pages/DashboardPage.tsx
|
|
191
|
-
touch src/pages/ProductsListPage.tsx
|
|
192
|
-
touch src/pages/ProductPage.tsx
|
|
193
|
-
# etc.
|
|
194
|
-
```
|
|
155
|
+
For each page from HLD page map, create `src/pages/[Name]Page.tsx`.
|
|
195
156
|
|
|
196
|
-
### Step 1.2: Add PageMeta
|
|
157
|
+
### Step 1.2: Add PageMeta + Interactive Stubs
|
|
197
158
|
|
|
198
159
|
**READ:** `src/pages/HomePage.tsx` - Copy the PageMeta pattern.
|
|
199
160
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
export const NAMESPACE = 'about';
|
|
206
|
-
|
|
207
|
-
export const meta: PageMeta = {
|
|
208
|
-
namespace: NAMESPACE,
|
|
209
|
-
icon: <Info />,
|
|
210
|
-
// auth: true, // Protected page
|
|
211
|
-
// auth: { required: true, role: 'admin' }, // Admin page
|
|
212
|
-
// hideFromMenu: true, // Don't show in nav
|
|
213
|
-
// route: '/custom-path', // Override auto route
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export default function AboutPage() {
|
|
217
|
-
return <PageContainer>About Page</PageContainer>;
|
|
218
|
-
}
|
|
219
|
-
```
|
|
161
|
+
Each page gets:
|
|
162
|
+
- `PageMeta` with namespace, icon, auth (set `auth: false` for prototype validation)
|
|
163
|
+
- Navigation buttons to related pages (from user journeys)
|
|
164
|
+
- Role description placeholder
|
|
220
165
|
|
|
221
|
-
**Output:** All routes exist as
|
|
166
|
+
**Output:** All routes exist as clickable prototype stubs. User can click through the North Star path.
|
|
222
167
|
|
|
223
168
|
---
|
|
224
169
|
|
|
225
170
|
## Phase 2: ENTITIES
|
|
226
171
|
|
|
227
|
-
**Goal:** Define all data models from
|
|
172
|
+
**Goal:** Define all data models from LLD.
|
|
228
173
|
|
|
229
174
|
**READ:**
|
|
175
|
+
- `docs/LLD.md` - Per-entity field specs, state machines, access matrices
|
|
230
176
|
- `entities/ExampleEntity.ts` - Entity definition pattern
|
|
231
177
|
- `guides/wai-way/entity_patterns.md` - Common entity schemas
|
|
232
178
|
|
|
233
179
|
### Step 2.1: Create Entity Files
|
|
234
180
|
|
|
235
|
-
For each entity from
|
|
181
|
+
For each entity from LLD:
|
|
236
182
|
|
|
237
183
|
1. Copy matching pattern from `entity_patterns.md`
|
|
238
184
|
2. Create `entities/[Entity].ts`
|
|
239
|
-
3. Customize fields
|
|
240
|
-
|
|
241
|
-
```typescript
|
|
242
|
-
// entities/Product.ts
|
|
243
|
-
import { defineEntity } from '@donotdev/core';
|
|
244
|
-
|
|
245
|
-
export const productEntity = defineEntity({
|
|
246
|
-
name: 'Product',
|
|
247
|
-
collection: 'products',
|
|
248
|
-
fields: {
|
|
249
|
-
name: {
|
|
250
|
-
name: 'name',
|
|
251
|
-
label: 'name',
|
|
252
|
-
type: 'text',
|
|
253
|
-
visibility: 'guest',
|
|
254
|
-
validation: { required: true },
|
|
255
|
-
},
|
|
256
|
-
price: {
|
|
257
|
-
name: 'price',
|
|
258
|
-
label: 'price',
|
|
259
|
-
type: 'number',
|
|
260
|
-
visibility: 'guest',
|
|
261
|
-
validation: { required: true, min: 0 },
|
|
262
|
-
},
|
|
263
|
-
// ... more fields from spec
|
|
264
|
-
},
|
|
265
|
-
access: {
|
|
266
|
-
create: 'admin',
|
|
267
|
-
read: 'guest',
|
|
268
|
-
update: 'admin',
|
|
269
|
-
delete: 'admin',
|
|
270
|
-
},
|
|
271
|
-
});
|
|
272
|
-
```
|
|
185
|
+
3. Customize fields from LLD field definitions
|
|
186
|
+
4. Set access rules from LLD access matrix
|
|
273
187
|
|
|
274
188
|
### Step 2.2: Export Entities
|
|
275
189
|
|
|
@@ -289,62 +203,19 @@ export { orderEntity } from './Order';
|
|
|
289
203
|
**Goal:** Build pages with components. HARDCODE ALL STRINGS.
|
|
290
204
|
|
|
291
205
|
**READ:**
|
|
206
|
+
- `docs/PRD.md` - User journeys (what each page does)
|
|
207
|
+
- `docs/HLD.md` - Page map (routes, layout decisions)
|
|
292
208
|
- `src/pages/ListPageExample.tsx` - CRUD list pattern
|
|
293
209
|
- `src/pages/FormPageExample.tsx` - CRUD form pattern
|
|
294
210
|
- `guides/wai-way/page_patterns.md` - All page patterns
|
|
295
211
|
|
|
296
|
-
### Step 3.1: CRUD Pages
|
|
297
|
-
|
|
298
|
-
**List Page:**
|
|
299
|
-
```tsx
|
|
300
|
-
import { EntityList } from '@donotdev/crud';
|
|
301
|
-
import { useAuth } from '@donotdev/auth';
|
|
302
|
-
import { PageContainer } from '@donotdev/ui';
|
|
303
|
-
import { productEntity } from 'entities';
|
|
304
|
-
|
|
305
|
-
export default function ProductsListPage() {
|
|
306
|
-
const user = useAuth('user');
|
|
307
|
-
return (
|
|
308
|
-
<PageContainer>
|
|
309
|
-
<EntityList entity={productEntity} userRole={user?.role} />
|
|
310
|
-
</PageContainer>
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
```
|
|
314
|
-
|
|
315
|
-
**Form Page:**
|
|
316
|
-
```tsx
|
|
317
|
-
import { EntityFormRenderer, useCrud } from '@donotdev/crud';
|
|
318
|
-
import { productEntity } from 'entities';
|
|
319
|
-
|
|
320
|
-
export default function ProductPage() {
|
|
321
|
-
const { id } = useParams();
|
|
322
|
-
const { get, add, update } = useCrud(productEntity);
|
|
323
|
-
const isNew = id === 'new';
|
|
324
|
-
// ... see page_patterns.md for full pattern
|
|
325
|
-
}
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
### Step 3.2: Landing/Dashboard Pages
|
|
329
|
-
|
|
330
|
-
Copy from `page_patterns.md`:
|
|
331
|
-
- Dashboard pattern for logged-in home
|
|
332
|
-
- Landing pattern for marketing pages
|
|
333
|
-
- Settings pattern for preferences
|
|
334
|
-
|
|
335
212
|
**HARDCODE all strings:**
|
|
336
213
|
```tsx
|
|
337
|
-
//
|
|
338
|
-
<HeroSection
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
/>
|
|
342
|
-
|
|
343
|
-
// ❌ BAD - Don't start with i18n
|
|
344
|
-
<HeroSection
|
|
345
|
-
title={t('hero.title')}
|
|
346
|
-
subtitle={t('hero.subtitle')}
|
|
347
|
-
/>
|
|
214
|
+
// GOOD
|
|
215
|
+
<HeroSection title="Welcome to My App" subtitle="The best app ever built" />
|
|
216
|
+
|
|
217
|
+
// BAD — Don't start with i18n
|
|
218
|
+
<HeroSection title={t('hero.title')} subtitle={t('hero.subtitle')} />
|
|
348
219
|
```
|
|
349
220
|
|
|
350
221
|
**Output:** All pages functional with hardcoded content.
|
|
@@ -356,113 +227,176 @@ Copy from `page_patterns.md`:
|
|
|
356
227
|
**Goal:** Generate tests, firestore rules, CI/CD, and finalize config.
|
|
357
228
|
|
|
358
229
|
**READ:**
|
|
359
|
-
- `
|
|
230
|
+
- `docs/PRD.md` - Permissions matrix, business rules (your test plan)
|
|
231
|
+
- `docs/LLD.md` - Per-entity access matrices
|
|
360
232
|
- `entities/index.ts` - All entity definitions
|
|
361
233
|
- `src/config/app.ts` - App configuration
|
|
362
234
|
- `guides/dndev/SETUP_TESTING.md` - Testing patterns
|
|
363
235
|
|
|
364
|
-
###
|
|
236
|
+
### Tests
|
|
237
|
+
- Entity tests: required fields, types, access rules match LLD
|
|
238
|
+
- Page tests: renders, PageMeta, route protection matches HLD
|
|
239
|
+
- Access control tests: admin/owner/guest permissions match PRD
|
|
365
240
|
|
|
366
|
-
|
|
241
|
+
### Config
|
|
242
|
+
- `app.ts`: APP_NAME from PRD, preset from HLD
|
|
243
|
+
- `legal.ts`: Company, contacts, hosting, jurisdiction
|
|
244
|
+
- `.env`: Firebase, license key, optional Stripe/Sentry
|
|
245
|
+
- `firestore.rules`: Generated from entity access definitions
|
|
246
|
+
- `.github/workflows/ci.yml`: Quality + deploy pipeline
|
|
367
247
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
- [ ] Field types match spec
|
|
371
|
-
- [ ] Access rules match spec (create/read/update/delete per role)
|
|
248
|
+
### Mobile Check
|
|
249
|
+
DevTools → 375px width → navigation, forms, text, buttons (44px), no horizontal scroll.
|
|
372
250
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
- [ ] PageMeta defined (title, auth, admin)
|
|
376
|
-
- [ ] Route protection matches spec
|
|
251
|
+
### i18n (Optional)
|
|
252
|
+
**Only after tests pass.** Extract hardcoded strings to `src/locales/[namespace]_en.json`.
|
|
377
253
|
|
|
378
|
-
**
|
|
379
|
-
- [ ] Admin entities require admin access
|
|
380
|
-
- [ ] User-owned entities have owner access
|
|
381
|
-
- [ ] No unauthenticated writes
|
|
254
|
+
**Output:** Test files, firestore.rules, CI/CD pipeline, configured app.
|
|
382
255
|
|
|
383
|
-
|
|
256
|
+
---
|
|
384
257
|
|
|
385
|
-
|
|
386
|
-
- `owner` → `resource.data.userId == request.auth.uid`
|
|
387
|
-
- `admin` → `request.auth.token.admin == true`
|
|
388
|
-
- `authenticated` → `request.auth != null`
|
|
258
|
+
## Implementation Tracking (Multi-Session Progress)
|
|
389
259
|
|
|
390
|
-
|
|
260
|
+
`.dndev/implementation.md` tracks what's done and what's pending across sessions.
|
|
391
261
|
|
|
392
|
-
|
|
393
|
-
- Quality job: `bun install` → `bun run type-check` → `bun test`
|
|
394
|
-
- Deploy job: `bun run build` → Firebase deploy (on main push)
|
|
262
|
+
### Setup (after Phase 0)
|
|
395
263
|
|
|
396
|
-
|
|
264
|
+
```
|
|
265
|
+
# Auto-generate from spec documents
|
|
266
|
+
init_implementation({ from_spec: true })
|
|
397
267
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
268
|
+
# Or manual sections
|
|
269
|
+
init_implementation({ sections: [
|
|
270
|
+
{ title: "Auth Module", items: ["Login page", "Registration", "Password reset"] },
|
|
271
|
+
{ title: "Dashboard", items: ["Stats cards", "Activity feed", "Charts"] }
|
|
272
|
+
] })
|
|
273
|
+
```
|
|
401
274
|
|
|
402
|
-
###
|
|
275
|
+
### During Work
|
|
403
276
|
|
|
404
|
-
```bash
|
|
405
|
-
bun test
|
|
406
277
|
```
|
|
278
|
+
# Tick items as you complete them
|
|
279
|
+
update_progress({ item: "Login page", done: true })
|
|
280
|
+
update_progress({ item: "Stats cards", done: true, note: "Used Card component with level h3" })
|
|
407
281
|
|
|
408
|
-
|
|
282
|
+
# Check progress
|
|
283
|
+
get_progress() # full overview
|
|
284
|
+
get_progress({ section: "Auth Module" }) # filtered to section
|
|
285
|
+
```
|
|
409
286
|
|
|
410
|
-
###
|
|
287
|
+
### Cross-Session Continuity
|
|
411
288
|
|
|
412
|
-
|
|
289
|
+
When you start a new session:
|
|
290
|
+
1. `start_phase(N)` automatically includes implementation progress
|
|
291
|
+
2. The agent sees what's done and picks up where it left off
|
|
292
|
+
3. No repeated work, no drift
|
|
413
293
|
|
|
414
|
-
|
|
294
|
+
### Versioning (V1 → V2 → V3)
|
|
295
|
+
|
|
296
|
+
When starting a new project version:
|
|
297
|
+
1. Archive current: `.dndev/implementation.md` → `.dndev/archive/implementation-v{N}.md`
|
|
298
|
+
2. Update spec documents: modify `docs/PRD.md`, `docs/HLD.md`, `docs/LLD.md` (git tracks history)
|
|
299
|
+
3. Create fresh plan: `init_implementation()` with V(N+1) sections
|
|
300
|
+
4. **Lessons carry forward** — `.dndev/LESSONS.md` accumulates across all versions
|
|
301
|
+
5. **Captain's log carries forward** — `.dndev/captain-log.json` is the full project history
|
|
302
|
+
|
|
303
|
+
---
|
|
304
|
+
|
|
305
|
+
## Captain's Log (Project History)
|
|
306
|
+
|
|
307
|
+
Every `approve_phase()` auto-records a session entry to `.dndev/captain-log.json`. No manual action needed. **Never deleted — carries across all project versions.**
|
|
308
|
+
|
|
309
|
+
### What's Recorded Automatically
|
|
310
|
+
|
|
311
|
+
- Date + timestamps (started/completed)
|
|
312
|
+
- Phase number and name
|
|
313
|
+
- Module (if scoped)
|
|
314
|
+
- Files touched + symbols used
|
|
315
|
+
- Outcome summary (from `complete_phase({ summary: "..." })`)
|
|
316
|
+
|
|
317
|
+
### Viewing History
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
get_project_history()
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Returns computed metrics + timeline:
|
|
324
|
+
- Total sessions, phases completed
|
|
325
|
+
- Files and symbols totals
|
|
326
|
+
- Per-session timeline with outcomes
|
|
415
327
|
|
|
416
328
|
---
|
|
417
329
|
|
|
418
|
-
|
|
330
|
+
## Lessons (Decisions & Gotchas)
|
|
331
|
+
|
|
332
|
+
`.dndev/LESSONS.md` — persistent operational knowledge. **Never deleted — carries across all project versions.**
|
|
333
|
+
|
|
334
|
+
### Recording
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
record_lesson("gotcha about Zustand store actions", { tags: ["zustand", "state"] })
|
|
338
|
+
```
|
|
419
339
|
|
|
420
|
-
|
|
340
|
+
### How They Work
|
|
421
341
|
|
|
422
|
-
|
|
342
|
+
- Tagged with inline markers for filtering
|
|
343
|
+
- `start_phase` filters by current phase + module — agents see only relevant lessons
|
|
344
|
+
- Confidence scoring: `score_lesson("lesson text", "helpful")` or `"harmful"`
|
|
345
|
+
- 90-day half-life decay — old lessons fade unless scored as helpful
|
|
346
|
+
- **Critical for V(N+1):** When starting a new version, agents read lessons to avoid repeating mistakes
|
|
423
347
|
|
|
424
348
|
---
|
|
425
349
|
|
|
426
350
|
## Quick Reference
|
|
427
351
|
|
|
428
|
-
### Key Files
|
|
352
|
+
### Key Files
|
|
429
353
|
|
|
430
354
|
| File | Purpose | When |
|
|
431
355
|
|------|---------|------|
|
|
432
|
-
| `guides/wai-way/spec_template.md` |
|
|
356
|
+
| `guides/wai-way/spec_template.md` | Conversation FORMAT (empty shell) | Phase 0 |
|
|
357
|
+
| `guides/wai-way/prd_template.md` | Output FORMAT for PRD | Phase 0 |
|
|
358
|
+
| `guides/wai-way/hld_template.md` | Output FORMAT for HLD | Phase 0 |
|
|
359
|
+
| `guides/wai-way/lld_template.md` | Output FORMAT for LLD | Phase 0 |
|
|
360
|
+
| `docs/PRD.md` | Product Requirements (produced by P0) | Phase 0-4 |
|
|
361
|
+
| `docs/HLD.md` | High-Level Design (produced by P0) | Phase 0-4 |
|
|
362
|
+
| `docs/LLD.md` | Low-Level Design (produced by P0) | Phase 2-4 |
|
|
433
363
|
| `guides/wai-way/presets_guide.md` | Preset decision | Phase 0 |
|
|
434
364
|
| `guides/wai-way/entity_patterns.md` | Entity schemas | Phase 2 |
|
|
435
365
|
| `guides/wai-way/page_patterns.md` | Page structures | Phase 1, 3 |
|
|
436
366
|
| `src/pages/HomePage.tsx` | PageMeta pattern | Phase 1 |
|
|
437
367
|
| `entities/ExampleEntity.ts` | Entity pattern | Phase 2 |
|
|
438
|
-
| `src/pages/ListPageExample.tsx` | CRUD list | Phase 3 |
|
|
439
|
-
| `src/pages/FormPageExample.tsx` | CRUD form | Phase 3 |
|
|
440
368
|
| `src/config/app.ts` | App config | Phase 4 |
|
|
441
|
-
| `src/config/legal.ts` | Legal info | Phase 4 |
|
|
442
369
|
|
|
443
|
-
### Agents
|
|
444
|
-
|
|
445
|
-
Activate agent personas from `guides/wai-way/agents/`:
|
|
370
|
+
### Agents
|
|
446
371
|
|
|
447
372
|
| Agent | Phase | Focus |
|
|
448
373
|
|-------|-------|-------|
|
|
449
|
-
| **Extractor** | 0-1 | Requirements
|
|
450
|
-
| **Architect** | 2 | Entities
|
|
451
|
-
| **Builder** | 3 | Page composition
|
|
374
|
+
| **Extractor** | 0-1 | Requirements → PRD + HLD + LLD, routes, prototype |
|
|
375
|
+
| **Architect** | 2 | Entities from LLD |
|
|
376
|
+
| **Builder** | 3 | Page composition from PRD + HLD |
|
|
452
377
|
| **Polisher** | 4 | Config, testing, polish, i18n |
|
|
453
378
|
|
|
454
|
-
|
|
379
|
+
### Operational Files
|
|
380
|
+
|
|
381
|
+
| File | Lives in | Versioned | Purpose |
|
|
382
|
+
|------|----------|-----------|---------|
|
|
383
|
+
| `PRD.md` | `docs/` | Git history | Requirements |
|
|
384
|
+
| `HLD.md` | `docs/` | Git history | Architecture |
|
|
385
|
+
| `LLD.md` | `docs/` | Git history | Detailed design |
|
|
386
|
+
| `implementation.md` | `.dndev/` | Archived per version | Active macro plan |
|
|
387
|
+
| `captain-log.json` | `.dndev/` | Never archived | Full project history |
|
|
388
|
+
| `LESSONS.md` | `.dndev/` | Never archived | Decisions + gotchas |
|
|
455
389
|
|
|
456
390
|
---
|
|
457
391
|
|
|
458
392
|
## Summary
|
|
459
393
|
|
|
460
394
|
```
|
|
461
|
-
Phase 0: BRAINSTORM → User idea →
|
|
462
|
-
Phase 1: SCAFFOLD → Create all *Page.tsx with PageMeta (from
|
|
463
|
-
Phase 2: ENTITIES → Define all entities with fields/access (from
|
|
464
|
-
Phase 3: COMPOSE → Build pages with components
|
|
395
|
+
Phase 0: BRAINSTORM → User idea → Questions → PRD.md + HLD.md + LLD.md + implementation.md
|
|
396
|
+
Phase 1: SCAFFOLD → Create all *Page.tsx with PageMeta, clickable prototype (from HLD page map)
|
|
397
|
+
Phase 2: ENTITIES → Define all entities with fields/access (from LLD)
|
|
398
|
+
Phase 3: COMPOSE → Build pages with components, HARDCODE strings (from PRD journeys + HLD pages)
|
|
465
399
|
Phase 4: CONFIGURE → Config, Firebase, test, mobile, optional i18n
|
|
466
400
|
```
|
|
467
401
|
|
|
468
|
-
**Remember:**
|
|
402
|
+
**Remember:** `spec_template.md` is the FORMAT. Phase 0 produces PRD + HLD + LLD. Validated documents = mechanical build.
|