@brunosps00/dev-workflow 0.13.0 → 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 (148) hide show
  1. package/README.md +106 -122
  2. package/lib/constants.js +16 -36
  3. package/lib/migrate-skills.js +11 -4
  4. package/lib/removed-commands.js +30 -0
  5. package/package.json +1 -1
  6. package/scaffold/en/agent-instructions.md +27 -16
  7. package/scaffold/en/commands/dw-adr.md +2 -2
  8. package/scaffold/en/commands/dw-analyze-project.md +7 -7
  9. package/scaffold/en/commands/dw-autopilot.md +20 -20
  10. package/scaffold/en/commands/dw-brainstorm.md +160 -9
  11. package/scaffold/en/commands/dw-bugfix.md +7 -6
  12. package/scaffold/en/commands/dw-commit.md +1 -1
  13. package/scaffold/en/commands/dw-dockerize.md +9 -9
  14. package/scaffold/en/commands/dw-find-skills.md +4 -4
  15. package/scaffold/en/commands/dw-functional-doc.md +2 -2
  16. package/scaffold/en/commands/dw-generate-pr.md +4 -4
  17. package/scaffold/en/commands/dw-help.md +95 -351
  18. package/scaffold/en/commands/dw-intel.md +76 -12
  19. package/scaffold/en/commands/dw-new-project.md +9 -9
  20. package/scaffold/en/commands/dw-plan.md +175 -0
  21. package/scaffold/en/commands/dw-qa.md +166 -0
  22. package/scaffold/en/commands/dw-redesign-ui.md +7 -7
  23. package/scaffold/en/commands/dw-review.md +198 -0
  24. package/scaffold/en/commands/dw-run.md +176 -0
  25. package/scaffold/en/commands/dw-secure-audit.md +222 -0
  26. package/scaffold/en/commands/dw-update.md +1 -1
  27. package/scaffold/en/references/playwright-patterns.md +1 -1
  28. package/scaffold/en/references/refactoring-catalog.md +1 -1
  29. package/scaffold/en/templates/brainstorm-matrix.md +1 -1
  30. package/scaffold/en/templates/idea-onepager.md +3 -3
  31. package/scaffold/en/templates/project-onepager.md +5 -5
  32. package/scaffold/pt-br/agent-instructions.md +27 -16
  33. package/scaffold/pt-br/commands/dw-adr.md +2 -2
  34. package/scaffold/pt-br/commands/dw-analyze-project.md +7 -7
  35. package/scaffold/pt-br/commands/dw-autopilot.md +20 -20
  36. package/scaffold/pt-br/commands/dw-brainstorm.md +160 -9
  37. package/scaffold/pt-br/commands/dw-bugfix.md +10 -9
  38. package/scaffold/pt-br/commands/dw-commit.md +1 -1
  39. package/scaffold/pt-br/commands/dw-dockerize.md +9 -9
  40. package/scaffold/pt-br/commands/dw-find-skills.md +4 -4
  41. package/scaffold/pt-br/commands/dw-functional-doc.md +2 -2
  42. package/scaffold/pt-br/commands/dw-generate-pr.md +4 -4
  43. package/scaffold/pt-br/commands/dw-help.md +97 -300
  44. package/scaffold/pt-br/commands/dw-intel.md +77 -13
  45. package/scaffold/pt-br/commands/dw-new-project.md +9 -9
  46. package/scaffold/pt-br/commands/dw-plan.md +175 -0
  47. package/scaffold/pt-br/commands/dw-qa.md +166 -0
  48. package/scaffold/pt-br/commands/dw-redesign-ui.md +7 -7
  49. package/scaffold/pt-br/commands/dw-review.md +198 -0
  50. package/scaffold/pt-br/commands/dw-run.md +176 -0
  51. package/scaffold/pt-br/commands/dw-secure-audit.md +222 -0
  52. package/scaffold/pt-br/commands/dw-update.md +1 -1
  53. package/scaffold/pt-br/references/playwright-patterns.md +1 -1
  54. package/scaffold/pt-br/references/refactoring-catalog.md +1 -1
  55. package/scaffold/pt-br/templates/brainstorm-matrix.md +1 -1
  56. package/scaffold/pt-br/templates/idea-onepager.md +3 -3
  57. package/scaffold/pt-br/templates/project-onepager.md +5 -5
  58. package/scaffold/pt-br/templates/tasks-template.md +1 -1
  59. package/scaffold/skills/api-testing-recipes/SKILL.md +6 -6
  60. package/scaffold/skills/api-testing-recipes/references/auth-patterns.md +1 -1
  61. package/scaffold/skills/api-testing-recipes/references/matrix-conventions.md +1 -1
  62. package/scaffold/skills/api-testing-recipes/references/openapi-driven.md +3 -3
  63. package/scaffold/skills/docker-compose-recipes/SKILL.md +1 -1
  64. package/scaffold/skills/dw-codebase-intel/SKILL.md +9 -9
  65. package/scaffold/skills/dw-codebase-intel/agents/intel-updater.md +4 -4
  66. package/scaffold/skills/dw-codebase-intel/references/api-design-discipline.md +1 -1
  67. package/scaffold/skills/dw-codebase-intel/references/incremental-update.md +5 -5
  68. package/scaffold/skills/dw-codebase-intel/references/intel-format.md +1 -1
  69. package/scaffold/skills/dw-codebase-intel/references/query-patterns.md +3 -3
  70. package/scaffold/skills/dw-council/SKILL.md +2 -2
  71. package/scaffold/skills/dw-debug-protocol/SKILL.md +5 -3
  72. package/scaffold/skills/dw-execute-phase/SKILL.md +16 -16
  73. package/scaffold/skills/dw-execute-phase/agents/executor.md +5 -5
  74. package/scaffold/skills/dw-execute-phase/agents/plan-checker.md +4 -4
  75. package/scaffold/skills/dw-execute-phase/references/atomic-commits.md +1 -1
  76. package/scaffold/skills/dw-execute-phase/references/plan-verification.md +2 -2
  77. package/scaffold/skills/dw-execute-phase/references/wave-coordination.md +1 -1
  78. package/scaffold/skills/dw-git-discipline/SKILL.md +5 -2
  79. package/scaffold/skills/dw-incident-response/SKILL.md +168 -0
  80. package/scaffold/skills/dw-incident-response/references/blameless-discipline.md +126 -0
  81. package/scaffold/skills/dw-incident-response/references/communication-templates.md +107 -0
  82. package/scaffold/skills/dw-incident-response/references/postmortem-template.md +133 -0
  83. package/scaffold/skills/dw-incident-response/references/runbook-templates.md +169 -0
  84. package/scaffold/skills/dw-incident-response/references/severity-and-triage.md +186 -0
  85. package/scaffold/skills/dw-llm-eval/SKILL.md +150 -0
  86. package/scaffold/skills/dw-llm-eval/references/agent-eval.md +252 -0
  87. package/scaffold/skills/dw-llm-eval/references/judge-calibration.md +169 -0
  88. package/scaffold/skills/dw-llm-eval/references/oracle-ladder.md +171 -0
  89. package/scaffold/skills/dw-llm-eval/references/rag-metrics.md +186 -0
  90. package/scaffold/skills/dw-llm-eval/references/reference-dataset.md +190 -0
  91. package/scaffold/skills/dw-memory/SKILL.md +2 -2
  92. package/scaffold/skills/dw-review-rigor/SKILL.md +5 -5
  93. package/scaffold/skills/dw-simplification/SKILL.md +4 -4
  94. package/scaffold/skills/dw-source-grounding/SKILL.md +1 -1
  95. package/scaffold/skills/dw-testing-discipline/SKILL.md +103 -78
  96. package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +170 -0
  97. package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +7 -7
  98. package/scaffold/skills/dw-testing-discipline/references/core-rules.md +128 -0
  99. package/scaffold/skills/dw-testing-discipline/references/flaky-discipline.md +3 -3
  100. package/scaffold/skills/dw-testing-discipline/references/{positive-patterns.md → patterns.md} +1 -1
  101. package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +3 -3
  102. package/scaffold/skills/dw-ui-discipline/SKILL.md +103 -79
  103. package/scaffold/skills/dw-ui-discipline/references/accessibility-floor.md +2 -2
  104. package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +93 -73
  105. package/scaffold/skills/dw-ui-discipline/references/state-matrix.md +1 -1
  106. package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +152 -0
  107. package/scaffold/skills/dw-verify/SKILL.md +4 -4
  108. package/scaffold/skills/humanizer/SKILL.md +1 -7
  109. package/scaffold/skills/remotion-best-practices/SKILL.md +3 -1
  110. package/scaffold/skills/security-review/SKILL.md +1 -1
  111. package/scaffold/skills/security-review/languages/csharp.md +1 -1
  112. package/scaffold/skills/security-review/languages/rust.md +1 -1
  113. package/scaffold/skills/security-review/languages/typescript.md +1 -1
  114. package/scaffold/skills/vercel-react-best-practices/SKILL.md +3 -1
  115. package/scaffold/templates-overrides-readme.md +3 -3
  116. package/scaffold/en/commands/dw-code-review.md +0 -385
  117. package/scaffold/en/commands/dw-create-prd.md +0 -148
  118. package/scaffold/en/commands/dw-create-tasks.md +0 -195
  119. package/scaffold/en/commands/dw-create-techspec.md +0 -210
  120. package/scaffold/en/commands/dw-deep-research.md +0 -418
  121. package/scaffold/en/commands/dw-deps-audit.md +0 -327
  122. package/scaffold/en/commands/dw-fix-qa.md +0 -152
  123. package/scaffold/en/commands/dw-map-codebase.md +0 -125
  124. package/scaffold/en/commands/dw-refactoring-analysis.md +0 -340
  125. package/scaffold/en/commands/dw-revert-task.md +0 -114
  126. package/scaffold/en/commands/dw-review-implementation.md +0 -349
  127. package/scaffold/en/commands/dw-run-plan.md +0 -300
  128. package/scaffold/en/commands/dw-run-qa.md +0 -496
  129. package/scaffold/en/commands/dw-run-task.md +0 -209
  130. package/scaffold/en/commands/dw-security-check.md +0 -271
  131. package/scaffold/pt-br/commands/dw-code-review.md +0 -365
  132. package/scaffold/pt-br/commands/dw-create-prd.md +0 -148
  133. package/scaffold/pt-br/commands/dw-create-tasks.md +0 -195
  134. package/scaffold/pt-br/commands/dw-create-techspec.md +0 -208
  135. package/scaffold/pt-br/commands/dw-deep-research.md +0 -172
  136. package/scaffold/pt-br/commands/dw-deps-audit.md +0 -327
  137. package/scaffold/pt-br/commands/dw-fix-qa.md +0 -152
  138. package/scaffold/pt-br/commands/dw-map-codebase.md +0 -125
  139. package/scaffold/pt-br/commands/dw-refactoring-analysis.md +0 -340
  140. package/scaffold/pt-br/commands/dw-revert-task.md +0 -114
  141. package/scaffold/pt-br/commands/dw-review-implementation.md +0 -337
  142. package/scaffold/pt-br/commands/dw-run-plan.md +0 -296
  143. package/scaffold/pt-br/commands/dw-run-qa.md +0 -494
  144. package/scaffold/pt-br/commands/dw-run-task.md +0 -208
  145. package/scaffold/pt-br/commands/dw-security-check.md +0 -271
  146. package/scaffold/skills/dw-testing-discipline/references/ai-agent-gates.md +0 -170
  147. package/scaffold/skills/dw-testing-discipline/references/iron-laws.md +0 -128
  148. package/scaffold/skills/dw-ui-discipline/references/anti-slop.md +0 -162
