niahere 0.2.61 → 0.2.63

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 (186) hide show
  1. package/defaults/memory-promoter.md +99 -0
  2. package/defaults/self/staging.md +48 -0
  3. package/package.json +7 -3
  4. package/skills/code-review/pr-review.md +14 -1
  5. package/skills/cro/page.md +22 -0
  6. package/skills/frontend-design/SKILL.md +7 -3
  7. package/skills/frontend-design/building.md +17 -2
  8. package/skills/qa/SKILL.md +108 -72
  9. package/skills/userinterface-wiki/AGENTS.md +3749 -0
  10. package/skills/userinterface-wiki/SKILL.md +253 -0
  11. package/skills/userinterface-wiki/metadata.json +26 -0
  12. package/skills/userinterface-wiki/rules/_sections.md +66 -0
  13. package/skills/userinterface-wiki/rules/_template.md +24 -0
  14. package/skills/userinterface-wiki/rules/a11y-reduced-motion-check.md +30 -0
  15. package/skills/userinterface-wiki/rules/a11y-toggle-setting.md +30 -0
  16. package/skills/userinterface-wiki/rules/a11y-visual-equivalent.md +36 -0
  17. package/skills/userinterface-wiki/rules/a11y-volume-control.md +28 -0
  18. package/skills/userinterface-wiki/rules/appropriate-confirmations-only.md +19 -0
  19. package/skills/userinterface-wiki/rules/appropriate-errors-warnings.md +18 -0
  20. package/skills/userinterface-wiki/rules/appropriate-no-decorative.md +21 -0
  21. package/skills/userinterface-wiki/rules/appropriate-no-high-frequency.md +28 -0
  22. package/skills/userinterface-wiki/rules/appropriate-no-punishing.md +27 -0
  23. package/skills/userinterface-wiki/rules/container-callback-ref.md +31 -0
  24. package/skills/userinterface-wiki/rules/container-guard-initial-zero.md +25 -0
  25. package/skills/userinterface-wiki/rules/container-no-excessive-use.md +13 -0
  26. package/skills/userinterface-wiki/rules/container-overflow-hidden.md +25 -0
  27. package/skills/userinterface-wiki/rules/container-transition-delay.md +21 -0
  28. package/skills/userinterface-wiki/rules/container-two-div-pattern.md +35 -0
  29. package/skills/userinterface-wiki/rules/container-use-resize-observer.md +48 -0
  30. package/skills/userinterface-wiki/rules/context-cleanup-nodes.md +25 -0
  31. package/skills/userinterface-wiki/rules/context-resume-suspended.md +28 -0
  32. package/skills/userinterface-wiki/rules/context-reuse-single.md +30 -0
  33. package/skills/userinterface-wiki/rules/design-filter-for-character.md +25 -0
  34. package/skills/userinterface-wiki/rules/design-noise-for-percussion.md +26 -0
  35. package/skills/userinterface-wiki/rules/design-oscillator-for-tonal.md +22 -0
  36. package/skills/userinterface-wiki/rules/duration-max-300ms.md +21 -0
  37. package/skills/userinterface-wiki/rules/duration-press-hover.md +21 -0
  38. package/skills/userinterface-wiki/rules/duration-shorten-before-curve.md +21 -0
  39. package/skills/userinterface-wiki/rules/duration-small-state.md +15 -0
  40. package/skills/userinterface-wiki/rules/easing-entrance-ease-out.md +21 -0
  41. package/skills/userinterface-wiki/rules/easing-exit-ease-in.md +21 -0
  42. package/skills/userinterface-wiki/rules/easing-for-state-change.md +27 -0
  43. package/skills/userinterface-wiki/rules/easing-linear-only-progress.md +21 -0
  44. package/skills/userinterface-wiki/rules/easing-natural-decay.md +22 -0
  45. package/skills/userinterface-wiki/rules/easing-no-linear-motion.md +22 -0
  46. package/skills/userinterface-wiki/rules/easing-transition-ease-in-out.md +15 -0
  47. package/skills/userinterface-wiki/rules/envelope-exponential-decay.md +21 -0
  48. package/skills/userinterface-wiki/rules/envelope-no-zero-target.md +21 -0
  49. package/skills/userinterface-wiki/rules/envelope-set-initial-value.md +22 -0
  50. package/skills/userinterface-wiki/rules/exit-key-required.md +29 -0
  51. package/skills/userinterface-wiki/rules/exit-matches-initial.md +29 -0
  52. package/skills/userinterface-wiki/rules/exit-prop-required.md +33 -0
  53. package/skills/userinterface-wiki/rules/exit-requires-wrapper.md +27 -0
  54. package/skills/userinterface-wiki/rules/impl-default-subtle.md +21 -0
  55. package/skills/userinterface-wiki/rules/impl-preload-audio.md +34 -0
  56. package/skills/userinterface-wiki/rules/impl-reset-current-time.md +26 -0
  57. package/skills/userinterface-wiki/rules/mode-pop-layout-for-lists.md +25 -0
  58. package/skills/userinterface-wiki/rules/mode-sync-layout-conflict.md +29 -0
  59. package/skills/userinterface-wiki/rules/mode-wait-doubles-duration.md +25 -0
  60. package/skills/userinterface-wiki/rules/morphing-aria-hidden.md +21 -0
  61. package/skills/userinterface-wiki/rules/morphing-consistent-viewbox.md +23 -0
  62. package/skills/userinterface-wiki/rules/morphing-group-variants.md +33 -0
  63. package/skills/userinterface-wiki/rules/morphing-jump-non-grouped.md +29 -0
  64. package/skills/userinterface-wiki/rules/morphing-reduced-motion.md +28 -0
  65. package/skills/userinterface-wiki/rules/morphing-spring-rotation.md +23 -0
  66. package/skills/userinterface-wiki/rules/morphing-strokelinecap-round.md +21 -0
  67. package/skills/userinterface-wiki/rules/morphing-three-lines.md +32 -0
  68. package/skills/userinterface-wiki/rules/morphing-use-collapsed.md +33 -0
  69. package/skills/userinterface-wiki/rules/native-backdrop-styling.md +27 -0
  70. package/skills/userinterface-wiki/rules/native-placeholder-styling.md +27 -0
  71. package/skills/userinterface-wiki/rules/native-selection-styling.md +18 -0
  72. package/skills/userinterface-wiki/rules/nested-consistent-timing.md +25 -0
  73. package/skills/userinterface-wiki/rules/nested-propagate-required.md +41 -0
  74. package/skills/userinterface-wiki/rules/none-context-menu-entrance.md +25 -0
  75. package/skills/userinterface-wiki/rules/none-high-frequency.md +29 -0
  76. package/skills/userinterface-wiki/rules/none-keyboard-navigation.md +32 -0
  77. package/skills/userinterface-wiki/rules/param-click-duration.md +21 -0
  78. package/skills/userinterface-wiki/rules/param-filter-frequency-range.md +21 -0
  79. package/skills/userinterface-wiki/rules/param-q-value-range.md +21 -0
  80. package/skills/userinterface-wiki/rules/param-reasonable-gain.md +21 -0
  81. package/skills/userinterface-wiki/rules/physics-active-state.md +23 -0
  82. package/skills/userinterface-wiki/rules/physics-no-excessive-stagger.md +22 -0
  83. package/skills/userinterface-wiki/rules/physics-spring-for-overshoot.md +23 -0
  84. package/skills/userinterface-wiki/rules/physics-subtle-deformation.md +22 -0
  85. package/skills/userinterface-wiki/rules/prefetch-hit-slop.md +27 -0
  86. package/skills/userinterface-wiki/rules/prefetch-keyboard-tab.md +19 -0
  87. package/skills/userinterface-wiki/rules/prefetch-not-everything.md +22 -0
  88. package/skills/userinterface-wiki/rules/prefetch-touch-fallback.md +34 -0
  89. package/skills/userinterface-wiki/rules/prefetch-trajectory-over-hover.md +32 -0
  90. package/skills/userinterface-wiki/rules/prefetch-use-selectively.md +13 -0
  91. package/skills/userinterface-wiki/rules/presence-disable-interactions.md +31 -0
  92. package/skills/userinterface-wiki/rules/presence-hook-in-child.md +31 -0
  93. package/skills/userinterface-wiki/rules/presence-safe-to-remove.md +37 -0
  94. package/skills/userinterface-wiki/rules/pseudo-content-required.md +28 -0
  95. package/skills/userinterface-wiki/rules/pseudo-first-line-styling.md +27 -0
  96. package/skills/userinterface-wiki/rules/pseudo-hit-target-expansion.md +31 -0
  97. package/skills/userinterface-wiki/rules/pseudo-marker-styling.md +28 -0
  98. package/skills/userinterface-wiki/rules/pseudo-over-dom-node.md +32 -0
  99. package/skills/userinterface-wiki/rules/pseudo-position-relative-parent.md +33 -0
  100. package/skills/userinterface-wiki/rules/pseudo-z-index-layering.md +37 -0
  101. package/skills/userinterface-wiki/rules/spring-for-gestures.md +27 -0
  102. package/skills/userinterface-wiki/rules/spring-for-interruptible.md +27 -0
  103. package/skills/userinterface-wiki/rules/spring-params-balanced.md +29 -0
  104. package/skills/userinterface-wiki/rules/spring-preserves-velocity.md +28 -0
  105. package/skills/userinterface-wiki/rules/staging-dim-background.md +22 -0
  106. package/skills/userinterface-wiki/rules/staging-one-focal-point.md +24 -0
  107. package/skills/userinterface-wiki/rules/staging-z-index-hierarchy.md +22 -0
  108. package/skills/userinterface-wiki/rules/timing-consistent.md +24 -0
  109. package/skills/userinterface-wiki/rules/timing-no-entrance-context-menu.md +22 -0
  110. package/skills/userinterface-wiki/rules/timing-under-300ms.md +22 -0
  111. package/skills/userinterface-wiki/rules/transition-name-cleanup.md +28 -0
  112. package/skills/userinterface-wiki/rules/transition-name-required.md +27 -0
  113. package/skills/userinterface-wiki/rules/transition-name-unique.md +24 -0
  114. package/skills/userinterface-wiki/rules/transition-over-js-library.md +32 -0
  115. package/skills/userinterface-wiki/rules/transition-style-pseudo-elements.md +24 -0
  116. package/skills/userinterface-wiki/rules/type-antialiased-on-retina.md +18 -0
  117. package/skills/userinterface-wiki/rules/type-disambiguation-stylistic-set.md +15 -0
  118. package/skills/userinterface-wiki/rules/type-font-display-swap.md +28 -0
  119. package/skills/userinterface-wiki/rules/type-justify-with-hyphens.md +24 -0
  120. package/skills/userinterface-wiki/rules/type-letter-spacing-uppercase.md +28 -0
  121. package/skills/userinterface-wiki/rules/type-no-font-synthesis.md +18 -0
  122. package/skills/userinterface-wiki/rules/type-oldstyle-nums-for-prose.md +21 -0
  123. package/skills/userinterface-wiki/rules/type-opentype-contextual-alternates.md +15 -0
  124. package/skills/userinterface-wiki/rules/type-optical-sizing-auto.md +25 -0
  125. package/skills/userinterface-wiki/rules/type-proper-fractions.md +15 -0
  126. package/skills/userinterface-wiki/rules/type-slashed-zero.md +17 -0
  127. package/skills/userinterface-wiki/rules/type-tabular-nums-for-data.md +21 -0
  128. package/skills/userinterface-wiki/rules/type-text-wrap-balance-headings.md +21 -0
  129. package/skills/userinterface-wiki/rules/type-text-wrap-pretty.md +16 -0
  130. package/skills/userinterface-wiki/rules/type-underline-offset.md +25 -0
  131. package/skills/userinterface-wiki/rules/type-variable-weight-continuous.md +23 -0
  132. package/skills/userinterface-wiki/rules/ux-aesthetic-usability.md +32 -0
  133. package/skills/userinterface-wiki/rules/ux-cognitive-load-reduce.md +49 -0
  134. package/skills/userinterface-wiki/rules/ux-common-region-boundaries.md +50 -0
  135. package/skills/userinterface-wiki/rules/ux-doherty-perceived-speed.md +29 -0
  136. package/skills/userinterface-wiki/rules/ux-doherty-under-400ms.md +30 -0
  137. package/skills/userinterface-wiki/rules/ux-fitts-hit-area.md +32 -0
  138. package/skills/userinterface-wiki/rules/ux-fitts-target-size.md +31 -0
  139. package/skills/userinterface-wiki/rules/ux-goal-gradient-progress.md +33 -0
  140. package/skills/userinterface-wiki/rules/ux-hicks-minimize-choices.md +45 -0
  141. package/skills/userinterface-wiki/rules/ux-jakobs-familiar-patterns.md +37 -0
  142. package/skills/userinterface-wiki/rules/ux-millers-chunking.md +23 -0
  143. package/skills/userinterface-wiki/rules/ux-pareto-prioritize-features.md +36 -0
  144. package/skills/userinterface-wiki/rules/ux-peak-end-finish-strong.md +35 -0
  145. package/skills/userinterface-wiki/rules/ux-postels-accept-messy-input.md +45 -0
  146. package/skills/userinterface-wiki/rules/ux-pragnanz-simplify.md +33 -0
  147. package/skills/userinterface-wiki/rules/ux-progressive-disclosure.md +41 -0
  148. package/skills/userinterface-wiki/rules/ux-proximity-grouping.md +38 -0
  149. package/skills/userinterface-wiki/rules/ux-serial-position.md +31 -0
  150. package/skills/userinterface-wiki/rules/ux-similarity-consistency.md +35 -0
  151. package/skills/userinterface-wiki/rules/ux-teslers-complexity.md +28 -0
  152. package/skills/userinterface-wiki/rules/ux-uniform-connectedness.md +43 -0
  153. package/skills/userinterface-wiki/rules/ux-von-restorff-emphasis.md +29 -0
  154. package/skills/userinterface-wiki/rules/ux-zeigarnik-show-incomplete.md +36 -0
  155. package/skills/userinterface-wiki/rules/visual-animate-shadow-pseudo.md +49 -0
  156. package/skills/userinterface-wiki/rules/visual-border-alpha-colors.md +25 -0
  157. package/skills/userinterface-wiki/rules/visual-button-shadow-anatomy.md +49 -0
  158. package/skills/userinterface-wiki/rules/visual-concentric-radius.md +40 -0
  159. package/skills/userinterface-wiki/rules/visual-consistent-spacing-scale.md +35 -0
  160. package/skills/userinterface-wiki/rules/visual-layered-shadows.md +30 -0
  161. package/skills/userinterface-wiki/rules/visual-no-pure-black-shadow.md +25 -0
  162. package/skills/userinterface-wiki/rules/visual-shadow-direction.md +25 -0
  163. package/skills/userinterface-wiki/rules/visual-shadow-matches-elevation.md +23 -0
  164. package/skills/userinterface-wiki/rules/weight-duration-matches-action.md +29 -0
  165. package/skills/userinterface-wiki/rules/weight-match-action.md +32 -0
  166. package/src/cli/index.ts +23 -73
  167. package/src/cli/job.ts +25 -92
  168. package/src/cli/status.ts +17 -9
  169. package/src/commands/init.ts +1 -0
  170. package/src/commands/validate.ts +12 -10
  171. package/src/core/agents.ts +6 -19
  172. package/src/core/consolidator.ts +97 -91
  173. package/src/core/daemon.ts +71 -43
  174. package/src/core/finalizer.ts +31 -3
  175. package/src/core/health.ts +5 -17
  176. package/src/core/runner.ts +8 -44
  177. package/src/core/scheduler.ts +12 -49
  178. package/src/core/skills.ts +4 -11
  179. package/src/core/summarizer.ts +7 -21
  180. package/src/db/connection.ts +0 -11
  181. package/src/db/models/job.ts +23 -22
  182. package/src/db/with-db.ts +11 -0
  183. package/src/mcp/server.ts +1 -1
  184. package/src/prompts/environment.md +44 -41
  185. package/src/utils/pid.ts +44 -0
  186. package/src/utils/schedule.ts +39 -0
