@donotdev/cli 0.0.37 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE.md +21 -48
  2. package/dependencies-matrix.json +108 -58
  3. package/dist/bin/commands/agent-setup.js +7196 -123
  4. package/dist/bin/commands/build.js +3341 -207
  5. package/dist/bin/commands/bump.js +268 -24
  6. package/dist/bin/commands/cacheout.js +262 -13
  7. package/dist/bin/commands/coach.js +365 -61
  8. package/dist/bin/commands/create-app.js +261 -14
  9. package/dist/bin/commands/create-project.js +270 -15
  10. package/dist/bin/commands/db.js +10743 -2346
  11. package/dist/bin/commands/deploy.js +4202 -776
  12. package/dist/bin/commands/dev.js +353 -38
  13. package/dist/bin/commands/doctor.js +412 -108
  14. package/dist/bin/commands/emu.js +392 -57
  15. package/dist/bin/commands/format.js +250 -15
  16. package/dist/bin/commands/get-demo.js +261 -14
  17. package/dist/bin/commands/make-admin.js +10022 -1552
  18. package/dist/bin/commands/preview.js +353 -38
  19. package/dist/bin/commands/seed.js +10743 -2346
  20. package/dist/bin/commands/setup-cicd.js +456 -133
  21. package/dist/bin/commands/setup.js +428 -125
  22. package/dist/bin/commands/staging.js +4202 -776
  23. package/dist/bin/commands/sync-secrets.js +250 -14
  24. package/dist/bin/commands/type-check.js +249 -13
  25. package/dist/bin/commands/wai.js +249 -13
  26. package/dist/bin/dndev.js +33 -4
  27. package/dist/bin/donotdev.js +33 -4
  28. package/dist/index.js +4278 -856
  29. package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
  30. package/package.json +3 -2
  31. package/templates/app-demo/src/themes.css.example +21 -0
  32. package/templates/app-dndev/index.html.example +0 -3
  33. package/templates/app-dndev/src/themes.css.example +21 -0
  34. package/templates/app-next/src/app/layout.tsx.example +13 -4
  35. package/templates/app-next/src/themes.css.example +21 -0
  36. package/templates/app-vite/csp.example.json +44 -0
  37. package/templates/app-vite/index.html.example +0 -3
  38. package/templates/app-vite/src/themes.css.example +21 -0
  39. package/templates/functions-supabase/supabase/functions/.env.example +12 -0
  40. package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
  41. package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
  42. package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
  43. package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
  44. package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
  45. package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
  46. package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
  47. package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
  48. package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
  49. package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
  50. package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
  51. package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
  52. package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
  53. package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
  54. package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
  55. package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
  56. package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
  57. package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
  58. package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
  59. package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
  60. package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
  61. package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
  62. package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
  63. package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
  64. package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
  65. package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
  66. package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
  67. package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
  68. package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
  69. package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
  70. package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
  71. package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
  72. package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
  73. package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
  74. package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
  75. package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
  76. package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
  77. package/templates/root-consumer/.claude/rules/git.md.example +14 -0
  78. package/templates/root-consumer/.claude/rules/security.md.example +13 -0
  79. package/templates/root-consumer/.claude/settings.json.example +123 -1
  80. package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
  81. package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
  82. package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
  83. package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +33 -16
  84. package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
  85. package/templates/root-consumer/AI.md.example +2 -2
  86. package/templates/root-consumer/CLAUDE.md.example +33 -1
  87. package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
  88. package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
  89. package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +12 -6
  90. package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
  91. package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
  92. package/templates/app-demo/public/manifest.json.example +0 -10
  93. package/templates/app-dndev/public/manifest.json.example +0 -10
  94. package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -147
  95. package/templates/root-consumer/.claude/commands/build.md.example +0 -131
  96. package/templates/root-consumer/.claude/commands/design.md.example +0 -153
  97. package/templates/root-consumer/.claude/commands/grill.md.example +0 -108
  98. package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
  99. package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
  100. package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
  101. package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
  102. package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
  103. package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
  104. package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
  105. package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
  106. package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
  107. package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
  108. package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
  109. package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
  110. package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
  111. package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
  112. package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
  113. package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
  114. package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
  115. package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
  116. package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
  117. package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
  118. package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
  119. package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
