dreative 0.4.0 → 0.5.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.
@@ -1,144 +1,144 @@
1
- # Dreative Specialist Skill — Functional UX (everything works)
2
-
3
- Load this file when `plan.skills` includes `ux`, for ANY product-register page,
4
- and whenever a redesign touches navigation, forms, or stateful views. It EXTENDS
5
- DESIGN.md §9 (the product floor) into a full working-page contract. Its premise:
6
- a beautiful page where the menu doesn't open, a link 404s, or an effect eats
7
- clicks is a FAILED page — visual craft cannot compensate for broken function.
8
- This skill is the reason "immersive but broken" never ships: it defines what
9
- "works" means, mechanically, and the runtime verification pass (SKILL.md) tests
10
- against it.
11
-
12
- ## 0. The working-page contract
13
-
14
- Every page you ship satisfies, verifiably:
15
-
16
- 1. Every visible control does something real (or is explicitly disabled with a
17
- reason). No dead buttons, no `href="#"`, no `onClick={() => {}}`.
18
- 2. Every navigation target resolves — internal routes exist, anchors match real
19
- ids, external links open safely (`rel="noopener"`, `target="_blank"` only
20
- for true externals).
21
- 3. Every stateful view renders all its states (loading/empty/error/success),
22
- not just the happy path.
23
- 4. Keyboard alone can operate everything a pointer can.
24
- 5. Nothing decorative intercepts input, blocks scroll, or steals focus.
25
-
26
- ## 1. Navigation
27
-
28
- - **Links resolve.** Before shipping, list every `href`/`to`/`navigate` target
29
- and check each exists (route table, file, or real URL). A designed 404 is
30
- still a 404.
31
- - **Active state**: the nav marks the current page/section (aria-current +
32
- visual). Section-scroll pages update it via IntersectionObserver.
33
- - **Mobile menu is a component, not a hope**: opens AND closes (button, Esc,
34
- backdrop click, and on route change); scroll-locks the body while open
35
- (`overflow:hidden` on html, restore on close — with scrollbar-gutter
36
- compensation so the page doesn't shift); traps focus while open and returns
37
- focus to the trigger on close; the toggle reflects state
38
- (`aria-expanded`, icon morph). Test the open→navigate→back sequence — stale
39
- open menus after route changes are the #1 shipped-menu bug.
40
- - **Anchors under fixed headers**: every in-page anchor target gets
41
- `scroll-margin-top` ≥ header height; smooth-scroll respects reduced-motion.
42
- - **Logo → home. Back button works** — spatial/SPA transitions must not break
43
- history (immersive.md §1); modals and drawers close on back where users
44
- expect it (mobile especially).
45
- - **Custom scroll (Lenis)** must not break anchors, keyboard scrolling
46
- (space/PgDn/arrows), or focus-into-view; wire `lenis.scrollTo` for anchor
47
- clicks and leave native behavior for the rest.
48
-
49
- ## 2. Forms
50
-
51
- - Every form submits somewhere real, or is explicitly wired to a stub with a
52
- visible success simulation — never a button that swallows the click.
53
- - Labels above inputs (placeholder-as-label banned, DESIGN.md §9);
54
- autocomplete attributes on identity fields; correct `type`/`inputmode`
55
- (email, tel, numeric) so mobile keyboards match.
56
- - Validate on submit first (not on first keystroke); after first submit,
57
- re-validate per field on blur/change. Errors inline, next to the field,
58
- specific ("Enter a valid email"), with `aria-describedby` wiring and focus
59
- moved to the first invalid field.
60
- - Submit feedback: button enters loading state (spinner inside, fixed width,
61
- interaction.md §5), double-submit prevented, success confirmed visibly
62
- (inline message or state change — not just a toast that may be missed),
63
- failure recoverable (inputs keep their values; never wipe a form on error).
64
- - Enter submits single-field forms (newsletter). Required fields marked; the
65
- disabled-until-valid pattern only when errors show on hover/focus of the
66
- disabled button, otherwise keep the button enabled and validate on click.
67
-
68
- ## 3. State coverage (every data view)
69
-
70
- For each list/table/feed/detail view, all four states are designed and
71
- reachable: **loading** (skeleton shaped like the content, DESIGN.md §9),
72
- **empty** (teaches the interface: what this will show + the action that fills
73
- it — never a blank area or a lonely "No data"), **error** (what happened + a
74
- retry affordance), **populated** (including the long-content case: 100 items,
75
- 40-character names, overflow handled per DESIGN.md §15). Async actions get
76
- optimistic UI only when low-stakes (DESIGN.md §6); destructive actions get
77
- confirmation and, ideally, undo instead of a scary modal.
78
-
79
- ## 4. Keyboard, focus, and the hit-area audit
80
-
81
- - Full tab walk: every interactive element reachable in visual order, operable
82
- (Enter/Space), with a visible `:focus-visible` ring (interaction.md §0), and
83
- escapable (no traps outside intentional modal traps).
84
- - Whatever hover reveals, focus reveals (cards' secondary actions, hover-woken
85
- media, dropdown menus). Custom gestures (drag, click-and-hold) always have a
86
- plain keyboard/click equivalent (cinematic.md §2).
87
- - **The pointer-events audit** (the #1 cause of "cool but broken"): walk every
88
- overlay in the stacking order — canvases, gradient/grain layers, custom
89
- cursor layers, transition curtains, closed menus, preloaders — and verify
90
- each is `pointer-events: none` (or removed from the DOM) whenever it is not
91
- actively being interacted with. A finished preloader or a closed fullscreen
92
- menu sitting at `opacity:0` with pointer-events on is an invisible wall over
93
- the whole page. Then hit-test the controls: click every button/link at its
94
- visual position — if something above it swallows the click, that's a §15
95
- spatial-integrity fail, fix the layer not the button.
96
- - Modals/drawers: focus trapped inside, Esc closes, focus returns to trigger,
97
- `aria-modal` + labelled; scrim click closes (unless data-loss risk).
98
- - Semantic HTML first: real `<button>`/`<a>`/`<nav>`/`<main>`/headings in
99
- order — divs-with-onClick fail half this section automatically.
100
-
101
- ## 5. Scroll and layout stability
102
-
103
- - Zero layout shift from async content: media boxes sized up front (media.md
104
- §5), fonts `swap` with metric-compatible fallbacks, skeletons the same size
105
- as what replaces them, no banners that push content after load.
106
- - Scroll restoration: back/forward returns to the previous position (default
107
- browser behavior — don't break it with manual scroll-to-top on every route;
108
- scroll to top only on forward navigation to a NEW page).
109
- - Fixed bars: content padded so nothing hides beneath them (DESIGN.md §15);
110
- 100dvh not 100vh; no horizontal body scroll at 320px.
111
- - Long pages get orientation aids: sticky nav or progress indication, and a
112
- footer that actually ends the page (no infinite-feeling voids).
113
-
114
- ## 6. Feedback and perceived performance
115
-
116
- - Every async action acknowledges input within 100ms (pressed state, spinner,
117
- optimistic change) — silence after a click reads as broken even when it
118
- works.
119
- - Toasts only for transient global events; they stack in ONE corner slot
120
- (DESIGN.md §15), auto-dismiss ≥ 4s, pause on hover, and are `aria-live`.
121
- - Destructive/irreversible actions: confirm with specifics ("Delete 3 items?"),
122
- never bare "Are you sure?"; prefer undo-toast over confirm-modal when safe.
123
- - Copy per DESIGN.md §8's UX-writing rules: buttons say what they do, errors
124
- say what to do next.
125
-
126
- ## 7. The functional audit (run at verification time)
127
-
128
- This is the checklist the runtime verification pass (SKILL.md) executes with
129
- browser tools — or walks mentally, file by file, when no browser exists:
130
-
131
- 1. Click every nav link + the logo; confirm each lands where labeled.
132
- 2. Open and close the mobile menu (both directions, plus Esc, plus navigate-
133
- while-open) at 390px width.
134
- 3. Submit each form empty → see inline errors; submit valid → see success
135
- state; confirm no double-submit.
136
- 4. Tab through the page start to finish; note any unreachable/invisible-focus/
137
- trapped stop.
138
- 5. Hit-test 5+ controls in effect-heavy regions (hero, canvas overlays,
139
- floating elements) — every click must land.
140
- 6. Trigger each data view's empty/error state if reachable (or verify the
141
- branch exists in code).
142
- 7. Console: zero uncaught errors during all of the above.
143
-
144
- Report the result as a pass/fail list, fix fails, re-run the failed items once.
1
+ # Dreative Specialist Skill — Functional UX (everything works)
2
+
3
+ Load this file when `plan.skills` includes `ux`, for ANY product-register page,
4
+ and whenever a redesign touches navigation, forms, or stateful views. It EXTENDS
5
+ DESIGN.md §9 (the product floor) into a full working-page contract. Its premise:
6
+ a beautiful page where the menu doesn't open, a link 404s, or an effect eats
7
+ clicks is a FAILED page — visual craft cannot compensate for broken function.
8
+ This skill is the reason "immersive but broken" never ships: it defines what
9
+ "works" means, mechanically, and the runtime verification pass (SKILL.md) tests
10
+ against it.
11
+
12
+ ## 0. The working-page contract
13
+
14
+ Every page you ship satisfies, verifiably:
15
+
16
+ 1. Every visible control does something real (or is explicitly disabled with a
17
+ reason). No dead buttons, no `href="#"`, no `onClick={() => {}}`.
18
+ 2. Every navigation target resolves — internal routes exist, anchors match real
19
+ ids, external links open safely (`rel="noopener"`, `target="_blank"` only
20
+ for true externals).
21
+ 3. Every stateful view renders all its states (loading/empty/error/success),
22
+ not just the happy path.
23
+ 4. Keyboard alone can operate everything a pointer can.
24
+ 5. Nothing decorative intercepts input, blocks scroll, or steals focus.
25
+
26
+ ## 1. Navigation
27
+
28
+ - **Links resolve.** Before shipping, list every `href`/`to`/`navigate` target
29
+ and check each exists (route table, file, or real URL). A designed 404 is
30
+ still a 404.
31
+ - **Active state**: the nav marks the current page/section (aria-current +
32
+ visual). Section-scroll pages update it via IntersectionObserver.
33
+ - **Mobile menu is a component, not a hope**: opens AND closes (button, Esc,
34
+ backdrop click, and on route change); scroll-locks the body while open
35
+ (`overflow:hidden` on html, restore on close — with scrollbar-gutter
36
+ compensation so the page doesn't shift); traps focus while open and returns
37
+ focus to the trigger on close; the toggle reflects state
38
+ (`aria-expanded`, icon morph). Test the open→navigate→back sequence — stale
39
+ open menus after route changes are the #1 shipped-menu bug.
40
+ - **Anchors under fixed headers**: every in-page anchor target gets
41
+ `scroll-margin-top` ≥ header height; smooth-scroll respects reduced-motion.
42
+ - **Logo → home. Back button works** — spatial/SPA transitions must not break
43
+ history (immersive.md §1); modals and drawers close on back where users
44
+ expect it (mobile especially).
45
+ - **Custom scroll (Lenis)** must not break anchors, keyboard scrolling
46
+ (space/PgDn/arrows), or focus-into-view; wire `lenis.scrollTo` for anchor
47
+ clicks and leave native behavior for the rest.
48
+
49
+ ## 2. Forms
50
+
51
+ - Every form submits somewhere real, or is explicitly wired to a stub with a
52
+ visible success simulation — never a button that swallows the click.
53
+ - Labels above inputs (placeholder-as-label banned, DESIGN.md §9);
54
+ autocomplete attributes on identity fields; correct `type`/`inputmode`
55
+ (email, tel, numeric) so mobile keyboards match.
56
+ - Validate on submit first (not on first keystroke); after first submit,
57
+ re-validate per field on blur/change. Errors inline, next to the field,
58
+ specific ("Enter a valid email"), with `aria-describedby` wiring and focus
59
+ moved to the first invalid field.
60
+ - Submit feedback: button enters loading state (spinner inside, fixed width,
61
+ interaction.md §5), double-submit prevented, success confirmed visibly
62
+ (inline message or state change — not just a toast that may be missed),
63
+ failure recoverable (inputs keep their values; never wipe a form on error).
64
+ - Enter submits single-field forms (newsletter). Required fields marked; the
65
+ disabled-until-valid pattern only when errors show on hover/focus of the
66
+ disabled button, otherwise keep the button enabled and validate on click.
67
+
68
+ ## 3. State coverage (every data view)
69
+
70
+ For each list/table/feed/detail view, all four states are designed and
71
+ reachable: **loading** (skeleton shaped like the content, DESIGN.md §9),
72
+ **empty** (teaches the interface: what this will show + the action that fills
73
+ it — never a blank area or a lonely "No data"), **error** (what happened + a
74
+ retry affordance), **populated** (including the long-content case: 100 items,
75
+ 40-character names, overflow handled per DESIGN.md §15). Async actions get
76
+ optimistic UI only when low-stakes (DESIGN.md §6); destructive actions get
77
+ confirmation and, ideally, undo instead of a scary modal.
78
+
79
+ ## 4. Keyboard, focus, and the hit-area audit
80
+
81
+ - Full tab walk: every interactive element reachable in visual order, operable
82
+ (Enter/Space), with a visible `:focus-visible` ring (interaction.md §0), and
83
+ escapable (no traps outside intentional modal traps).
84
+ - Whatever hover reveals, focus reveals (cards' secondary actions, hover-woken
85
+ media, dropdown menus). Custom gestures (drag, click-and-hold) always have a
86
+ plain keyboard/click equivalent (cinematic.md §2).
87
+ - **The pointer-events audit** (the #1 cause of "cool but broken"): walk every
88
+ overlay in the stacking order — canvases, gradient/grain layers, custom
89
+ cursor layers, transition curtains, closed menus, preloaders — and verify
90
+ each is `pointer-events: none` (or removed from the DOM) whenever it is not
91
+ actively being interacted with. A finished preloader or a closed fullscreen
92
+ menu sitting at `opacity:0` with pointer-events on is an invisible wall over
93
+ the whole page. Then hit-test the controls: click every button/link at its
94
+ visual position — if something above it swallows the click, that's a §15
95
+ spatial-integrity fail, fix the layer not the button.
96
+ - Modals/drawers: focus trapped inside, Esc closes, focus returns to trigger,
97
+ `aria-modal` + labelled; scrim click closes (unless data-loss risk).
98
+ - Semantic HTML first: real `<button>`/`<a>`/`<nav>`/`<main>`/headings in
99
+ order — divs-with-onClick fail half this section automatically.
100
+
101
+ ## 5. Scroll and layout stability
102
+
103
+ - Zero layout shift from async content: media boxes sized up front (media.md
104
+ §5), fonts `swap` with metric-compatible fallbacks, skeletons the same size
105
+ as what replaces them, no banners that push content after load.
106
+ - Scroll restoration: back/forward returns to the previous position (default
107
+ browser behavior — don't break it with manual scroll-to-top on every route;
108
+ scroll to top only on forward navigation to a NEW page).
109
+ - Fixed bars: content padded so nothing hides beneath them (DESIGN.md §15);
110
+ 100dvh not 100vh; no horizontal body scroll at 320px.
111
+ - Long pages get orientation aids: sticky nav or progress indication, and a
112
+ footer that actually ends the page (no infinite-feeling voids).
113
+
114
+ ## 6. Feedback and perceived performance
115
+
116
+ - Every async action acknowledges input within 100ms (pressed state, spinner,
117
+ optimistic change) — silence after a click reads as broken even when it
118
+ works.
119
+ - Toasts only for transient global events; they stack in ONE corner slot
120
+ (DESIGN.md §15), auto-dismiss ≥ 4s, pause on hover, and are `aria-live`.
121
+ - Destructive/irreversible actions: confirm with specifics ("Delete 3 items?"),
122
+ never bare "Are you sure?"; prefer undo-toast over confirm-modal when safe.
123
+ - Copy per DESIGN.md §8's UX-writing rules: buttons say what they do, errors
124
+ say what to do next.
125
+
126
+ ## 7. The functional audit (run at verification time)
127
+
128
+ This is the checklist the runtime verification pass (SKILL.md) executes with
129
+ browser tools — or walks mentally, file by file, when no browser exists:
130
+
131
+ 1. Click every nav link + the logo; confirm each lands where labeled.
132
+ 2. Open and close the mobile menu (both directions, plus Esc, plus navigate-
133
+ while-open) at 390px width.
134
+ 3. Submit each form empty → see inline errors; submit valid → see success
135
+ state; confirm no double-submit.
136
+ 4. Tab through the page start to finish; note any unreachable/invisible-focus/
137
+ trapped stop.
138
+ 5. Hit-test 5+ controls in effect-heavy regions (hero, canvas overlays,
139
+ floating elements) — every click must land.
140
+ 6. Trigger each data view's empty/error state if reachable (or verify the
141
+ branch exists in code).
142
+ 7. Console: zero uncaught errors during all of the above.
143
+
144
+ Report the result as a pass/fail list, fix fails, re-run the failed items once.