agy-superpowers 5.1.2 → 5.1.4
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/LICENSE +1 -1
- package/README.md +198 -175
- package/package.json +1 -1
- package/template/agent/.shared/mobile-uiux-promax/data/accessibility.csv +25 -0
- package/template/agent/.shared/mobile-uiux-promax/data/animation.csv +22 -0
- package/template/agent/.shared/mobile-uiux-promax/data/components.csv +21 -0
- package/template/agent/.shared/mobile-uiux-promax/data/gestures.csv +26 -0
- package/template/agent/.shared/mobile-uiux-promax/data/layout.csv +21 -0
- package/template/agent/.shared/mobile-uiux-promax/data/navigation.csv +27 -0
- package/template/agent/.shared/mobile-uiux-promax/data/onboarding.csv +17 -0
- package/template/agent/.shared/mobile-uiux-promax/data/platform.csv +22 -0
- package/template/agent/.shared/mobile-uiux-promax/data/stacks/flutter.csv +19 -0
- package/template/agent/.shared/mobile-uiux-promax/data/stacks/jetpack-compose.csv +18 -0
- package/template/agent/.shared/mobile-uiux-promax/data/stacks/react-native.csv +20 -0
- package/template/agent/.shared/mobile-uiux-promax/data/stacks/swiftui.csv +18 -0
- package/template/agent/.shared/mobile-uiux-promax/data/ux-laws.csv +16 -0
- package/template/agent/.shared/mobile-uiux-promax/scripts/mobile-search.py +157 -0
- package/template/agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/template/agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/template/agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/template/agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/template/agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/template/agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/template/agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/template/agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/template/agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/template/agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/template/agent/.shared/ui-ux-pro-max/scripts/core.py +236 -0
- package/template/agent/.shared/ui-ux-pro-max/scripts/search.py +61 -0
- package/template/agent/.tests/TESTS.md +119 -0
- package/template/agent/.tests/mobile-uiux-promax/test_search.py +266 -0
- package/template/agent/.tests/run_tests.py +86 -0
- package/template/agent/patches/skills-patches.md +24 -0
- package/template/agent/rules/git-policy.md +25 -0
- package/template/agent/skills/brainstorming/SKILL.md +57 -0
- package/template/agent/skills/finishing-a-development-branch/SKILL.md +18 -6
- package/template/agent/skills/frontend-design/SKILL.md +147 -0
- package/template/agent/skills/frontend-design/reference/color-and-contrast.md +117 -0
- package/template/agent/skills/frontend-design/reference/interaction-design.md +159 -0
- package/template/agent/skills/frontend-design/reference/motion-design.md +150 -0
- package/template/agent/skills/frontend-design/reference/responsive-design.md +161 -0
- package/template/agent/skills/frontend-design/reference/spatial-design.md +122 -0
- package/template/agent/skills/frontend-design/reference/typography.md +124 -0
- package/template/agent/skills/frontend-design/reference/ux-writing.md +127 -0
- package/template/agent/skills/mobile-uiux-promax/SKILL.md +139 -0
- package/template/agent/skills/using-git-worktrees/SKILL.md +3 -1
- package/template/agent/skills/verification-before-completion/SKILL.md +11 -0
- package/template/agent/workflows/mobile-uiux-promax.md +137 -0
- package/template/agent/workflows/ui-ux-pro-max.md +231 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Responsive Design
|
|
2
|
+
|
|
3
|
+
## Mobile-First: Write It Right
|
|
4
|
+
|
|
5
|
+
Start with base styles for mobile, use `min-width` queries to layer complexity. Desktop-first (`max-width`) means mobile loads unnecessary styles first.
|
|
6
|
+
|
|
7
|
+
```css
|
|
8
|
+
/* Mobile-first (correct) */
|
|
9
|
+
.container { padding: 1rem; }
|
|
10
|
+
|
|
11
|
+
@media (min-width: 768px) {
|
|
12
|
+
.container { padding: 2rem; }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* Desktop-first (wrong way) */
|
|
16
|
+
.container { padding: 2rem; }
|
|
17
|
+
|
|
18
|
+
@media (max-width: 768px) {
|
|
19
|
+
.container { padding: 1rem; }
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Breakpoints: Content-Driven
|
|
26
|
+
|
|
27
|
+
Don't chase device sizes — let content tell you where to break. Start narrow, stretch until design breaks, add breakpoint there. Three breakpoints usually suffice: 640, 768, 1024px. Use `clamp()` for fluid values without breakpoints.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Detect Input Method, Not Just Screen Size
|
|
32
|
+
|
|
33
|
+
Screen size doesn't tell you input method. A laptop with touchscreen, a tablet with keyboard — use pointer and hover queries:
|
|
34
|
+
|
|
35
|
+
```css
|
|
36
|
+
/* Fine pointer (mouse, trackpad) */
|
|
37
|
+
@media (pointer: fine) {
|
|
38
|
+
.button { padding: 8px 16px; }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Coarse pointer (touch, stylus) */
|
|
42
|
+
@media (pointer: coarse) {
|
|
43
|
+
.button { padding: 12px 20px; }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Device supports hover */
|
|
47
|
+
@media (hover: hover) {
|
|
48
|
+
.card:hover { transform: translateY(-2px); }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Device doesn't support hover (touch) */
|
|
52
|
+
@media (hover: none) {
|
|
53
|
+
.card { /* No hover state — use active instead */ }
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Critical**: Don't rely on hover for functionality. Touch users can't hover.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Safe Areas: Handle the Notch
|
|
62
|
+
|
|
63
|
+
Modern phones have notches, rounded corners, and home indicators:
|
|
64
|
+
|
|
65
|
+
```css
|
|
66
|
+
body {
|
|
67
|
+
padding-top: env(safe-area-inset-top);
|
|
68
|
+
padding-bottom: env(safe-area-inset-bottom);
|
|
69
|
+
padding-left: env(safe-area-inset-left);
|
|
70
|
+
padding-right: env(safe-area-inset-right);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* With fallback */
|
|
74
|
+
.footer {
|
|
75
|
+
padding-bottom: max(1rem, env(safe-area-inset-bottom));
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Enable viewport-fit in your meta tag:
|
|
80
|
+
```html
|
|
81
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Responsive Images
|
|
87
|
+
|
|
88
|
+
### srcset with Width Descriptors
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<img
|
|
92
|
+
src="hero-800.jpg"
|
|
93
|
+
srcset="
|
|
94
|
+
hero-400.jpg 400w,
|
|
95
|
+
hero-800.jpg 800w,
|
|
96
|
+
hero-1200.jpg 1200w
|
|
97
|
+
"
|
|
98
|
+
sizes="(max-width: 768px) 100vw, 50vw"
|
|
99
|
+
alt="Hero image"
|
|
100
|
+
>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- `srcset` lists available images with their actual widths
|
|
104
|
+
- `sizes` tells the browser how wide the image will display
|
|
105
|
+
- Browser picks the best file based on viewport width AND device pixel ratio
|
|
106
|
+
|
|
107
|
+
### Picture Element for Art Direction
|
|
108
|
+
|
|
109
|
+
When you need different crops/compositions (not just resolutions):
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<picture>
|
|
113
|
+
<source media="(min-width: 768px)" srcset="wide.jpg">
|
|
114
|
+
<source media="(max-width: 767px)" srcset="tall.jpg">
|
|
115
|
+
<img src="fallback.jpg" alt="...">
|
|
116
|
+
</picture>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Layout Adaptation Patterns
|
|
122
|
+
|
|
123
|
+
**Navigation** — three stages:
|
|
124
|
+
- Mobile: hamburger + drawer
|
|
125
|
+
- Tablet: horizontal compact
|
|
126
|
+
- Desktop: full with labels
|
|
127
|
+
|
|
128
|
+
**Tables** — transform to cards on mobile:
|
|
129
|
+
```css
|
|
130
|
+
@media (max-width: 640px) {
|
|
131
|
+
table, thead, tbody, tr, td {
|
|
132
|
+
display: block;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
td::before {
|
|
136
|
+
content: attr(data-label) ": ";
|
|
137
|
+
font-weight: bold;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
thead { display: none; }
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Progressive disclosure** — use `<details>/<summary>` for content that can collapse on mobile.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Testing: Don't Trust DevTools Alone
|
|
149
|
+
|
|
150
|
+
DevTools device emulation is useful for layout but misses:
|
|
151
|
+
- Actual touch interactions
|
|
152
|
+
- Real CPU/memory constraints
|
|
153
|
+
- Network latency patterns
|
|
154
|
+
- Font rendering differences
|
|
155
|
+
- Browser chrome/keyboard appearances
|
|
156
|
+
|
|
157
|
+
**Test on at least**: One real iPhone, one real Android, a tablet if relevant. Cheap Android phones reveal performance issues you'll never see on simulators.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
**Avoid**: Desktop-first design. Device detection instead of feature detection. Separate mobile/desktop codebases. Ignoring tablet and landscape. Assuming all mobile devices are powerful.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Spatial Design
|
|
2
|
+
|
|
3
|
+
## Spacing Systems
|
|
4
|
+
|
|
5
|
+
### Use 4pt Base, Not 8pt
|
|
6
|
+
8pt systems are too coarse — you'll frequently need 12px (between 8 and 16). Use 4pt for granularity: 4, 8, 12, 16, 24, 32, 48, 64, 96px.
|
|
7
|
+
|
|
8
|
+
### Name Tokens Semantically
|
|
9
|
+
Name by relationship (`--space-sm`, `--space-lg`), not value (`--spacing-8`). Use `gap` instead of margins for sibling spacing — it eliminates margin collapse and cleanup hacks.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Grid Systems
|
|
14
|
+
|
|
15
|
+
### The Self-Adjusting Grid
|
|
16
|
+
Use `repeat(auto-fit, minmax(280px, 1fr))` for responsive grids without breakpoints. Columns are at least 280px, as many as fit per row, leftovers stretch.
|
|
17
|
+
|
|
18
|
+
For complex layouts, use named grid areas (`grid-template-areas`) and redefine them at breakpoints.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Visual Hierarchy
|
|
23
|
+
|
|
24
|
+
### The Squint Test
|
|
25
|
+
Blur your eyes (or screenshot and blur). Can you still identify:
|
|
26
|
+
- The most important element?
|
|
27
|
+
- The second most important?
|
|
28
|
+
- Clear groupings?
|
|
29
|
+
|
|
30
|
+
If everything looks the same weight blurred, you have a hierarchy problem.
|
|
31
|
+
|
|
32
|
+
### Hierarchy Through Multiple Dimensions
|
|
33
|
+
Don't rely on size alone. Combine:
|
|
34
|
+
|
|
35
|
+
| Tool | Strong Hierarchy | Weak Hierarchy |
|
|
36
|
+
|------|------------------|----------------|
|
|
37
|
+
| **Size** | 3:1 ratio or more | <2:1 ratio |
|
|
38
|
+
| **Weight** | Bold vs Regular | Medium vs Regular |
|
|
39
|
+
| **Color** | High contrast | Similar tones |
|
|
40
|
+
| **Position** | Top/left (primary) | Bottom/right |
|
|
41
|
+
| **Space** | Surrounded by white space | Crowded |
|
|
42
|
+
|
|
43
|
+
**The best hierarchy uses 2–3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
|
|
44
|
+
|
|
45
|
+
### Cards Are Not Required
|
|
46
|
+
Cards are overused. Spacing and alignment create visual grouping naturally. Use cards only when:
|
|
47
|
+
- Content is truly distinct and actionable
|
|
48
|
+
- Items need visual comparison in a grid
|
|
49
|
+
- Content needs clear interaction boundaries
|
|
50
|
+
|
|
51
|
+
**Never nest cards inside cards** — use spacing, typography, and subtle dividers for hierarchy within a card.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Container Queries
|
|
56
|
+
|
|
57
|
+
Viewport queries are for page layouts. **Container queries are for components**:
|
|
58
|
+
|
|
59
|
+
```css
|
|
60
|
+
.card-container {
|
|
61
|
+
container-type: inline-size;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.card {
|
|
65
|
+
display: grid;
|
|
66
|
+
gap: var(--space-md);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Card layout changes based on its container, not viewport */
|
|
70
|
+
@container (min-width: 400px) {
|
|
71
|
+
.card {
|
|
72
|
+
grid-template-columns: 120px 1fr;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands — automatically, without viewport hacks.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Optical Adjustments
|
|
82
|
+
|
|
83
|
+
- Text at `margin-left: 0` looks indented due to letterform whitespace — use negative margin (`-0.05em`) to optically align
|
|
84
|
+
- Geometrically centered icons often look off-center; play icons need to shift right, arrows shift toward their direction
|
|
85
|
+
|
|
86
|
+
### Touch Targets vs Visual Size
|
|
87
|
+
Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
|
|
88
|
+
|
|
89
|
+
```css
|
|
90
|
+
.icon-button {
|
|
91
|
+
width: 24px;
|
|
92
|
+
height: 24px;
|
|
93
|
+
position: relative;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.icon-button::before {
|
|
97
|
+
content: '';
|
|
98
|
+
position: absolute;
|
|
99
|
+
inset: -10px; /* Expand tap target to 44px */
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Depth & Elevation
|
|
106
|
+
|
|
107
|
+
Create semantic z-index scales (dropdown → sticky → modal-backdrop → modal → toast → tooltip) instead of arbitrary numbers.
|
|
108
|
+
|
|
109
|
+
For shadows, create a consistent elevation scale (sm → md → lg → xl). **Key insight**: Shadows should be subtle — if you can clearly see it, it's probably too strong.
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
:root {
|
|
113
|
+
--shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.05);
|
|
114
|
+
--shadow-md: 0 4px 6px oklch(0% 0 0 / 0.07);
|
|
115
|
+
--shadow-lg: 0 10px 15px oklch(0% 0 0 / 0.1);
|
|
116
|
+
--shadow-xl: 0 20px 25px oklch(0% 0 0 / 0.12);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
**Avoid**: Arbitrary spacing values outside your scale. Making all spacing equal (variety creates hierarchy). Creating hierarchy through size alone. Nesting cards in cards.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Typography
|
|
2
|
+
|
|
3
|
+
## Classic Typography Principles
|
|
4
|
+
|
|
5
|
+
### Vertical Rhythm
|
|
6
|
+
Your line-height should be the base unit for ALL vertical spacing. If body text has `line-height: 1.5` on `16px` type (= 24px), spacing values should be multiples of 24px. This creates subconscious harmony — text and space share a mathematical foundation.
|
|
7
|
+
|
|
8
|
+
### Modular Scale & Hierarchy
|
|
9
|
+
The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
|
|
10
|
+
|
|
11
|
+
**Use fewer sizes with more contrast.** A 5-size system covers most needs:
|
|
12
|
+
|
|
13
|
+
| Role | Typical Ratio | Use Case |
|
|
14
|
+
|------|---------------|----------|
|
|
15
|
+
| xs | 0.75rem | Captions, legal |
|
|
16
|
+
| sm | 0.875rem | Secondary UI, metadata |
|
|
17
|
+
| base | 1rem | Body text |
|
|
18
|
+
| lg | 1.25–1.5rem | Subheadings, lead text |
|
|
19
|
+
| xl+ | 2–4rem | Headlines, hero text |
|
|
20
|
+
|
|
21
|
+
Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
|
|
22
|
+
|
|
23
|
+
### Readability & Measure
|
|
24
|
+
Use `ch` units for character-based measure (`max-width: 65ch`). Line-height scales inversely with line length — narrow columns need tighter leading, wide columns need more.
|
|
25
|
+
|
|
26
|
+
**Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05–0.1 to your normal line-height.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Font Selection & Pairing
|
|
31
|
+
|
|
32
|
+
### Choosing Distinctive Fonts
|
|
33
|
+
**Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal — but if you want distinctive design, look elsewhere.
|
|
34
|
+
|
|
35
|
+
**Better Google Fonts alternatives**:
|
|
36
|
+
- Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
|
|
37
|
+
- Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
|
|
38
|
+
- Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
|
|
39
|
+
- For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
|
|
40
|
+
|
|
41
|
+
**System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider for apps where performance > personality.
|
|
42
|
+
|
|
43
|
+
### Pairing Principles
|
|
44
|
+
**The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces.
|
|
45
|
+
|
|
46
|
+
When pairing, contrast on multiple axes:
|
|
47
|
+
- Serif + Sans (structure contrast)
|
|
48
|
+
- Geometric + Humanist (personality contrast)
|
|
49
|
+
- Condensed display + Wide body (proportion contrast)
|
|
50
|
+
|
|
51
|
+
**Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
|
|
52
|
+
|
|
53
|
+
### Web Font Loading
|
|
54
|
+
The layout shift problem: fonts load late, text reflows, users see content jump. The fix:
|
|
55
|
+
|
|
56
|
+
```css
|
|
57
|
+
/* 1. Use font-display: swap for visibility */
|
|
58
|
+
@font-face {
|
|
59
|
+
font-family: 'CustomFont';
|
|
60
|
+
src: url('font.woff2') format('woff2');
|
|
61
|
+
font-display: swap;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* 2. Match fallback metrics to minimize shift */
|
|
65
|
+
@font-face {
|
|
66
|
+
font-family: 'CustomFont-Fallback';
|
|
67
|
+
src: local('Arial');
|
|
68
|
+
size-adjust: 105%;
|
|
69
|
+
ascent-override: 90%;
|
|
70
|
+
descent-override: 20%;
|
|
71
|
+
line-gap-override: 10%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
body {
|
|
75
|
+
font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Modern Web Typography
|
|
82
|
+
|
|
83
|
+
### Fluid Type
|
|
84
|
+
Fluid typography via `clamp(min, preferred, max)` scales text smoothly with the viewport.
|
|
85
|
+
|
|
86
|
+
**Use fluid type for**: Headings and display text on marketing/content pages.
|
|
87
|
+
**Use fixed `rem` scales for**: App UIs, dashboards, data-dense interfaces. Body text should also be fixed.
|
|
88
|
+
|
|
89
|
+
### OpenType Features
|
|
90
|
+
Use these for polish — most developers don't know they exist:
|
|
91
|
+
|
|
92
|
+
```css
|
|
93
|
+
/* Tabular numbers for data alignment */
|
|
94
|
+
.data-table { font-variant-numeric: tabular-nums; }
|
|
95
|
+
|
|
96
|
+
/* Proper fractions */
|
|
97
|
+
.recipe-amount { font-variant-numeric: diagonal-fractions; }
|
|
98
|
+
|
|
99
|
+
/* Small caps for abbreviations */
|
|
100
|
+
abbr { font-variant-caps: all-small-caps; }
|
|
101
|
+
|
|
102
|
+
/* Disable ligatures in code */
|
|
103
|
+
code { font-variant-ligatures: none; }
|
|
104
|
+
|
|
105
|
+
/* Enable kerning */
|
|
106
|
+
body { font-kerning: normal; }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Typography System Architecture
|
|
112
|
+
|
|
113
|
+
Name tokens semantically (`--text-body`, `--text-heading`), not by value (`--font-size-16`). Include font stacks, size scale, weights, line-heights, and letter-spacing in your token system.
|
|
114
|
+
|
|
115
|
+
## Accessibility
|
|
116
|
+
|
|
117
|
+
- **Never disable zoom**: `user-scalable=no` breaks accessibility
|
|
118
|
+
- **Use rem/em for font sizes**: Respects user browser settings. Never `px` for body text
|
|
119
|
+
- **Minimum 16px body text**: Smaller strains eyes and fails WCAG on mobile
|
|
120
|
+
- **Adequate touch targets**: Text links need padding creating 44px+ tap targets
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
**Avoid**: More than 2–3 font families per project. Skipping fallback font definitions. Ignoring font loading performance (FOUT/FOIT). Using decorative fonts for body text.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# UX Writing
|
|
2
|
+
|
|
3
|
+
## The Button Label Problem
|
|
4
|
+
|
|
5
|
+
**Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
|
|
6
|
+
|
|
7
|
+
| Bad | Good | Why |
|
|
8
|
+
|-----|------|-----|
|
|
9
|
+
| OK | Save changes | Says what will happen |
|
|
10
|
+
| Submit | Create account | Outcome-focused |
|
|
11
|
+
| Yes | Delete message | Confirms the action |
|
|
12
|
+
| Cancel | Keep editing | Clarifies what "cancel" means |
|
|
13
|
+
| Click here | Download PDF | Describes the destination |
|
|
14
|
+
|
|
15
|
+
**For destructive actions**, name the destruction:
|
|
16
|
+
- "Delete" not "Remove" (delete is permanent, remove implies recoverable)
|
|
17
|
+
- "Delete 5 items" not "Delete selected" (show the count)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Error Messages: The Formula
|
|
22
|
+
|
|
23
|
+
Every error should answer: (1) What happened? (2) Why? (3) How to fix it?
|
|
24
|
+
|
|
25
|
+
- ✅ `"Email address isn't valid. Please include an @ symbol."`
|
|
26
|
+
- ❌ `"Invalid input"`
|
|
27
|
+
|
|
28
|
+
### Templates per Situation
|
|
29
|
+
|
|
30
|
+
| Situation | Template |
|
|
31
|
+
|-----------|----------|
|
|
32
|
+
| **Format error** | "[Field] needs to be [format]. Example: [example]" |
|
|
33
|
+
| **Missing required** | "Please enter [what's missing]" |
|
|
34
|
+
| **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
|
|
35
|
+
| **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
|
|
36
|
+
| **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
|
|
37
|
+
|
|
38
|
+
### Don't Blame the User
|
|
39
|
+
Reframe errors:
|
|
40
|
+
- ✅ `"Please enter a date in MM/DD/YYYY format"`
|
|
41
|
+
- ❌ `"You entered an invalid date"`
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Empty States Are Opportunities
|
|
46
|
+
|
|
47
|
+
Empty states are onboarding moments: (1) Acknowledge briefly, (2) Explain the value, (3) Provide a clear action.
|
|
48
|
+
|
|
49
|
+
- ✅ "No projects yet. Create your first one to get started."
|
|
50
|
+
- ❌ "No items"
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Voice vs Tone
|
|
55
|
+
|
|
56
|
+
**Voice** is your brand's personality — consistent everywhere.
|
|
57
|
+
**Tone** adapts to the moment:
|
|
58
|
+
|
|
59
|
+
| Moment | Tone Shift |
|
|
60
|
+
|--------|------------|
|
|
61
|
+
| Success | Celebratory, brief: "Done! Your changes are live." |
|
|
62
|
+
| Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
|
|
63
|
+
| Loading | Reassuring: "Saving your work..." |
|
|
64
|
+
| Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
|
|
65
|
+
|
|
66
|
+
**Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Writing for Accessibility
|
|
71
|
+
|
|
72
|
+
- **Link text** must have standalone meaning — "View pricing plans" not "Click here"
|
|
73
|
+
- **Alt text** describes information, not the image — "Revenue increased 40% in Q4" not "Chart"
|
|
74
|
+
- Use `alt=""` for decorative images
|
|
75
|
+
- **Icon buttons** need `aria-label`
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Writing for Translation
|
|
80
|
+
|
|
81
|
+
### Plan for Expansion
|
|
82
|
+
|
|
83
|
+
| Language | Expansion |
|
|
84
|
+
|----------|-----------|
|
|
85
|
+
| German | +30% |
|
|
86
|
+
| French | +20% |
|
|
87
|
+
| Finnish | +30–40% |
|
|
88
|
+
| Chinese | −30% (fewer chars, same width) |
|
|
89
|
+
|
|
90
|
+
### Translation-Friendly Patterns
|
|
91
|
+
- Keep numbers separate ("New messages: 3" not "You have 3 new messages")
|
|
92
|
+
- Use full sentences as single strings (word order varies by language)
|
|
93
|
+
- Avoid abbreviations ("5 minutes ago" not "5 mins ago")
|
|
94
|
+
- Give translators context about where strings appear
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Consistency: The Terminology Problem
|
|
99
|
+
|
|
100
|
+
Pick one term and stick with it:
|
|
101
|
+
|
|
102
|
+
| Inconsistent | Consistent |
|
|
103
|
+
|--------------|------------|
|
|
104
|
+
| Delete / Remove / Trash | Delete |
|
|
105
|
+
| Settings / Preferences / Options | Settings |
|
|
106
|
+
| Sign in / Log in / Enter | Sign in |
|
|
107
|
+
| Create / Add / New | Create |
|
|
108
|
+
|
|
109
|
+
Build a terminology glossary and enforce it. Variety creates confusion.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Avoid Redundant Copy
|
|
114
|
+
|
|
115
|
+
If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
|
|
116
|
+
|
|
117
|
+
## Loading States
|
|
118
|
+
|
|
119
|
+
Be specific: "Saving your draft..." not "Loading...". For long waits, set expectations ("This usually takes 30 seconds") or show progress.
|
|
120
|
+
|
|
121
|
+
## Confirmation Dialogs: Use Sparingly
|
|
122
|
+
|
|
123
|
+
Most confirmation dialogs are design failures — **consider undo instead**. When you must confirm: name the action, explain consequences, use specific button labels ("Delete project" / "Keep project", not "Yes" / "No").
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
**Avoid**: Jargon without explanation. Blaming users ("Invalid input" → "Please include @"). Vague errors. Varying terminology for variety. Humor for error states.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mobile-uiux-promax
|
|
3
|
+
description: Use when designing or building mobile app UI for iOS, Android, React Native, Flutter, SwiftUI, or Jetpack Compose
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mobile UI/UX Pro Max
|
|
7
|
+
|
|
8
|
+
Data-grounded mobile design intelligence. Every design decision is backed by platform-authoritative data from Apple HIG, Material Design 3, and stack-specific best practices.
|
|
9
|
+
|
|
10
|
+
## When to Activate
|
|
11
|
+
|
|
12
|
+
Activate this skill when the request involves:
|
|
13
|
+
- Designing any mobile screen, flow, or component
|
|
14
|
+
- Reviewing mobile UI for platform-appropriateness
|
|
15
|
+
- Choosing between navigation patterns for mobile apps
|
|
16
|
+
- Implementing gesture-driven or haptic-rich interactions
|
|
17
|
+
- Advising on iOS vs Android design conventions
|
|
18
|
+
- Building onboarding flows or paywall timing
|
|
19
|
+
- Animation and motion design for mobile
|
|
20
|
+
|
|
21
|
+
## Workflow
|
|
22
|
+
|
|
23
|
+
Run the 4-step search sequence from: `.agent/workflows/mobile-uiux-promax.md`
|
|
24
|
+
|
|
25
|
+
**Read the workflow file before responding.** It contains the exact search commands to run.
|
|
26
|
+
|
|
27
|
+
## Core Design Principles (Memorize These)
|
|
28
|
+
|
|
29
|
+
### 1. Platform-First, Not Platform-Only
|
|
30
|
+
- Follow platform conventions by default
|
|
31
|
+
- Deviate only when there's clear UX benefit to users
|
|
32
|
+
- Cross-platform apps must feel native on each platform, not identical
|
|
33
|
+
- iOS users expect swipe-back + tab bar at bottom; Android users expect system back + nav structure
|
|
34
|
+
|
|
35
|
+
### 2. Thumb Zone Above All
|
|
36
|
+
- Primary actions belong in the bottom 60% of the screen
|
|
37
|
+
- Top-left corner = hardest to reach one-handed
|
|
38
|
+
- Platform back buttons (iOS top-left) are the only justified exception
|
|
39
|
+
|
|
40
|
+
### 3. Gesture + Haptic + Visual = One Interaction
|
|
41
|
+
- Every interaction should engage all three senses when appropriate
|
|
42
|
+
- Swipe reveals → haptic at threshold + visual action button
|
|
43
|
+
- Toggle → haptic on state change + visual state update simultaneously
|
|
44
|
+
- Pull-to-refresh → haptic on trigger + spinner animation + announce to screen readers
|
|
45
|
+
|
|
46
|
+
### 4. Accessibility Is Not Optional
|
|
47
|
+
- Minimum touch target: 44pt (iOS) / 48dp (Android)
|
|
48
|
+
- Every tappable element without visible text needs `accessibilityLabel`
|
|
49
|
+
- Every gesture needs an accessible alternative action
|
|
50
|
+
- Test with VoiceOver (iOS) and TalkBack (Android) before shipping
|
|
51
|
+
- Support Dynamic Type / sp font scaling (never lock font size)
|
|
52
|
+
|
|
53
|
+
### 5. Reduce Motion Is a Hard Requirement
|
|
54
|
+
- Check `UIAccessibility.isReduceMotionEnabled` (iOS) and `LocalReduceMotion` (Compose) everywhere you animate
|
|
55
|
+
- Replace slides with fades; replace springs with eases; reduce or eliminate particle effects
|
|
56
|
+
- Haptics are NOT animation — keep them even when reducing motion
|
|
57
|
+
|
|
58
|
+
### 6. Safe Area = Non-Negotiable
|
|
59
|
+
- Never hardcode padding for device-specific areas
|
|
60
|
+
- Always use `safeAreaInsets` / `SafeAreaView` / `WindowInsets` APIs
|
|
61
|
+
- Test on iPhone SE (small), iPhone 14 Pro (Dynamic Island), and latest iPad
|
|
62
|
+
|
|
63
|
+
## Pre-Delivery Checklist
|
|
64
|
+
|
|
65
|
+
Before presenting any design decision, implementation, or code:
|
|
66
|
+
|
|
67
|
+
**Layout & Ergonomics**
|
|
68
|
+
- [ ] Touch targets ≥ 44pt / 48dp everywhere
|
|
69
|
+
- [ ] Safe area insets respected on all edges
|
|
70
|
+
- [ ] Primary actions in thumb-reachable zone (bottom 60%)
|
|
71
|
+
- [ ] Content not hidden behind notch / Dynamic Island / home indicator
|
|
72
|
+
- [ ] Keyboard avoidance implemented for any screen with text inputs
|
|
73
|
+
|
|
74
|
+
**Platform Conventions**
|
|
75
|
+
- [ ] Back navigation: iOS swipe-back enabled + button; Android system back handled
|
|
76
|
+
- [ ] Navigation pattern matches platform idiom (tab bar on iOS; nav bar or drawer on Android)
|
|
77
|
+
- [ ] Status bar style contrasts with content behind it
|
|
78
|
+
- [ ] Haptic feedback added for primary interactions (where hardware supports)
|
|
79
|
+
|
|
80
|
+
**Accessibility**
|
|
81
|
+
- [ ] VoiceOver/TalkBack labels on all interactive elements
|
|
82
|
+
- [ ] Heading traits applied to screen titles and section headers
|
|
83
|
+
- [ ] Custom gesture actions available via accessibility Actions menu
|
|
84
|
+
- [ ] Dynamic Type / sp units used (no fixed font sizes)
|
|
85
|
+
- [ ] Color contrast ≥ 4.5:1 for body text; ≥ 3:1 for large text / UI
|
|
86
|
+
- [ ] Color information supplemented with shape/icon/text
|
|
87
|
+
|
|
88
|
+
**Motion**
|
|
89
|
+
- [ ] `reduceMotion` check before every animation
|
|
90
|
+
- [ ] Animation duration appropriate (200-400ms for most; <200ms for micro)
|
|
91
|
+
- [ ] Spring used for natural feel on expand/appear; ease-out for dismiss/collapse
|
|
92
|
+
|
|
93
|
+
**Dark Mode**
|
|
94
|
+
- [ ] All colors defined as adaptive (no hardcoded hex for any UI color)
|
|
95
|
+
- [ ] Test on OLED (true black matters for pure black backgrounds)
|
|
96
|
+
- [ ] Images and media contrast tested in both appearances
|
|
97
|
+
|
|
98
|
+
## Stack-Specific Reminders
|
|
99
|
+
|
|
100
|
+
### React Native
|
|
101
|
+
- Use `react-native-safe-area-context` not built-in SafeAreaView
|
|
102
|
+
- Use `react-native-reanimated` for gesture-driven animations
|
|
103
|
+
- Use `react-native-gesture-handler` for complex touch interactions
|
|
104
|
+
- FlatList not ScrollView for lists with 20+ items
|
|
105
|
+
- `useNativeDriver: true` on every `Animated.timing()`
|
|
106
|
+
|
|
107
|
+
### Flutter
|
|
108
|
+
- `ListView.builder` not `Column + ForEach` for long lists
|
|
109
|
+
- `const` constructors everywhere possible
|
|
110
|
+
- `GoRouter` for navigation with deep link support
|
|
111
|
+
- `Riverpod` for state management
|
|
112
|
+
- `cached_network_image` for network images
|
|
113
|
+
|
|
114
|
+
### SwiftUI
|
|
115
|
+
- `NavigationStack` not deprecated `NavigationView` (iOS 16+)
|
|
116
|
+
- `@StateObject` not `@ObservedObject` for own ViewModels
|
|
117
|
+
- `LazyVStack` not `VStack` for long lists
|
|
118
|
+
- `matchedGeometryEffect` for hero-like shared element transitions
|
|
119
|
+
- `@Environment(\.accessibilityReduceMotion)` before any animation
|
|
120
|
+
|
|
121
|
+
### Jetpack Compose
|
|
122
|
+
- `LazyColumn` with `key = { it.id }` for lists
|
|
123
|
+
- `derivedStateOf` for computed state values
|
|
124
|
+
- `StatefulShellRoute` for tab persistence in GoRouter
|
|
125
|
+
- `collectAsStateWithLifecycle()` in all state collection
|
|
126
|
+
- `WindowCompat.setDecorFitsSystemWindows(window, false)` for edge-to-edge
|
|
127
|
+
|
|
128
|
+
## Key Data Sources Baked Into Database
|
|
129
|
+
|
|
130
|
+
| Domain | Authority |
|
|
131
|
+
|--------|-----------|
|
|
132
|
+
| iOS conventions | Apple Human Interface Guidelines |
|
|
133
|
+
| Android conventions | Material Design 3 |
|
|
134
|
+
| React Native patterns | React Navigation docs + RN official docs |
|
|
135
|
+
| Flutter patterns | Flutter official docs + pub.dev best packages |
|
|
136
|
+
| SwiftUI patterns | Apple developer documentation |
|
|
137
|
+
| Compose patterns | Android Jetpack documentation |
|
|
138
|
+
| Accessibility | WCAG 2.1 + iOS Accessibility + Android Accessibility |
|
|
139
|
+
| Animation timing | Platform-standard specs (iOS spring / MD3 motion) |
|
|
@@ -63,7 +63,9 @@ git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/d
|
|
|
63
63
|
|
|
64
64
|
Per Jesse's rule "Fix broken things immediately":
|
|
65
65
|
1. Add appropriate line to .gitignore
|
|
66
|
-
2. Commit the change
|
|
66
|
+
2. Commit the change (if auto_commit enabled)
|
|
67
|
+
- Read `.agent/config.yml` — if `auto_commit: false`: skip commit, print "Skipping git operation (auto_commit: false)."
|
|
68
|
+
- If `auto_commit: true` (or absent): `git add .gitignore && git commit -m "chore: ignore worktree directory"`
|
|
67
69
|
3. Proceed with worktree creation
|
|
68
70
|
|
|
69
71
|
**Why critical:** Prevents accidentally committing worktree contents to repository.
|