design-protocol 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +225 -0
- package/agents/dp-researcher.md +239 -0
- package/agents/dp-verifier.md +207 -0
- package/bin/install.js +464 -0
- package/commands/dp-back.md +221 -0
- package/commands/dp-discuss.md +257 -0
- package/commands/dp-execute.md +513 -0
- package/commands/dp-journey.md +85 -0
- package/commands/dp-progress.md +178 -0
- package/commands/dp-roadmap.md +83 -0
- package/commands/dp-skip.md +186 -0
- package/commands/dp-start.md +510 -0
- package/commands/dp-storytell.md +94 -0
- package/commands/dp-verify.md +207 -0
- package/package.json +59 -0
- package/skills/dp-color/SKILL.md +214 -0
- package/skills/dp-color/export_tokens.py +297 -0
- package/skills/dp-color/references/apca-contrast.md +87 -0
- package/skills/dp-color/references/hue-emotions.md +109 -0
- package/skills/dp-color/references/oklch-gamut.md +79 -0
- package/skills/dp-color/references/pitfalls.md +171 -0
- package/skills/dp-color/references/scale-patterns.md +206 -0
- package/skills/dp-color/references/tool-workflows.md +200 -0
- package/skills/dp-discovery/SKILL.md +480 -0
- package/skills/dp-eng_review/SKILL.md +471 -0
- package/skills/dp-eng_review/references/code-review-checklist.md +385 -0
- package/skills/dp-eng_review/references/react-patterns.md +512 -0
- package/skills/dp-eng_review/references/shadcn-patterns.md +510 -0
- package/skills/dp-eng_review/references/tailwind-conventions.md +351 -0
- package/skills/dp-journey/SKILL.md +682 -0
- package/skills/dp-journey/references/journey-types.md +97 -0
- package/skills/dp-journey/references/map-structures.md +177 -0
- package/skills/dp-journey/references/omnichannel-patterns.md +208 -0
- package/skills/dp-journey/references/research-methods.md +125 -0
- package/skills/dp-prd/SKILL.md +201 -0
- package/skills/dp-prd/references/claude-code-spec.md +107 -0
- package/skills/dp-prd/references/interview-questions.md +158 -0
- package/skills/dp-prd/references/section-templates.md +231 -0
- package/skills/dp-research/SKILL.md +540 -0
- package/skills/dp-research/references/facilitation-guide.md +291 -0
- package/skills/dp-research/references/interview-guide-template.md +190 -0
- package/skills/dp-research/references/method-selection.md +195 -0
- package/skills/dp-research/references/question-writing.md +244 -0
- package/skills/dp-research/references/research-report-template.md +363 -0
- package/skills/dp-research/references/synthesis-methods.md +289 -0
- package/skills/dp-research/references/usability-test-template.md +260 -0
- package/skills/dp-roadmap/SKILL.md +648 -0
- package/skills/dp-roadmap/references/prioritization-frameworks.md +312 -0
- package/skills/dp-roadmap/references/roadmap-structures.md +179 -0
- package/skills/dp-roadmap/references/roadmap-workshops.md +264 -0
- package/skills/dp-roadmap/references/theme-development.md +168 -0
- package/skills/dp-storytell/SKILL.md +645 -0
- package/skills/dp-storytell/references/audience-playbooks.md +260 -0
- package/skills/dp-storytell/references/content-type-templates.md +310 -0
- package/skills/dp-storytell/references/delivery-tactics.md +228 -0
- package/skills/dp-storytell/references/narrative-frameworks.md +259 -0
- package/skills/dp-ui/SKILL.md +503 -0
- package/skills/dp-ui/references/b2b-enterprise-patterns.md +319 -0
- package/skills/dp-ui/references/data-visualization.md +304 -0
- package/skills/dp-ui/references/visual-design-principles.md +237 -0
- package/skills/dp-ux/SKILL.md +414 -0
- package/skills/dp-ux/references/accessibility-checklist.md +128 -0
- package/skills/dp-ux/references/product-excellence.md +149 -0
- package/skills/dp-ux/references/usability-principles.md +140 -0
- package/skills/dp-ux/references/ux-patterns.md +221 -0
- package/templates/config.json +55 -0
- package/templates/context.md +96 -0
- package/templates/project.md +83 -0
- package/templates/requirements.md +137 -0
- package/templates/roadmap.md +168 -0
- package/templates/state.md +107 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dp-execute
|
|
3
|
+
description: Generate working implementation from DP phase outputs. After UX phase creates interactive wireframe; after UI phase creates polished React + Tailwind + shadcn components.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /dp:execute — Generate Implementation
|
|
7
|
+
|
|
8
|
+
You are generating a working implementation from DP workflow outputs. This command auto-detects the current phase and generates appropriate code.
|
|
9
|
+
|
|
10
|
+
## Execution Modes
|
|
11
|
+
|
|
12
|
+
| Current State | Mode | Output |
|
|
13
|
+
|---------------|------|--------|
|
|
14
|
+
| UX complete, UI not started | **Wireframe** | Interactive prototype with minimal styling |
|
|
15
|
+
| UI complete | **Polished** | Production-ready React + Tailwind + shadcn |
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
### Step 1: Detect Current Phase
|
|
20
|
+
|
|
21
|
+
Read `.design/config.json` and validate before proceeding:
|
|
22
|
+
|
|
23
|
+
**Validate:** Ensure the file is valid JSON and has `workflow.phases_completed` (array). If config is missing or corrupted, show:
|
|
24
|
+
```
|
|
25
|
+
⚠ Cannot read .design/config.json — run /dp:start to initialize or /dp:progress to repair.
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then determine execution mode:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
const { workflow } = config;
|
|
32
|
+
const uxComplete = workflow.phases_completed.includes('ux');
|
|
33
|
+
const uiComplete = workflow.phases_completed.includes('ui');
|
|
34
|
+
|
|
35
|
+
if (uiComplete) {
|
|
36
|
+
mode = 'polished';
|
|
37
|
+
} else if (uxComplete) {
|
|
38
|
+
mode = 'wireframe';
|
|
39
|
+
} else {
|
|
40
|
+
error('Run /dp:ux first to generate UX decisions');
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 2: Load Phase Context
|
|
45
|
+
|
|
46
|
+
**For Wireframe mode, load:**
|
|
47
|
+
- `.design/phases/DISCOVERY.md` — Requirements, user context
|
|
48
|
+
- `.design/phases/UX-DECISIONS.md` — Components, states, interactions
|
|
49
|
+
|
|
50
|
+
**For Polished mode, also load:**
|
|
51
|
+
- `.design/phases/UI-SPEC.md` — Design tokens, visual specs, Tailwind classes
|
|
52
|
+
|
|
53
|
+
### Step 3: Extract Component Specifications
|
|
54
|
+
|
|
55
|
+
From UX-DECISIONS.md, extract:
|
|
56
|
+
- Component names and hierarchy
|
|
57
|
+
- State definitions (default, hover, focus, loading, error, success, etc.)
|
|
58
|
+
- Interaction behaviors (onClick, onChange, validation)
|
|
59
|
+
- Accessibility requirements (keyboard nav, ARIA)
|
|
60
|
+
|
|
61
|
+
From UI-SPEC.md (polished mode), also extract:
|
|
62
|
+
- Design tokens (colors, spacing, typography)
|
|
63
|
+
- Tailwind classes for each component/state
|
|
64
|
+
- Animation specifications
|
|
65
|
+
- shadcn/ui component mappings
|
|
66
|
+
|
|
67
|
+
### Step 4: Detect Project Structure
|
|
68
|
+
|
|
69
|
+
Before generating code, detect the user's project setup. Do NOT assume any specific framework or directory structure.
|
|
70
|
+
|
|
71
|
+
**Detect component directory:**
|
|
72
|
+
1. Check for existing component directories in this order:
|
|
73
|
+
- `src/components/` — Most common (Next.js, Vite, CRA)
|
|
74
|
+
- `app/components/` — Remix, some Next.js setups
|
|
75
|
+
- `components/` — Root-level components
|
|
76
|
+
- Any directory already containing `.tsx` or `.jsx` files
|
|
77
|
+
2. If none found, ask the user: "Where should I put the generated components?"
|
|
78
|
+
|
|
79
|
+
**Detect framework:**
|
|
80
|
+
1. Read `package.json` to identify:
|
|
81
|
+
- **Next.js** — Has `next` in dependencies → uses App Router (`src/app/`) or Pages Router (`pages/`)
|
|
82
|
+
- **Remix** — Has `@remix-run/react` → uses `app/routes/`
|
|
83
|
+
- **Vite/CRA** — Has `vite` or `react-scripts` → no file-based routing
|
|
84
|
+
- **Other** — Ask the user about their setup
|
|
85
|
+
2. Check for `next.config.*`, `vite.config.*`, `remix.config.*` to confirm
|
|
86
|
+
|
|
87
|
+
**Detect dev server:**
|
|
88
|
+
1. Read `package.json` scripts for the dev command (`dev`, `start`, `serve`)
|
|
89
|
+
2. Check common ports: 3000, 5173, 8080, 4321
|
|
90
|
+
3. Do NOT assume port 3000
|
|
91
|
+
|
|
92
|
+
**Detect shadcn/ui (polished mode):**
|
|
93
|
+
1. Check for `components.json` (shadcn config file)
|
|
94
|
+
2. Check for `@/components/dp:ui/` directory
|
|
95
|
+
3. If not found, warn: "shadcn/ui not detected. Install it first, or I can generate without it."
|
|
96
|
+
|
|
97
|
+
Store detected values for use in generation:
|
|
98
|
+
```
|
|
99
|
+
componentDir: [detected path]
|
|
100
|
+
framework: [next-app | next-pages | remix | vite | unknown]
|
|
101
|
+
devCommand: [detected command]
|
|
102
|
+
devPort: [detected port]
|
|
103
|
+
hasShadcn: [true | false]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Step 5: Generate Component Structure
|
|
107
|
+
|
|
108
|
+
**Output location:** `{componentDir}/{feature-name}/`
|
|
109
|
+
|
|
110
|
+
**Naming convention:**
|
|
111
|
+
- Feature folder: kebab-case (e.g., `team-invite-modal`)
|
|
112
|
+
- Component files: kebab-case (e.g., `email-input.tsx`)
|
|
113
|
+
- Component names: PascalCase (e.g., `EmailInput`)
|
|
114
|
+
|
|
115
|
+
**Standard structure:**
|
|
116
|
+
```
|
|
117
|
+
{componentDir}/{feature-name}/
|
|
118
|
+
├── index.ts # Barrel export
|
|
119
|
+
├── {feature-name}.tsx # Main container component
|
|
120
|
+
├── {sub-component-1}.tsx # Sub-component
|
|
121
|
+
├── {sub-component-2}.tsx # Sub-component
|
|
122
|
+
├── types.ts # TypeScript interfaces (if complex)
|
|
123
|
+
└── use-{feature-name}.ts # Custom hook (if needed)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Step 6: Generate Code
|
|
127
|
+
|
|
128
|
+
#### Wireframe Mode
|
|
129
|
+
|
|
130
|
+
Generate functional React components with:
|
|
131
|
+
|
|
132
|
+
**Styling approach:**
|
|
133
|
+
- Minimal inline styles or basic Tailwind (borders, padding only)
|
|
134
|
+
- Gray color palette (`bg-gray-100`, `border-gray-300`)
|
|
135
|
+
- No shadows, no gradients, no animations
|
|
136
|
+
- Clear visual structure without polish
|
|
137
|
+
|
|
138
|
+
**Functionality:**
|
|
139
|
+
- All states working (useState, useEffect)
|
|
140
|
+
- All interactions functional (onClick, onChange, onSubmit)
|
|
141
|
+
- Validation logic implemented
|
|
142
|
+
- Keyboard navigation working
|
|
143
|
+
- Console.log for actions that would hit API
|
|
144
|
+
|
|
145
|
+
**Example wireframe component:**
|
|
146
|
+
```tsx
|
|
147
|
+
'use client';
|
|
148
|
+
|
|
149
|
+
import { useState } from 'react';
|
|
150
|
+
|
|
151
|
+
interface EmailInputProps {
|
|
152
|
+
onAdd: (email: string) => void;
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export function EmailInput({ onAdd, disabled }: EmailInputProps) {
|
|
157
|
+
const [value, setValue] = useState('');
|
|
158
|
+
const [error, setError] = useState<string | null>(null);
|
|
159
|
+
|
|
160
|
+
const validate = (email: string) => {
|
|
161
|
+
const isValid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
162
|
+
return isValid ? null : 'Invalid email format';
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const handleSubmit = () => {
|
|
166
|
+
const validationError = validate(value);
|
|
167
|
+
if (validationError) {
|
|
168
|
+
setError(validationError);
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
onAdd(value);
|
|
172
|
+
setValue('');
|
|
173
|
+
setError(null);
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
return (
|
|
177
|
+
<div className="space-y-1">
|
|
178
|
+
<div className="flex gap-2">
|
|
179
|
+
<input
|
|
180
|
+
type="email"
|
|
181
|
+
value={value}
|
|
182
|
+
onChange={(e) => {
|
|
183
|
+
setValue(e.target.value);
|
|
184
|
+
setError(null);
|
|
185
|
+
}}
|
|
186
|
+
onKeyDown={(e) => e.key === 'Enter' && handleSubmit()}
|
|
187
|
+
disabled={disabled}
|
|
188
|
+
placeholder="Enter email address"
|
|
189
|
+
className="flex-1 px-3 py-2 border border-gray-300 rounded"
|
|
190
|
+
/>
|
|
191
|
+
<button
|
|
192
|
+
onClick={handleSubmit}
|
|
193
|
+
disabled={disabled || !value}
|
|
194
|
+
className="px-4 py-2 border border-gray-300 rounded disabled:opacity-50"
|
|
195
|
+
>
|
|
196
|
+
Add
|
|
197
|
+
</button>
|
|
198
|
+
</div>
|
|
199
|
+
{error && (
|
|
200
|
+
<p className="text-sm text-red-600">{error}</p>
|
|
201
|
+
)}
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
#### Polished Mode
|
|
208
|
+
|
|
209
|
+
Generate production-ready components with:
|
|
210
|
+
|
|
211
|
+
**Styling approach:**
|
|
212
|
+
- Full Tailwind classes from UI-SPEC.md
|
|
213
|
+
- Design tokens applied (colors, spacing, typography)
|
|
214
|
+
- All visual states styled (hover, focus, active, disabled)
|
|
215
|
+
- Animations and transitions per spec
|
|
216
|
+
- Responsive behavior
|
|
217
|
+
|
|
218
|
+
**shadcn/ui integration:**
|
|
219
|
+
- Use shadcn components where specified
|
|
220
|
+
- Import from `@/components/dp:ui/`
|
|
221
|
+
- Extend with custom styling via className
|
|
222
|
+
|
|
223
|
+
**Example polished component:**
|
|
224
|
+
```tsx
|
|
225
|
+
'use client';
|
|
226
|
+
|
|
227
|
+
import { useState, useCallback } from 'react';
|
|
228
|
+
import { Input } from '@/components/dp:ui/input';
|
|
229
|
+
import { Button } from '@/components/dp:ui/button';
|
|
230
|
+
import { CheckCircle, AlertCircle } from 'lucide-react';
|
|
231
|
+
import { cn } from '@/lib/utils';
|
|
232
|
+
|
|
233
|
+
interface EmailInputProps {
|
|
234
|
+
onAdd: (email: string) => void;
|
|
235
|
+
disabled?: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function EmailInput({ onAdd, disabled }: EmailInputProps) {
|
|
239
|
+
const [value, setValue] = useState('');
|
|
240
|
+
const [error, setError] = useState<string | null>(null);
|
|
241
|
+
const [isValid, setIsValid] = useState(false);
|
|
242
|
+
|
|
243
|
+
const validate = useCallback((email: string) => {
|
|
244
|
+
if (!email) {
|
|
245
|
+
setIsValid(false);
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
const valid = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
249
|
+
setIsValid(valid);
|
|
250
|
+
return valid ? null : 'Please enter a valid email address';
|
|
251
|
+
}, []);
|
|
252
|
+
|
|
253
|
+
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
254
|
+
const newValue = e.target.value;
|
|
255
|
+
setValue(newValue);
|
|
256
|
+
// Debounced validation would go here in production
|
|
257
|
+
const validationError = validate(newValue);
|
|
258
|
+
setError(validationError);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
const handleSubmit = () => {
|
|
262
|
+
const validationError = validate(value);
|
|
263
|
+
if (validationError) {
|
|
264
|
+
setError(validationError);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
onAdd(value);
|
|
268
|
+
setValue('');
|
|
269
|
+
setError(null);
|
|
270
|
+
setIsValid(false);
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
return (
|
|
274
|
+
<div className="space-y-1">
|
|
275
|
+
<div className="flex gap-2">
|
|
276
|
+
<div className="relative flex-1">
|
|
277
|
+
<Input
|
|
278
|
+
type="email"
|
|
279
|
+
value={value}
|
|
280
|
+
onChange={handleChange}
|
|
281
|
+
onKeyDown={(e) => e.key === 'Enter' && handleSubmit()}
|
|
282
|
+
disabled={disabled}
|
|
283
|
+
placeholder="Enter email address"
|
|
284
|
+
className={cn(
|
|
285
|
+
'h-11 pr-10',
|
|
286
|
+
error && 'border-destructive bg-destructive/10',
|
|
287
|
+
isValid && 'border-green-500'
|
|
288
|
+
)}
|
|
289
|
+
aria-invalid={!!error}
|
|
290
|
+
aria-describedby={error ? 'email-error' : undefined}
|
|
291
|
+
/>
|
|
292
|
+
{isValid && (
|
|
293
|
+
<CheckCircle className="absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-green-500" />
|
|
294
|
+
)}
|
|
295
|
+
</div>
|
|
296
|
+
<Button
|
|
297
|
+
onClick={handleSubmit}
|
|
298
|
+
disabled={disabled || !value || !!error}
|
|
299
|
+
variant="outline"
|
|
300
|
+
>
|
|
301
|
+
Add
|
|
302
|
+
</Button>
|
|
303
|
+
</div>
|
|
304
|
+
{error && (
|
|
305
|
+
<p id="email-error" className="flex items-center gap-1 text-xs text-destructive">
|
|
306
|
+
<AlertCircle className="h-3 w-3" />
|
|
307
|
+
{error}
|
|
308
|
+
</p>
|
|
309
|
+
)}
|
|
310
|
+
</div>
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Step 7: Generate Preview Page
|
|
316
|
+
|
|
317
|
+
Create a preview page to view the component in browser. The location and format depend on the detected framework:
|
|
318
|
+
|
|
319
|
+
**Next.js (App Router):** `src/app/preview/{feature-name}/page.tsx` or `app/preview/{feature-name}/page.tsx`
|
|
320
|
+
**Next.js (Pages Router):** `pages/preview/{feature-name}.tsx`
|
|
321
|
+
**Remix:** `app/routes/preview.{feature-name}.tsx`
|
|
322
|
+
**Vite/CRA/Other:** `src/pages/preview-{feature-name}.tsx` (add route manually)
|
|
323
|
+
|
|
324
|
+
**Structure (adapt imports to detected componentDir):**
|
|
325
|
+
```tsx
|
|
326
|
+
import { {MainComponent} } from '{relative-import-to-component}';
|
|
327
|
+
|
|
328
|
+
export default function Preview{FeatureName}Page() {
|
|
329
|
+
return (
|
|
330
|
+
<div className="min-h-screen bg-gray-50 p-8">
|
|
331
|
+
<div className="max-w-2xl mx-auto">
|
|
332
|
+
<h1 className="text-2xl font-bold mb-4">{Feature Name} Preview</h1>
|
|
333
|
+
<p className="text-gray-600 mb-8">
|
|
334
|
+
{Wireframe | Polished} implementation from DP workflow
|
|
335
|
+
</p>
|
|
336
|
+
|
|
337
|
+
{/* Trigger button to open modal, or inline component */}
|
|
338
|
+
<{MainComponent} />
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Step 8: Open in Browser
|
|
346
|
+
|
|
347
|
+
Use Playwright to open the preview:
|
|
348
|
+
|
|
349
|
+
```typescript
|
|
350
|
+
// Open browser to preview page using detected port
|
|
351
|
+
await mcp__playwright__browser_navigate({
|
|
352
|
+
url: 'http://localhost:{devPort}/preview/{feature-name}'
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// Take snapshot to verify rendering
|
|
356
|
+
await mcp__playwright__browser_snapshot({});
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
**If dev server not running:**
|
|
360
|
+
1. Check if a dev server is running on the detected port
|
|
361
|
+
2. If not, inform user: "Start dev server with `{devCommand}` to preview"
|
|
362
|
+
3. Provide the preview URL for manual access
|
|
363
|
+
|
|
364
|
+
### Step 9: Update State
|
|
365
|
+
|
|
366
|
+
Update `.design/STATE.md`:
|
|
367
|
+
```markdown
|
|
368
|
+
### Last Activity
|
|
369
|
+
- **Date:** [timestamp]
|
|
370
|
+
- **Action:** Generated {wireframe|polished} implementation
|
|
371
|
+
- **Mode:** {Wireframe|Polished}
|
|
372
|
+
- **Components:** {count} files generated
|
|
373
|
+
- **Preview:** {preview-page-path}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Update `.design/config.json`:
|
|
377
|
+
```json
|
|
378
|
+
{
|
|
379
|
+
"workflow": {
|
|
380
|
+
"executions": {
|
|
381
|
+
"wireframe": {
|
|
382
|
+
"completed": true,
|
|
383
|
+
"timestamp": "...",
|
|
384
|
+
"files": [...]
|
|
385
|
+
},
|
|
386
|
+
"polished": {
|
|
387
|
+
"completed": true,
|
|
388
|
+
"timestamp": "...",
|
|
389
|
+
"files": [...]
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Component Generation Guidelines
|
|
399
|
+
|
|
400
|
+
### TypeScript
|
|
401
|
+
|
|
402
|
+
- All components use TypeScript
|
|
403
|
+
- Define interfaces for props
|
|
404
|
+
- Use proper event types (`React.ChangeEvent<HTMLInputElement>`)
|
|
405
|
+
- Export types that consumers might need
|
|
406
|
+
|
|
407
|
+
### React Patterns
|
|
408
|
+
|
|
409
|
+
- Use `'use client'` directive for interactive components
|
|
410
|
+
- Prefer controlled components
|
|
411
|
+
- Use `useCallback` for handlers passed to children (polished mode)
|
|
412
|
+
- Implement proper cleanup in useEffect
|
|
413
|
+
|
|
414
|
+
### Accessibility
|
|
415
|
+
|
|
416
|
+
- All inputs have labels (visible or sr-only)
|
|
417
|
+
- Error messages linked via `aria-describedby`
|
|
418
|
+
- Focus management in modals
|
|
419
|
+
- Keyboard navigation (Tab, Enter, Escape)
|
|
420
|
+
- ARIA attributes for dynamic content
|
|
421
|
+
|
|
422
|
+
### State Management
|
|
423
|
+
|
|
424
|
+
- Local state with useState for component-specific state
|
|
425
|
+
- Props for data that comes from parent
|
|
426
|
+
- Callbacks for actions that affect parent
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Error Handling
|
|
431
|
+
|
|
432
|
+
| Scenario | Response |
|
|
433
|
+
|----------|----------|
|
|
434
|
+
| No UX phase complete | "Run /dp:ux first to define components and interactions" |
|
|
435
|
+
| Missing UX-DECISIONS.md | "UX-DECISIONS.md not found. Run /dp:ux to generate it." |
|
|
436
|
+
| Missing UI-SPEC.md (polished) | "UI-SPEC.md not found. Run /dp:ui first, or use wireframe mode." |
|
|
437
|
+
| Component directory not found | Ask user for preferred location (see Step 4 detection) |
|
|
438
|
+
| Component files already exist | Ask: "Overwrite existing files?" with diff preview |
|
|
439
|
+
| shadcn not installed (polished) | Warn and offer to generate without shadcn, or provide install command |
|
|
440
|
+
|
|
441
|
+
---
|
|
442
|
+
|
|
443
|
+
## Output Summary
|
|
444
|
+
|
|
445
|
+
After execution, display:
|
|
446
|
+
|
|
447
|
+
```
|
|
448
|
+
═══════════════════════════════════════════════════════════════════════════════
|
|
449
|
+
DP EXECUTE: {Feature Name} — {Wireframe|Polished}
|
|
450
|
+
═══════════════════════════════════════════════════════════════════════════════
|
|
451
|
+
|
|
452
|
+
Generated {N} components:
|
|
453
|
+
|
|
454
|
+
{componentDir}/{feature-name}/
|
|
455
|
+
├── index.ts ✓ created
|
|
456
|
+
├── {feature-name}.tsx ✓ created (main component)
|
|
457
|
+
├── {component-1}.tsx ✓ created
|
|
458
|
+
├── {component-2}.tsx ✓ created
|
|
459
|
+
└── ...
|
|
460
|
+
|
|
461
|
+
Preview page:
|
|
462
|
+
└── {preview-page-path} ✓ created
|
|
463
|
+
|
|
464
|
+
NEXT STEPS
|
|
465
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
466
|
+
{If wireframe}
|
|
467
|
+
→ Run `{devCommand}` and visit http://localhost:{devPort}/preview/{feature-name}
|
|
468
|
+
→ Test interactions and validate UX flow
|
|
469
|
+
→ When satisfied, run /dp:ui to design visual specs
|
|
470
|
+
→ Then /dp:execute again for polished implementation
|
|
471
|
+
|
|
472
|
+
{If polished}
|
|
473
|
+
→ Run `{devCommand}` and visit http://localhost:{devPort}/preview/{feature-name}
|
|
474
|
+
→ Verify visual design matches UI-SPEC.md
|
|
475
|
+
→ When satisfied, run /dp:eng_review for code review
|
|
476
|
+
→ Then /dp:verify to complete workflow
|
|
477
|
+
|
|
478
|
+
═══════════════════════════════════════════════════════════════════════════════
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## Execution Checklist
|
|
484
|
+
|
|
485
|
+
Before generating, verify:
|
|
486
|
+
|
|
487
|
+
- [ ] UX-DECISIONS.md has component list with states
|
|
488
|
+
- [ ] Each component has defined interactions
|
|
489
|
+
- [ ] Accessibility requirements are specified
|
|
490
|
+
- [ ] (Polished) UI-SPEC.md has Tailwind classes
|
|
491
|
+
- [ ] (Polished) Design tokens are defined
|
|
492
|
+
- [ ] (Polished) shadcn component mappings exist
|
|
493
|
+
|
|
494
|
+
After generating, verify:
|
|
495
|
+
|
|
496
|
+
- [ ] All components render without errors
|
|
497
|
+
- [ ] All states are implemented
|
|
498
|
+
- [ ] Interactions work as specified
|
|
499
|
+
- [ ] Keyboard navigation functional
|
|
500
|
+
- [ ] (Polished) Visual design matches spec
|
|
501
|
+
- [ ] (Polished) Animations are smooth
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
## Workflow Navigation
|
|
506
|
+
|
|
507
|
+
| | |
|
|
508
|
+
|---|---|
|
|
509
|
+
| **This command** | `/dp:execute` — Generate implementation |
|
|
510
|
+
| **Wireframe mode** | Runs after `/dp:ux` (Phase 2) → next: `/dp:ui` (Phase 3) |
|
|
511
|
+
| **Polished mode** | Runs after `/dp:ui` (Phase 3) → next: `/dp:eng_review` (Phase 4) |
|
|
512
|
+
| **Related** | `/dp:progress` — Check which mode will run |
|
|
513
|
+
| | `/dp:back` — Return to previous phase if output needs changes |
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dp-journey
|
|
3
|
+
description: Build a customer journey map, service blueprint, or omnichannel experience map using NNGroup methodology. Optional phase 1.5b in DP workflow, runs between Discovery and UX.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /dp:journey — Journey Mapping Phase
|
|
7
|
+
|
|
8
|
+
You are running the journey-mapping phase of the DP workflow. Invoke the `dp-journey` skill immediately.
|
|
9
|
+
|
|
10
|
+
## What this command does
|
|
11
|
+
|
|
12
|
+
Produces one of five journey artifacts using NNGroup's methodology:
|
|
13
|
+
- Customer journey map (default)
|
|
14
|
+
- Experience map
|
|
15
|
+
- Day-in-the-life map
|
|
16
|
+
- Service blueprint
|
|
17
|
+
- Omnichannel journey map
|
|
18
|
+
|
|
19
|
+
Each artifact follows Kaplan's 5 principles: establish why/what, base on truth, collaborate, don't rush to visualization, engage others.
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
### Step 1 — Detect workflow mode
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
ls .design/config.json 2>/dev/null
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If found → workflow mode. Load:
|
|
30
|
+
- `.design/config.json`
|
|
31
|
+
- `.design/phases/DISCOVERY.md`
|
|
32
|
+
- `.design/phases/PRD.md` (if exists)
|
|
33
|
+
- Any research artifacts under `.design/research/` (e.g., `RESEARCH-PLAN.md`, `FINDINGS-*.md`)
|
|
34
|
+
- `.design/phases/01.5b-CONTEXT.md` (if `/dp:discuss` was run)
|
|
35
|
+
|
|
36
|
+
If not found → standalone mode. Ask the user whether they want to run the full DP workflow with `/dp:start`, or proceed standalone.
|
|
37
|
+
|
|
38
|
+
### Step 2 — Invoke the skill
|
|
39
|
+
|
|
40
|
+
Invoke the `dp-journey` skill. The skill drives:
|
|
41
|
+
- Artifact type selection
|
|
42
|
+
- Scope definition (actor + scenario)
|
|
43
|
+
- Research basis check (→ hypothesis mode if missing)
|
|
44
|
+
- Six-step synthesis process
|
|
45
|
+
- Output generation
|
|
46
|
+
|
|
47
|
+
### Step 3 — Write output
|
|
48
|
+
|
|
49
|
+
**Workflow mode:** writes `.design/phases/JOURNEY-MAP.md` and updates STATE.md, config.json.
|
|
50
|
+
|
|
51
|
+
**Standalone mode:** outputs inline; offers to save.
|
|
52
|
+
|
|
53
|
+
### Step 4 — Handoff
|
|
54
|
+
|
|
55
|
+
After completion, suggest next step:
|
|
56
|
+
- `/dp:ux` — continue to UX phase (most common)
|
|
57
|
+
- `/dp:research` — if hypothesis-mode map needs validation
|
|
58
|
+
- `/dp:prd` — if PRD hasn't been generated and journey insights should feed it
|
|
59
|
+
|
|
60
|
+
## When to use this command
|
|
61
|
+
|
|
62
|
+
- Multi-step customer experiences (onboarding, purchase, renewal, support)
|
|
63
|
+
- Omnichannel experiences (web + mobile + email + in-person)
|
|
64
|
+
- Services with backstage operations (service blueprint)
|
|
65
|
+
- Pre-product discovery (experience map, day-in-the-life)
|
|
66
|
+
- Diagnosing why a journey is underperforming
|
|
67
|
+
|
|
68
|
+
## When NOT to use this command
|
|
69
|
+
|
|
70
|
+
- Single-screen UX decisions → use `/dp:ux`
|
|
71
|
+
- Feature specs → use `/dp:prd`
|
|
72
|
+
- Requirements gathering → use `/dp:discovery`
|
|
73
|
+
- Research interviews → use `/dp:research`
|
|
74
|
+
|
|
75
|
+
## Workflow Navigation
|
|
76
|
+
|
|
77
|
+
| | |
|
|
78
|
+
|---|---|
|
|
79
|
+
| **Previous** | `/dp:discovery` — Discovery (Phase 1) |
|
|
80
|
+
| **Parallel** | `/dp:prd` — PRD (Phase 1.5a) |
|
|
81
|
+
| **This** | `/dp:journey` — Journey mapping (Phase 1.5b) |
|
|
82
|
+
| **Next** | `/dp:ux` — UX phase (Phase 2) |
|
|
83
|
+
| **Related** | `/dp:research` — Validate hypotheses |
|
|
84
|
+
| | `/dp:discuss` — Capture context first |
|
|
85
|
+
| | `/dp:back` — Return to discovery |
|