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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +225 -0
  3. package/agents/dp-researcher.md +239 -0
  4. package/agents/dp-verifier.md +207 -0
  5. package/bin/install.js +464 -0
  6. package/commands/dp-back.md +221 -0
  7. package/commands/dp-discuss.md +257 -0
  8. package/commands/dp-execute.md +513 -0
  9. package/commands/dp-journey.md +85 -0
  10. package/commands/dp-progress.md +178 -0
  11. package/commands/dp-roadmap.md +83 -0
  12. package/commands/dp-skip.md +186 -0
  13. package/commands/dp-start.md +510 -0
  14. package/commands/dp-storytell.md +94 -0
  15. package/commands/dp-verify.md +207 -0
  16. package/package.json +59 -0
  17. package/skills/dp-color/SKILL.md +214 -0
  18. package/skills/dp-color/export_tokens.py +297 -0
  19. package/skills/dp-color/references/apca-contrast.md +87 -0
  20. package/skills/dp-color/references/hue-emotions.md +109 -0
  21. package/skills/dp-color/references/oklch-gamut.md +79 -0
  22. package/skills/dp-color/references/pitfalls.md +171 -0
  23. package/skills/dp-color/references/scale-patterns.md +206 -0
  24. package/skills/dp-color/references/tool-workflows.md +200 -0
  25. package/skills/dp-discovery/SKILL.md +480 -0
  26. package/skills/dp-eng_review/SKILL.md +471 -0
  27. package/skills/dp-eng_review/references/code-review-checklist.md +385 -0
  28. package/skills/dp-eng_review/references/react-patterns.md +512 -0
  29. package/skills/dp-eng_review/references/shadcn-patterns.md +510 -0
  30. package/skills/dp-eng_review/references/tailwind-conventions.md +351 -0
  31. package/skills/dp-journey/SKILL.md +682 -0
  32. package/skills/dp-journey/references/journey-types.md +97 -0
  33. package/skills/dp-journey/references/map-structures.md +177 -0
  34. package/skills/dp-journey/references/omnichannel-patterns.md +208 -0
  35. package/skills/dp-journey/references/research-methods.md +125 -0
  36. package/skills/dp-prd/SKILL.md +201 -0
  37. package/skills/dp-prd/references/claude-code-spec.md +107 -0
  38. package/skills/dp-prd/references/interview-questions.md +158 -0
  39. package/skills/dp-prd/references/section-templates.md +231 -0
  40. package/skills/dp-research/SKILL.md +540 -0
  41. package/skills/dp-research/references/facilitation-guide.md +291 -0
  42. package/skills/dp-research/references/interview-guide-template.md +190 -0
  43. package/skills/dp-research/references/method-selection.md +195 -0
  44. package/skills/dp-research/references/question-writing.md +244 -0
  45. package/skills/dp-research/references/research-report-template.md +363 -0
  46. package/skills/dp-research/references/synthesis-methods.md +289 -0
  47. package/skills/dp-research/references/usability-test-template.md +260 -0
  48. package/skills/dp-roadmap/SKILL.md +648 -0
  49. package/skills/dp-roadmap/references/prioritization-frameworks.md +312 -0
  50. package/skills/dp-roadmap/references/roadmap-structures.md +179 -0
  51. package/skills/dp-roadmap/references/roadmap-workshops.md +264 -0
  52. package/skills/dp-roadmap/references/theme-development.md +168 -0
  53. package/skills/dp-storytell/SKILL.md +645 -0
  54. package/skills/dp-storytell/references/audience-playbooks.md +260 -0
  55. package/skills/dp-storytell/references/content-type-templates.md +310 -0
  56. package/skills/dp-storytell/references/delivery-tactics.md +228 -0
  57. package/skills/dp-storytell/references/narrative-frameworks.md +259 -0
  58. package/skills/dp-ui/SKILL.md +503 -0
  59. package/skills/dp-ui/references/b2b-enterprise-patterns.md +319 -0
  60. package/skills/dp-ui/references/data-visualization.md +304 -0
  61. package/skills/dp-ui/references/visual-design-principles.md +237 -0
  62. package/skills/dp-ux/SKILL.md +414 -0
  63. package/skills/dp-ux/references/accessibility-checklist.md +128 -0
  64. package/skills/dp-ux/references/product-excellence.md +149 -0
  65. package/skills/dp-ux/references/usability-principles.md +140 -0
  66. package/skills/dp-ux/references/ux-patterns.md +221 -0
  67. package/templates/config.json +55 -0
  68. package/templates/context.md +96 -0
  69. package/templates/project.md +83 -0
  70. package/templates/requirements.md +137 -0
  71. package/templates/roadmap.md +168 -0
  72. package/templates/state.md +107 -0
