@brunosps00/dev-workflow 0.13.0 → 0.15.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/README.md +9 -3
- package/package.json +1 -1
- package/scaffold/en/commands/dw-bugfix.md +2 -1
- package/scaffold/en/commands/dw-code-review.md +1 -0
- package/scaffold/en/commands/dw-create-tasks.md +6 -0
- package/scaffold/en/commands/dw-deps-audit.md +1 -1
- package/scaffold/en/commands/dw-fix-qa.md +1 -1
- package/scaffold/en/commands/dw-functional-doc.md +1 -1
- package/scaffold/en/commands/dw-help.md +1 -1
- package/scaffold/en/commands/dw-redesign-ui.md +1 -1
- package/scaffold/en/commands/dw-run-qa.md +2 -1
- package/scaffold/en/commands/dw-run-task.md +1 -1
- package/scaffold/pt-br/commands/dw-bugfix.md +2 -1
- package/scaffold/pt-br/commands/dw-code-review.md +1 -0
- package/scaffold/pt-br/commands/dw-create-tasks.md +6 -0
- package/scaffold/pt-br/commands/dw-deps-audit.md +1 -1
- package/scaffold/pt-br/commands/dw-fix-qa.md +1 -1
- package/scaffold/pt-br/commands/dw-functional-doc.md +1 -1
- package/scaffold/pt-br/commands/dw-help.md +1 -1
- package/scaffold/pt-br/commands/dw-redesign-ui.md +1 -1
- package/scaffold/pt-br/commands/dw-run-qa.md +2 -1
- package/scaffold/pt-br/commands/dw-run-task.md +1 -1
- package/scaffold/skills/dw-incident-response/SKILL.md +164 -0
- package/scaffold/skills/dw-incident-response/references/blameless-discipline.md +126 -0
- package/scaffold/skills/dw-incident-response/references/communication-templates.md +107 -0
- package/scaffold/skills/dw-incident-response/references/postmortem-template.md +133 -0
- package/scaffold/skills/dw-incident-response/references/runbook-templates.md +169 -0
- package/scaffold/skills/dw-incident-response/references/severity-and-triage.md +186 -0
- package/scaffold/skills/dw-llm-eval/SKILL.md +148 -0
- package/scaffold/skills/dw-llm-eval/references/agent-eval.md +252 -0
- package/scaffold/skills/dw-llm-eval/references/judge-calibration.md +169 -0
- package/scaffold/skills/dw-llm-eval/references/oracle-ladder.md +171 -0
- package/scaffold/skills/dw-llm-eval/references/rag-metrics.md +186 -0
- package/scaffold/skills/dw-llm-eval/references/reference-dataset.md +190 -0
- package/scaffold/skills/dw-testing-discipline/SKILL.md +99 -76
- package/scaffold/skills/dw-testing-discipline/references/agent-guardrails.md +170 -0
- package/scaffold/skills/dw-testing-discipline/references/anti-patterns.md +6 -6
- package/scaffold/skills/dw-testing-discipline/references/core-rules.md +128 -0
- package/scaffold/skills/dw-testing-discipline/references/playwright-recipes.md +2 -2
- package/scaffold/skills/dw-ui-discipline/SKILL.md +101 -79
- package/scaffold/skills/dw-ui-discipline/references/hard-gate.md +93 -73
- package/scaffold/skills/dw-ui-discipline/references/visual-slop.md +152 -0
- package/scaffold/skills/dw-testing-discipline/references/ai-agent-gates.md +0 -170
- package/scaffold/skills/dw-testing-discipline/references/iron-laws.md +0 -128
- package/scaffold/skills/dw-ui-discipline/references/anti-slop.md +0 -162
- /package/scaffold/skills/dw-testing-discipline/references/{positive-patterns.md → patterns.md} +0 -0
|
@@ -1,128 +1,150 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dw-ui-discipline
|
|
3
|
-
description: Use BEFORE any UI work —
|
|
3
|
+
description: Use BEFORE any UI work — runs a 4-question grounding (where do design decisions come from, what does this surface help the user do, what states does it have, who uses it where), then enforces the WCAG 2.2 AA floor and 14 visual-slop checks so UI ships with intent instead of training-data defaults.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# UI Discipline
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
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
9
|
|
|
10
|
-
|
|
10
|
+
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
11
|
|
|
12
|
-
## When
|
|
12
|
+
## When to use
|
|
13
13
|
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- Inside `/dw-redesign-ui` — both proposal and validation steps.
|
|
15
|
+
- Inside `/dw-create-techspec` when the spec has UI sections.
|
|
16
|
+
- Inside `/dw-functional-doc` when documenting screen-level patterns.
|
|
17
|
+
- Inside `/dw-code-review` when the diff touches UI files (CSS, JSX, templates).
|
|
18
|
+
- Inside `/dw-brainstorm` when the conversation drifts into visual direction.
|
|
18
19
|
|
|
19
|
-
If you're tempted to skip
|
|
20
|
+
If you're tempted to skip this "because it's just a small tweak" — that's the trigger. Run the grounding.
|
|
20
21
|
|
|
21
|
-
## The
|
|
22
|
+
## The four grounding questions
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Answer all four before proposing colors, layouts, components, or any visual decision.
|
|
24
25
|
|
|
25
|
-
### 1.
|
|
26
|
+
### 1. Where do design decisions come from?
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
Find the project's design source-of-truth in this order:
|
|
29
|
+
1. `.dw/rules/<frontend-module>.md` design system section.
|
|
30
|
+
2. `DESIGN.md`, `BRAND.md`, `STYLE_GUIDE.md` at project root.
|
|
31
|
+
3. Design token config — Tailwind theme, CSS variables in `theme.css`/`globals.css`, MUI/Chakra theme.
|
|
32
|
+
4. Component library config — `components.json` for shadcn, theme exports.
|
|
33
|
+
5. Storybook stories (implicit canonical components).
|
|
31
34
|
|
|
32
|
-
If **
|
|
35
|
+
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
36
|
|
|
34
|
-
|
|
37
|
+
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
38
|
|
|
36
|
-
|
|
39
|
+
**Anti-patterns at this question:**
|
|
40
|
+
- Inventing color hex values inline (`bg-[#FF6B35]`).
|
|
41
|
+
- "I'll use Tailwind defaults" — that's training-data defaults, not project authority.
|
|
42
|
+
- Copying values from "a site I like" without understanding what it solved.
|
|
43
|
+
|
|
44
|
+
### 2. What does this surface help the user do?
|
|
45
|
+
|
|
46
|
+
Write one sentence: **"This surface helps the user `<verb-phrase>` so that `<outcome>`."**
|
|
47
|
+
|
|
48
|
+
Good examples:
|
|
49
|
+
- "...helps the user filter overdue invoices so they can chase late payers in under 30 seconds."
|
|
50
|
+
- "...helps the on-call engineer diagnose which deploy caused the spike so they can roll back without paging the team."
|
|
51
|
+
- "...helps the manager approve or reject expense reports without leaving Slack."
|
|
52
|
+
|
|
53
|
+
Bad examples:
|
|
54
|
+
- "This surface displays invoice data." (no user, no outcome)
|
|
55
|
+
- "Settings page for managing the account." (vague, no specificity)
|
|
56
|
+
- "Dashboard." (one word)
|
|
37
57
|
|
|
38
58
|
If you can't write the sentence, the requirements are unclear. Stop and clarify before proceeding.
|
|
39
59
|
|
|
40
|
-
### 3.
|
|
60
|
+
### 3. What states does the surface have?
|
|
61
|
+
|
|
62
|
+
Enumerate all states before designing the happy path. Minimum nine, plus domain-specific ones — see `references/state-matrix.md`:
|
|
41
63
|
|
|
42
|
-
|
|
43
|
-
- `default`, `hover`, `active`, `focus-visible`, `disabled`, `loading`, `empty`, `error`, `success`
|
|
44
|
-
- Plus any domain-specific states (read/unread, online/offline, etc.)
|
|
64
|
+
`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
65
|
|
|
46
66
|
Missing a state at design time = production bug later. The "we'll add empty state later" trap is real.
|
|
47
67
|
|
|
48
|
-
### 4.
|
|
68
|
+
### 4. Who uses this surface, where, and in what mood?
|
|
49
69
|
|
|
50
|
-
One sentence
|
|
70
|
+
One sentence: **"`<Who>` uses this on `<where>` in `<what light>` while `<what mood>`."**
|
|
51
71
|
|
|
52
|
-
|
|
72
|
+
Good examples:
|
|
73
|
+
- "An on-call engineer uses this on a dark-room laptop at 3am while troubleshooting a fire."
|
|
74
|
+
- "A field nurse uses this on a phone in bright outdoor light while juggling clipboards."
|
|
75
|
+
- "A receptionist uses this on a 24″ monitor at a busy front desk while talking to a visitor."
|
|
53
76
|
|
|
54
|
-
|
|
77
|
+
Decisions cascade from the answer:
|
|
78
|
+
- 3am dark room → dark mode, high contrast, no flashing animations.
|
|
79
|
+
- Bright outdoor → minimum 7:1 contrast, larger touch targets, no thin fonts.
|
|
80
|
+
- Busy front desk → glanceable info, no nested menus, large numbers.
|
|
55
81
|
|
|
56
|
-
|
|
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) |
|
|
82
|
+
Without this sentence, defaults take over: light mode, default contrasts, animations, regular touch targets. Production users hate it; you can't articulate why.
|
|
63
83
|
|
|
64
|
-
##
|
|
84
|
+
## Required reading by context
|
|
65
85
|
|
|
66
|
-
|
|
86
|
+
| Doing what | Read |
|
|
87
|
+
|------------|------|
|
|
88
|
+
| Any UI work (the full version of the grounding) | `references/hard-gate.md` |
|
|
89
|
+
| Reviewing or proposing a design | `references/visual-slop.md` (14 patterns + specific anti-default values) |
|
|
90
|
+
| Designing state coverage | `references/state-matrix.md` |
|
|
91
|
+
| Interactive widget (button, form, modal, anything clickable) | `references/accessibility-floor.md` |
|
|
92
|
+
| No design authority exists in the project | `references/curated-defaults.md` (palettes / fonts / scales) |
|
|
67
93
|
|
|
68
|
-
|
|
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.
|
|
94
|
+
## The 14 visual-slop patterns (full catalog in `references/visual-slop.md`)
|
|
82
95
|
|
|
83
|
-
|
|
96
|
+
Watch for these in proposed designs and PR diffs:
|
|
97
|
+
|
|
98
|
+
1. **Uniform-section flatness** — every section looks like every other section; no anchor for the eye.
|
|
99
|
+
2. **Soft hierarchy** — headings barely larger than body; primary CTA same color as secondary.
|
|
100
|
+
3. **Decorative hover** — hover states that don't change anything functional or clickable.
|
|
101
|
+
4. **Emoji as ornament** — emojis in headers, CTAs, section labels where they add no information.
|
|
102
|
+
5. **Gradient cover** — gradients used to mask weak composition rather than serve a poetic hero.
|
|
103
|
+
6. **Glass-on-everything** — frosted-glass effect on every panel, including ones with nothing behind.
|
|
104
|
+
7. **Center-aligned by default** — body paragraphs and forms reading center where left would read better.
|
|
105
|
+
8. **Grayscale wash** — neutral grays everywhere, no accent personality, no character.
|
|
106
|
+
9. **Verb-less CTAs** — "Get Started", "Learn More", "Click Here", "Submit", "OK".
|
|
107
|
+
10. **Stock-illustration hero** — figure-with-laptop, diverse-team-around-table, abstract floating shapes.
|
|
108
|
+
11. **Shadow soup** — shadows on cards on shadows on borders on gradients on one element.
|
|
109
|
+
12. **Generic spinner** — wall-clock spinner as the only loading state for every operation.
|
|
110
|
+
13. **Silent empty state** — "No items found." centered. Nothing else. No guidance.
|
|
111
|
+
14. **Toast everywhere** — every UI event becomes a toast; five stack up and none get read.
|
|
112
|
+
|
|
113
|
+
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
114
|
|
|
85
115
|
## Accessibility floor — non-negotiable
|
|
86
116
|
|
|
87
117
|
Before any interactive widget ships:
|
|
88
118
|
|
|
89
|
-
- [ ] Color contrast meets WCAG 2.2 AA (4.5:1
|
|
90
|
-
- [ ] Focus-visible state
|
|
91
|
-
- [ ] Keyboard navigation works
|
|
119
|
+
- [ ] Color contrast meets WCAG 2.2 AA (4.5:1 body, 3:1 large text and UI components).
|
|
120
|
+
- [ ] Focus-visible state distinct from hover.
|
|
121
|
+
- [ ] Keyboard navigation works end-to-end.
|
|
92
122
|
- [ ] ARIA labels for icon-only buttons.
|
|
93
|
-
- [ ] Form errors
|
|
123
|
+
- [ ] Form errors announced to screen readers.
|
|
94
124
|
- [ ] No keyboard traps.
|
|
125
|
+
- [ ] Touch targets ≥24×24 CSS pixels (≥44×44 recommended on mobile).
|
|
126
|
+
- [ ] Heading hierarchy is semantic (no skipped levels).
|
|
127
|
+
- [ ] `prefers-reduced-motion` honored.
|
|
95
128
|
|
|
96
|
-
Full verification recipes in `references/accessibility-floor.md`.
|
|
97
|
-
|
|
98
|
-
## When the gate bends
|
|
129
|
+
Full verification recipes in `references/accessibility-floor.md`. `/dw-code-review` rejects the verdict if any interactive widget ships without these.
|
|
99
130
|
|
|
100
|
-
|
|
131
|
+
## When the grounding bends
|
|
101
132
|
|
|
102
|
-
- **Bug fix in existing UI** —
|
|
103
|
-
- **Pure copy change** —
|
|
104
|
-
- **
|
|
133
|
+
- **Bug fix in existing UI** — grounding applies only to the area touched, not the whole surface.
|
|
134
|
+
- **Pure copy change** — only the "what does this help the user do" question still applies as a sanity check.
|
|
135
|
+
- **Throwaway spike** — grounding skippable if the spike is explicitly marked non-production.
|
|
105
136
|
|
|
106
|
-
In all bend cases, document the bend in the PR
|
|
137
|
+
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
138
|
|
|
108
139
|
## Integration with dev-workflow commands
|
|
109
140
|
|
|
110
|
-
- `/dw-redesign-ui` runs the
|
|
111
|
-
- `/dw-create-techspec` UI sections must
|
|
112
|
-
- `/dw-code-review` checks
|
|
113
|
-
- `/dw-functional-doc`
|
|
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.
|
|
141
|
+
- `/dw-redesign-ui` runs the grounding end-to-end. Steps 4 (propose) and 7 (validate) consult this skill explicitly.
|
|
142
|
+
- `/dw-create-techspec` UI sections must answer the 4 grounding questions and reference the state matrix.
|
|
143
|
+
- `/dw-code-review` checks UI diffs against the 14 visual-slop patterns and the accessibility floor.
|
|
144
|
+
- `/dw-functional-doc` records the surface-job and scene sentences in the overview for each screen.
|
|
123
145
|
|
|
124
|
-
## Why this
|
|
146
|
+
## Why this approach
|
|
125
147
|
|
|
126
|
-
The
|
|
148
|
+
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
149
|
|
|
128
|
-
|
|
150
|
+
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,142 +1,162 @@
|
|
|
1
|
-
# The
|
|
1
|
+
# The grounding protocol — full version
|
|
2
2
|
|
|
3
|
-
Four
|
|
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
|
|
5
|
+
## Why the grounding matters
|
|
6
6
|
|
|
7
|
-
Training-data defaults
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
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
|
|
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
|
-
##
|
|
14
|
+
## Question 1 — Where do design decisions come from?
|
|
15
15
|
|
|
16
|
-
**Goal:** know
|
|
16
|
+
**Goal:** know the source of truth for visual values. Documented authority, or curated default — never invented.
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### How to find it
|
|
19
19
|
|
|
20
|
-
|
|
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
|
-
|
|
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
|
-
|
|
28
|
+
### What to do based on what you find
|
|
31
29
|
|
|
32
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
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
|
-
|
|
42
|
+
### Output
|
|
43
|
+
|
|
44
|
+
A one-sentence note in the techspec or PR describing which authority you consulted.
|
|
41
45
|
|
|
42
|
-
##
|
|
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
|
|
50
|
+
**Format:** "This surface helps the user **`<verb-phrase>`** so that **`<outcome>`**."
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
### Good examples
|
|
49
53
|
|
|
50
|
-
- "
|
|
51
|
-
- "
|
|
52
|
-
- "
|
|
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
|
-
|
|
58
|
+
### Bad examples
|
|
55
59
|
|
|
56
|
-
- "This surface displays invoice data."
|
|
57
|
-
- "Settings page for managing the account."
|
|
58
|
-
- "Dashboard."
|
|
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
|
-
|
|
64
|
+
### When the brief is vague
|
|
61
65
|
|
|
62
|
-
If
|
|
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
|
-
|
|
72
|
+
### Output
|
|
73
|
+
|
|
74
|
+
One sentence in the techspec/PR description.
|
|
67
75
|
|
|
68
|
-
##
|
|
76
|
+
## Question 3 — What states does the surface have?
|
|
69
77
|
|
|
70
|
-
**Goal:** enumerate every state the surface can be in
|
|
78
|
+
**Goal:** enumerate every state the surface can be in BEFORE designing for the happy path.
|
|
71
79
|
|
|
72
|
-
|
|
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
|
|
79
|
-
| `focus-visible` | Keyboard tab
|
|
80
|
-
| `disabled` | Interaction unavailable | Reduced opacity + cursor change
|
|
81
|
-
| `loading` | Async operation in flight | Skeleton, spinner, or progress
|
|
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
|
|
92
|
+
| `success` | Operation succeeded | Confirmation; auto-dismiss when safe |
|
|
85
93
|
|
|
86
|
-
|
|
94
|
+
### Domain-specific states
|
|
87
95
|
|
|
88
|
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
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
|
-
|
|
107
|
+
### Tripwire
|
|
95
108
|
|
|
96
|
-
|
|
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
|
-
|
|
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:** "
|
|
119
|
+
**Format:** "**`<Who>`** uses this on **`<where>`** in **`<what light>`** while **`<what mood>`**."
|
|
103
120
|
|
|
104
|
-
|
|
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
|
|
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
|
-
**
|
|
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
|
-
|
|
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
|
-
|
|
137
|
+
### Output
|
|
118
138
|
|
|
119
|
-
|
|
139
|
+
One sentence in the techspec.
|
|
120
140
|
|
|
121
|
-
## What "passing the
|
|
141
|
+
## What "passing the grounding" looks like
|
|
122
142
|
|
|
123
|
-
A PR description
|
|
143
|
+
A PR description or techspec UI section that includes:
|
|
124
144
|
|
|
125
145
|
```markdown
|
|
126
|
-
## UI Discipline
|
|
146
|
+
## UI Discipline Grounding
|
|
127
147
|
|
|
128
|
-
**
|
|
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
|
-
**
|
|
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
|
|
156
|
+
This is the minimum disclosure. Anything less and the grounding didn't pass.
|
|
137
157
|
|
|
138
|
-
##
|
|
158
|
+
## After grounding
|
|
139
159
|
|
|
140
|
-
The downstream
|
|
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`
|
|
162
|
+
`/dw-code-review` fails verdict on UI PRs where this disclosure is missing.
|