@@ -1,128 +1,152 @@
1
1
  ---
2
2
  name: dw-ui-discipline
3
- description: Use BEFORE any UI work enforces a hard-gate (brand authorities or curated defaults, surface job, state matrix, scene sentence), 14 anti-slop patterns, and WCAG 2.2 AA floor so UI ships with discipline instead of training-data defaults.
3
+ description: Use BEFORE any UI work. 4 grounding questions (design source, surface job, state matrix, scene), 14 anti-slop patterns, WCAG 2.2 AA floor. Triggers on UI design, /dw-redesign-ui, UI diffs.
4
+ allowed-tools:
5
+ - Read
4
6
  ---
5
7
 
6
8
  # UI Discipline
7
9
 
8
- > **Inspired by** [`pedronauck/skills/ui-craft`](https://github.com/pedronauck/skills/tree/main/skills/mine/ui-craft) (MIT). Hard-gate protocol, anti-slop catalog, state matrix enforcement, and accessibility-floor patterns adapted from Pedro Nauck's work; specifics rewritten for dev-workflow's redesign and review loops.
10
+ Training-data defaults are the enemy. An ungrounded LLM proposing UI will reach for `#3B82F6` blue, `rounded-lg` radius, center-aligned text, and gradient backgrounds because those screenshots dominate training data. The surface ends up looking like every other SaaS dashboard, and users can't tell what to look at first.
9
11
 
10
- The fastest path through UI work is the disciplined one. "It's just a small change" is the most common slop excuse. This skill blocks that excuse at four checkpoints before any design decision lands.
12
+ This skill blocks that autopilot at four grounding questions before any visual decision lands. After the questions pass, it enforces an accessibility floor and runs a visual-slop catalog as the proposed design comes together.
11
13
 
12
- ## When this skill applies
14
+ ## When to use
13
15
 
14
- - Any work invoked from `/dw-redesign-ui`, `/dw-create-techspec` (UI sections), `/dw-functional-doc`, or `/dw-code-review` when the diff touches UI.
15
- - Adding new screens, components, or surfaces.
16
- - Reviewing visual changes in a PR.
17
- - Auditing accessibility on existing surfaces.
16
+ - Inside `/dw-redesign-ui` both proposal and validation steps.
17
+ - Inside `/dw-plan techspec` when the spec has UI sections.
18
+ - Inside `/dw-functional-doc` when documenting screen-level patterns.
19
+ - Inside `/dw-review --code-only` when the diff touches UI files (CSS, JSX, templates).
20
+ - Inside `/dw-brainstorm` when the conversation drifts into visual direction.
18
21
 
19
- If you're tempted to skip the gate "because it's just a tweak" — that's the trigger. Run the gate.
22
+ If you're tempted to skip this "because it's just a small tweak" — that's the trigger. Run the grounding.
20
23
 
21
- ## The hard-gate (4 mandatory items before any UI work)
24
+ ## The four grounding questions
22
25
 
23
- Before proposing colors, layouts, components, or any visual decision, complete all four:
26
+ Answer all four before proposing colors, layouts, components, or any visual decision.
24
27
 
25
- ### 1. Brand authorities OR curated defaults
28
+ ### 1. Where do design decisions come from?
26
29
 
27
- Locate the project's design source of truth:
28
- - `.dw/rules/{frontend-module}.md` design system section
29
- - `DESIGN.md`, `BRAND.md`, or design tokens config (Tailwind, CSS vars, theme file)
30
- - Component library docs (shadcn/ui, MUI, Chakra, etc.)
30
+ Find the project's design source-of-truth in this order:
31
+ 1. `.dw/rules/<frontend-module>.md` design system section.
32
+ 2. `DESIGN.md`, `BRAND.md`, `STYLE_GUIDE.md` at project root.
33
+ 3. Design token config — Tailwind theme, CSS variables in `theme.css`/`globals.css`, MUI/Chakra theme.
34
+ 4. Component library config — `components.json` for shadcn, theme exports.
35
+ 5. Storybook stories (implicit canonical components).
31
36
 
32
- If **none exist**, do NOT invent. Read `references/curated-defaults.md` pick from the 10 neutral palettes + 10 font pairings shipped there. Mark the choice as a finding in the techspec ("no design authority found; used curated default <name>; recommend establishing one").
37
+ If **at least one** exists: it wins. Defer to it. If a needed token is missing (e.g., a danger-secondary color), propose adding it to the authority FIRST, not inline.
33
38
 
34
- ### 2. Surface job sentence
39
+ If **none exists**: read `references/curated-defaults.md` and pick one of the 10 neutral palettes + one of the 10 font pairings shipped there. Mark the choice in the techspec/PR description: "Design source: no project authority found; using curated default `<name>`; recommend establishing `DESIGN.md`."
35
40
 
36
- Write one sentence: "This surface helps the user <do what> so that <outcome>." Vague language ("show data", "manage settings") fails — be specific ("filter overdue invoices so they can chase late payers in <30s").
41
+ **Anti-patterns at this question:**
42
+ - Inventing color hex values inline (`bg-[#FF6B35]`).
43
+ - "I'll use Tailwind defaults" — that's training-data defaults, not project authority.
44
+ - Copying values from "a site I like" without understanding what it solved.
45
+
46
+ ### 2. What does this surface help the user do?
47
+
48
+ Write one sentence: **"This surface helps the user `<verb-phrase>` so that `<outcome>`."**
49
+
50
+ Good examples:
51
+ - "...helps the user filter overdue invoices so they can chase late payers in under 30 seconds."
52
+ - "...helps the on-call engineer diagnose which deploy caused the spike so they can roll back without paging the team."
53
+ - "...helps the manager approve or reject expense reports without leaving Slack."
54
+
55
+ Bad examples:
56
+ - "This surface displays invoice data." (no user, no outcome)
57
+ - "Settings page for managing the account." (vague, no specificity)
58
+ - "Dashboard." (one word)
37
59
 
38
60
  If you can't write the sentence, the requirements are unclear. Stop and clarify before proceeding.
39
61
 
40
- ### 3. Complete state matrix
62
+ ### 3. What states does the surface have?
63
+
64
+ Enumerate all states before designing the happy path. Minimum nine, plus domain-specific ones — see `references/state-matrix.md`:
41
65
 
42
- Enumerate all states the surface can be in. See `references/state-matrix.md` for the full list:
43
- - `default`, `hover`, `active`, `focus-visible`, `disabled`, `loading`, `empty`, `error`, `success`
44
- - Plus any domain-specific states (read/unread, online/offline, etc.)
66
+ `default`, `hover`, `active`, `focus-visible`, `disabled`, `loading`, `empty`, `error`, `success` plus any domain states (read/unread, online/offline, stale/fresh, pending/approved/rejected, draft/saved/dirty, partial/complete, etc.).
45
67
 
46
68
  Missing a state at design time = production bug later. The "we'll add empty state later" trap is real.
47
69
 
48
- ### 4. Scene sentence
70
+ ### 4. Who uses this surface, where, and in what mood?
49
71
 
50
- One sentence describing the physical context: **who** is using this, **where** (mobile bus, office desktop, on-call laptop), **what light** (dark room, bright outdoor), **what mood** (rushed, exploring, troubleshooting).
72
+ One sentence: **"`<Who>` uses this on `<where>` in `<what light>` while `<what mood>`."**
51
73
 
52
- This forcing function prevents category-level defaults from becoming the answer. A "dashboard for an on-call engineer at 3am in a dark room troubleshooting a fire" produces different decisions than "dashboard for a manager during business hours."
74
+ Good examples:
75
+ - "An on-call engineer uses this on a dark-room laptop at 3am while troubleshooting a fire."
76
+ - "A field nurse uses this on a phone in bright outdoor light while juggling clipboards."
77
+ - "A receptionist uses this on a 24″ monitor at a busy front desk while talking to a visitor."
53
78
 
54
- ## Required Reading Router
79
+ Decisions cascade from the answer:
80
+ - 3am dark room → dark mode, high contrast, no flashing animations.
81
+ - Bright outdoor → minimum 7:1 contrast, larger touch targets, no thin fonts.
82
+ - Busy front desk → glanceable info, no nested menus, large numbers.
55
83
 
56
- | Context | Read |
57
- |---------|------|
58
- | Any UI work | `references/hard-gate.md` (full protocol with examples) |
59
- | Interactive widgets (buttons, forms, modals) | `references/accessibility-floor.md` (WCAG 2.2 AA non-negotiable) |
60
- | Reviewing a UI diff | `references/anti-slop.md` (14 anti-patterns + 17 anti-defaults) |
61
- | Designing state coverage | `references/state-matrix.md` (full enumeration + checklist) |
62
- | No design authority exists in project | `references/curated-defaults.md` (10 palettes + 10 fonts) |
84
+ Without this sentence, defaults take over: light mode, default contrasts, animations, regular touch targets. Production users hate it; you can't articulate why.
63
85
 
64
- ## Anti-slop summary (full list in references/anti-slop.md)
86
+ ## Required reading by context
65
87
 
66
- The 14 patterns this skill catches:
88
+ | Doing what | Read |
89
+ |------------|------|
90
+ | Any UI work (the full version of the grounding) | `references/hard-gate.md` |
91
+ | Reviewing or proposing a design | `references/visual-slop.md` (14 patterns + specific anti-default values) |
92
+ | Designing state coverage | `references/state-matrix.md` |
93
+ | Interactive widget (button, form, modal, anything clickable) | `references/accessibility-floor.md` |
94
+ | No design authority exists in the project | `references/curated-defaults.md` (palettes / fonts / scales) |
67
95
 
68
- 1. **Visual sameness** every section looks like every other section.
69
- 2. **Weak hierarchy** — nothing draws the eye to what matters first.
70
- 3. **Fake interactivity** — hover states that don't change anything functional.
71
- 4. **Emoji spam** — emojis as decoration where icons or restraint would serve.
72
- 5. **Gradient crutch** — gradients used to mask weak composition.
73
- 6. **Glass everything** — frosted glass on every panel.
74
- 7. **Centered all the things** — center-aligned text when left-aligned reads better.
75
- 8. **AI gray washing** — neutral grays everywhere, no character.
76
- 9. **Generic CTAs** — "Get Started", "Learn More", "Click Here" with no specificity.
77
- 10. **Stock illustration** — generic figure-with-laptop hero art.
78
- 11. **Drop shadow soup** — shadows on cards on shadows on borders.
79
- 12. **Loading spinner default** — spinner as the only loading state for everything.
80
- 13. **Empty state void** — empty list with no guidance on what to do next.
81
- 14. **Notification-soup tray** — every UI event becomes a toast.
96
+ ## The 14 visual-slop patterns (full catalog in `references/visual-slop.md`)
82
97
 
83
- Plus 17 anti-defaults (specific values to NEVER use without intent — `#3B82F6` blue, `rounded-lg` everywhere, etc.) in `references/anti-slop.md`.
98
+ Watch for these in proposed designs and PR diffs:
99
+
100
+ 1. **Uniform-section flatness** — every section looks like every other section; no anchor for the eye.
101
+ 2. **Soft hierarchy** — headings barely larger than body; primary CTA same color as secondary.
102
+ 3. **Decorative hover** — hover states that don't change anything functional or clickable.
103
+ 4. **Emoji as ornament** — emojis in headers, CTAs, section labels where they add no information.
104
+ 5. **Gradient cover** — gradients used to mask weak composition rather than serve a poetic hero.
105
+ 6. **Glass-on-everything** — frosted-glass effect on every panel, including ones with nothing behind.
106
+ 7. **Center-aligned by default** — body paragraphs and forms reading center where left would read better.
107
+ 8. **Grayscale wash** — neutral grays everywhere, no accent personality, no character.
108
+ 9. **Verb-less CTAs** — "Get Started", "Learn More", "Click Here", "Submit", "OK".
109
+ 10. **Stock-illustration hero** — figure-with-laptop, diverse-team-around-table, abstract floating shapes.
110
+ 11. **Shadow soup** — shadows on cards on shadows on borders on gradients on one element.
111
+ 12. **Generic spinner** — wall-clock spinner as the only loading state for every operation.
112
+ 13. **Silent empty state** — "No items found." centered. Nothing else. No guidance.
113
+ 14. **Toast everywhere** — every UI event becomes a toast; five stack up and none get read.
114
+
115
+ Plus 17 anti-default values (specific colors, radii, font choices, spacing presets) that signal "no thought went into this" — full list in `references/visual-slop.md`.
84
116
 
85
117
  ## Accessibility floor — non-negotiable
86
118
 
87
119
  Before any interactive widget ships:
88
120
 
89
- - [ ] Color contrast meets WCAG 2.2 AA (4.5:1 for body text, 3:1 for large text and UI components).
90
- - [ ] Focus-visible state exists and is distinct from hover.
91
- - [ ] Keyboard navigation works (tab order, escape closes modals, enter submits forms).
121
+ - [ ] Color contrast meets WCAG 2.2 AA (4.5:1 body, 3:1 large text and UI components).
122
+ - [ ] Focus-visible state distinct from hover.
123
+ - [ ] Keyboard navigation works end-to-end.
92
124
  - [ ] ARIA labels for icon-only buttons.
93
- - [ ] Form errors are announced to screen readers.
125
+ - [ ] Form errors announced to screen readers.
94
126
  - [ ] No keyboard traps.
127
+ - [ ] Touch targets ≥24×24 CSS pixels (≥44×44 recommended on mobile).
128
+ - [ ] Heading hierarchy is semantic (no skipped levels).
129
+ - [ ] `prefers-reduced-motion` honored.
95
130
 
96
- Full verification recipes in `references/accessibility-floor.md`. This is a hard gate — `/dw-code-review` fails verdict if any interactive widget ships without these.
97
-
98
- ## When the gate bends
131
+ Full verification recipes in `references/accessibility-floor.md`. `/dw-review --code-only` rejects the verdict if any interactive widget ships without these.
99
132
 
100
- Real-world UI can't always be perfect:
133
+ ## When the grounding bends
101
134
 
102
- - **Bug fix in existing UI** — gate applies only to the area touched, not the whole surface.
103
- - **Pure copy change** — gate is just "scene sentence still holds?" quick check.
104
- - **Spike / exploration** — gate skipped if the spike is explicitly marked throwaway; production code must run the gate.
135
+ - **Bug fix in existing UI** — grounding applies only to the area touched, not the whole surface.
136
+ - **Pure copy change** — only the "what does this help the user do" question still applies as a sanity check.
137
+ - **Throwaway spike** — grounding skippable if the spike is explicitly marked non-production.
105
138
 
106
- In all bend cases, document the bend in the PR description (one line). "I skipped the state matrix because this is a one-line copy fix" is fine. "I skipped because I was in a hurry" is not.
139
+ In all bend cases, document the bend in the PR (one line). "I skipped the state matrix because this is a one-line copy fix" is fine. "I skipped because I was in a hurry" is not.
107
140
 
108
141
  ## Integration with dev-workflow commands
109
142
 
110
- - `/dw-redesign-ui` runs the gate end-to-end. Steps 4 (propose design) and 7 (validate WCAG) consult this skill.
111
- - `/dw-create-techspec` UI sections must list which authorities were consulted (brand vs curated default) and reference the state matrix.
112
- - `/dw-code-review` checks the diff against `references/anti-slop.md` and the accessibility floor.
113
- - `/dw-functional-doc` documents the scene sentence in the overview.
114
-
115
- ## Anti-patterns this skill prevents
116
-
117
- - "Just use the same hero as the marketing page" — without verifying the surface job differs.
118
- - "We'll add empty/error states later" — they're never added later.
119
- - "It looks fine on my desktop" — without checking mobile + keyboard + screen reader.
120
- - Designing in isolation from `.dw/rules/` documented patterns.
121
- - Inventing color values when the design system has tokens that fit.
122
- - Shipping interactive widgets without WCAG 2.2 AA verification.
143
+ - `/dw-redesign-ui` runs the grounding end-to-end. Steps 4 (propose) and 7 (validate) consult this skill explicitly.
144
+ - `/dw-plan techspec` UI sections must answer the 4 grounding questions and reference the state matrix.
145
+ - `/dw-review --code-only` checks UI diffs against the 14 visual-slop patterns and the accessibility floor.
146
+ - `/dw-functional-doc` records the surface-job and scene sentences in the overview for each screen.
123
147
 
124
- ## Why this skill exists
148
+ ## Why this approach
125
149
 
126
- The previous bundled skill (`ui-ux-pro-max`) provided 161 color palettes and 57 font pairings a CATALOG of taste. It had no gates, no anti-patterns, no enforcement. Agents loaded KB of palette data and still produced slop because there was no DISCIPLINE.
150
+ The shorter route "agent loads a 161-palette catalog and picks one"produces dashboards that look like every other dashboard because the agent has no constraint that pulls it away from training-data centers of mass.
127
151
 
128
- This skill inverts that trade-off: 10 curated defaults (enough for 90% of cases) + a strong gate + an anti-slop catalog. Less context bytes, more leverage.
152
+ The grounding pulls the design toward the specific surface, the specific user, the specific moment. Even with the same palette catalog, a "3am on-call dark room troubleshooting" design lands different choices than a "morning manager approving expenses" design. That difference is where surface quality lives.
@@ -1,6 +1,6 @@
1
1
  # Accessibility floor — WCAG 2.2 AA is the minimum, not the goal
2
2
 
3
- This reference is read in full before any interactive widget ships. Skipping any item below is a hard-block in `/dw-code-review`.
3
+ This reference is read in full before any interactive widget ships. Skipping any item below is a hard-block in `/dw-review --code-only`.
4
4
 
5
5
  ## The non-negotiables
6
6
 
@@ -222,4 +222,4 @@ LLM-produced UI commonly fails on:
222
222
  - Modals that trap focus only on success path, not on error.
223
223
  - Auto-playing carousels with no pause control.
224
224
 
225
- `/dw-code-review` runs axe-style checks on the diff for these.
225
+ `/dw-review --code-only` runs axe-style checks on the diff for these.
@@ -1,142 +1,162 @@
1
- # The hard-gate protocol — full version
1
+ # The grounding protocol — full version
2
2
 
3
- Four checkpoints before any UI work touches code. Each has a concrete output. Don't proceed without finishing the current one.
3
+ Four questions before any UI work touches code. Each has a concrete output. Don't proceed past one without finishing its output.
4
4
 
5
- ## Why a gate at all
5
+ ## Why the grounding matters
6
6
 
7
- Training-data defaults are the enemy. An LLM proposing UI without grounding will:
8
- - Reach for `#3B82F6` blue and `rounded-lg` because they appeared 10M times in training data.
9
- - Default to glass morphism, gradient backgrounds, and center-aligned everything because those screenshots dominate the web.
10
- - Skip empty/error states because happy-path screenshots are the most common training signal.
7
+ Training-data defaults dominate ungrounded UI generation. An LLM proposing a "dashboard" without context will produce:
8
+ - `#3B82F6` blue + `rounded-lg` because those values appeared 10M+ times in training.
9
+ - Glass morphism, gradients, center-aligned blocks because those screenshots dominate web aesthetics.
10
+ - Happy-path layouts only, because most training screenshots show success states.
11
11
 
12
- The gate forces grounding in this project's reality before training-data autopilot fires.
12
+ The four questions pull the design AWAY from the training-data center of mass and TOWARD this project, this surface, this user, this moment.
13
13
 
14
- ## Checkpoint 1: Brand authorities OR curated defaults
14
+ ## Question 1 Where do design decisions come from?
15
15
 
16
- **Goal:** know where visual decisions come from. Documented authority, or curated default — never invented.
16
+ **Goal:** know the source of truth for visual values. Documented authority, or curated default — never invented.
17
17
 
18
- **How:**
18
+ ### How to find it
19
19
 
20
- 1. Search the project for design source-of-truth:
21
- - `.dw/rules/*.md` — look for "Design", "Patterns to Follow", "Naming Conventions" sections.
22
- - `DESIGN.md`, `BRAND.md`, `BRANDING.md`, `STYLE_GUIDE.md` at root.
23
- - Tailwind `tailwind.config.{ts,js}` — theme tokens.
24
- - CSS variables in `globals.css`, `theme.css`, `tokens.css`.
25
- - Component library config (shadcn `components.json`, MUI theme, Chakra theme).
26
- - Storybook stories — implicit canonical components.
20
+ Search the project in this order:
27
21
 
28
- 2. If **at least one** authority exists: it wins. Decisions defer to it. If a needed token doesn't exist (e.g., a danger-secondary color), propose adding it to the authority FIRST, not inline.
22
+ 1. **`.dw/rules/*.md`** look for sections titled "Design", "Patterns to Follow", "Naming Conventions". The codebase intelligence skill writes these.
23
+ 2. **Root-level docs** — `DESIGN.md`, `BRAND.md`, `BRANDING.md`, `STYLE_GUIDE.md`.
24
+ 3. **Token configuration** — `tailwind.config.{ts,js}` `theme` block; CSS variables in `globals.css`, `theme.css`, `tokens.css`.
25
+ 4. **Component library config** — shadcn `components.json`, MUI/Chakra theme exports.
26
+ 5. **Storybook stories** — implicit canonical components.
29
27
 
30
- 3. If **none exists**: pick a curated default. Read `curated-defaults.md` in this references folder. Pick one of the 10 palettes + one of the 10 font pairings. Mark the choice in the techspec/PR description:
28
+ ### What to do based on what you find
31
29
 
32
- > **Design source:** No project authority found. Using curated default "Cool Stone" (neutral grays + electric blue accent) + "Inter / Source Serif" pairing. Recommend establishing `DESIGN.md` to formalize.
30
+ **At least one authority exists**: it wins. Defer to it. If you need a token it doesn't have (e.g., a danger-secondary color), propose adding the token to the authority FIRST, then use it. Don't hardcode the new value.
33
31
 
34
- **Anti-patterns at this checkpoint:**
32
+ **No authority exists**: read `curated-defaults.md` in this references folder. Pick one of the 10 palettes + one of the 10 font pairings. Mark the choice as a finding in the techspec/PR:
35
33
 
36
- - Inventing color hex values inline (`bg-[#FF6B35]`).
34
+ > **Design source**: No project authority found. Using curated default "Cool Stone" (neutral slate + intentional accent) + "Inter / Source Serif" pairing. Recommend establishing `DESIGN.md` to formalize.
35
+
36
+ ### Anti-patterns at this question
37
+
38
+ - Inventing color hex inline (`bg-[#FF6B35]`).
37
39
  - "I'll use Tailwind defaults" — Tailwind defaults are training-data defaults, not project authority.
38
40
  - Copying values from "a site I like" without understanding what it solved.
39
41
 
40
- **Output:** A one-sentence note in the techspec/PR describing the authority consulted.
42
+ ### Output
43
+
44
+ A one-sentence note in the techspec or PR describing which authority you consulted.
41
45
 
42
- ## Checkpoint 2: Surface job sentence
46
+ ## Question 2 What does this surface help the user do?
43
47
 
44
48
  **Goal:** the user's intent at this surface, stated in one specific sentence.
45
49
 
46
- **Format:** "This surface helps the user **<verb-phrase>** so that **<outcome>**."
50
+ **Format:** "This surface helps the user **`<verb-phrase>`** so that **`<outcome>`**."
47
51
 
48
- **Examples good:**
52
+ ### Good examples
49
53
 
50
- - "This surface helps the user filter overdue invoices so they can chase late payers in under 30 seconds."
51
- - "This surface helps the on-call engineer diagnose which deploy caused the spike so they can roll back without paging the team."
52
- - "This surface helps the manager approve or reject expense reports without leaving Slack."
54
+ - "...helps the user filter overdue invoices so they can chase late payers in under 30 seconds."
55
+ - "...helps the on-call engineer diagnose which deploy caused the spike so they can roll back without paging the team."
56
+ - "...helps the manager approve or reject expense reports without leaving Slack."
53
57
 
54
- **Examples bad:**
58
+ ### Bad examples
55
59
 
56
- - "This surface displays invoice data." (no user, no outcome)
57
- - "Settings page for managing the account." (vague, no specificity)
58
- - "Dashboard." (one word)
60
+ - "This surface displays invoice data." no user, no outcome.
61
+ - "Settings page for managing the account." vague.
62
+ - "Dashboard." one word; says nothing.
59
63
 
60
- **How to push back when the brief is vague:**
64
+ ### When the brief is vague
61
65
 
62
- If the requester can't articulate the job, the requirements aren't ready. Reply with: "Before I design this surface, I need the job sentence: <example>. Can you fill in the verb-phrase and outcome?"
66
+ If you can't write this sentence, the requirements are unclear. Stop. Push back to the requester:
67
+
68
+ > "Before designing this surface, I need the job sentence: 'helps the user `<verb-phrase>` so that `<outcome>`.' Can you fill in the verb-phrase and outcome?"
63
69
 
64
70
  Designing without this sentence produces generic surfaces — the "just another dashboard" outcome.
65
71
 
66
- **Output:** The one-sentence job, committed to the techspec/PR description.
72
+ ### Output
73
+
74
+ One sentence in the techspec/PR description.
67
75
 
68
- ## Checkpoint 3: Complete state matrix
76
+ ## Question 3 What states does the surface have?
69
77
 
70
- **Goal:** enumerate every state the surface can be in, BEFORE designing for the happy path.
78
+ **Goal:** enumerate every state the surface can be in BEFORE designing for the happy path.
71
79
 
72
- **Minimum states (always enumerate):**
80
+ ### Mandatory minimum
73
81
 
74
82
  | State | Trigger | What user sees |
75
83
  |-------|---------|---------------|
76
84
  | `default` | First load, no interaction | Initial render |
77
85
  | `hover` | Cursor over interactive element | Visual feedback |
78
- | `active` | Click in progress | Pressed/depressed visual |
79
- | `focus-visible` | Keyboard tab arrived | Distinct outline, not the same as hover |
80
- | `disabled` | Interaction unavailable | Reduced opacity + cursor change, NO action |
81
- | `loading` | Async operation in flight | Skeleton, spinner, or progress context-appropriate |
86
+ | `active` | Click in progress (mouse down) | Pressed/depressed |
87
+ | `focus-visible` | Keyboard tab arrives | Distinct outline, NOT same as hover |
88
+ | `disabled` | Interaction unavailable | Reduced opacity + cursor change; NO on-click |
89
+ | `loading` | Async operation in flight | Skeleton, spinner, or progress (context-appropriate) |
82
90
  | `empty` | No data to show | Guidance on what to do next |
83
91
  | `error` | Operation failed | What broke + how to recover |
84
- | `success` | Operation succeeded | Confirmation that doesn't require ack |
92
+ | `success` | Operation succeeded | Confirmation; auto-dismiss when safe |
85
93
 
86
- **Add domain-specific states as needed:**
94
+ ### Domain-specific states
87
95
 
88
- - Read/unread (notifications, messages)
89
- - Online/offline (chat, collaborative tools)
90
- - Stale/fresh (dashboards with cached data)
91
- - Pending/approved/rejected (workflow states)
92
- - New/saved/dirty (forms)
96
+ Add when the surface has matching semantics:
97
+ - `read` / `unread` — notifications, messages.
98
+ - `online` / `offline` / `connecting` — chat, presence.
99
+ - `stale` / `fresh` — dashboards with cached data.
100
+ - `pending` / `approved` / `rejected` — workflow records.
101
+ - `draft` / `saved` / `dirty` — forms, editors.
102
+ - `new` / `existing` — composers (title and CTA wording differ).
103
+ - `partial` / `complete` — multi-step flows.
104
+ - `selected` / `unselected` — lists with multi-select.
105
+ - `expired` / `active` — tokens, subscriptions.
93
106
 
94
- **Tripwire:** if the design has only `default`, you missed 8 states. If it has `default` + `loading`, you missed 6. The full matrix is non-negotiable.
107
+ ### Tripwire
95
108
 
96
- **Output:** A state matrix table in the techspec or design doc.
109
+ If your design has only `default`, you missed 8 states. If it has `default` + `loading`, you missed 6. The full enumeration is non-negotiable. Empirically, states added "later" are added after a user reports the bug.
97
110
 
98
- ## Checkpoint 4: Scene sentence
111
+ ### Output
112
+
113
+ A state matrix table in the techspec or design doc.
114
+
115
+ ## Question 4 — Who uses this surface, where, and in what mood?
99
116
 
100
117
  **Goal:** the physical context the surface lives in.
101
118
 
102
- **Format:** "**<Who>** uses this **<where>** in **<what light>** while **<what mood>**."
119
+ **Format:** "**`<Who>`** uses this on **`<where>`** in **`<what light>`** while **`<what mood>`**."
103
120
 
104
- **Examples good:**
121
+ ### Good examples
105
122
 
106
123
  - "An on-call engineer uses this on a dark-room laptop at 3am while troubleshooting a fire."
107
124
  - "A field nurse uses this on a phone in bright outdoor light while juggling clipboards."
108
- - "A receptionist uses this on a 24" monitor at a busy front desk while talking to a visitor."
125
+ - "A receptionist uses this on a 24 monitor at a busy front desk while talking to a visitor."
126
+
127
+ ### Why this matters
128
+
129
+ Decisions cascade from the answer:
109
130
 
110
- **Why this matters:**
131
+ - **3am dark room** → dark mode default, high contrast, no flashing animations, generous spacing.
132
+ - **Bright outdoor** → minimum 7:1 contrast, large touch targets, no thin fonts, no subtle hover.
133
+ - **Busy front desk** → glanceable info, no nested menus, large numbers, single-screen layout.
111
134
 
112
- Decisions cascade from the scene:
113
- - 3am dark room → dark mode, high contrast, no flashing animations.
114
- - Bright outdoor → minimum 7:1 contrast, larger touch targets, no thin fonts.
115
- - Busy front desk → glanceable info, no nested menus, big numbers.
135
+ Without the answer, defaults take over: light mode, default contrasts, animations, regular touch targets. Production users find it terrible and you can't articulate why.
116
136
 
117
- Without the scene, defaults take over: light mode, default contrasts, animations, regular touch targets. Production users hate it; you can't articulate why.
137
+ ### Output
118
138
 
119
- **Output:** Scene sentence in the techspec.
139
+ One sentence in the techspec.
120
140
 
121
- ## What "passing the gate" looks like
141
+ ## What "passing the grounding" looks like
122
142
 
123
- A PR description / techspec UI section that includes:
143
+ A PR description or techspec UI section that includes:
124
144
 
125
145
  ```markdown
126
- ## UI Discipline Gate
146
+ ## UI Discipline Grounding
127
147
 
128
- **Authority:** `.dw/rules/frontend.md` design tokens (Tailwind theme + custom CSS vars).
148
+ **Design source:** `.dw/rules/frontend.md` design tokens (Tailwind theme + custom CSS vars).
129
149
  **Surface job:** Helps on-call engineers diagnose which deploy caused the latency spike so they can roll back without paging the team.
130
150
  **State matrix:**
131
151
  - default, hover, active, focus-visible, disabled, loading, empty (no spikes detected), error (metrics API down), success (rollback completed)
132
152
  - Plus: stale (>5min old data) — show timestamp + refresh CTA.
133
- **Scene:** On-call engineer uses this on a dark-room laptop at 3am while troubleshooting a production fire.
153
+ **Context:** On-call engineer uses this on a dark-room laptop at 3am while troubleshooting a production fire.
134
154
  ```
135
155
 
136
- This is the minimum disclosure. Anything less and the gate didn't pass.
156
+ This is the minimum disclosure. Anything less and the grounding didn't pass.
137
157
 
138
- ## When this gate has been run
158
+ ## After grounding
139
159
 
140
- The downstream skills (`anti-slop.md`, `state-matrix.md`, `accessibility-floor.md`) assume gate passed. They won't re-verify; if you skipped, you get bad output.
160
+ The downstream references (`visual-slop.md`, `state-matrix.md`, `accessibility-floor.md`) assume the grounding passed. They won't re-verify; if you skipped a question, the output will reflect it.
141
161
 
142
- `/dw-code-review` failing verdict on a UI PR where this disclosure is missing.
162
+ `/dw-review --code-only` fails verdict on UI PRs where this disclosure is missing.
@@ -86,7 +86,7 @@ Before declaring the design "done":
86
86
  - [ ] `focus-visible` is distinct from `hover` (keyboard users need their own affordance).
87
87
  - [ ] Color is never the SOLE differentiator (a11y); pair with shape/text/position.
88
88
 
89
- ## Integration with `/dw-code-review`
89
+ ## Integration with `/dw-review --code-only`
90
90
 
91
91
  Review fails verdict (REJECTED) on a UI PR when:
92
92
  - A new component handles async data but renders only the default state.