@@ -1,147 +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 1: Activate EXTRACTOR Agent
53
-
54
- **Deploy:** `/agents extractor` (BMAD EXTRACTOR persona)
55
-
56
- **Input:** User's app idea (any level of clarity)
57
-
58
- **Actions:**
59
- 1. EXTRACTOR asks probing questions (one at a time)
60
- 2. EXTRACTOR uses MCP to discover framework capabilities
61
- 3. EXTRACTOR identifies native vs custom components
62
- 4. EXTRACTOR tracks progress and identifies gaps
63
- 5. EXTRACTOR generates complete HLD when all targets extracted
64
-
65
- **Output:** Complete HLD document (`HLD.md`)
66
-
67
- ---
68
-
69
- ## What EXTRACTOR Extracts
70
-
71
- | Category | What EXTRACTOR Asks |
72
- |----------|---------------------|
73
- | **Vision** | What is this app? Who uses it? |
74
- | **Users** | What roles exist? What can each role do? |
75
- | **Entities** | What "things" exist? What fields? How do they relate? |
76
- | **Features** | What can users DO? MVP vs V2? |
77
- | **Pages** | What screens exist? Routes? Access levels? |
78
- | **Constraints** | Platform? Languages? Auth? Integrations? |
79
- | **Native vs Custom** | What uses framework defaults? What needs custom? |
80
-
81
- ---
82
-
83
- ## Output Format
84
-
85
- EXTRACTOR generates `HLD.md` with:
86
-
87
- - **Vision** - One sentence description
88
- - **Users** - Roles and permissions table
89
- - **Entities** - All entities with fields, types, visibility, validation
90
- - **Features** - MVP vs V2 categorization
91
- - **Pages** - Routes, access levels, components
92
- - **Constraints** - Platform, languages, auth, integrations
93
- - **Native vs Custom** - Framework-native vs custom components
94
- - **Open Questions** - Unresolved items
95
-
96
- ---
97
-
98
- ## Validation Gate & Phase Completion (MANDATORY)
99
-
100
- **Before proceeding to `/design`:**
101
- - [ ] HLD is complete (no empty sections or TBDs)
102
- - [ ] All user journeys mapped (numbered steps)
103
- - [ ] All entities have fields, states, permissions
104
- - [ ] All business rules documented
105
- - [ ] Native vs custom analysis complete
106
- - [ ] User has validated HLD
107
-
108
- **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:
109
- ```
110
- complete_phase({ files: ["docs/HLD.md"], summary: "HLD complete — N entities, N pages, N features" })
111
- ```
112
- Then wait for the user to call `approve_phase()` before moving to `/design`.
113
-
114
- **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.
115
-
116
- ---
117
-
118
- ## Rules
119
-
120
- - **EXTRACTOR asks one question at a time** - Wait for answer before next question
121
- - **EXTRACTOR probes vague answers** - "What does 'manage' mean?"
122
- - **EXTRACTOR challenges scope** - "What's the minimum to launch?"
123
- - **EXTRACTOR summarizes progress** - Every 3-4 exchanges
124
- - **EXTRACTOR asks when uncertain** - Never guesses
125
- - **EXTRACTOR stops when complete** - Generates HLD only when all targets extracted
126
-
127
- ---
128
-
129
- ## Integration with WAI-WAY
130
-
131
- - Uses **BMAD EXTRACTOR** persona (proven, battle-tested)
132
- - Follows WAI-WAY Phase 0 (BRAINSTORM → SPEC)
133
- - Output feeds into `/design` command (BMAD PRINTER/Architect)
134
-
135
- ---
136
-
137
- ## Requirements
138
-
139
- - MCP server configured (`.mcp.json` or `.cursor/mcp.json`) - for framework discovery
140
- - User available for conversation (requirements extraction is interactive)
141
-
142
- ---
143
-
144
- ## Next Step
145
-
146
- Once HLD is validated:
147
- → 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,153 +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 1: Architect Phase
55
-
56
- **Deploy:** `/agents architect` (WAI-WAY architect role)
57
-
58
- **Input:** User requirement or design question
59
-
60
- **Actions:**
61
- 1. Analyze requirement/question
62
- 2. Read constraints from:
63
- - `CLAUDE.md` (project rules)
64
- - Framework architecture docs (`docs/architecture/`)
65
- - Existing patterns in codebase
66
- - WAI-WAY entity patterns (if applicable)
67
- 3. Research similar solutions (codebase search, online if needed)
68
- 4. Design solution with:
69
- - Architecture overview
70
- - Trade-offs analysis
71
- - Implementation approach
72
- - File locations and changes needed
73
- - Dependencies and impacts
74
- - Validation criteria
75
-
76
- **Output:** Complete design document ready for `/build`
77
-
78
- ## Output Format
79
-
80
- ```
81
- DESIGN DOCUMENT:
82
-
83
- REQUIREMENT:
84
- [Clear statement of what needs to be designed]
85
-
86
- ANALYSIS:
87
- - Current state: [what exists]
88
- - Problem: [what needs solving]
89
- - Constraints: [framework rules, patterns, etc.]
90
-
91
- DESIGN:
92
- [Architecture/solution design]
93
-
94
- TRADE-OFFS:
95
- - Option A: [pros/cons]
96
- - Option B: [pros/cons]
97
- - Recommendation: [which and why]
98
-
99
- IMPLEMENTATION PLAN:
100
- - Files to create/modify: [list]
101
- - Changes needed: [detailed breakdown]
102
- - Dependencies: [what depends on this]
103
- - Testing: [how to validate]
104
-
105
- READY FOR /build:
106
- [Summary of what will be built]
107
-
108
- UNRESOLVED:
109
- - [Any open questions]
110
- ```
111
-
112
- ## Rules
113
-
114
- - **NEVER write code** - only design and plan
115
- - **ALWAYS analyze existing patterns** - don't reinvent
116
- - **ALWAYS consider trade-offs** - no solution is perfect
117
- - **ALWAYS reference framework architecture** - stay aligned
118
- - **ALWAYS identify impacts** - what breaks if we change this?
119
- - **ALWAYS prepare for /build** - design should be actionable
120
- - **ALWAYS use `lookup_symbol`** when referencing @donotdev components in your design — verify the API exists before putting it in the plan
121
- - **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`
122
-
123
- ## Integration with WAI-WAY & BMAD
124
-
125
- - Uses **BMAD PRINTER** persona (proven, battle-tested)
126
- - Follows WAI-WAY Phase 2 (ENTITIES) + Architecture
127
- - Output feeds into `/build` command (BMAD FORGER/Builder)
128
-
129
- ## Mode Detection
130
-
131
- **CRITICAL:** Check working mode first.
132
-
133
- **Framework dev indicators:**
134
- - `packages/` directory exists
135
- - `CLAUDE.md` says "Framework Development Mode"
136
- - Using `dn` CLI
137
-
138
- **Consumer app indicators:**
139
- - `apps/` or `src/` directory exists
140
- - `CLAUDE.md` says "Consumer App Development Mode"
141
- - Using `dndev` CLI
142
-
143
- **If framework dev detected:**
144
- - STOP and inform user: "`/design` is for consumer apps. In framework dev, design directly using Architecture Hub patterns, then code in `packages/*/src/`"
145
-
146
- **If consumer app detected:**
147
- - Use ONLY published `@donotdev/*` packages
148
- - Cannot reference internal framework patterns
149
-
150
- ## Requirements
151
-
152
- - MCP server configured (`.mcp.json` or `.cursor/mcp.json`) - for component/package lookups
153
- - Architecture docs available (for framework context)
@@ -1,108 +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
- 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)
14
- - Security issues (injection, unvalidated input at system boundaries, exposed secrets)
15
- - Over-engineering (abstractions not earned by current requirements)
16
- - Missing or incorrect TypeScript types
17
- - @donotdev component usage without `lookup_symbol` verification
18
-
19
- Rules:
20
- - NEVER suggest fixes. Report problems only.
21
- - NEVER skip BLOCKER items to be polite.
22
- - If there are no issues at a severity level, omit that level entirely.
23
- - **Quality > quantity. 15 real issues >>> 60 padded items.**
24
-
25
- ## Output — 3-step lifecycle
26
-
27
- The grill report is a **living queue**. Each run cleans up resolved items, archives them, then appends new findings.
28
-
29
- ### Step 1 — Clean up + archive
30
-
31
- Read existing `.dndev/grill-report.json`. If it exists and has items:
32
-
33
- 1. Separate items into **resolved** (`status` = `fixed`, `resolved`, or `rejected`) and **surviving** (`pending`, `fixing`, or any other status).
34
- 2. Append a history entry to `.dndev/grill-history.json` (read existing array or start with `[]`):
35
- ```json
36
- {
37
- "date": "<now ISO>",
38
- "gitSha": "<short git HEAD>",
39
- "target": "<previous report target>",
40
- "verdict": "<previous report verdict>",
41
- "blockers": <previous blocker count>,
42
- "warnings": <previous warning count>,
43
- "notes": <previous note count>,
44
- "total": <previous items.length>,
45
- "resolved": <resolved count>,
46
- "carried": <surviving count>
47
- }
48
- ```
49
- 3. Keep the surviving items — they carry over into the updated report.
50
-
51
- If no existing report or no items, skip this step.
52
-
53
- ### Step 2 — Scan
54
-
55
- 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.
56
-
57
- ### Step 3 — Write report
58
-
59
- 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`:
60
-
61
- ```json
62
- {
63
- "generated": "<now ISO>",
64
- "gitSha": "<short git HEAD>",
65
- "target": "<description of what was reviewed>",
66
- "verdict": "SHIP" | "DO NOT SHIP",
67
- "items": [
68
- {
69
- "id": 1,
70
- "severity": "blocker" | "warn" | "note",
71
- "file": "src/pages/Foo.tsx",
72
- "line": 42,
73
- "issue": "Short description of the problem",
74
- "context": "Optional: why this matters, what could go wrong",
75
- "category": "security" | "architecture" | "edge-case" | "types" | "dead-code" | "consistency" | "dx" | "docs" | "performance",
76
- "status": "pending",
77
- "verified": true
78
- }
79
- ]
80
- }
81
- ```
82
-
83
- Verdict is based on the **merged** items (carried + new). If any blocker exists → DO NOT SHIP.
84
-
85
- ### Field rules
86
-
87
- - `gitSha` — Run `git rev-parse --short HEAD`. Required.
88
- - `verified` — Always `true` in final output.
89
- - New items always get `status: "pending"`. Carried items keep their existing status.
90
-
91
- ### Fixing findings
92
-
93
- When asked to fix grill findings (not during a scan — during a separate fix request):
94
-
95
- 1. Apply the code fix.
96
- 2. Update `.dndev/grill-report.json`: set `status: "fixed"` on each resolved item.
97
- 3. Set `lastReviewed` to current ISO timestamp.
98
-
99
- This ensures the report reflects reality. Next grill run archives fixed items to history.
100
-
101
- ### General rules
102
-
103
- - NEVER suggest fixes. Report problems only — during a scan.
104
- - NEVER skip BLOCKER items.
105
- - **Quality > quantity. 15 real issues >>> 60 padded items** (for new findings — carried items don't count toward this cap).
106
- - Group by file, sort by line number.
107
- - After writing, print: `Cleaned N resolved items → history. Carried M items. Added K new findings. Total: T items.`
108
- - Print verdict: SHIP / DO NOT SHIP.
@@ -1,146 +0,0 @@
1
- ---
2
- description: Generate tests, firestore rules, CI/CD, config, fix bugs, i18n (Phase 4) - AFTER /build
3
- ---
4
-
5
- # Polish Command - Production-Ready App
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 `/polish`** - framework dev doesn't use this workflow
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 `/polish` after `/build` is complete
15
- - ✅ Use `/polish` to generate tests, firestore rules, CI/CD
16
- - ✅ Use `/polish` to fix bugs, add styling, add i18n
17
- - ✅ Use `/polish` to finalize configuration
18
-
19
- **WORKFLOW ORDER:**
20
- 1. `/brainstorm` → Extract requirements, generate spec
21
- 2. `/design` → Create technical plan
22
- 3. `/build` → Implement code using framework defaults
23
- 4. `/polish` → Generate tests, config, CI/CD, fix bugs (THIS COMMAND)
24
-
25
- ---
26
-
27
- ## Usage
28
-
29
- ```
30
- /polish [task]
31
- ```
32
-
33
- **Examples:**
34
- ```
35
- /polish Generate all tests and firestore rules
36
- /polish Fix bug: Projects list is empty
37
- /polish Add French and Spanish translations
38
- /polish Complete configuration and deploy
39
- ```
40
-
41
- ---
42
-
43
- ## Process
44
-
45
- ### Step 0: Start Phase (MANDATORY — DO THIS FIRST)
46
-
47
- **BEFORE any polish work**, call:
48
- ```
49
- start_phase(4)
50
- ```
51
- This activates Phase 4: CONFIGURE and loads the blueprint, persona, context, and lessons. **Do NOT proceed without this call.**
52
-
53
- ### Step 1: Activate Polisher Agent
54
-
55
- **Deploy:** `/agents polisher` (Phase 4 Polisher persona)
56
-
57
- **READ first:**
58
- - `guides/wai-way/spec_template.md` — validated spec (your test plan)
59
- - `entities/index.ts` — all entity definitions
60
- - `src/pages/` — all page files
61
- - `guides/dndev/SETUP_TESTING.md` — testing patterns
62
-
63
- ### Step 2: Generate Tests
64
-
65
- Call `get_guide("TESTING")` for patterns.
66
-
67
- 1. **Entity tests** — one per entity in `tests/entities/[Entity].test.ts`
68
- 2. **Page tests** — one per page in `tests/pages/[Page].test.tsx`
69
- 3. **Access control tests** — `tests/access/access-rules.test.ts`
70
-
71
- ### Step 3: Generate Firestore Rules
72
-
73
- Create `firestore.rules` from entity access definitions.
74
-
75
- ### Step 4: Generate CI/CD
76
-
77
- Create `.github/workflows/ci.yml` — type-check → test → build → deploy.
78
-
79
- ### Step 5: Configure
80
-
81
- - `src/config/app.ts` — APP_NAME, preset, footer
82
- - `src/config/legal.ts` — company, contacts, jurisdiction
83
- - `.env` — Firebase config, license key
84
-
85
- ### Step 6: Run Tests
86
-
87
- ```bash
88
- bun test
89
- ```
90
-
91
- All tests must pass.
92
-
93
- ### Step 7: Fix Bugs (if any)
94
-
95
- - Understand → Diagnose → Fix (minimal) → Verify → Check regressions
96
-
97
- ### Step 8: Mobile Check
98
-
99
- DevTools → 375px → navigation, forms, text, buttons (44px)
100
-
101
- ### Step 9: i18n (Optional)
102
-
103
- Extract strings to `src/locales/`, replace with `useTranslation()`.
104
-
105
- ---
106
-
107
- ## What Polisher Does
108
-
109
- | Task | Description |
110
- |------|-------------|
111
- | **Test Generation** | Entity tests, page tests, access tests from spec |
112
- | **Firestore Rules** | Security rules from entity access definitions |
113
- | **CI/CD** | GitHub Actions workflow (test → build → deploy) |
114
- | **Configuration** | app.ts, legal.ts, .env, Firebase setup |
115
- | **Bug Fixes** | Diagnose and fix bugs with minimal changes |
116
- | **i18n** | Extract strings, create translation files (optional) |
117
-
118
- ---
119
-
120
- ## Ship Readiness
121
-
122
- App is ready to ship when:
123
- - ✅ `dndev tc` passes
124
- - ✅ `bun test` passes
125
- - ✅ `firestore.rules` generated
126
- - ✅ `.github/workflows/ci.yml` created
127
- - ✅ No critical bugs
128
- - ✅ Auth is secure
129
- - ✅ Mobile works at 375px
130
- - ✅ Configuration complete
131
- - ✅ (Optional) i18n added
132
-
133
- ## Phase Completion (MANDATORY)
134
-
135
- When all ship readiness checks pass, call:
136
- ```
137
- complete_phase({ files: ["...all test/config files..."], summary: "Tests passing, config complete, ready to ship" })
138
- ```
139
- Wait for user to call `approve_phase()`.
140
-
141
- ---
142
-
143
- ## Next Step
144
-
145
- Once app is production-ready:
146
- → `dndev deploy`