@@ -0,0 +1,253 @@
1
+ ---
2
+ name: userinterface-wiki
3
+ description: UI/UX best practices for web interfaces. Use when reviewing animations, CSS, audio, typography, UX patterns, prefetching, or icon implementations. Covers 11 categories from animation principles to typography. Outputs file:line findings.
4
+ license: MIT
5
+ metadata:
6
+ author: raphael-salaja
7
+ version: "3.0.0"
8
+ ---
9
+
10
+ # User Interface Wiki
11
+
12
+ Comprehensive UI/UX best practices guide for web interfaces. Contains 152 rules across 12 categories, prioritized by impact to guide automated code review and generation.
13
+
14
+ ## When to Apply
15
+
16
+ Reference these guidelines when:
17
+ - Implementing or reviewing animations (CSS transitions, Motion/Framer Motion)
18
+ - Choosing between springs, easing curves, or no animation
19
+ - Working with AnimatePresence and exit animations
20
+ - Writing CSS with pseudo-elements or View Transitions API
21
+ - Adding audio feedback or procedural sound to UI
22
+ - Building morphing icon components
23
+ - Animating container width/height with dynamic content
24
+ - Designing UI that respects cognitive psychology (Fitts's, Hick's, Miller's laws)
25
+ - Implementing predictive prefetching for perceived performance
26
+ - Setting up typography, OpenType features, or numeric formatting
27
+
28
+ ## Rule Categories by Priority
29
+
30
+ | Priority | Category | Impact | Prefixes |
31
+ |----------|----------|--------|----------|
32
+ | 1 | Animation Principles | CRITICAL | `timing-`, `physics-`, `staging-` |
33
+ | 2 | Timing Functions | HIGH | `spring-`, `easing-`, `duration-`, `none-` |
34
+ | 3 | Exit Animations | HIGH | `exit-`, `presence-`, `mode-`, `nested-` |
35
+ | 4 | CSS Pseudo Elements | MEDIUM | `pseudo-`, `transition-`, `native-` |
36
+ | 5 | Audio Feedback | MEDIUM | `a11y-`, `appropriate-`, `impl-`, `weight-` |
37
+ | 6 | Sound Synthesis | MEDIUM | `context-`, `envelope-`, `design-`, `param-` |
38
+ | 7 | Morphing Icons | LOW | `morphing-` |
39
+ | 8 | Container Animation | MEDIUM | `container-` |
40
+ | 9 | Laws of UX | HIGH | `ux-` |
41
+ | 10 | Predictive Prefetching | MEDIUM | `prefetch-` |
42
+ | 11 | Typography | MEDIUM | `type-` |
43
+ | 12 | Visual Design | HIGH | `visual-` |
44
+
45
+ ## Quick Reference
46
+
47
+ ### 1. Animation Principles (CRITICAL)
48
+
49
+ - `timing-under-300ms` - User animations must complete within 300ms
50
+ - `timing-consistent` - Similar elements use identical timing values
51
+ - `timing-no-entrance-context-menu` - Context menus: no entrance animation, exit only
52
+ - `easing-natural-decay` - Use exponential ramps for natural decay, not linear
53
+ - `easing-no-linear-motion` - Linear easing only for progress indicators
54
+ - `physics-active-state` - Interactive elements need :active scale transform
55
+ - `physics-subtle-deformation` - Squash/stretch in 0.95-1.05 range
56
+ - `physics-spring-for-overshoot` - Springs for overshoot-and-settle, not easing
57
+ - `physics-no-excessive-stagger` - Stagger delays under 50ms per item
58
+ - `staging-one-focal-point` - One prominent animation at a time
59
+ - `staging-dim-background` - Dim modal/dialog backgrounds
60
+ - `staging-z-index-hierarchy` - Animated elements respect z-index layers
61
+
62
+ ### 2. Timing Functions (HIGH)
63
+
64
+ - `spring-for-gestures` - Gesture-driven motion (drag, flick) must use springs
65
+ - `spring-for-interruptible` - Interruptible motion must use springs
66
+ - `spring-preserves-velocity` - Springs preserve input energy on release
67
+ - `spring-params-balanced` - Avoid excessive oscillation in spring params
68
+ - `easing-for-state-change` - System state changes use easing curves
69
+ - `easing-entrance-ease-out` - Entrances use ease-out
70
+ - `easing-exit-ease-in` - Exits use ease-in
71
+ - `easing-transition-ease-in-out` - View transitions use ease-in-out
72
+ - `easing-linear-only-progress` - Linear only for progress/time representation
73
+ - `duration-press-hover` - Press/hover: 120-180ms
74
+ - `duration-small-state` - Small state changes: 180-260ms
75
+ - `duration-max-300ms` - User-initiated max 300ms
76
+ - `duration-shorten-before-curve` - Fix slow feel with shorter duration, not curve
77
+ - `none-high-frequency` - No animation for high-frequency interactions
78
+ - `none-keyboard-navigation` - Keyboard navigation instant, no animation
79
+ - `none-context-menu-entrance` - Context menus: no entrance, exit only
80
+
81
+ ### 3. Exit Animations (HIGH)
82
+
83
+ - `exit-requires-wrapper` - Conditional motion elements need AnimatePresence wrapper
84
+ - `exit-prop-required` - Elements in AnimatePresence need exit prop
85
+ - `exit-key-required` - Dynamic lists need unique keys, not index
86
+ - `exit-matches-initial` - Exit mirrors initial for symmetry
87
+ - `presence-hook-in-child` - useIsPresent in child, not parent
88
+ - `presence-safe-to-remove` - Call safeToRemove after async cleanup
89
+ - `presence-disable-interactions` - Disable interactions on exiting elements
90
+ - `mode-wait-doubles-duration` - Mode "wait" doubles duration; halve timing
91
+ - `mode-sync-layout-conflict` - Mode "sync" causes layout conflicts
92
+ - `mode-pop-layout-for-lists` - Use popLayout for list reordering
93
+ - `nested-propagate-required` - Nested AnimatePresence needs propagate prop
94
+ - `nested-consistent-timing` - Coordinate parent-child exit durations
95
+
96
+ ### 4. CSS Pseudo Elements (MEDIUM)
97
+
98
+ - `pseudo-content-required` - ::before/::after need content property
99
+ - `pseudo-over-dom-node` - Pseudo-elements over extra DOM nodes for decoration
100
+ - `pseudo-position-relative-parent` - Parent needs position: relative
101
+ - `pseudo-z-index-layering` - Z-index for correct pseudo-element layering
102
+ - `pseudo-hit-target-expansion` - Negative inset for larger hit targets
103
+ - `pseudo-marker-styling` - Use ::marker for custom list bullet styles
104
+ - `pseudo-first-line-styling` - Use ::first-line for typographic treatments
105
+ - `transition-name-required` - View transitions need view-transition-name
106
+ - `transition-name-unique` - Each transition name unique during transition
107
+ - `transition-name-cleanup` - Remove transition name after completion
108
+ - `transition-over-js-library` - Prefer View Transitions API over JS libraries
109
+ - `transition-style-pseudo-elements` - Style ::view-transition-group for custom animations
110
+ - `native-backdrop-styling` - Use ::backdrop for dialog backgrounds
111
+ - `native-placeholder-styling` - Use ::placeholder for input styling
112
+ - `native-selection-styling` - Use ::selection for text selection styling
113
+
114
+ ### 5. Audio Feedback (MEDIUM)
115
+
116
+ - `a11y-visual-equivalent` - Every sound must have a visual equivalent
117
+ - `a11y-toggle-setting` - Provide toggle to disable sounds
118
+ - `a11y-reduced-motion-check` - Respect prefers-reduced-motion for sound
119
+ - `a11y-volume-control` - Allow independent volume adjustment
120
+ - `appropriate-no-high-frequency` - No sound on typing or keyboard nav
121
+ - `appropriate-confirmations-only` - Sound for payments, uploads, submissions
122
+ - `appropriate-errors-warnings` - Sound for errors that can't be overlooked
123
+ - `appropriate-no-decorative` - No sound on hover or decorative moments
124
+ - `appropriate-no-punishing` - Inform, don't punish with harsh sounds
125
+ - `impl-preload-audio` - Preload audio files to avoid delay
126
+ - `impl-default-subtle` - Default volume subtle (0.3), not loud
127
+ - `impl-reset-current-time` - Reset currentTime before replay
128
+ - `weight-match-action` - Sound weight matches action importance
129
+ - `weight-duration-matches-action` - Sound duration matches action duration
130
+
131
+ ### 6. Sound Synthesis (MEDIUM)
132
+
133
+ - `context-reuse-single` - Reuse single AudioContext, don't create per sound
134
+ - `context-resume-suspended` - Resume suspended AudioContext before playing
135
+ - `context-cleanup-nodes` - Disconnect audio nodes after playback
136
+ - `envelope-exponential-decay` - Exponential ramps for natural decay
137
+ - `envelope-no-zero-target` - Exponential ramps target 0.001, not 0
138
+ - `envelope-set-initial-value` - Set initial value before ramping
139
+ - `design-noise-for-percussion` - Filtered noise for clicks/taps
140
+ - `design-oscillator-for-tonal` - Oscillators with pitch sweep for tonal sounds
141
+ - `design-filter-for-character` - Bandpass filter to shape percussive sounds
142
+ - `param-click-duration` - Click sounds: 5-15ms duration
143
+ - `param-filter-frequency-range` - Click filter: 3000-6000Hz
144
+ - `param-reasonable-gain` - Gain under 1.0 to prevent clipping
145
+ - `param-q-value-range` - Filter Q: 2-5 for focused but natural
146
+
147
+ ### 7. Morphing Icons (LOW)
148
+
149
+ - `morphing-three-lines` - Every icon uses exactly 3 SVG lines
150
+ - `morphing-use-collapsed` - Unused lines use collapsed constant
151
+ - `morphing-consistent-viewbox` - All icons share same viewBox (14x14)
152
+ - `morphing-group-variants` - Rotational variants share group and base lines
153
+ - `morphing-spring-rotation` - Spring physics for grouped icon rotation
154
+ - `morphing-reduced-motion` - Respect prefers-reduced-motion
155
+ - `morphing-jump-non-grouped` - Instant rotation jump between non-grouped icons
156
+ - `morphing-strokelinecap-round` - Round stroke line caps
157
+ - `morphing-aria-hidden` - Icon SVGs are aria-hidden
158
+
159
+ ### 8. Container Animation (MEDIUM)
160
+
161
+ - `container-two-div-pattern` - Outer animated div, inner measured div; never same element
162
+ - `container-guard-initial-zero` - Guard bounds === 0 on initial render, fall back to "auto"
163
+ - `container-use-resize-observer` - Use ResizeObserver for measurement, not getBoundingClientRect
164
+ - `container-overflow-hidden` - Set overflow: hidden on animated container during transitions
165
+ - `container-no-excessive-use` - Use sparingly: buttons, accordions, interactive elements
166
+ - `container-callback-ref` - Use callback ref (not useRef) for measurement hooks
167
+ - `container-transition-delay` - Add small delay for natural catching-up feel
168
+
169
+ ### 9. Laws of UX (HIGH)
170
+
171
+ - `ux-fitts-target-size` - Size interactive targets for easy clicking (min 32px)
172
+ - `ux-fitts-hit-area` - Expand hit areas with invisible padding or pseudo-elements
173
+ - `ux-hicks-minimize-choices` - Minimize choices to reduce decision time
174
+ - `ux-millers-chunking` - Chunk data into groups of 5-9 for scannability
175
+ - `ux-doherty-under-400ms` - Respond within 400ms to feel instant
176
+ - `ux-doherty-perceived-speed` - Fake speed with skeletons, optimistic UI, progress indicators
177
+ - `ux-postels-accept-messy-input` - Accept messy input, output clean data
178
+ - `ux-progressive-disclosure` - Show what matters now, reveal complexity later
179
+ - `ux-jakobs-familiar-patterns` - Use familiar UI patterns users know from other sites
180
+ - `ux-aesthetic-usability` - Visual polish increases perceived usability
181
+ - `ux-proximity-grouping` - Group related elements spatially with tighter spacing
182
+ - `ux-similarity-consistency` - Similar elements should look alike
183
+ - `ux-common-region-boundaries` - Use boundaries to group related content
184
+ - `ux-von-restorff-emphasis` - Make important elements visually distinct
185
+ - `ux-serial-position` - Place key items first or last in sequences
186
+ - `ux-peak-end-finish-strong` - End experiences with clear success states
187
+ - `ux-teslers-complexity` - Move complexity to the system, not the user
188
+ - `ux-goal-gradient-progress` - Show progress toward completion
189
+ - `ux-zeigarnik-show-incomplete` - Show incomplete state to drive completion
190
+ - `ux-pragnanz-simplify` - Simplify complex visuals into clear forms
191
+ - `ux-pareto-prioritize-features` - Prioritize the critical 20% of features
192
+ - `ux-cognitive-load-reduce` - Minimize extraneous cognitive load
193
+ - `ux-uniform-connectedness` - Visually connect related elements with lines or frames
194
+
195
+ ### 10. Predictive Prefetching (MEDIUM)
196
+
197
+ - `prefetch-trajectory-over-hover` - Trajectory prediction over hover; reclaims 100-200ms
198
+ - `prefetch-not-everything` - Prefetch by intent, not viewport; avoid wasted bandwidth
199
+ - `prefetch-hit-slop` - Use hitSlop to trigger predictions earlier
200
+ - `prefetch-touch-fallback` - Fall back gracefully on touch devices (no cursor)
201
+ - `prefetch-keyboard-tab` - Prefetch on keyboard navigation when focus approaches
202
+ - `prefetch-use-selectively` - Use predictive prefetching where latency is noticeable
203
+
204
+ ### 11. Typography (MEDIUM)
205
+
206
+ - `type-tabular-nums-for-data` - Tabular numbers for columns, dashboards, pricing
207
+ - `type-oldstyle-nums-for-prose` - Oldstyle numbers blend into body text
208
+ - `type-slashed-zero` - Slashed zero in code-adjacent UIs
209
+ - `type-opentype-contextual-alternates` - Keep calt enabled for contextual glyph adjustment
210
+ - `type-disambiguation-stylistic-set` - Enable ss02 to distinguish I/l/1 and 0/O
211
+ - `type-optical-sizing-auto` - Leave font-optical-sizing auto for size-adaptive glyphs
212
+ - `type-antialiased-on-retina` - Antialiased font smoothing on retina displays
213
+ - `type-text-wrap-balance-headings` - text-wrap: balance on headings for even lines
214
+ - `type-underline-offset` - Offset underlines below descenders
215
+ - `type-no-font-synthesis` - Disable font-synthesis to prevent faux bold/italic
216
+ - `type-font-display-swap` - Use font-display: swap to avoid invisible text during load
217
+ - `type-variable-weight-continuous` - Use continuous weight values (100-900) with variable fonts
218
+ - `type-text-wrap-pretty` - text-wrap: pretty for body text to reduce orphans
219
+ - `type-justify-with-hyphens` - Pair text-align: justify with hyphens: auto
220
+ - `type-letter-spacing-uppercase` - Add letter-spacing to uppercase and small-caps text
221
+ - `type-proper-fractions` - Use diagonal-fractions for proper typographic fractions
222
+
223
+ ### 12. Visual Design (HIGH)
224
+
225
+ - `visual-concentric-radius` - Inner radius = outer radius minus padding for nested elements
226
+ - `visual-layered-shadows` - Layer multiple shadows for realistic depth
227
+ - `visual-shadow-direction` - All shadows share same offset direction (single light source)
228
+ - `visual-no-pure-black-shadow` - Use neutral colors, not pure black, for shadows
229
+ - `visual-shadow-matches-elevation` - Shadow size indicates elevation in consistent scale
230
+ - `visual-animate-shadow-pseudo` - Animate shadow via pseudo-element opacity for performance
231
+ - `visual-consistent-spacing-scale` - Use a consistent spacing scale, not arbitrary values
232
+ - `visual-border-alpha-colors` - Semi-transparent borders adapt to any background
233
+ - `visual-button-shadow-anatomy` - Six-layer shadow anatomy for polished buttons
234
+
235
+ ## How to Use
236
+
237
+ Read individual rule files for detailed explanations and code examples:
238
+
239
+ ```
240
+ rules/timing-under-300ms.md
241
+ rules/spring-for-gestures.md
242
+ rules/ux-doherty-under-400ms.md
243
+ rules/type-tabular-nums-for-data.md
244
+ ```
245
+
246
+ Each rule file contains:
247
+ - Brief explanation of why it matters
248
+ - Incorrect code example with explanation
249
+ - Correct code example with explanation
250
+
251
+ ## Full Compiled Document
252
+
253
+ For the complete guide with all rules expanded: `AGENTS.md`
@@ -0,0 +1,26 @@
1
+ {
2
+ "version": "3.0.0",
3
+ "organization": "User Interface Wiki",
4
+ "author": "raphael-salaja",
5
+ "date": "March 2026",
6
+ "abstract": "Comprehensive UI/UX best practices guide for web interfaces. Contains 152 rules across 12 categories covering animation principles, timing functions, exit animations, CSS pseudo-elements, audio feedback, sound synthesis, morphing icons, container animation, laws of UX, predictive prefetching, typography, and visual design. Each rule includes detailed explanations and code examples comparing incorrect vs. correct implementations.",
7
+ "references": [
8
+ "https://developer.apple.com/videos/play/wwdc2023/10158",
9
+ "https://motion.dev",
10
+ "https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API",
11
+ "https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/Pseudo-elements",
12
+ "https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API",
13
+ "https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion",
14
+ "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line",
15
+ "https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver",
16
+ "https://lawsofux.com",
17
+ "https://foresightjs.com",
18
+ "https://nextjs.org/docs/app/guides/prefetching",
19
+ "https://rsms.me/inter",
20
+ "https://developer.mozilla.org/en-US/docs/Web/CSS/font-feature-settings",
21
+ "https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-numeric",
22
+ "https://www.joshwcomeau.com/css/designing-shadows",
23
+ "https://jakub.kr/work/concentric-border-radius",
24
+ "https://developer.mozilla.org/en-US/docs/Web/CSS/text-wrap"
25
+ ]
26
+ }
@@ -0,0 +1,66 @@
1
+ # Sections
2
+
3
+ This file defines all sections, their ordering, impact levels, and descriptions.
4
+ The section ID (in parentheses) is the filename prefix used to group rules.
5
+
6
+ ---
7
+
8
+ ## 1. Animation Principles (timing, physics, staging)
9
+
10
+ **Impact:** CRITICAL
11
+ **Description:** Disney's 12 principles adapted for web. Timing, physics, and staging rules ensure animations feel natural and purposeful. Violations here produce the most noticeable quality issues.
12
+
13
+ ## 2. Timing Functions (spring, easing, duration, none)
14
+
15
+ **Impact:** HIGH
16
+ **Description:** Choosing the right timing function—spring, easing curve, or no animation—based on whether motion is user-driven, system-driven, or high-frequency.
17
+
18
+ ## 3. Exit Animations (exit, presence, mode, nested)
19
+
20
+ **Impact:** HIGH
21
+ **Description:** AnimatePresence and exit animation patterns in Motion/Framer Motion. Correct usage prevents layout shifts, stale interactions, and orphaned elements.
22
+
23
+ ## 4. CSS Pseudo Elements (pseudo, transition, native)
24
+
25
+ **Impact:** MEDIUM
26
+ **Description:** Leveraging ::before, ::after, View Transitions API, and native pseudo-elements (::backdrop, ::placeholder, ::selection) to reduce DOM nodes and improve transitions.
27
+
28
+ ## 5. Audio Feedback (a11y, appropriate, impl, weight)
29
+
30
+ **Impact:** MEDIUM
31
+ **Description:** When and how to use sound in UI. Covers accessibility, appropriateness heuristics, implementation patterns, and matching sound weight to action importance.
32
+
33
+ ## 6. Sound Synthesis (context, envelope, design, param)
34
+
35
+ **Impact:** MEDIUM
36
+ **Description:** Web Audio API best practices for procedural sound generation. Covers AudioContext management, envelope shaping, sound design patterns, and parameter ranges.
37
+
38
+ ## 7. Morphing Icons (morphing)
39
+
40
+ **Impact:** LOW
41
+ **Description:** Building icon components that morph between any two icons through SVG line transformation. All icons share a 3-line structure enabling seamless transitions.
42
+
43
+ ## 8. Container Animation (container)
44
+
45
+ **Impact:** MEDIUM
46
+ **Description:** Animating container width and height using a measure-and-animate pattern with ResizeObserver and Motion. The two-div pattern separates measurement from animation to avoid feedback loops.
47
+
48
+ ## 9. Laws of UX (ux)
49
+
50
+ **Impact:** HIGH
51
+ **Description:** Psychological principles behind interfaces that feel right. Covers Fitts's Law (target sizing), Hick's Law (choice reduction), Miller's Law (chunking), Doherty Threshold (response time), and Postel's Law (input tolerance).
52
+
53
+ ## 10. Predictive Prefetching (prefetch)
54
+
55
+ **Impact:** MEDIUM
56
+ **Description:** Loading content before the user clicks by analyzing cursor trajectory, reducing perceived latency by 100-200ms. Covers trajectory vs hover vs click strategies and device-aware fallbacks.
57
+
58
+ ## 11. Typography (type)
59
+
60
+ **Impact:** MEDIUM
61
+ **Description:** CSS font and text properties most developers overlook. OpenType features, numeric variants, variable font axes, text rendering, wrapping, and decoration controls that make typography feel considered.
62
+
63
+ ## 12. Visual Design (visual)
64
+
65
+ **Impact:** HIGH
66
+ **Description:** CSS design fundamentals that compound into visual polish. Concentric border radius, layered shadows, consistent spacing scales, and alpha borders. Small details that separate considered interfaces from default ones.
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: Rule Title Here
3
+ impact: MEDIUM
4
+ impactDescription: Optional description of impact
5
+ tags: tag1, tag2
6
+ ---
7
+
8
+ ## Rule Title Here
9
+
10
+ Brief explanation of the rule and why it matters.
11
+
12
+ **Incorrect (description of what's wrong):**
13
+
14
+ ```tsx
15
+ // Bad code example here
16
+ ```
17
+
18
+ **Correct (description of what's right):**
19
+
20
+ ```tsx
21
+ // Good code example here
22
+ ```
23
+
24
+ Reference: [Link to documentation or resource](https://example.com)
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: Respect prefers-reduced-motion for Sound
3
+ impact: HIGH
4
+ tags: a11y, reduced-motion, sound
5
+ ---
6
+
7
+ ## Respect prefers-reduced-motion for Sound
8
+
9
+ Respect prefers-reduced-motion as proxy for sound sensitivity.
10
+
11
+ **Incorrect (ignores preference):**
12
+
13
+ ```tsx
14
+ function playSound(name: string) {
15
+ audio.play();
16
+ }
17
+ ```
18
+
19
+ **Correct (checks preference):**
20
+
21
+ ```tsx
22
+ function playSound(name: string) {
23
+ const prefersReducedMotion = window.matchMedia(
24
+ "(prefers-reduced-motion: reduce)"
25
+ ).matches;
26
+
27
+ if (prefersReducedMotion) return;
28
+ audio.play();
29
+ }
30
+ ```
@@ -0,0 +1,30 @@
1
+ ---
2
+ title: Toggle Setting to Disable Sounds
3
+ impact: HIGH
4
+ tags: a11y, settings, toggle
5
+ ---
6
+
7
+ ## Toggle Setting to Disable Sounds
8
+
9
+ Provide explicit toggle to disable sounds in settings.
10
+
11
+ **Incorrect (no way to disable):**
12
+
13
+ ```tsx
14
+ function App() {
15
+ return <SoundProvider>{children}</SoundProvider>;
16
+ }
17
+ ```
18
+
19
+ **Correct (toggle available):**
20
+
21
+ ```tsx
22
+ function App() {
23
+ const { soundEnabled } = usePreferences();
24
+ return (
25
+ <SoundProvider enabled={soundEnabled}>
26
+ {children}
27
+ </SoundProvider>
28
+ );
29
+ }
30
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: Visual Equivalent for Every Sound
3
+ impact: HIGH
4
+ tags: a11y, visual, sound
5
+ ---
6
+
7
+ ## Visual Equivalent for Every Sound
8
+
9
+ Every audio cue must have a visual equivalent; sound never replaces visual feedback.
10
+
11
+ **Incorrect (sound without visual):**
12
+
13
+ ```tsx
14
+ function SubmitButton({ onClick }) {
15
+ const handleClick = () => {
16
+ playSound("success");
17
+ onClick();
18
+ };
19
+ }
20
+ ```
21
+
22
+ **Correct (sound with visual):**
23
+
24
+ ```tsx
25
+ function SubmitButton({ onClick }) {
26
+ const [status, setStatus] = useState("idle");
27
+
28
+ const handleClick = () => {
29
+ playSound("success");
30
+ setStatus("success");
31
+ onClick();
32
+ };
33
+
34
+ return <button data-status={status}>Submit</button>;
35
+ }
36
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: Independent Volume Control
3
+ impact: MEDIUM
4
+ tags: a11y, volume, settings
5
+ ---
6
+
7
+ ## Independent Volume Control
8
+
9
+ Allow volume adjustment independent of system volume.
10
+
11
+ **Incorrect (always full volume):**
12
+
13
+ ```tsx
14
+ function playSound() {
15
+ audio.volume = 1;
16
+ audio.play();
17
+ }
18
+ ```
19
+
20
+ **Correct (user-controlled volume):**
21
+
22
+ ```tsx
23
+ function playSound() {
24
+ const { volume } = usePreferences();
25
+ audio.volume = volume;
26
+ audio.play();
27
+ }
28
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ title: Sound for Confirmations
3
+ impact: MEDIUM
4
+ tags: appropriate, confirmation, payment
5
+ ---
6
+
7
+ ## Sound for Confirmations
8
+
9
+ Sound is appropriate for confirmations: payments, uploads, form submissions.
10
+
11
+ **Correct:**
12
+
13
+ ```tsx
14
+ async function handlePayment() {
15
+ await processPayment();
16
+ playSound("success");
17
+ showConfirmation();
18
+ }
19
+ ```
@@ -0,0 +1,18 @@
1
+ ---
2
+ title: Sound for Errors and Warnings
3
+ impact: MEDIUM
4
+ tags: appropriate, error, warning
5
+ ---
6
+
7
+ ## Sound for Errors and Warnings
8
+
9
+ Sound is appropriate for errors and warnings that can't be overlooked.
10
+
11
+ **Correct:**
12
+
13
+ ```tsx
14
+ function handleError(error: Error) {
15
+ playSound("error");
16
+ showErrorToast(error.message);
17
+ }
18
+ ```
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: No Decorative Sound
3
+ impact: MEDIUM
4
+ tags: appropriate, decorative, hover
5
+ ---
6
+
7
+ ## No Decorative Sound
8
+
9
+ Do not add sound to decorative moments with no informational value.
10
+
11
+ **Incorrect (hover sound):**
12
+
13
+ ```tsx
14
+ function Card({ onHover }) {
15
+ return (
16
+ <div onMouseEnter={() => playSound("hover")}>
17
+ {children}
18
+ </div>
19
+ );
20
+ }
21
+ ```
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: No Sound on High-Frequency Interactions
3
+ impact: HIGH
4
+ tags: appropriate, frequency, typing
5
+ ---
6
+
7
+ ## No Sound on High-Frequency Interactions
8
+
9
+ Do not add sound to high-frequency interactions (typing, keyboard navigation).
10
+
11
+ **Incorrect (sound on every keystroke):**
12
+
13
+ ```tsx
14
+ function Input({ onChange }) {
15
+ const handleChange = (e) => {
16
+ playSound("keystroke");
17
+ onChange(e);
18
+ };
19
+ }
20
+ ```
21
+
22
+ **Correct (no sound on typing):**
23
+
24
+ ```tsx
25
+ function Input({ onChange }) {
26
+ return <input onChange={onChange} />;
27
+ }
28
+ ```
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: Informative Not Punishing Sound
3
+ impact: MEDIUM
4
+ tags: appropriate, error, tone
5
+ ---
6
+
7
+ ## Informative Not Punishing Sound
8
+
9
+ Sound should inform, not punish; avoid harsh sounds for user mistakes.
10
+
11
+ **Incorrect (harsh buzzer):**
12
+
13
+ ```tsx
14
+ function ValidationError() {
15
+ playSound("loud-buzzer");
16
+ return <span>Invalid input</span>;
17
+ }
18
+ ```
19
+
20
+ **Correct (gentle alert):**
21
+
22
+ ```tsx
23
+ function ValidationError() {
24
+ playSound("gentle-alert");
25
+ return <span>Invalid input</span>;
26
+ }
27
+ ```
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: Use Callback Ref for Measurement
3
+ impact: MEDIUM
4
+ tags: container, ref, callback
5
+ ---
6
+
7
+ ## Use Callback Ref for Measurement
8
+
9
+ Use a callback ref (not useRef) for measurement hooks so the observer attaches when the DOM node is ready.
10
+
11
+ **Incorrect (useRef may be null on first effect):**
12
+
13
+ ```tsx
14
+ const ref = useRef(null);
15
+ useEffect(() => {
16
+ if (!ref.current) return;
17
+ observer.observe(ref.current);
18
+ }, []);
19
+ ```
20
+
21
+ **Correct (callback ref guarantees node):**
22
+
23
+ ```tsx
24
+ const [element, setElement] = useState(null);
25
+ const ref = useCallback((node) => setElement(node), []);
26
+ useEffect(() => {
27
+ if (!element) return;
28
+ observer.observe(element);
29
+ return () => observer.disconnect();
30
+ }, [element]);
31
+ ```
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: Guard Against Zero on Initial Render
3
+ impact: HIGH
4
+ tags: container, measure, initial-render
5
+ ---
6
+
7
+ ## Guard Against Zero on Initial Render
8
+
9
+ On initial render, measured bounds are 0. Guard against this to prevent animating from 0 to actual size.
10
+
11
+ **Incorrect (animates from 0 on mount):**
12
+
13
+ ```tsx
14
+ <motion.div animate={{ width: bounds.width }}>
15
+ <div ref={ref}>{children}</div>
16
+ </motion.div>
17
+ ```
18
+
19
+ **Correct (falls back to auto on first frame):**
20
+
21
+ ```tsx
22
+ <motion.div animate={{ width: bounds.width > 0 ? bounds.width : "auto" }}>
23
+ <div ref={ref}>{children}</div>
24
+ </motion.div>
25
+ ```