@donotdev/cli 0.1.0 → 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/dependencies-matrix.json +100 -50
- package/dist/bin/commands/agent-setup.js +245 -12
- package/dist/bin/commands/build.js +3339 -208
- package/dist/bin/commands/bump.js +245 -12
- package/dist/bin/commands/cacheout.js +245 -12
- package/dist/bin/commands/coach.js +361 -60
- package/dist/bin/commands/create-app.js +245 -12
- package/dist/bin/commands/create-project.js +253 -12
- package/dist/bin/commands/db.js +9114 -2327
- package/dist/bin/commands/deploy.js +4074 -694
- package/dist/bin/commands/dev.js +347 -33
- package/dist/bin/commands/doctor.js +408 -107
- package/dist/bin/commands/emu.js +386 -52
- package/dist/bin/commands/format.js +245 -12
- package/dist/bin/commands/get-demo.js +245 -12
- package/dist/bin/commands/make-admin.js +8356 -1516
- package/dist/bin/commands/preview.js +347 -33
- package/dist/bin/commands/seed.js +9114 -2327
- package/dist/bin/commands/setup-cicd.js +452 -132
- package/dist/bin/commands/setup.js +407 -107
- package/dist/bin/commands/staging.js +4074 -694
- package/dist/bin/commands/sync-secrets.js +246 -13
- package/dist/bin/commands/type-check.js +245 -12
- package/dist/bin/commands/wai.js +245 -12
- package/dist/bin/dndev.js +13 -4
- package/dist/bin/donotdev.js +13 -4
- package/dist/index.js +4169 -812
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +2 -1
- 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/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/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/build/SKILL.md.example +103 -25
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +26 -15
- 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 +10 -5
- 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 -175
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -184
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -135
- 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,175 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Extract requirements and generate complete HLD through conversation (BMAD EXTRACTOR)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Brainstorm Command - Requirements Extraction
|
|
6
|
-
|
|
7
|
-
**⚠️ MODE CHECK:** This command is for **Consumer App Development** only.
|
|
8
|
-
|
|
9
|
-
**If you're in the framework monorepo (this repo):**
|
|
10
|
-
- ❌ **DO NOT use `/brainstorm`** - framework dev doesn't need requirements extraction
|
|
11
|
-
- ✅ See [Modes Guide](https://github.com/donotdev/framework/blob/main/docs/development/MODES.md) for framework dev workflow
|
|
12
|
-
|
|
13
|
-
**If you're in a consumer repo:**
|
|
14
|
-
- ✅ Use `/brainstorm` to extract requirements and generate HLD
|
|
15
|
-
- ✅ Use `/design` after HLD is validated
|
|
16
|
-
- ✅ Use `/build` after LLD is validated
|
|
17
|
-
- ✅ Use `/polish` after app is functional
|
|
18
|
-
|
|
19
|
-
**WORKFLOW ORDER:**
|
|
20
|
-
1. `/brainstorm` → Extract requirements, generate HLD (THIS COMMAND)
|
|
21
|
-
2. `/design` → Create technical plan (LLD)
|
|
22
|
-
3. `/build` → Implement code using framework defaults
|
|
23
|
-
4. `/polish` → Add styling, customization, i18n
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
/brainstorm [app idea or requirement]
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Examples:**
|
|
34
|
-
```
|
|
35
|
-
/brainstorm I want to build a car dealership management app
|
|
36
|
-
/brainstorm Create a task management app for teams
|
|
37
|
-
/brainstorm Build a portfolio website for a photographer
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Process
|
|
43
|
-
|
|
44
|
-
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
45
|
-
|
|
46
|
-
**BEFORE asking any questions or doing any work**, call:
|
|
47
|
-
```
|
|
48
|
-
start_phase(0)
|
|
49
|
-
```
|
|
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
|
-
|
|
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
|
-
|
|
80
|
-
### Step 1: Activate EXTRACTOR Agent
|
|
81
|
-
|
|
82
|
-
**Deploy:** `/agents extractor` (BMAD EXTRACTOR persona)
|
|
83
|
-
|
|
84
|
-
**Input:** User's app idea (any level of clarity)
|
|
85
|
-
|
|
86
|
-
**Actions:**
|
|
87
|
-
1. EXTRACTOR asks probing questions (one at a time)
|
|
88
|
-
2. EXTRACTOR uses MCP to discover framework capabilities
|
|
89
|
-
3. EXTRACTOR identifies native vs custom components
|
|
90
|
-
4. EXTRACTOR tracks progress and identifies gaps
|
|
91
|
-
5. EXTRACTOR generates complete HLD when all targets extracted
|
|
92
|
-
|
|
93
|
-
**Output:** Complete HLD document (`HLD.md`)
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## What EXTRACTOR Extracts
|
|
98
|
-
|
|
99
|
-
| Category | What EXTRACTOR Asks |
|
|
100
|
-
|----------|---------------------|
|
|
101
|
-
| **Vision** | What is this app? Who uses it? |
|
|
102
|
-
| **Users** | What roles exist? What can each role do? |
|
|
103
|
-
| **Entities** | What "things" exist? What fields? How do they relate? |
|
|
104
|
-
| **Features** | What can users DO? MVP vs V2? |
|
|
105
|
-
| **Pages** | What screens exist? Routes? Access levels? |
|
|
106
|
-
| **Constraints** | Platform? Languages? Auth? Integrations? |
|
|
107
|
-
| **Native vs Custom** | What uses framework defaults? What needs custom? |
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Output Format
|
|
112
|
-
|
|
113
|
-
EXTRACTOR generates `HLD.md` with:
|
|
114
|
-
|
|
115
|
-
- **Vision** - One sentence description
|
|
116
|
-
- **Users** - Roles and permissions table
|
|
117
|
-
- **Entities** - All entities with fields, types, visibility, validation
|
|
118
|
-
- **Features** - MVP vs V2 categorization
|
|
119
|
-
- **Pages** - Routes, access levels, components
|
|
120
|
-
- **Constraints** - Platform, languages, auth, integrations
|
|
121
|
-
- **Native vs Custom** - Framework-native vs custom components
|
|
122
|
-
- **Open Questions** - Unresolved items
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Validation Gate & Phase Completion (MANDATORY)
|
|
127
|
-
|
|
128
|
-
**Before proceeding to `/design`:**
|
|
129
|
-
- [ ] HLD is complete (no empty sections or TBDs)
|
|
130
|
-
- [ ] All user journeys mapped (numbered steps)
|
|
131
|
-
- [ ] All entities have fields, states, permissions
|
|
132
|
-
- [ ] All business rules documented
|
|
133
|
-
- [ ] Native vs custom analysis complete
|
|
134
|
-
- [ ] User has validated HLD
|
|
135
|
-
|
|
136
|
-
**When HLD is complete**, write the filled-out spec to `docs/HLD.md` (the template at `guides/wai-way/spec_template.md` stays untouched as reference). Then call:
|
|
137
|
-
```
|
|
138
|
-
complete_phase({ files: ["docs/HLD.md"], summary: "HLD complete — N entities, N pages, N features" })
|
|
139
|
-
```
|
|
140
|
-
Then wait for the user to call `approve_phase()` before moving to `/design`.
|
|
141
|
-
|
|
142
|
-
**Quality Over Speed:** Take as long as needed. A complete HLD that takes 4 hours is better than an incomplete one that takes 20 minutes.
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Rules
|
|
147
|
-
|
|
148
|
-
- **EXTRACTOR asks one question at a time** - Wait for answer before next question
|
|
149
|
-
- **EXTRACTOR probes vague answers** - "What does 'manage' mean?"
|
|
150
|
-
- **EXTRACTOR challenges scope** - "What's the minimum to launch?"
|
|
151
|
-
- **EXTRACTOR summarizes progress** - Every 3-4 exchanges
|
|
152
|
-
- **EXTRACTOR asks when uncertain** - Never guesses
|
|
153
|
-
- **EXTRACTOR stops when complete** - Generates HLD only when all targets extracted
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Integration with WAI-WAY
|
|
158
|
-
|
|
159
|
-
- Uses **BMAD EXTRACTOR** persona (proven, battle-tested)
|
|
160
|
-
- Follows WAI-WAY Phase 0 (BRAINSTORM → SPEC)
|
|
161
|
-
- Output feeds into `/design` command (BMAD PRINTER/Architect)
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Requirements
|
|
166
|
-
|
|
167
|
-
- MCP server configured (`.mcp.json` or `.cursor/mcp.json`) - for framework discovery
|
|
168
|
-
- User available for conversation (requirements extraction is interactive)
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Next Step
|
|
173
|
-
|
|
174
|
-
Once HLD is validated:
|
|
175
|
-
→ Use `/design` to create technical plan (LLD)
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Two-agent workflow: Prompt Engineer → Coder (AFTER /design)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Build Command - Two-Agent Workflow
|
|
6
|
-
|
|
7
|
-
**⚠️ MODE CHECK:** This command is for **Consumer App Development** only.
|
|
8
|
-
|
|
9
|
-
**If you're in the framework monorepo (this repo):**
|
|
10
|
-
- ❌ **DO NOT use `/build`** - code directly in `packages/*/src/`
|
|
11
|
-
- ✅ Use direct coding following Architecture Hub patterns
|
|
12
|
-
- ✅ See [Modes Guide](https://github.com/donotdev/framework/blob/main/docs/development/MODES.md) for framework dev workflow
|
|
13
|
-
|
|
14
|
-
**If you're in a consumer repo:**
|
|
15
|
-
- ✅ Use `/build` to implement features
|
|
16
|
-
- ✅ Use `/design` first for architecture decisions
|
|
17
|
-
|
|
18
|
-
**WORKFLOW ORDER:**
|
|
19
|
-
1. `/brainstorm` → Extract requirements, generate HLD
|
|
20
|
-
2. `/design` → Create technical plan (LLD)
|
|
21
|
-
3. `/build` → Implement code using framework defaults (THIS COMMAND)
|
|
22
|
-
4. `/polish` → Add styling, customization, i18n
|
|
23
|
-
|
|
24
|
-
**If no LLD exists, Builder will create on-the-fly, but `/design` first is recommended.**
|
|
25
|
-
|
|
26
|
-
## Usage
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
/build [requirement]
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
**Example:**
|
|
33
|
-
```
|
|
34
|
-
/build Create customer detail page with inquiry list
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Process
|
|
38
|
-
|
|
39
|
-
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
40
|
-
|
|
41
|
-
**BEFORE writing any code**, call:
|
|
42
|
-
```
|
|
43
|
-
start_phase(3)
|
|
44
|
-
```
|
|
45
|
-
This activates Phase 3: COMPOSE and loads the blueprint, persona, context, and lessons. **Do NOT write code without this call.**
|
|
46
|
-
|
|
47
|
-
### Step 1: Activate FORGER Agent
|
|
48
|
-
|
|
49
|
-
**Deploy:** `/agents builder` (BMAD FORGER persona)
|
|
50
|
-
|
|
51
|
-
**Input:** LLD from `/design` command OR user requirement
|
|
52
|
-
|
|
53
|
-
**Actions:**
|
|
54
|
-
1. Read LLD (or create on-the-fly if no LLD exists)
|
|
55
|
-
2. Use MCP `lookup_symbol` for ALL components used
|
|
56
|
-
3. Build in phases:
|
|
57
|
-
- Phase 1: Entities (create entity files)
|
|
58
|
-
- Phase 2: Routes (create route config)
|
|
59
|
-
- Phase 3: Auth (if needed)
|
|
60
|
-
- Phase 4: Native Pages (using framework defaults)
|
|
61
|
-
- Phase 5: Custom Components (if any)
|
|
62
|
-
- Phase 6: Integration (wire everything together)
|
|
63
|
-
4. Use framework defaults ONLY (no styling, no customization)
|
|
64
|
-
5. Hardcode all strings (no i18n yet)
|
|
65
|
-
6. Run `dndev tc` after every file change — type errors must be fixed immediately
|
|
66
|
-
7. Validate each phase before proceeding
|
|
67
|
-
|
|
68
|
-
**Output:** Working app (functional MVP, no styling)
|
|
69
|
-
|
|
70
|
-
### Phase Completion (MANDATORY)
|
|
71
|
-
|
|
72
|
-
When all pages are built and `dndev tc` passes, call:
|
|
73
|
-
```
|
|
74
|
-
complete_phase({ files: ["src/pages/...all page files..."], summary: "N pages composed, all type-checking" })
|
|
75
|
-
```
|
|
76
|
-
Wait for user to call `approve_phase()` before moving to `/polish`.
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## Alternative: Two-Agent Workflow
|
|
81
|
-
|
|
82
|
-
For complex builds, you can use:
|
|
83
|
-
|
|
84
|
-
**Step 1: Prompt Engineer**
|
|
85
|
-
- Deploy `/agents prompt-engineer`
|
|
86
|
-
- Prepares detailed prompt with all constraints
|
|
87
|
-
|
|
88
|
-
**Step 2: Coder**
|
|
89
|
-
- Deploy `/agents coder`
|
|
90
|
-
- Executes prompt following constraints
|
|
91
|
-
|
|
92
|
-
**Note:** BMAD FORGER (builder) is recommended for most cases as it's proven and battle-tested.
|
|
93
|
-
|
|
94
|
-
## Rules
|
|
95
|
-
|
|
96
|
-
- **Builder (FORGER):** Implements exactly what's in LLD, uses framework defaults only
|
|
97
|
-
- **Framework defaults ONLY:** No styling, no customization (deferred to /polish)
|
|
98
|
-
- **Hardcode strings:** No i18n yet (deferred to /polish)
|
|
99
|
-
- **Phase by phase:** Complete each phase before proceeding
|
|
100
|
-
- **User:** Reviews output, proceeds to /polish when functional
|
|
101
|
-
|
|
102
|
-
## STOP — lookup_symbol Before Every Component (Repeated Here On Purpose)
|
|
103
|
-
|
|
104
|
-
**STOP before writing ANY `@donotdev` import.** Call `lookup_symbol({ symbol: "Name" })` first. Do NOT guess props, hooks, or APIs. Do NOT proceed without verification. `complete_phase` will reject un-looked-up symbols.
|
|
105
|
-
|
|
106
|
-
**Import convention:** Always `@donotdev/<package>` — never sub-paths. No `@donotdev/ui/routing`, no `@donotdev/components/card`. The only exceptions are `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`.
|
|
107
|
-
|
|
108
|
-
## Mode Detection
|
|
109
|
-
|
|
110
|
-
**CRITICAL:** Check working mode first.
|
|
111
|
-
|
|
112
|
-
**Framework dev indicators:**
|
|
113
|
-
- `packages/` directory exists
|
|
114
|
-
- `CLAUDE.md` says "Framework Development Mode"
|
|
115
|
-
- Using `dn` CLI
|
|
116
|
-
|
|
117
|
-
**Consumer app indicators:**
|
|
118
|
-
- `apps/` or `src/` directory exists
|
|
119
|
-
- `CLAUDE.md` says "Consumer App Development Mode"
|
|
120
|
-
- Using `dndev` CLI
|
|
121
|
-
|
|
122
|
-
**If framework dev detected:**
|
|
123
|
-
- STOP and inform user: "`/build` is for consumer apps. In framework dev, code directly in `packages/*/src/`"
|
|
124
|
-
|
|
125
|
-
**If consumer app detected:**
|
|
126
|
-
- Use ONLY published `@donotdev/*` packages (no internals)
|
|
127
|
-
|
|
128
|
-
## Requirements
|
|
129
|
-
|
|
130
|
-
- MCP server configured (`.mcp.json` or `.cursor/mcp.json`)
|
|
131
|
-
- `@donotdev/mcp-server` available (via `bunx` or installed)
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Design workflow: Architect → Design Document (BEFORE /build)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Design Command - Architecture & Design Workflow
|
|
6
|
-
|
|
7
|
-
**⚠️ MODE CHECK:** This command is for **Consumer App Development** only.
|
|
8
|
-
|
|
9
|
-
**If you're in the framework monorepo (this repo):**
|
|
10
|
-
- ❌ **DO NOT use `/design`** - design directly, then code in `packages/*/src/`
|
|
11
|
-
- ✅ Use Architecture Hub + Development Hub for framework design patterns
|
|
12
|
-
- ✅ See [Modes Guide](https://github.com/donotdev/framework/blob/main/docs/development/MODES.md) for framework dev workflow
|
|
13
|
-
|
|
14
|
-
**If you're in a consumer repo:**
|
|
15
|
-
- ✅ Use `/design` for architecture decisions
|
|
16
|
-
- ✅ Use `/build` to implement the design
|
|
17
|
-
|
|
18
|
-
**WORKFLOW ORDER:**
|
|
19
|
-
1. `/design` → Architect designs solution (THIS COMMAND)
|
|
20
|
-
2. `/build` → Prompt Engineer + Coder implement design
|
|
21
|
-
|
|
22
|
-
**Design comes BEFORE build. Design the solution, then build it.**
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
/design [requirement or question]
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**Examples:**
|
|
31
|
-
```
|
|
32
|
-
/design How should we handle documentation updates in dndev bump?
|
|
33
|
-
/design Add documentation update step to bump command
|
|
34
|
-
/design Status translation fallback chain architecture
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Process
|
|
38
|
-
|
|
39
|
-
### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
|
|
40
|
-
|
|
41
|
-
**BEFORE doing any design work**, call the appropriate phase:
|
|
42
|
-
```
|
|
43
|
-
start_phase(1) # for SCAFFOLD (routes, page stubs)
|
|
44
|
-
start_phase(2) # for ENTITIES (data models, fields, access)
|
|
45
|
-
```
|
|
46
|
-
This loads the blueprint, persona, context, and lessons. **Do NOT proceed without this call.**
|
|
47
|
-
|
|
48
|
-
When design work is complete, call:
|
|
49
|
-
```
|
|
50
|
-
complete_phase({ files: ["...affected files..."], summary: "Description of what was designed" })
|
|
51
|
-
```
|
|
52
|
-
Wait for user to call `approve_phase()` before moving on.
|
|
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
|
-
|
|
85
|
-
### Step 1: Architect Phase
|
|
86
|
-
|
|
87
|
-
**Deploy:** `/agents architect` (WAI-WAY architect role)
|
|
88
|
-
|
|
89
|
-
**Input:** User requirement or design question
|
|
90
|
-
|
|
91
|
-
**Actions:**
|
|
92
|
-
1. Analyze requirement/question
|
|
93
|
-
2. Read constraints from:
|
|
94
|
-
- `CLAUDE.md` (project rules)
|
|
95
|
-
- Framework architecture docs (`docs/architecture/`)
|
|
96
|
-
- Existing patterns in codebase
|
|
97
|
-
- WAI-WAY entity patterns (if applicable)
|
|
98
|
-
3. Research similar solutions (codebase search, online if needed)
|
|
99
|
-
4. Design solution with:
|
|
100
|
-
- Architecture overview
|
|
101
|
-
- Trade-offs analysis
|
|
102
|
-
- Implementation approach
|
|
103
|
-
- File locations and changes needed
|
|
104
|
-
- Dependencies and impacts
|
|
105
|
-
- Validation criteria
|
|
106
|
-
|
|
107
|
-
**Output:** Complete design document ready for `/build`
|
|
108
|
-
|
|
109
|
-
## Output Format
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
DESIGN DOCUMENT:
|
|
113
|
-
|
|
114
|
-
REQUIREMENT:
|
|
115
|
-
[Clear statement of what needs to be designed]
|
|
116
|
-
|
|
117
|
-
ANALYSIS:
|
|
118
|
-
- Current state: [what exists]
|
|
119
|
-
- Problem: [what needs solving]
|
|
120
|
-
- Constraints: [framework rules, patterns, etc.]
|
|
121
|
-
|
|
122
|
-
DESIGN:
|
|
123
|
-
[Architecture/solution design]
|
|
124
|
-
|
|
125
|
-
TRADE-OFFS:
|
|
126
|
-
- Option A: [pros/cons]
|
|
127
|
-
- Option B: [pros/cons]
|
|
128
|
-
- Recommendation: [which and why]
|
|
129
|
-
|
|
130
|
-
IMPLEMENTATION PLAN:
|
|
131
|
-
- Files to create/modify: [list]
|
|
132
|
-
- Changes needed: [detailed breakdown]
|
|
133
|
-
- Dependencies: [what depends on this]
|
|
134
|
-
- Testing: [how to validate]
|
|
135
|
-
|
|
136
|
-
READY FOR /build:
|
|
137
|
-
[Summary of what will be built]
|
|
138
|
-
|
|
139
|
-
UNRESOLVED:
|
|
140
|
-
- [Any open questions]
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
## Rules
|
|
144
|
-
|
|
145
|
-
- **NEVER write code** - only design and plan
|
|
146
|
-
- **ALWAYS analyze existing patterns** - don't reinvent
|
|
147
|
-
- **ALWAYS consider trade-offs** - no solution is perfect
|
|
148
|
-
- **ALWAYS reference framework architecture** - stay aligned
|
|
149
|
-
- **ALWAYS identify impacts** - what breaks if we change this?
|
|
150
|
-
- **ALWAYS prepare for /build** - design should be actionable
|
|
151
|
-
- **ALWAYS use `lookup_symbol`** when referencing @donotdev components in your design — verify the API exists before putting it in the plan
|
|
152
|
-
- **Import convention:** Always `@donotdev/<package>` top-level, never sub-paths. The only exceptions are `@donotdev/core/server`, `@donotdev/core/vite`, `@donotdev/core/next`, `@donotdev/core/functions`
|
|
153
|
-
|
|
154
|
-
## Integration with WAI-WAY & BMAD
|
|
155
|
-
|
|
156
|
-
- Uses **BMAD PRINTER** persona (proven, battle-tested)
|
|
157
|
-
- Follows WAI-WAY Phase 2 (ENTITIES) + Architecture
|
|
158
|
-
- Output feeds into `/build` command (BMAD FORGER/Builder)
|
|
159
|
-
|
|
160
|
-
## Mode Detection
|
|
161
|
-
|
|
162
|
-
**CRITICAL:** Check working mode first.
|
|
163
|
-
|
|
164
|
-
**Framework dev indicators:**
|
|
165
|
-
- `packages/` directory exists
|
|
166
|
-
- `CLAUDE.md` says "Framework Development Mode"
|
|
167
|
-
- Using `dn` CLI
|
|
168
|
-
|
|
169
|
-
**Consumer app indicators:**
|
|
170
|
-
- `apps/` or `src/` directory exists
|
|
171
|
-
- `CLAUDE.md` says "Consumer App Development Mode"
|
|
172
|
-
- Using `dndev` CLI
|
|
173
|
-
|
|
174
|
-
**If framework dev detected:**
|
|
175
|
-
- STOP and inform user: "`/design` is for consumer apps. In framework dev, design directly using Architecture Hub patterns, then code in `packages/*/src/`"
|
|
176
|
-
|
|
177
|
-
**If consumer app detected:**
|
|
178
|
-
- Use ONLY published `@donotdev/*` packages
|
|
179
|
-
- Cannot reference internal framework patterns
|
|
180
|
-
|
|
181
|
-
## Requirements
|
|
182
|
-
|
|
183
|
-
- MCP server configured (`.mcp.json` or `.cursor/mcp.json`) - for component/package lookups
|
|
184
|
-
- Architecture docs available (for framework context)
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Critical staff-engineer code review — flags problems before shipping
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
**Phase gate: only use after Phase 3 (COMPOSE) is complete.**
|
|
6
|
-
|
|
7
|
-
Act as a skeptical staff engineer doing a blocking code review.
|
|
8
|
-
|
|
9
|
-
Target: the last modified files in this session, or files passed as argument.
|
|
10
|
-
|
|
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:
|
|
24
|
-
- Security issues (injection, unvalidated input at system boundaries, exposed secrets)
|
|
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
|
|
41
|
-
- Missing or incorrect TypeScript types
|
|
42
|
-
|
|
43
|
-
**NOTE** - sparingly. Only genuine maintainer gotchas.
|
|
44
|
-
|
|
45
|
-
### Rules
|
|
46
|
-
|
|
47
|
-
- NEVER suggest fixes. Report problems only.
|
|
48
|
-
- NEVER skip BLOCKER items to be polite.
|
|
49
|
-
- If there are no issues at a severity level, omit that level entirely.
|
|
50
|
-
- **Quality > quantity. 15 real issues >>> 60 padded items.**
|
|
51
|
-
|
|
52
|
-
## Output — 3-step lifecycle
|
|
53
|
-
|
|
54
|
-
The grill report is a **living queue**. Each run cleans up resolved items, archives them, then appends new findings.
|
|
55
|
-
|
|
56
|
-
### Step 1 — Clean up + archive
|
|
57
|
-
|
|
58
|
-
Read existing `.dndev/grill-report.json`. If it exists and has items:
|
|
59
|
-
|
|
60
|
-
1. Separate items into **resolved** (`status` = `fixed`, `resolved`, or `rejected`) and **surviving** (`pending`, `fixing`, or any other status).
|
|
61
|
-
2. Append a history entry to `.dndev/grill-history.json` (read existing array or start with `[]`):
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"date": "<now ISO>",
|
|
65
|
-
"gitSha": "<short git HEAD>",
|
|
66
|
-
"target": "<previous report target>",
|
|
67
|
-
"verdict": "<previous report verdict>",
|
|
68
|
-
"blockers": <previous blocker count>,
|
|
69
|
-
"warnings": <previous warning count>,
|
|
70
|
-
"notes": <previous note count>,
|
|
71
|
-
"total": <previous items.length>,
|
|
72
|
-
"resolved": <resolved count>,
|
|
73
|
-
"carried": <surviving count>
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
3. Keep the surviving items — they carry over into the updated report.
|
|
77
|
-
|
|
78
|
-
If no existing report or no items, skip this step.
|
|
79
|
-
|
|
80
|
-
### Step 2 — Scan
|
|
81
|
-
|
|
82
|
-
Produce new findings from the target files. **Deduplicate** against surviving items from Step 1: if a new finding matches an existing item on `file` + `line` + `issue` (fuzzy match on issue text), skip it.
|
|
83
|
-
|
|
84
|
-
### Step 3 — Write report
|
|
85
|
-
|
|
86
|
-
Merge surviving items from Step 1 + new findings from Step 2. Re-number `id` fields sequentially starting at 1. Write to `.dndev/grill-report.json`:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"generated": "<now ISO>",
|
|
91
|
-
"gitSha": "<short git HEAD>",
|
|
92
|
-
"target": "<description of what was reviewed>",
|
|
93
|
-
"verdict": "SHIP" | "DO NOT SHIP",
|
|
94
|
-
"items": [
|
|
95
|
-
{
|
|
96
|
-
"id": 1,
|
|
97
|
-
"severity": "blocker" | "warn" | "note",
|
|
98
|
-
"file": "src/pages/Foo.tsx",
|
|
99
|
-
"line": 42,
|
|
100
|
-
"issue": "Short description of the problem",
|
|
101
|
-
"context": "Optional: why this matters, what could go wrong",
|
|
102
|
-
"category": "security" | "architecture" | "edge-case" | "types" | "dead-code" | "consistency" | "dx" | "docs" | "performance",
|
|
103
|
-
"status": "pending",
|
|
104
|
-
"verified": true
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Verdict is based on the **merged** items (carried + new). If any blocker exists → DO NOT SHIP.
|
|
111
|
-
|
|
112
|
-
### Field rules
|
|
113
|
-
|
|
114
|
-
- `gitSha` — Run `git rev-parse --short HEAD`. Required.
|
|
115
|
-
- `verified` — Always `true` in final output.
|
|
116
|
-
- New items always get `status: "pending"`. Carried items keep their existing status.
|
|
117
|
-
|
|
118
|
-
### Fixing findings
|
|
119
|
-
|
|
120
|
-
When asked to fix grill findings (not during a scan — during a separate fix request):
|
|
121
|
-
|
|
122
|
-
1. Apply the code fix.
|
|
123
|
-
2. Update `.dndev/grill-report.json`: set `status: "fixed"` on each resolved item.
|
|
124
|
-
3. Set `lastReviewed` to current ISO timestamp.
|
|
125
|
-
|
|
126
|
-
This ensures the report reflects reality. Next grill run archives fixed items to history.
|
|
127
|
-
|
|
128
|
-
### General rules
|
|
129
|
-
|
|
130
|
-
- NEVER suggest fixes. Report problems only — during a scan.
|
|
131
|
-
- NEVER skip BLOCKER items.
|
|
132
|
-
- **Quality > quantity. 15 real issues >>> 60 padded items** (for new findings — carried items don't count toward this cap).
|
|
133
|
-
- Group by file, sort by line number.
|
|
134
|
-
- After writing, print: `Cleaned N resolved items → history. Carried M items. Added K new findings. Total: T items.`
|
|
135
|
-
- Print verdict: SHIP / DO NOT SHIP.
|