devtronic 1.2.2 → 1.2.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/dist/index.js +154 -149
- package/package.json +1 -1
- package/templates/addons/auto-devtronic/agents/failure-analyst.md +156 -0
- package/templates/addons/auto-devtronic/agents/issue-parser.md +145 -0
- package/templates/addons/auto-devtronic/agents/quality-runner.md +85 -0
- package/templates/addons/auto-devtronic/manifest.json +16 -0
- package/templates/addons/auto-devtronic/skills/auto-devtronic/SKILL.md +611 -0
- package/templates/addons/design-best-practices/manifest.json +28 -0
- package/templates/addons/design-best-practices/reference/color-and-contrast.md +146 -0
- package/templates/addons/design-best-practices/reference/interaction-design.md +208 -0
- package/templates/addons/design-best-practices/reference/motion-design.md +167 -0
- package/templates/addons/design-best-practices/reference/responsive-design.md +180 -0
- package/templates/addons/design-best-practices/reference/spatial-design.md +161 -0
- package/templates/addons/design-best-practices/reference/typography.md +136 -0
- package/templates/addons/design-best-practices/reference/ux-writing.md +190 -0
- package/templates/addons/design-best-practices/rules/design-quality.md +53 -0
- package/templates/addons/design-best-practices/skills/design-harden/SKILL.md +142 -0
- package/templates/addons/design-best-practices/skills/design-init/SKILL.md +95 -0
- package/templates/addons/design-best-practices/skills/design-refine/SKILL.md +124 -0
- package/templates/addons/design-best-practices/skills/design-review/SKILL.md +107 -0
- package/templates/addons/design-best-practices/skills/design-system/SKILL.md +125 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Spatial Design Reference
|
|
2
|
+
|
|
3
|
+
Guide to spacing, layout, and visual hierarchy through spatial relationships.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Base Unit: 4px Grid
|
|
8
|
+
|
|
9
|
+
All spacing values should be multiples of 4px:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
4px → tight inline spacing, icon padding
|
|
13
|
+
8px → compact element spacing
|
|
14
|
+
12px → related element groups
|
|
15
|
+
16px → standard element spacing (1rem)
|
|
16
|
+
24px → section padding, card padding
|
|
17
|
+
32px → between distinct groups
|
|
18
|
+
48px → section separation
|
|
19
|
+
64px → major section breaks
|
|
20
|
+
96px → hero/page-level spacing
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Why 4px:** Divisible into halves (2px for borders/outlines) and works at all scale factors. 8px is also common — pick one and be consistent.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Spacing Hierarchy
|
|
28
|
+
|
|
29
|
+
Use spacing to communicate relationships:
|
|
30
|
+
|
|
31
|
+
| Relationship | Spacing | Example |
|
|
32
|
+
|-------------|---------|---------|
|
|
33
|
+
| Tight coupling | 4-8px | Icon + label, badge + text |
|
|
34
|
+
| Related items | 12-16px | Form field + label, list items |
|
|
35
|
+
| Group boundary | 24-32px | Card sections, form groups |
|
|
36
|
+
| Section break | 48-64px | Page sections, content blocks |
|
|
37
|
+
| Page-level | 96px+ | Hero to content, footer spacing |
|
|
38
|
+
|
|
39
|
+
**Rule:** Smaller gaps = related. Larger gaps = distinct. Don't use equal spacing everywhere.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Layout Grids
|
|
44
|
+
|
|
45
|
+
### CSS Grid for Page Layout
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
/* 12-column responsive grid */
|
|
49
|
+
.layout {
|
|
50
|
+
display: grid;
|
|
51
|
+
grid-template-columns: repeat(12, 1fr);
|
|
52
|
+
gap: 24px;
|
|
53
|
+
max-width: 1200px;
|
|
54
|
+
margin-inline: auto;
|
|
55
|
+
padding-inline: 16px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Content areas span columns */
|
|
59
|
+
.main { grid-column: 1 / 9; }
|
|
60
|
+
.sidebar { grid-column: 9 / 13; }
|
|
61
|
+
|
|
62
|
+
/* Responsive collapse */
|
|
63
|
+
@media (max-width: 768px) {
|
|
64
|
+
.layout { grid-template-columns: 1fr; }
|
|
65
|
+
.main, .sidebar { grid-column: 1 / -1; }
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Container Queries
|
|
70
|
+
|
|
71
|
+
Use container queries for component-level responsive design:
|
|
72
|
+
|
|
73
|
+
```css
|
|
74
|
+
.card-container {
|
|
75
|
+
container-type: inline-size;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@container (min-width: 400px) {
|
|
79
|
+
.card { flex-direction: row; }
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@container (max-width: 399px) {
|
|
83
|
+
.card { flex-direction: column; }
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Visual Hierarchy Through Space
|
|
90
|
+
|
|
91
|
+
### Scale Contrast
|
|
92
|
+
|
|
93
|
+
Pair large elements with small ones for visual interest:
|
|
94
|
+
|
|
95
|
+
- Large headline + small meta text
|
|
96
|
+
- Big number + small label
|
|
97
|
+
- Full-width hero + narrow text column
|
|
98
|
+
|
|
99
|
+
### Asymmetric Layouts
|
|
100
|
+
|
|
101
|
+
Break visual monotony:
|
|
102
|
+
|
|
103
|
+
```css
|
|
104
|
+
/* Instead of equal columns */
|
|
105
|
+
.grid-interesting {
|
|
106
|
+
display: grid;
|
|
107
|
+
grid-template-columns: 2fr 1fr; /* or 1fr 2fr */
|
|
108
|
+
gap: 32px;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Optical Alignment
|
|
113
|
+
|
|
114
|
+
Sometimes mathematical alignment looks wrong. Adjust visually:
|
|
115
|
+
|
|
116
|
+
- Text with leading whitespace (quotes, bullets) may need negative indent
|
|
117
|
+
- Icons in circles need slight offset from center (visual center ≠ mathematical center)
|
|
118
|
+
- Padding inside rounded containers should be slightly larger than flat ones
|
|
119
|
+
- Top padding often needs to be slightly less than bottom padding for visual balance
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Max Width Constraints
|
|
124
|
+
|
|
125
|
+
Prevent layouts from becoming too wide:
|
|
126
|
+
|
|
127
|
+
```css
|
|
128
|
+
/* Content wrapper */
|
|
129
|
+
.container { max-width: 1200px; margin-inline: auto; }
|
|
130
|
+
|
|
131
|
+
/* Prose content */
|
|
132
|
+
.prose { max-width: 65ch; }
|
|
133
|
+
|
|
134
|
+
/* Cards */
|
|
135
|
+
.card { max-width: 400px; }
|
|
136
|
+
|
|
137
|
+
/* Full-bleed sections break out of container */
|
|
138
|
+
.full-bleed {
|
|
139
|
+
width: 100vw;
|
|
140
|
+
margin-inline: calc(50% - 50vw);
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Z-Index Scale
|
|
147
|
+
|
|
148
|
+
Define a z-index scale to avoid conflicts:
|
|
149
|
+
|
|
150
|
+
```css
|
|
151
|
+
:root {
|
|
152
|
+
--z-base: 0;
|
|
153
|
+
--z-dropdown: 100;
|
|
154
|
+
--z-sticky: 200;
|
|
155
|
+
--z-overlay: 300;
|
|
156
|
+
--z-modal: 400;
|
|
157
|
+
--z-popover: 500;
|
|
158
|
+
--z-toast: 600;
|
|
159
|
+
--z-tooltip: 700;
|
|
160
|
+
}
|
|
161
|
+
```
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Typography Reference
|
|
2
|
+
|
|
3
|
+
Comprehensive guide to typographic best practices for frontend development.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Type Scale
|
|
8
|
+
|
|
9
|
+
### Modular Scale
|
|
10
|
+
|
|
11
|
+
Use a consistent ratio to generate font sizes. Common ratios:
|
|
12
|
+
|
|
13
|
+
| Name | Ratio | Use Case |
|
|
14
|
+
|------|-------|----------|
|
|
15
|
+
| Minor Third | 1.2 | Compact UI, data-dense apps |
|
|
16
|
+
| Major Third | 1.25 | General purpose, most apps |
|
|
17
|
+
| Perfect Fourth | 1.333 | Editorial, marketing pages |
|
|
18
|
+
| Golden Ratio | 1.618 | Display-heavy, hero sections |
|
|
19
|
+
|
|
20
|
+
**Example (Major Third, base 16px):**
|
|
21
|
+
```
|
|
22
|
+
12px → 14px → 16px → 20px → 25px → 31px → 39px → 49px
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Fluid Type with `clamp()`
|
|
26
|
+
|
|
27
|
+
Scale font sizes smoothly between viewport breakpoints:
|
|
28
|
+
|
|
29
|
+
```css
|
|
30
|
+
/* clamp(min, preferred, max) */
|
|
31
|
+
h1 { font-size: clamp(2rem, 5vw + 1rem, 4rem); }
|
|
32
|
+
h2 { font-size: clamp(1.5rem, 3vw + 0.75rem, 2.5rem); }
|
|
33
|
+
body { font-size: clamp(1rem, 1vw + 0.75rem, 1.25rem); }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Rules:**
|
|
37
|
+
- Minimum must be readable (≥14px for body, ≥12px for captions)
|
|
38
|
+
- Maximum prevents text from becoming absurdly large
|
|
39
|
+
- Preferred value uses `vw` + a fixed base for smooth scaling
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Font Selection
|
|
44
|
+
|
|
45
|
+
### System Font Stacks
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
/* Modern system stack */
|
|
49
|
+
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
50
|
+
|
|
51
|
+
/* Monospace */
|
|
52
|
+
font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Web Font Performance
|
|
56
|
+
|
|
57
|
+
- Limit to 2 font families maximum (display + body)
|
|
58
|
+
- Load only needed weights (typically 400, 500, 700)
|
|
59
|
+
- Use `font-display: swap` for body, `font-display: optional` for display
|
|
60
|
+
- Subset fonts to Latin characters when possible
|
|
61
|
+
- Prefer variable fonts for multiple weights
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Vertical Rhythm
|
|
66
|
+
|
|
67
|
+
Maintain consistent spacing based on line height:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
:root {
|
|
71
|
+
--line-height-base: 1.5; /* 24px at 16px base */
|
|
72
|
+
--rhythm: calc(1rem * var(--line-height-base)); /* 24px */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* All vertical spacing is multiples of the rhythm unit */
|
|
76
|
+
h1 { margin-bottom: var(--rhythm); }
|
|
77
|
+
p { margin-bottom: var(--rhythm); }
|
|
78
|
+
section { padding-block: calc(var(--rhythm) * 2); }
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Line Length
|
|
84
|
+
|
|
85
|
+
Optimal reading line length: **45-75 characters** (65ch ideal).
|
|
86
|
+
|
|
87
|
+
```css
|
|
88
|
+
.prose {
|
|
89
|
+
max-width: 65ch;
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
For narrow containers (sidebars, cards): 35-50 characters is acceptable.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Letter Spacing (Tracking)
|
|
98
|
+
|
|
99
|
+
- **Large display text** (>32px): Tighten tracking (-0.02em to -0.04em)
|
|
100
|
+
- **Body text** (14-18px): Leave at default (0)
|
|
101
|
+
- **Small caps / tiny labels** (<12px): Open tracking (+0.05em to +0.1em)
|
|
102
|
+
- **All-uppercase text**: Always add tracking (+0.05em minimum)
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
.display { letter-spacing: -0.02em; }
|
|
106
|
+
.label-caps { letter-spacing: 0.05em; text-transform: uppercase; }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## OpenType Features
|
|
112
|
+
|
|
113
|
+
Enable useful ligatures and numeric features:
|
|
114
|
+
|
|
115
|
+
```css
|
|
116
|
+
/* Tabular numbers for data tables */
|
|
117
|
+
.data { font-variant-numeric: tabular-nums; }
|
|
118
|
+
|
|
119
|
+
/* Old-style numbers for body text */
|
|
120
|
+
.prose { font-variant-numeric: oldstyle-nums; }
|
|
121
|
+
|
|
122
|
+
/* Common ligatures */
|
|
123
|
+
body { font-variant-ligatures: common-ligatures; }
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Hierarchy Checklist
|
|
129
|
+
|
|
130
|
+
A well-structured page should have:
|
|
131
|
+
|
|
132
|
+
1. **One dominant element** — largest text, most visual weight
|
|
133
|
+
2. **Clear heading progression** — H1 > H2 > H3 (don't skip levels)
|
|
134
|
+
3. **Body text contrast** — noticeably smaller/lighter than headings
|
|
135
|
+
4. **Caption/meta text** — smallest, lowest contrast (but still readable)
|
|
136
|
+
5. **Weight variation** — pair heavy display weights with light/regular body
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# UX Writing Reference
|
|
2
|
+
|
|
3
|
+
Guide to interface copy: error messages, labels, CTAs, empty states, and microcopy.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Error Messages
|
|
8
|
+
|
|
9
|
+
### Structure
|
|
10
|
+
|
|
11
|
+
Every error message needs three parts:
|
|
12
|
+
|
|
13
|
+
1. **What happened** — Clear description of the problem
|
|
14
|
+
2. **Why it happened** — Brief explanation (if helpful)
|
|
15
|
+
3. **What to do** — Actionable next step
|
|
16
|
+
|
|
17
|
+
### Examples
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
❌ "Error 422: Validation failed"
|
|
21
|
+
✅ "This email is already registered. Try signing in instead."
|
|
22
|
+
|
|
23
|
+
❌ "Something went wrong"
|
|
24
|
+
✅ "We couldn't save your changes. Check your connection and try again."
|
|
25
|
+
|
|
26
|
+
❌ "Invalid input"
|
|
27
|
+
✅ "Password must be at least 8 characters with one number."
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Rules
|
|
31
|
+
|
|
32
|
+
- Never blame the user ("You entered an invalid email")
|
|
33
|
+
- Never use technical jargon ("Error 500", "null reference")
|
|
34
|
+
- Always provide a path forward
|
|
35
|
+
- Use the same tone as the rest of the UI
|
|
36
|
+
- Place error messages next to the field, not in a toast or alert
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Labels & Form Copy
|
|
41
|
+
|
|
42
|
+
### Input Labels
|
|
43
|
+
|
|
44
|
+
- Be specific: "Work email" not "Email"
|
|
45
|
+
- Use nouns, not instructions: "Full name" not "Enter your full name"
|
|
46
|
+
- Don't end with a colon in modern UI (the position above the input is enough)
|
|
47
|
+
|
|
48
|
+
### Placeholder Text
|
|
49
|
+
|
|
50
|
+
- Use for format hints only: "jane@example.com", "MM/DD/YYYY"
|
|
51
|
+
- Never use as the only label (disappears on type)
|
|
52
|
+
- Use lighter color than input text
|
|
53
|
+
|
|
54
|
+
### Help Text
|
|
55
|
+
|
|
56
|
+
- Place below the input, before error messages
|
|
57
|
+
- Keep to one line: "We'll only use this for password recovery."
|
|
58
|
+
- Don't repeat the label as help text
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Buttons & CTAs
|
|
63
|
+
|
|
64
|
+
### Primary Actions
|
|
65
|
+
|
|
66
|
+
Use specific verbs, not generic ones:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
❌ "Submit" → ✅ "Create account"
|
|
70
|
+
❌ "OK" → ✅ "Save changes"
|
|
71
|
+
❌ "Click here" → ✅ "Download report"
|
|
72
|
+
❌ "Yes" → ✅ "Delete project"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Destructive Actions
|
|
76
|
+
|
|
77
|
+
- Name the action explicitly: "Delete project" not "Delete"
|
|
78
|
+
- Add confirmation context: "This will permanently delete 23 files"
|
|
79
|
+
- Use red/warning styling
|
|
80
|
+
- Make cancel the primary (default) action in confirmation dialogs
|
|
81
|
+
|
|
82
|
+
### Button Pairs
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
✅ "Cancel" / "Save changes" (clear contrast)
|
|
86
|
+
✅ "Go back" / "Continue to payment"
|
|
87
|
+
❌ "No" / "Yes" (ambiguous)
|
|
88
|
+
❌ "Cancel" / "OK" (what does OK mean?)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Empty States
|
|
94
|
+
|
|
95
|
+
Every empty state needs:
|
|
96
|
+
|
|
97
|
+
1. **Illustration or icon** (optional but effective)
|
|
98
|
+
2. **Headline** — What would be here
|
|
99
|
+
3. **Description** — Why it's empty
|
|
100
|
+
4. **Action** — How to fill it
|
|
101
|
+
|
|
102
|
+
### Examples
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
No projects yet
|
|
106
|
+
You haven't created any projects. Start with a template or from scratch.
|
|
107
|
+
[Create project]
|
|
108
|
+
|
|
109
|
+
No results for "flarbx"
|
|
110
|
+
Try a different search term or check your filters.
|
|
111
|
+
[Clear search]
|
|
112
|
+
|
|
113
|
+
All caught up!
|
|
114
|
+
No new notifications. We'll let you know when something needs your attention.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Rules
|
|
118
|
+
|
|
119
|
+
- Don't leave empty containers without explanation
|
|
120
|
+
- Guide toward the most common action
|
|
121
|
+
- Keep tone encouraging, not apologetic
|
|
122
|
+
- Different empty states: first-time vs. filtered-to-zero vs. deleted-all
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Loading Copy
|
|
127
|
+
|
|
128
|
+
### Spinner/Skeleton Text
|
|
129
|
+
|
|
130
|
+
- Don't write "Loading..." everywhere
|
|
131
|
+
- Be specific when possible: "Loading your projects..."
|
|
132
|
+
- For long waits (>3s), add context: "Setting up your workspace. This usually takes a few seconds."
|
|
133
|
+
|
|
134
|
+
### Progress States
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Uploading 3 of 12 files...
|
|
138
|
+
Almost there — analyzing your data...
|
|
139
|
+
Your report is ready!
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Confirmation & Success
|
|
145
|
+
|
|
146
|
+
### Inline Confirmation
|
|
147
|
+
|
|
148
|
+
- "Changes saved" (brief, next to the action)
|
|
149
|
+
- "Email sent to jane@example.com" (specific)
|
|
150
|
+
- Auto-dismiss after 3-5 seconds
|
|
151
|
+
|
|
152
|
+
### Don't Over-Confirm
|
|
153
|
+
|
|
154
|
+
- Saving a draft: no confirmation needed (auto-save)
|
|
155
|
+
- Adding to cart: show cart count update (visual confirmation)
|
|
156
|
+
- Deleting a major item: full confirmation dialog
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Tone Guidelines
|
|
161
|
+
|
|
162
|
+
### Default Tone: Clear, Warm, Concise
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
✅ Professional but human
|
|
166
|
+
✅ Direct without being cold
|
|
167
|
+
✅ Helpful without being patronizing
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Scale Formality by Context
|
|
171
|
+
|
|
172
|
+
| Context | Tone | Example |
|
|
173
|
+
|---------|------|---------|
|
|
174
|
+
| Onboarding | Warm, encouraging | "Welcome! Let's set up your workspace." |
|
|
175
|
+
| Error | Calm, helpful | "That file is too large. Try one under 10MB." |
|
|
176
|
+
| Success | Brief, positive | "Project created." |
|
|
177
|
+
| Destructive | Serious, clear | "This will permanently delete your account and all data." |
|
|
178
|
+
| Empty state | Friendly, guiding | "No messages yet. Start a conversation!" |
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Microcopy Checklist
|
|
183
|
+
|
|
184
|
+
- [ ] Every button says what it does (no generic "Submit")
|
|
185
|
+
- [ ] Every empty state guides toward action
|
|
186
|
+
- [ ] Error messages are actionable, not technical
|
|
187
|
+
- [ ] Tooltips add information, not restate labels
|
|
188
|
+
- [ ] Confirmation text matches the action severity
|
|
189
|
+
- [ ] Loading states are specific when possible
|
|
190
|
+
- [ ] Numbers and dates are formatted for locale
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Design Quality
|
|
2
|
+
|
|
3
|
+
Auto-loaded rule for frontend design quality. Active during frontend file editing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## AI Slop Detection
|
|
8
|
+
|
|
9
|
+
Watch for these common AI-generated design anti-patterns:
|
|
10
|
+
|
|
11
|
+
### DON'T
|
|
12
|
+
|
|
13
|
+
- Generic blue/purple gradients with no design rationale
|
|
14
|
+
- Excessive border-radius on everything (the "pill everything" syndrome)
|
|
15
|
+
- Drop shadows on every element — creates visual noise, not depth
|
|
16
|
+
- Meaningless hover animations (scale, glow) on non-interactive elements
|
|
17
|
+
- Placeholder-quality copy: "Welcome to our platform", "Get started today"
|
|
18
|
+
- Stock illustration style with flat characters and oversized props
|
|
19
|
+
- Symmetric card grids with identical spacing — no visual hierarchy
|
|
20
|
+
- Rainbow-colored dashboards with competing accent colors
|
|
21
|
+
- Decorative icons that add no information
|
|
22
|
+
- Equal visual weight on all elements — nothing stands out
|
|
23
|
+
- Dark navy + bright purple/lime accent palette (the "SaaS 2020" look)
|
|
24
|
+
- Using `opacity` to create text hierarchy instead of proper color/weight choices
|
|
25
|
+
|
|
26
|
+
### DO
|
|
27
|
+
|
|
28
|
+
- Build a constrained color palette: neutrals first, one intentional accent
|
|
29
|
+
- Create clear typographic hierarchy: vary size, weight, and color deliberately
|
|
30
|
+
- Use whitespace as a design tool — tighter for groups, generous for hero content
|
|
31
|
+
- Design for real content: actual copy, realistic data, edge-case lengths
|
|
32
|
+
- Apply the 60-30-10 color rule: dominant, secondary, accent
|
|
33
|
+
- Test contrast ratios — WCAG AA minimum (4.5:1 body, 3:1 large text)
|
|
34
|
+
- Use consistent spacing rhythm based on a 4px or 8px grid
|
|
35
|
+
- Make interactive elements obviously interactive (cursor, state changes)
|
|
36
|
+
- Ensure focus indicators are visible for keyboard navigation
|
|
37
|
+
- Design error, empty, and loading states — not just happy paths
|
|
38
|
+
- Prefer information on surfaces over boxing everything in cards
|
|
39
|
+
- Vary scale and weight to create visual interest, not just grid sameness
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Quick Reference
|
|
44
|
+
|
|
45
|
+
For detailed guidance, see the reference docs in the `design-harden` skill:
|
|
46
|
+
|
|
47
|
+
- `reference/typography.md` — Type scales, fluid sizing, vertical rhythm
|
|
48
|
+
- `reference/color-and-contrast.md` — OKLCH, WCAG contrast, functional palettes
|
|
49
|
+
- `reference/spatial-design.md` — Grid systems, spacing rhythm, optical alignment
|
|
50
|
+
- `reference/motion-design.md` — Easing, duration rules, reduced motion
|
|
51
|
+
- `reference/interaction-design.md` — States, focus management, form patterns
|
|
52
|
+
- `reference/responsive-design.md` — Breakpoints, container queries, touch targets
|
|
53
|
+
- `reference/ux-writing.md` — Error copy, CTAs, empty states, microcopy
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-harden
|
|
3
|
+
description: Production hardening — text overflow, i18n, error states, accessibility, responsive, edge cases with severity report
|
|
4
|
+
user-invokable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Design Harden
|
|
8
|
+
|
|
9
|
+
Systematically test UI components against real-world edge cases. Produces a severity-ranked report of issues found and fixes applied.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Before shipping any user-facing UI
|
|
14
|
+
- After implementing a new feature or page
|
|
15
|
+
- During pre-release QA
|
|
16
|
+
- When inheriting UI code from another team
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Process
|
|
21
|
+
|
|
22
|
+
### 1. Text Overflow & Content Limits
|
|
23
|
+
|
|
24
|
+
Test every text element with:
|
|
25
|
+
|
|
26
|
+
- **Long content**: 200+ character strings, no spaces (e.g., long URLs, German compound words)
|
|
27
|
+
- **Short content**: Single character, empty string
|
|
28
|
+
- **Special characters**: Quotes, ampersands, angle brackets, emoji, RTL characters
|
|
29
|
+
- **Numbers**: Large numbers (1,000,000+), negative numbers, decimals
|
|
30
|
+
|
|
31
|
+
**Check for:**
|
|
32
|
+
- Text clipping without ellipsis
|
|
33
|
+
- Layout breaking from long strings
|
|
34
|
+
- Container overflow
|
|
35
|
+
- Missing `text-overflow`, `overflow`, `word-break` properties
|
|
36
|
+
|
|
37
|
+
### 2. Internationalization (i18n)
|
|
38
|
+
|
|
39
|
+
- **Text expansion**: German/Finnish text is 30-40% longer than English
|
|
40
|
+
- **RTL layout**: Does the layout mirror correctly?
|
|
41
|
+
- **CJK text**: Chinese/Japanese/Korean characters may affect line height
|
|
42
|
+
- **Date/number formats**: Localized formatting
|
|
43
|
+
- **Pluralization**: "1 item" vs "2 items" vs "0 items"
|
|
44
|
+
|
|
45
|
+
### 3. Error States
|
|
46
|
+
|
|
47
|
+
Every interactive element needs:
|
|
48
|
+
|
|
49
|
+
- **Validation errors**: Inline, accessible, not just color-coded
|
|
50
|
+
- **Network failures**: What happens when the API is unreachable?
|
|
51
|
+
- **Empty states**: No data, no results, first-time user
|
|
52
|
+
- **Partial failures**: Some items load, others fail
|
|
53
|
+
- **Timeout states**: Slow network, pending responses
|
|
54
|
+
|
|
55
|
+
### 4. Accessibility Audit
|
|
56
|
+
|
|
57
|
+
- **Keyboard navigation**: Tab order logical? All interactive elements reachable?
|
|
58
|
+
- **Focus management**: Focus trap in modals? Focus restored on close?
|
|
59
|
+
- **Screen reader**: Landmarks, headings hierarchy, ARIA labels, live regions
|
|
60
|
+
- **Color contrast**: WCAG AA (4.5:1 body, 3:1 large text, 3:1 UI components)
|
|
61
|
+
- **Motion**: `prefers-reduced-motion` respected?
|
|
62
|
+
- **Touch targets**: 44x44px minimum on mobile
|
|
63
|
+
|
|
64
|
+
### 5. Responsive Testing
|
|
65
|
+
|
|
66
|
+
Test at these critical widths:
|
|
67
|
+
- 320px (small mobile)
|
|
68
|
+
- 375px (standard mobile)
|
|
69
|
+
- 768px (tablet)
|
|
70
|
+
- 1024px (small desktop)
|
|
71
|
+
- 1440px (standard desktop)
|
|
72
|
+
- 1920px+ (large desktop)
|
|
73
|
+
|
|
74
|
+
**Check for:**
|
|
75
|
+
- Horizontal scroll at any viewport
|
|
76
|
+
- Touch targets too small on mobile
|
|
77
|
+
- Text unreadable at small sizes
|
|
78
|
+
- Images not scaling
|
|
79
|
+
- Navigation usability on all sizes
|
|
80
|
+
|
|
81
|
+
### 6. Edge Cases
|
|
82
|
+
|
|
83
|
+
- **Loading states**: Skeleton screens, spinners, progressive loading
|
|
84
|
+
- **Stale data**: What shows when cached data is outdated?
|
|
85
|
+
- **Concurrent actions**: Double-click submit, rapid toggle
|
|
86
|
+
- **Browser back/forward**: State preserved?
|
|
87
|
+
- **Deep linking**: Direct URL access to specific states
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Output Format
|
|
92
|
+
|
|
93
|
+
```markdown
|
|
94
|
+
## Hardening Report: [Component/Page]
|
|
95
|
+
|
|
96
|
+
### Summary
|
|
97
|
+
- Critical: N issues
|
|
98
|
+
- Major: N issues
|
|
99
|
+
- Minor: N issues
|
|
100
|
+
|
|
101
|
+
### Critical (must fix before ship)
|
|
102
|
+
|
|
103
|
+
| # | Category | Issue | Location | Fix |
|
|
104
|
+
|---|----------|-------|----------|-----|
|
|
105
|
+
| 1 | Overflow | Long text breaks card layout | `Card.tsx:34` | Add `overflow-hidden truncate` |
|
|
106
|
+
| 2 | A11y | No focus indicator on buttons | `Button.tsx:12` | Add `focus-visible:ring-2` |
|
|
107
|
+
|
|
108
|
+
### Major (fix soon)
|
|
109
|
+
|
|
110
|
+
| # | Category | Issue | Location | Fix |
|
|
111
|
+
|---|----------|-------|----------|-----|
|
|
112
|
+
| 3 | Responsive | Nav overlaps content at 320px | `Nav.tsx:22` | Use hamburger below 640px |
|
|
113
|
+
|
|
114
|
+
### Minor (nice to have)
|
|
115
|
+
|
|
116
|
+
| # | Category | Issue | Location | Fix |
|
|
117
|
+
|---|----------|-------|----------|-----|
|
|
118
|
+
| 4 | i18n | Hardcoded "items" string | `List.tsx:45` | Use i18n key |
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Reference Docs
|
|
124
|
+
|
|
125
|
+
Detailed guidance for each area is available in the `reference/` directory:
|
|
126
|
+
|
|
127
|
+
- `reference/typography.md` — Type scales, fluid sizing, vertical rhythm
|
|
128
|
+
- `reference/color-and-contrast.md` — OKLCH, WCAG, functional palettes
|
|
129
|
+
- `reference/spatial-design.md` — Grid, spacing rhythm, optical alignment
|
|
130
|
+
- `reference/motion-design.md` — Duration, easing, reduced motion
|
|
131
|
+
- `reference/interaction-design.md` — States, focus, forms, keyboard nav
|
|
132
|
+
- `reference/responsive-design.md` — Breakpoints, container queries, safe areas
|
|
133
|
+
- `reference/ux-writing.md` — Error messages, CTAs, empty states
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Tips
|
|
138
|
+
|
|
139
|
+
- Start with critical categories (overflow, a11y) before minor ones
|
|
140
|
+
- Test with real content, not "Lorem ipsum"
|
|
141
|
+
- Use browser DevTools to simulate slow network, different viewports
|
|
142
|
+
- Run this skill on individual components, not entire pages at once
|