@donotdev/cli 0.0.8 → 0.0.11
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 +177 -76
- package/dist/bin/commands/build.js +2 -2
- package/dist/bin/commands/bump.js +578 -94
- package/dist/bin/commands/cacheout.js +2 -2
- package/dist/bin/commands/create-app.js +46 -9
- package/dist/bin/commands/create-project.js +63 -10
- package/dist/bin/commands/deploy.js +114 -25
- package/dist/bin/commands/dev.js +2 -2
- package/dist/bin/commands/emu.js +2 -2
- package/dist/bin/commands/format.js +2 -2
- package/dist/bin/commands/lint.js +2 -2
- package/dist/bin/commands/preview.js +2 -2
- package/dist/bin/commands/sync-secrets.js +2 -2
- package/dist/bin/dndev.js +7 -4
- package/dist/bin/donotdev.js +7 -4
- package/dist/index.js +177 -33
- package/package.json +5 -4
- package/templates/app-next/src/config/app.ts.example +1 -1
- package/templates/app-vite/index.html.example +24 -2
- package/templates/app-vite/src/config/app.ts.example +1 -1
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +8 -5
- package/templates/app-vite/src/pages/ListPageExample.tsx.example +4 -7
- package/templates/root-consumer/.claude/agents/architect.md.example +313 -0
- package/templates/root-consumer/.claude/agents/builder.md.example +329 -0
- package/templates/root-consumer/.claude/agents/coder.md.example +87 -0
- package/templates/root-consumer/.claude/agents/extractor.md.example +235 -0
- package/templates/root-consumer/.claude/agents/polisher.md.example +359 -0
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +85 -0
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +133 -0
- package/templates/root-consumer/.claude/commands/build.md.example +109 -0
- package/templates/root-consumer/.claude/commands/design.md.example +136 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +145 -0
- package/templates/root-consumer/.cursor/mcp.json.example +8 -0
- package/templates/root-consumer/.firebaserc.example +5 -0
- package/templates/root-consumer/.mcp.json.example +8 -0
- package/templates/root-consumer/CLAUDE.md.example +146 -0
- package/templates/root-consumer/entities/ExampleEntity.ts.example +2 -1
- package/templates/root-consumer/entities/demo.ts.example +1 -1
- package/templates/root-consumer/firestore.indexes.json.example +4 -0
- package/templates/root-consumer/firestore.rules.example +11 -0
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +15 -12
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +9 -6
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +195 -0
- package/templates/root-consumer/guides/dndev/INDEX.md.example +3 -1
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +485 -57
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +1 -1
- package/templates/root-consumer/storage.rules.example +8 -0
|
@@ -7,6 +7,32 @@
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
+
## ⚠️ WORKING MODE: Consumer App Development
|
|
11
|
+
|
|
12
|
+
**YOU ARE IN:** Consumer App Development Mode
|
|
13
|
+
|
|
14
|
+
**Location:** Consumer repository (scaffolded by `dndev init`)
|
|
15
|
+
|
|
16
|
+
**Your Role:**
|
|
17
|
+
- **Creating with framework** (Mode 3): Build new app features
|
|
18
|
+
- **Tweaking framework app** (Mode 4): Modify existing app features
|
|
19
|
+
|
|
20
|
+
**CLI:** `dndev` (public CLI, installed globally)
|
|
21
|
+
|
|
22
|
+
**Workflow:**
|
|
23
|
+
1. `/design [requirement]` → Architect designs solution
|
|
24
|
+
2. `/build [requirement]` → Prompt Engineer + Coder implement
|
|
25
|
+
3. Iterate with WAI-WAY agents
|
|
26
|
+
|
|
27
|
+
**Reference:** [Modes Guide](https://github.com/donotdev/framework/blob/main/docs/development/MODES.md) | Framework guides in `guides/dndev/`
|
|
28
|
+
|
|
29
|
+
**⚠️ IMPORTANT:**
|
|
30
|
+
- Use ONLY published `@donotdev/*` packages
|
|
31
|
+
- Cannot modify framework internals
|
|
32
|
+
- If framework needs changes, work in monorepo (`c:\ws\dndev`)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
10
36
|
**PRIME DIRECTIVE: PRECISION OVER SPEED.**
|
|
11
37
|
|
|
12
38
|
## **Correctness is non-negotiable. Concise, even at the cost of grammar. Never guess, every output must be verifiable. Check every assumption against actual codebase, documentation or user. If ambiguity exists, ask. No exceptions.**
|
|
@@ -71,3 +97,123 @@ At end of each plan, list unresolved questions (if any). Extremely concise.
|
|
|
71
97
|
## General Principles
|
|
72
98
|
- **Code reading/writing:** Be critical and concise/precise. Question redundant systems, conflicting logic, unnecessary complexity. You need to **ANALYZE** code.
|
|
73
99
|
- **Conventions:** Always follow project's conventions when updating/adding/fixing files
|
|
100
|
+
|
|
101
|
+
## Component Usage - MCP REQUIRED
|
|
102
|
+
|
|
103
|
+
**BEFORE writing ANY @donotdev component:**
|
|
104
|
+
|
|
105
|
+
1. Call `lookup_component({ component: "ComponentName" })`
|
|
106
|
+
2. Read the actual props from the returned TypeScript interface
|
|
107
|
+
3. Use ONLY those props
|
|
108
|
+
|
|
109
|
+
**NEVER guess props. NEVER use props from memory/training.**
|
|
110
|
+
|
|
111
|
+
If MCP tools unavailable → STOP and tell user to enable MCP.
|
|
112
|
+
|
|
113
|
+
**Available MCP tools:**
|
|
114
|
+
- `lookup_component` - get actual props from .d.ts
|
|
115
|
+
- `list_components` - list exports from a package
|
|
116
|
+
- `list_packages` - list all @donotdev packages
|
|
117
|
+
|
|
118
|
+
## WAI-WAY Workflow - Four-Phase System (BMAD-Based)
|
|
119
|
+
|
|
120
|
+
**Workflow Order:**
|
|
121
|
+
1. `/brainstorm` → BMAD EXTRACTOR extracts requirements, generates HLD
|
|
122
|
+
2. `/design` → BMAD PRINTER (Architect) creates technical plan (LLD)
|
|
123
|
+
3. `/build` → BMAD FORGER (Builder) implements code using framework defaults
|
|
124
|
+
4. `/polish` → BMAD FINISHER (Polisher) adds styling, customization, i18n
|
|
125
|
+
|
|
126
|
+
**Quality Over Speed:** Each phase must be complete before proceeding. Take as long as needed.
|
|
127
|
+
|
|
128
|
+
### Brainstorm Phase
|
|
129
|
+
|
|
130
|
+
**Use `/brainstorm [app idea]` to extract complete requirements.**
|
|
131
|
+
|
|
132
|
+
**Workflow:**
|
|
133
|
+
1. `/brainstorm` → BMAD EXTRACTOR asks probing questions
|
|
134
|
+
2. EXTRACTOR uses MCP to discover framework capabilities
|
|
135
|
+
3. EXTRACTOR identifies native vs custom components
|
|
136
|
+
4. Output → Complete HLD document
|
|
137
|
+
|
|
138
|
+
**Example:**
|
|
139
|
+
```
|
|
140
|
+
/brainstorm I want to build a car dealership management app
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Agent:**
|
|
144
|
+
- `extractor` (BMAD EXTRACTOR) - Extracts requirements through conversation
|
|
145
|
+
|
|
146
|
+
**See:** `.claude/commands/brainstorm.md` for full workflow details.
|
|
147
|
+
|
|
148
|
+
### Design Phase
|
|
149
|
+
|
|
150
|
+
**Use `/design [HLD reference]` to create technical implementation plan.**
|
|
151
|
+
|
|
152
|
+
**Workflow:**
|
|
153
|
+
1. `/design` → BMAD PRINTER (Architect) reads validated HLD
|
|
154
|
+
2. PRINTER creates technical artifacts (LLD):
|
|
155
|
+
- Entity schemas
|
|
156
|
+
- Navigation config
|
|
157
|
+
- Feature mapping
|
|
158
|
+
- Custom component specs
|
|
159
|
+
3. Output → Complete LLD document
|
|
160
|
+
|
|
161
|
+
**Example:**
|
|
162
|
+
```
|
|
163
|
+
/design Create technical plan from HLD.md
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Agent:**
|
|
167
|
+
- `architect` (BMAD PRINTER) - Transforms HLD into technical specifications
|
|
168
|
+
|
|
169
|
+
**See:** `.claude/commands/design.md` for full workflow details.
|
|
170
|
+
|
|
171
|
+
### Build Phase
|
|
172
|
+
|
|
173
|
+
**Use `/build [LLD reference]` to implement working code.**
|
|
174
|
+
|
|
175
|
+
**Workflow:**
|
|
176
|
+
1. `/build` → BMAD FORGER (Builder) reads LLD
|
|
177
|
+
2. FORGER implements in phases:
|
|
178
|
+
- Entities → Routes → Auth → Native Pages → Custom Components → Integration
|
|
179
|
+
3. Uses framework defaults ONLY (no styling, no customization)
|
|
180
|
+
4. Hardcodes all strings (no i18n yet)
|
|
181
|
+
5. Output → Working app (functional MVP)
|
|
182
|
+
|
|
183
|
+
**Example:**
|
|
184
|
+
```
|
|
185
|
+
/build Implement from LLD.md
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Agent:**
|
|
189
|
+
- `builder` (BMAD FORGER) - Implements app from specifications
|
|
190
|
+
|
|
191
|
+
**See:** `.claude/commands/build.md` for full workflow details.
|
|
192
|
+
|
|
193
|
+
### Polish Phase
|
|
194
|
+
|
|
195
|
+
**Use `/polish [requirements]` to make app production-ready.**
|
|
196
|
+
|
|
197
|
+
**Workflow:**
|
|
198
|
+
1. `/polish` → BMAD FINISHER (Polisher) reads working app
|
|
199
|
+
2. FINISHER:
|
|
200
|
+
- Fixes bugs (if any)
|
|
201
|
+
- Adds styling/customization
|
|
202
|
+
- Adds i18n translations
|
|
203
|
+
- Finalizes configuration
|
|
204
|
+
- Tests and validates
|
|
205
|
+
3. Output → Production-ready app
|
|
206
|
+
|
|
207
|
+
**Example:**
|
|
208
|
+
```
|
|
209
|
+
/polish Add styling and French translations
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**Agent:**
|
|
213
|
+
- `polisher` (BMAD FINISHER) - Fixes bugs, adds styling, i18n, config
|
|
214
|
+
|
|
215
|
+
**See:** `.claude/commands/polish.md` for full workflow details.
|
|
216
|
+
|
|
217
|
+
**Requirements:**
|
|
218
|
+
- MCP server configured (`.mcp.json` or `.cursor/mcp.json`)
|
|
219
|
+
- `@donotdev/mcp-server` available (via `bunx` or installed)
|
|
@@ -63,6 +63,7 @@ export const productEntity = defineEntity({
|
|
|
63
63
|
// 'checkbox' → Multiple selections
|
|
64
64
|
// 'date' → Date picker
|
|
65
65
|
// 'timestamp' → Date + time
|
|
66
|
+
// 'price' → Structured price (amount, currency, VAT, discount %)
|
|
66
67
|
// 'images' → Image upload (multiple)
|
|
67
68
|
// 'reference' → Link to another entity
|
|
68
69
|
//
|
|
@@ -120,7 +121,7 @@ export const productEntity = defineEntity({
|
|
|
120
121
|
price: {
|
|
121
122
|
name: 'price',
|
|
122
123
|
label: 'price',
|
|
123
|
-
type: '
|
|
124
|
+
type: 'price',
|
|
124
125
|
visibility: 'guest',
|
|
125
126
|
editable: 'admin',
|
|
126
127
|
validation: { required: true },
|
|
@@ -99,7 +99,7 @@ const demoEntity = defineEntity({
|
|
|
99
99
|
price: {
|
|
100
100
|
name: 'price',
|
|
101
101
|
label: 'price',
|
|
102
|
-
type: '
|
|
102
|
+
type: 'price', // Value: { amount, currency?, vatIncluded?, discountPercent? }
|
|
103
103
|
visibility: 'guest',
|
|
104
104
|
editable: 'admin',
|
|
105
105
|
validation: { required: true },
|
|
@@ -229,25 +229,28 @@ bun run dev
|
|
|
229
229
|
|
|
230
230
|
---
|
|
231
231
|
|
|
232
|
-
## 🤖 WAI-WAY: The "With AI Way" Protocol (
|
|
232
|
+
## 🤖 WAI-WAY: The "With AI Way" Protocol (BMAD-Based)
|
|
233
233
|
|
|
234
|
-
**WAI-WAY**
|
|
234
|
+
**WAI-WAY** is a rigorous, agent-driven protocol based on the **BMAD Method**. It separates concerns into 4 distinct phases.
|
|
235
235
|
|
|
236
|
-
**
|
|
237
|
-
1. Navigate to `guides/wai-way/`.
|
|
238
|
-
2. Open `WAI_WAY_CLI.md` to see the activation instructions.
|
|
239
|
-
3. Paste the **Activation Prompt** into your AI Agent (Cursor, Claude, etc.) to start a phase.
|
|
236
|
+
**Entry Point:** Use commands in `.claude/commands/` (synced via `dndev bump`)
|
|
240
237
|
|
|
241
238
|
**The 4 Phases:**
|
|
242
|
-
1.
|
|
243
|
-
2.
|
|
244
|
-
3.
|
|
245
|
-
4.
|
|
239
|
+
1. **`/brainstorm`** → BMAD EXTRACTOR extracts requirements, generates HLD
|
|
240
|
+
2. **`/design`** → BMAD PRINTER (Architect) creates technical plan (LLD)
|
|
241
|
+
3. **`/build`** → BMAD FORGER (Builder) implements code using framework defaults
|
|
242
|
+
4. **`/polish`** → BMAD FINISHER (Polisher) adds styling, customization, i18n
|
|
243
|
+
|
|
244
|
+
**How It Works:**
|
|
245
|
+
- Commands are in `.claude/commands/` (synced from framework)
|
|
246
|
+
- Agents are in `.claude/agents/` (BMAD personas, synced from framework)
|
|
247
|
+
- Run commands in Cursor: `/brainstorm [app idea]`, `/design [HLD]`, `/build [LLD]`, `/polish [app]`
|
|
248
|
+
- Documentation syncs automatically via `dndev bump`
|
|
246
249
|
|
|
247
250
|
**Why use it?**
|
|
248
|
-
WAI-WAY forces your AI to "Think before it Codes". By separating
|
|
251
|
+
WAI-WAY forces your AI to "Think before it Codes". By separating Architecture from Build, we ensure **only valid DoNotDev primitives are used**, preventing custom CSS bloat and "hallucinated" patterns.
|
|
249
252
|
|
|
250
|
-
**See
|
|
253
|
+
**See:** `.claude/commands/` for command details | `guides/wai-way/WAI_WAY_CLI.md` for methodology
|
|
251
254
|
|
|
252
255
|
---
|
|
253
256
|
|
|
@@ -19,14 +19,14 @@ await remove('doc-id');
|
|
|
19
19
|
Paginated list with automatic loading. For data tables.
|
|
20
20
|
|
|
21
21
|
```tsx
|
|
22
|
-
const { items, loading,
|
|
22
|
+
const { items, loading, refresh } = useCrudList(productEntity);
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### useCrudCardList
|
|
26
26
|
Card-based list with infinite scroll.
|
|
27
27
|
|
|
28
28
|
```tsx
|
|
29
|
-
const { items, loading,
|
|
29
|
+
const { items, loading, refresh } = useCrudCardList(articleEntity);
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
---
|
|
@@ -106,6 +106,9 @@ Field components are auto-rendered by `FormFieldRenderer`. You don't import them
|
|
|
106
106
|
### Numbers
|
|
107
107
|
- `number` - Numeric input
|
|
108
108
|
- `range` - Slider input
|
|
109
|
+
- `rating` - Star rating input (1–5, configurable max)
|
|
110
|
+
|
|
111
|
+
**Rating + comment (e.g. reviews):** Use two fields on the same entity — `rating` (type `rating`) for stars and `comment` (type `textarea`) for the text. The form renders them as separate rows; no composite field type needed.
|
|
109
112
|
|
|
110
113
|
### Boolean
|
|
111
114
|
- `checkbox` - Checkbox input
|
|
@@ -153,7 +156,7 @@ import { useController, registerFieldType } from '@donotdev/crud';
|
|
|
153
156
|
import type { ControlledFieldProps } from '@donotdev/crud';
|
|
154
157
|
|
|
155
158
|
// Custom controlled component MUST use framework's useController (not react-hook-form's)
|
|
156
|
-
function
|
|
159
|
+
function ScoreField({
|
|
157
160
|
fieldConfig,
|
|
158
161
|
control,
|
|
159
162
|
errors,
|
|
@@ -179,7 +182,7 @@ function RatingField({
|
|
|
179
182
|
onChange?.(value);
|
|
180
183
|
}}
|
|
181
184
|
min={0}
|
|
182
|
-
max={
|
|
185
|
+
max={10}
|
|
183
186
|
/>
|
|
184
187
|
{fieldState?.error && (
|
|
185
188
|
<span className="error">{fieldState.error.message}</span>
|
|
@@ -189,8 +192,8 @@ function RatingField({
|
|
|
189
192
|
}
|
|
190
193
|
|
|
191
194
|
registerFieldType({
|
|
192
|
-
type: '
|
|
193
|
-
controlledComponent:
|
|
195
|
+
type: 'score',
|
|
196
|
+
controlledComponent: ScoreField,
|
|
194
197
|
});
|
|
195
198
|
```
|
|
196
199
|
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# Component API Reference
|
|
2
|
+
|
|
3
|
+
**SOURCE OF TRUTH. If prop not listed here, it does not exist.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Button
|
|
8
|
+
```tsx
|
|
9
|
+
<Button>Label</Button>
|
|
10
|
+
<Button variant="primary">Label</Button>
|
|
11
|
+
<Button onClick={fn}>Label</Button>
|
|
12
|
+
```
|
|
13
|
+
| Prop | Type | Default |
|
|
14
|
+
|------|------|---------|
|
|
15
|
+
| variant | `'default'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'destructive'` \| `'ghost'` \| `'outline'` \| `'link'` | `'default'` |
|
|
16
|
+
| icon | `LucideIcon` \| `ReactNode` | - |
|
|
17
|
+
| iconEnd | `boolean` | `false` |
|
|
18
|
+
| display | `'auto'` \| `'compact'` \| `'full'` | `'auto'` |
|
|
19
|
+
| tooltip | `string` | - |
|
|
20
|
+
| floating | `boolean` | `false` |
|
|
21
|
+
| fullWidth | `boolean` | `false` |
|
|
22
|
+
| loading | `boolean` | `false` |
|
|
23
|
+
| loadingText | `string` | - |
|
|
24
|
+
| progress | `number` (0-100) | - |
|
|
25
|
+
| disabled | `boolean` | `false` |
|
|
26
|
+
| render | `(props) => ReactNode` | - |
|
|
27
|
+
|
|
28
|
+
**NO: size, tone, gap**
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Text
|
|
33
|
+
```tsx
|
|
34
|
+
<Text>Content</Text>
|
|
35
|
+
<Text level="h1">Heading</Text>
|
|
36
|
+
<Text as="p">Paragraph</Text>
|
|
37
|
+
```
|
|
38
|
+
| Prop | Type | Default |
|
|
39
|
+
|------|------|---------|
|
|
40
|
+
| as | `'h1'`-`'h6'` \| `'p'` \| `'span'` \| `'div'` \| `'li'` \| `'label'` \| `'code'` | `'div'` |
|
|
41
|
+
| level | `'h1'`-`'h6'` \| `'body'` \| `'small'` \| `'caption'` | auto from `as` |
|
|
42
|
+
| variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` \| `'code'` | `'default'` |
|
|
43
|
+
| align | `'start'` \| `'center'` \| `'end'` | `'start'` |
|
|
44
|
+
| weight | `'normal'` \| `'medium'` \| `'semibold'` \| `'bold'` | - |
|
|
45
|
+
|
|
46
|
+
**NO: size, tone, color**
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Stack
|
|
51
|
+
```tsx
|
|
52
|
+
<Stack>children</Stack>
|
|
53
|
+
<Stack direction="row">children</Stack>
|
|
54
|
+
```
|
|
55
|
+
| Prop | Type | Default |
|
|
56
|
+
|------|------|---------|
|
|
57
|
+
| as | `ElementType` | `'div'` |
|
|
58
|
+
| direction | `'row'` \| `'column'` \| `'row-reverse'` \| `'column-reverse'` | `'column'` |
|
|
59
|
+
| align | `'start'` \| `'center'` \| `'end'` \| `'stretch'` \| `'baseline'` | `'stretch'` |
|
|
60
|
+
| justify | `'start'` \| `'center'` \| `'end'` \| `'between'` \| `'around'` \| `'evenly'` | `'start'` |
|
|
61
|
+
| gap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
|
|
62
|
+
| wrap | `'nowrap'` \| `'wrap'` \| `'wrap-reverse'` | `'nowrap'` |
|
|
63
|
+
| width | `'full'` \| `'fit'` \| `'auto'` | `'full'` |
|
|
64
|
+
| centered | `boolean` | `false` |
|
|
65
|
+
|
|
66
|
+
**NO: spacing, size**
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Card
|
|
71
|
+
```tsx
|
|
72
|
+
<Card>children</Card>
|
|
73
|
+
<Card title="Title">children</Card>
|
|
74
|
+
<Card onClick={fn}>children</Card>
|
|
75
|
+
```
|
|
76
|
+
| Prop | Type | Default |
|
|
77
|
+
|------|------|---------|
|
|
78
|
+
| variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` | `'default'` |
|
|
79
|
+
| title | `string` \| `ReactNode` | - |
|
|
80
|
+
| subtitle | `string` \| `ReactNode` | - |
|
|
81
|
+
| icon | `LucideIcon` | - |
|
|
82
|
+
| content | `string` \| `string[]` \| `ReactNode` | - |
|
|
83
|
+
| footer | `ReactNode` | - |
|
|
84
|
+
| onClick | `() => void` | - |
|
|
85
|
+
| clickable | `boolean` | auto from onClick |
|
|
86
|
+
| elevated | `boolean` | `false` |
|
|
87
|
+
| asChild | `boolean` | `false` |
|
|
88
|
+
|
|
89
|
+
**NO: size, padding, margin**
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Grid
|
|
94
|
+
```tsx
|
|
95
|
+
<Grid>children</Grid>
|
|
96
|
+
<Grid cols={3}>children</Grid>
|
|
97
|
+
<Grid cols={[1, 1, 2, 3]}>children</Grid>
|
|
98
|
+
```
|
|
99
|
+
| Prop | Type | Default |
|
|
100
|
+
|------|------|---------|
|
|
101
|
+
| as | `ElementType` | `'div'` |
|
|
102
|
+
| cols | `number` \| `[mobile, tablet, laptop, desktop]` | `1` |
|
|
103
|
+
| gap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
|
|
104
|
+
| align | `'start'` \| `'center'` \| `'end'` \| `'stretch'` | `'stretch'` |
|
|
105
|
+
| justify | `'start'` \| `'center'` \| `'end'` \| `'stretch'` | `'stretch'` |
|
|
106
|
+
|
|
107
|
+
**NO: spacing, columns (use cols)**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Section
|
|
112
|
+
```tsx
|
|
113
|
+
<Section title="Title">children</Section>
|
|
114
|
+
```
|
|
115
|
+
| Prop | Type | Default |
|
|
116
|
+
|------|------|---------|
|
|
117
|
+
| as | `'section'` \| `'article'` \| `'aside'` \| `'div'` \| `'main'` | `'section'` |
|
|
118
|
+
| title | `string` | - |
|
|
119
|
+
| separator | `boolean` | `false` |
|
|
120
|
+
| tone | `'base'` \| `'muted'` \| `'elevated'` \| `'contrast'` \| `'accent'` | `'base'` |
|
|
121
|
+
| align | `'start'` \| `'center'` \| `'end'` | `'center'` |
|
|
122
|
+
| gridCols | `number` \| `[mobile, tablet, laptop, desktop]` | - |
|
|
123
|
+
| gridGap | `'none'` \| `'tight'` \| `'medium'` \| `'large'` | `'medium'` |
|
|
124
|
+
| collapsible | `boolean` | `false` |
|
|
125
|
+
| defaultOpen | `boolean` | `false` |
|
|
126
|
+
|
|
127
|
+
**NO: padding, margin, background**
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Badge
|
|
132
|
+
```tsx
|
|
133
|
+
<Badge>Label</Badge>
|
|
134
|
+
<Badge variant="primary">Label</Badge>
|
|
135
|
+
```
|
|
136
|
+
| Prop | Type | Default |
|
|
137
|
+
|------|------|---------|
|
|
138
|
+
| as | `'div'` \| `'span'` \| `'mark'` | `'div'` |
|
|
139
|
+
| variant | `'default'` \| `'muted'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` \| `'outline'` | `'default'` |
|
|
140
|
+
| tooltip | `string` | - |
|
|
141
|
+
|
|
142
|
+
**NO: size, color**
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Spinner
|
|
147
|
+
```tsx
|
|
148
|
+
<Spinner />
|
|
149
|
+
<Spinner overlay />
|
|
150
|
+
```
|
|
151
|
+
| Prop | Type | Default |
|
|
152
|
+
|------|------|---------|
|
|
153
|
+
| overlay | `boolean` | `false` |
|
|
154
|
+
| variant | `'default'` \| `'primary'` \| `'secondary'` \| `'accent'` \| `'success'` \| `'warning'` \| `'destructive'` | `'primary'` |
|
|
155
|
+
|
|
156
|
+
**NO: size**
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Separator
|
|
161
|
+
```tsx
|
|
162
|
+
<Separator />
|
|
163
|
+
```
|
|
164
|
+
| Prop | Type | Default |
|
|
165
|
+
|------|------|---------|
|
|
166
|
+
| orientation | `'horizontal'` \| `'vertical'` | `'horizontal'` |
|
|
167
|
+
| variant | `'default'` \| `'muted'` \| `'accent'` | `'default'` |
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## EntityFormRenderer
|
|
172
|
+
```tsx
|
|
173
|
+
<EntityFormRenderer entity={entity} operation="create" onSubmit={fn} />
|
|
174
|
+
```
|
|
175
|
+
| Prop | Type | Default |
|
|
176
|
+
|------|------|---------|
|
|
177
|
+
| entity | `Entity` | required |
|
|
178
|
+
| operation | `'create'` \| `'edit'` | `'create'` |
|
|
179
|
+
| onSubmit | `(data) => void` | required |
|
|
180
|
+
| defaultValues | `Record<string, unknown>` | - |
|
|
181
|
+
| loading | `boolean` | `false` |
|
|
182
|
+
| submitText | `string` | - |
|
|
183
|
+
| cancelText | `string` | - |
|
|
184
|
+
| onCancel | `() => void` | - |
|
|
185
|
+
| viewerRole | `string` | `'guest'` |
|
|
186
|
+
|
|
187
|
+
**NO: fields (renders all editable fields automatically)**
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## BEFORE WRITING JSX
|
|
192
|
+
|
|
193
|
+
1. Check this file
|
|
194
|
+
2. If prop not listed → don't use it
|
|
195
|
+
3. When in doubt → use defaults only
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# DoNotDev Framework Guides
|
|
2
2
|
|
|
3
|
-
**For AI Agents:** See [AGENT_START_HERE.md](./AGENT_START_HERE.md)
|
|
3
|
+
**For AI Agents:** See [AGENT_START_HERE.md](./AGENT_START_HERE.md) ← **START HERE**
|
|
4
|
+
|
|
5
|
+
**AI System:** Commands in `.claude/commands/`, agents in `.claude/agents/` (synced via `dndev bump`)
|
|
4
6
|
|
|
5
7
|
---
|
|
6
8
|
|