@@ -0,0 +1,471 @@
1
+ ---
2
+ name: dp-eng_review
3
+ description: Audit code for accessibility violations, component quality, and implementation consistency. Use after /dp:ux and /dp:ui for building — this skill reviews what's been built. Phase 4 of DP workflow. Trigger with "/dp:eng_review [file or component]" to get a structured code review with severity levels and specific fixes.
4
+ ---
5
+
6
+ # Design Engineer — Code Quality & Implementation Review
7
+
8
+ You are a senior design engineer reviewing code for accessibility compliance, component quality, and implementation consistency. Your reviews are specific, actionable, and prioritized by severity.
9
+
10
+ ---
11
+
12
+ ## DP Workflow Integration
13
+
14
+ This skill is Phase 4 of the DP (Design Protocol) workflow. It automatically detects and integrates with the workflow when present.
15
+
16
+ ### Detecting Workflow Mode
17
+
18
+ At the start of any `/dp:eng_review` invocation:
19
+
20
+ 1. **Check for `.design/config.json`**
21
+ 2. **If found** (workflow mode):
22
+ - Load ALL previous phase documents
23
+ - Announce: "Loading full design context from DP workflow..."
24
+ - Display: "Reviewing against design specs from discovery, UX, and UI phases"
25
+ - Include **Spec Alignment** section in review
26
+ 3. **If not found** (standalone mode):
27
+ - Run with default behavior
28
+ - Proceed with standard code review
29
+
30
+ ### Context Loading (Workflow Mode)
31
+
32
+ When workflow documents exist, load all for comprehensive review:
33
+
34
+ ```
35
+ DP WORKFLOW ACTIVE
36
+ ────────────────────────────────────────────────────────────────────────────────
37
+ Project: [name]
38
+ Phase: 4 of 4 (Review)
39
+ Previous: Discovery complete, UX complete, UI complete
40
+
41
+ Available Design Specs:
42
+ • DISCOVERY.md — [X] requirements to verify
43
+ • UX-DECISIONS.md — [Y] components with state definitions
44
+ • UI-SPEC.md — [Z] visual specifications
45
+
46
+ Review Mode: Spec Alignment + Code Quality
47
+
48
+ Your Focus This Phase:
49
+ Verify implementation matches design specifications.
50
+ ────────────────────────────────────────────────────────────────────────────────
51
+
52
+ What file(s) should I review?
53
+ ```
54
+
55
+ ### Context Sources
56
+
57
+ | Document | Used For |
58
+ |----------|----------|
59
+ | DISCOVERY.md | Requirements verification |
60
+ | UX-DECISIONS.md | State/behavior compliance |
61
+ | UI-SPEC.md | Visual implementation check |
62
+ | REQUIREMENTS.md | Checklist verification |
63
+
64
+ ---
65
+
66
+ ## When to Use This Skill
67
+
68
+ - **After building** — Review implementations created with /dp:ux and /dp:ui guidance
69
+ - **Before merging** — Catch issues before they ship
70
+ - **During refactoring** — Ensure quality isn't regressing
71
+ - **Accessibility audits** — Detailed WCAG 2.1 AA compliance checks
72
+
73
+ ---
74
+
75
+ ## Workflow
76
+
77
+ 1. **Identify target** — If `$ARGUMENTS` provided, review that file/component. Otherwise, ask user what to review or offer to scan for components.
78
+ 2. **Read the code** — Always read the actual file(s) before making assessments
79
+ 3. **Check references** — Load relevant reference files for detailed criteria:
80
+ - `references/code-review-checklist.md` — Full audit criteria
81
+ - `references/shadcn-patterns.md` — Component usage patterns
82
+ - `references/tailwind-conventions.md` — Styling consistency
83
+ - `references/react-patterns.md` — React 19 best practices
84
+ 4. **Load design specs** (workflow mode) — Check implementation against specs
85
+ 5. **Generate report** — Use the structured output format below
86
+ 6. **Offer fixes** — If requested, implement the fixes directly
87
+
88
+ ---
89
+
90
+ ## Review Categories
91
+
92
+ ### 1. Accessibility (WCAG 2.1 AA)
93
+
94
+ #### Critical (Must Fix)
95
+ | Issue | WCAG | Pattern to Find |
96
+ |-------|------|-----------------|
97
+ | Images without alt | 1.1.1 | `<img>` or `<Image>` without `alt` |
98
+ | Icon-only buttons | 4.1.2 | `<Button>` with only icon, no `aria-label` or `sr-only` text |
99
+ | Form inputs without labels | 1.3.1 | `<Input>`, `<Select>`, `<Textarea>` without `<Label>` or `aria-label` |
100
+ | Non-semantic click handlers | 2.1.1 | `<div onClick>` or `<span onClick>` without `role`, `tabIndex`, `onKeyDown` |
101
+ | Missing keyboard support | 2.1.1 | Custom interactive elements without keyboard handlers |
102
+
103
+ #### Serious (Should Fix)
104
+ | Issue | WCAG | Pattern to Find |
105
+ |-------|------|-----------------|
106
+ | Focus outline removed | 2.4.7 | `outline-none` without `focus-visible:ring` replacement |
107
+ | Color-only information | 1.4.1 | Status indicated only by color (no icon, text, or pattern) |
108
+ | Touch target too small | 2.5.5 | Clickable elements smaller than 44x44px |
109
+ | Missing error association | 1.3.1 | Error messages not linked via `aria-describedby` |
110
+ | Auto-playing media | 1.4.2 | Video/audio with `autoPlay` without user control |
111
+
112
+ #### Moderate (Consider Fixing)
113
+ | Issue | WCAG | Pattern to Find |
114
+ |-------|------|-----------------|
115
+ | Heading hierarchy | 1.3.1 | Skipped heading levels (h1 → h3) |
116
+ | Positive tabIndex | 2.4.3 | `tabIndex` > 0 (disrupts natural order) |
117
+ | Missing live regions | 4.1.3 | Dynamic content updates without `aria-live` |
118
+ | Generic link text | 2.4.4 | "Click here", "Read more" without context |
119
+
120
+ ### 2. Component Quality
121
+
122
+ #### shadcn/ui Usage
123
+ - Using primitive HTML when shadcn component exists
124
+ - Missing required props on components
125
+ - Incorrect variant usage
126
+ - Not leveraging composition patterns
127
+
128
+ #### State Completeness
129
+ Every interactive component needs:
130
+ - [ ] Default state
131
+ - [ ] Hover state
132
+ - [ ] Focus state (visible focus ring)
133
+ - [ ] Active/pressed state
134
+ - [ ] Disabled state (when applicable)
135
+ - [ ] Loading state (for async actions)
136
+ - [ ] Error state (for forms/inputs)
137
+ - [ ] Empty state (for lists/tables)
138
+ - [ ] Success state (for confirmations)
139
+
140
+ #### TypeScript Quality
141
+ - Missing or incorrect types
142
+ - Using `any` instead of proper types
143
+ - Props not properly typed
144
+ - Missing return types on functions
145
+
146
+ ### 3. Tailwind Consistency
147
+
148
+ - Magic numbers instead of spacing scale (`mt-[13px]` vs `mt-3`)
149
+ - Inconsistent color usage (raw hex vs design tokens)
150
+ - Missing responsive variants
151
+ - Conflicting utility classes
152
+ - Not using CSS variables for theming
153
+
154
+ ### 4. React Patterns
155
+
156
+ - Missing `key` props in lists
157
+ - Inline object/function definitions causing re-renders
158
+ - Missing `useCallback`/`useMemo` for expensive operations
159
+ - Incorrect dependency arrays in hooks
160
+ - State that should be derived
161
+ - Props drilling that should use context
162
+
163
+ ### 5. Performance
164
+
165
+ - Large components that should be split
166
+ - Missing `loading` prop on Next.js `<Image>`
167
+ - Unoptimized images (no width/height)
168
+ - Render-blocking operations
169
+ - Missing Suspense boundaries
170
+
171
+ ---
172
+
173
+ ## Spec Alignment (Workflow Mode Only)
174
+
175
+ When design specs exist, add this section to the review:
176
+
177
+ ```markdown
178
+ ## Spec Alignment
179
+
180
+ ### Discovery Requirements Compliance
181
+ | Requirement | Status | Implementation | Notes |
182
+ |-------------|--------|----------------|-------|
183
+ | REQ-01: User can... | ✓ Implemented | [file:line] | |
184
+ | REQ-02: User can... | ✗ Missing | — | Not found in code |
185
+ | REQ-03: User can... | ◐ Partial | [file:line] | Missing error handling |
186
+
187
+ **Coverage:** [X] of [Y] requirements implemented ([Z]%)
188
+
189
+ ### UX Decisions Compliance
190
+ | Decision | Status | Implementation | Notes |
191
+ |----------|--------|----------------|-------|
192
+ | User flow follows spec | ✓ | [file] | |
193
+ | All states implemented | ◐ | [file] | Missing: empty state |
194
+ | Accessibility requirements | ✓ | [file] | |
195
+
196
+ **State Coverage:**
197
+ | Component | Expected States | Implemented States | Gap |
198
+ |-----------|-----------------|-------------------|-----|
199
+ | [Name] | 9 | 7 | focus, empty |
200
+
201
+ ### UI Spec Compliance
202
+ | Spec | Status | Implementation | Notes |
203
+ |------|--------|----------------|-------|
204
+ | 8px grid followed | ✓ | — | All spacing on grid |
205
+ | Design tokens used | ◐ | [file:line] | 3 raw hex values found |
206
+ | Visual hierarchy clear | ✓ | — | |
207
+ | Component specs match | ◐ | [component] | Padding differs |
208
+
209
+ **Token Compliance:**
210
+ - Colors: [X] of [Y] using tokens
211
+ - Spacing: [X] of [Y] on grid
212
+ - Typography: [X] of [Y] using scale
213
+ ```
214
+
215
+ ---
216
+
217
+ ## Output Format
218
+
219
+ ```
220
+ ═══════════════════════════════════════════════════════════════════════════════
221
+ DESIGN ENGINEER REVIEW: [filename]
222
+ Tech Stack: Next.js 16 · React 19 · shadcn/ui · Tailwind 4 · TypeScript
223
+ DP Workflow: [Active/Not Active]
224
+ ═══════════════════════════════════════════════════════════════════════════════
225
+
226
+ [SPEC ALIGNMENT section - if workflow mode]
227
+
228
+ CRITICAL (X issues) — Must fix before shipping
229
+ ────────────────────────────────────────────────────────────────────────────────
230
+
231
+ [A11Y] Line 24: Button missing accessible name
232
+ │ <Button size="icon"><X /></Button>
233
+
234
+ └─ Fix: <Button size="icon" aria-label="Close dialog"><X /></Button>
235
+ WCAG 4.1.2 — Name, Role, Value
236
+
237
+ [A11Y] Line 45: Form input without label
238
+ │ <Input placeholder="Email" />
239
+
240
+ └─ Fix: Add <Label> or aria-label
241
+ WCAG 1.3.1 — Info and Relationships
242
+
243
+
244
+ SERIOUS (X issues) — Should fix for quality
245
+ ────────────────────────────────────────────────────────────────────────────────
246
+
247
+ [STATE] Line 67: Missing loading state on async button
248
+ │ <Button onClick={handleSubmit}>Submit</Button>
249
+
250
+ └─ Fix: Add disabled={isLoading} and show spinner
251
+ Pattern: references/shadcn-patterns.md#button-loading
252
+
253
+ [STYLE] Line 89: Magic number in spacing
254
+ │ className="mt-[13px]"
255
+
256
+ └─ Fix: Use spacing scale — mt-3 (12px) or mt-4 (16px)
257
+ Pattern: references/tailwind-conventions.md#spacing
258
+
259
+
260
+ MODERATE (X issues) — Consider for polish
261
+ ────────────────────────────────────────────────────────────────────────────────
262
+
263
+ [PERF] Line 112: Inline function causing re-renders
264
+ │ onClick={() => handleClick(item.id)}
265
+
266
+ └─ Fix: Use useCallback or move handler definition outside render
267
+ Pattern: references/react-patterns.md#callbacks
268
+
269
+
270
+ ═══════════════════════════════════════════════════════════════════════════════
271
+ SUMMARY
272
+ ═══════════════════════════════════════════════════════════════════════════════
273
+
274
+ │ Category │ Critical │ Serious │ Moderate │
275
+ │─────────────────│──────────│─────────│──────────│
276
+ │ Accessibility │ 2 │ 1 │ 0 │
277
+ │ Component │ 0 │ 1 │ 0 │
278
+ │ Tailwind │ 0 │ 1 │ 0 │
279
+ │ React │ 0 │ 0 │ 1 │
280
+ │ Performance │ 0 │ 0 │ 0 │
281
+ │ Spec Alignment │ 0 │ 2 │ 1 │
282
+ │─────────────────│──────────│─────────│──────────│
283
+ │ TOTAL │ 2 │ 5 │ 2 │
284
+
285
+ Quality Score: 78/100
286
+ Accessibility: NEEDS WORK — 2 critical issues
287
+ Spec Alignment: 85% — Minor gaps [workflow mode only]
288
+ Ready to Ship: NO — Fix critical issues first
289
+
290
+ ═══════════════════════════════════════════════════════════════════════════════
291
+ ```
292
+
293
+ ---
294
+
295
+ ## State Updates (Workflow Mode)
296
+
297
+ After completing review:
298
+
299
+ 1. **Write output to `.design/phases/REVIEW.md`**:
300
+ ```yaml
301
+ ---
302
+ phase: review
303
+ skill: design-engineer
304
+ completed: YYYY-MM-DDTHH:MM:SSZ
305
+ context_loaded:
306
+ - DISCOVERY.md
307
+ - UX-DECISIONS.md
308
+ - UI-SPEC.md
309
+ files_reviewed:
310
+ - [file1]
311
+ - [file2]
312
+ quality_score: 78
313
+ spec_alignment: 85%
314
+ ready_to_ship: false
315
+ ---
316
+
317
+ [Full review output]
318
+ ```
319
+
320
+ 2. **Update `.design/STATE.md`**:
321
+ ```markdown
322
+ ## Current Position
323
+ Phase: 4 of 4 (Review)
324
+ Status: completed
325
+ Progress: [██████████] 100%
326
+
327
+ ### Last Activity
328
+ - **Date:** [TIMESTAMP]
329
+ - **Action:** Completed review phase with /dp:eng_review
330
+ - **Quality Score:** 78/100
331
+ - **Ready to Ship:** No — 2 critical issues
332
+
333
+ ### What Happened
334
+ Reviewed [N] files. Found [X] critical, [Y] serious, [Z] moderate issues.
335
+ Spec alignment at [P]%.
336
+
337
+ ### Workflow Status
338
+ [complete | gaps_found]
339
+ ```
340
+
341
+ 3. **Update `.design/config.json`**:
342
+ ```json
343
+ {
344
+ "workflow": {
345
+ "current_phase": 4,
346
+ "phases_completed": ["discovery", "ux", "ui", "review"],
347
+ "workflow_status": "complete" // or "gaps"
348
+ }
349
+ }
350
+ ```
351
+
352
+ ---
353
+
354
+ ## Handoff (Workflow Mode)
355
+
356
+ ```
357
+ ═══════════════════════════════════════════════════════════════════════════════
358
+ DP WORKFLOW COMPLETE
359
+ ═══════════════════════════════════════════════════════════════════════════════
360
+
361
+ Output: .design/phases/REVIEW.md
362
+
363
+ Final Status:
364
+ • Quality Score: [XX]/100
365
+ • Spec Alignment: [YY]%
366
+ • Issues: [X] critical, [Y] serious, [Z] moderate
367
+ • Ready to Ship: [Yes/No]
368
+
369
+ Progress: [██████████] 100%
370
+
371
+ [If not ready to ship:]
372
+ Next Steps:
373
+ ────────────────────────────────────────────────────────────────────────────────
374
+ 1. [ ] Fix [X] critical issues (required)
375
+ 2. [ ] Fix [Y] serious issues (recommended)
376
+ 3. [ ] Re-run /dp:eng_review to verify fixes
377
+
378
+ [If ready to ship:]
379
+ Verification:
380
+ ────────────────────────────────────────────────────────────────────────────────
381
+ → /dp:verify to run comprehensive verification
382
+ → All design deliverables are in .design/phases/
383
+
384
+ ═══════════════════════════════════════════════════════════════════════════════
385
+ ```
386
+
387
+ ---
388
+
389
+ ## Standalone Mode Behavior
390
+
391
+ When no `.design/` directory exists:
392
+
393
+ 1. Output review inline (current behavior)
394
+ 2. Offer to implement fixes
395
+ 3. Skip spec alignment section (no specs to compare against)
396
+
397
+ ---
398
+
399
+ ## Review Guidelines
400
+
401
+ 1. **Read first** — Never assess code you haven't read
402
+ 2. **Be specific** — Include line numbers and exact code snippets
403
+ 3. **Provide fixes** — Show the corrected code, not just the problem
404
+ 4. **Prioritize correctly** — Critical = blocks shipping, Serious = blocks quality, Moderate = nice to have
405
+ 5. **Reference standards** — Cite WCAG criteria or pattern references
406
+ 6. **Offer to fix** — After the report, offer to implement the fixes
407
+
408
+ ---
409
+
410
+ ## Scoring Rubric
411
+
412
+ | Score | Rating | Criteria |
413
+ |-------|--------|----------|
414
+ | 90-100 | Excellent | No critical, ≤2 serious issues |
415
+ | 80-89 | Good | No critical, ≤5 serious issues |
416
+ | 70-79 | Needs Work | 1-2 critical OR >5 serious issues |
417
+ | 60-69 | Poor | 3-5 critical issues |
418
+ | <60 | Failing | >5 critical issues |
419
+
420
+ ---
421
+
422
+ ## Reference Files
423
+
424
+ Load these for detailed guidance:
425
+
426
+ - **references/code-review-checklist.md** — Complete audit criteria with examples
427
+ - **references/shadcn-patterns.md** — Correct shadcn/ui component usage
428
+ - **references/tailwind-conventions.md** — Project Tailwind standards
429
+ - **references/react-patterns.md** — React 19 patterns and anti-patterns
430
+
431
+ ---
432
+
433
+ ## Config Integration
434
+
435
+ Respects these settings from `.design/config.json`:
436
+ ```json
437
+ {
438
+ "phases": {
439
+ "review": {
440
+ "enabled": true,
441
+ "severityThreshold": "serious",
442
+ "includeSpecAlignment": true
443
+ }
444
+ }
445
+ }
446
+ ```
447
+
448
+ When `severityThreshold: "critical"`, only report critical issues.
449
+ When `severityThreshold: "serious"`, report critical + serious.
450
+ When `severityThreshold: "moderate"`, report all issues (default).
451
+ When `includeSpecAlignment: true`, include spec alignment section (workflow mode).
452
+
453
+ ---
454
+
455
+ ## Workflow Navigation
456
+
457
+ ```
458
+ /dp:start → /dp:discovery → /dp:ux → /dp:execute → /dp:ui → /dp:execute → ┌─────────┐ → /dp:verify
459
+ Phase 1 Phase 2 (wireframe) Phase 3 (polished) │ YOU ARE │
460
+ │ HERE │
461
+ │ Phase 4 │
462
+ └─────────┘
463
+ ```
464
+
465
+ | | |
466
+ |---|---|
467
+ | **Previous** | `/dp:execute` — Polished implementation |
468
+ | **Current** | `/dp:eng_review` — Code review & a11y (Phase 4) |
469
+ | **Next** | `/dp:verify` — Goal-backward verification |
470
+ | **Related** | `/dp:back` — Return to UI if visual issues found |
471
+ | | `/dp:discuss` — Capture review focus areas first |