picasso-skill 2.0.0 → 2.0.2

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.
@@ -0,0 +1,227 @@
1
+ # Tables and Forms Reference
2
+
3
+ ## Table of Contents
4
+ 1. Sortable Tables
5
+ 2. Responsive Tables
6
+ 3. Inline Editing
7
+ 4. Multi-Select Patterns
8
+ 5. Form Validation
9
+ 6. Multi-Step Forms
10
+ 7. Complex Inputs
11
+ 8. Common Mistakes
12
+
13
+ ---
14
+
15
+ ## 1. Sortable Tables
16
+
17
+ ```html
18
+ <table>
19
+ <thead>
20
+ <tr>
21
+ <th aria-sort="ascending">
22
+ <button>Name <span aria-hidden="true">↑</span></button>
23
+ </th>
24
+ <th aria-sort="none">
25
+ <button>Date <span aria-hidden="true">↕</span></button>
26
+ </th>
27
+ </tr>
28
+ </thead>
29
+ </table>
30
+ ```
31
+
32
+ - Use `aria-sort` on `<th>`: `ascending`, `descending`, or `none`.
33
+ - Sort icon: `↑` ascending, `↓` descending, `↕` unsorted. Use `aria-hidden="true"` on the icon.
34
+ - Sortable headers must be `<button>` inside `<th>`, not clickable `<th>`.
35
+ - Default sort: most recent first for dates, alphabetical for names.
36
+
37
+ ---
38
+
39
+ ## 2. Responsive Tables
40
+
41
+ **Option A: Horizontal scroll** (preferred for data tables)
42
+
43
+ ```css
44
+ .table-container {
45
+ overflow-x: auto;
46
+ -webkit-overflow-scrolling: touch;
47
+ border: 1px solid var(--border);
48
+ border-radius: 8px;
49
+ }
50
+
51
+ /* Fade edge to hint scrollability */
52
+ .table-container::after {
53
+ content: '';
54
+ position: absolute;
55
+ right: 0;
56
+ top: 0;
57
+ bottom: 0;
58
+ width: 40px;
59
+ background: linear-gradient(to left, var(--surface-1), transparent);
60
+ pointer-events: none;
61
+ }
62
+ ```
63
+
64
+ **Option B: Stacked cards** (for simple tables on mobile)
65
+
66
+ ```css
67
+ @media (max-width: 640px) {
68
+ table, thead, tbody, th, td, tr { display: block; }
69
+ thead { display: none; }
70
+ td { padding: 8px 16px; text-align: right; }
71
+ td::before {
72
+ content: attr(data-label);
73
+ float: left;
74
+ font-weight: 600;
75
+ color: var(--text-secondary);
76
+ }
77
+ }
78
+ ```
79
+
80
+ ---
81
+
82
+ ## 3. Inline Editing
83
+
84
+ Click to edit pattern: display text, click reveals input, blur/Enter saves.
85
+
86
+ ```jsx
87
+ function EditableCell({ value, onSave }) {
88
+ const [editing, setEditing] = useState(false);
89
+ const [draft, setDraft] = useState(value);
90
+
91
+ if (!editing) return (
92
+ <span onClick={() => setEditing(true)} className="cursor-text hover:bg-surface-2 px-2 py-1 rounded">
93
+ {value}
94
+ </span>
95
+ );
96
+
97
+ return (
98
+ <input
99
+ value={draft}
100
+ onChange={e => setDraft(e.target.value)}
101
+ onBlur={() => { onSave(draft); setEditing(false); }}
102
+ onKeyDown={e => { if (e.key === 'Enter') { onSave(draft); setEditing(false); } if (e.key === 'Escape') setEditing(false); }}
103
+ autoFocus
104
+ className="input-base w-full"
105
+ />
106
+ );
107
+ }
108
+ ```
109
+
110
+ Show a subtle pencil icon on row hover. Use `opacity-0 group-hover:opacity-100` pattern.
111
+
112
+ ---
113
+
114
+ ## 4. Multi-Select Patterns
115
+
116
+ - **Checkbox column**: leftmost column, always visible.
117
+ - **Shift-click range select**: select from last checked to current.
118
+ - **Select all**: checkbox in header, toggles all visible (filtered) rows.
119
+ - **Bulk action bar**: appears when 1+ rows selected. Shows count + actions.
120
+
121
+ ```jsx
122
+ <div className={`fixed bottom-4 left-1/2 -translate-x-1/2 bg-surface-2 rounded-xl px-4 py-2
123
+ flex items-center gap-4 shadow-lg border border-border transition-transform
124
+ ${selectedCount > 0 ? 'translate-y-0' : 'translate-y-[200%]'}`}>
125
+ <span className="text-sm font-medium">{selectedCount} selected</span>
126
+ <button className="btn-ghost text-sm">Export</button>
127
+ <button className="btn-ghost text-sm text-red">Delete</button>
128
+ </div>
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 5. Form Validation
134
+
135
+ **When to validate:**
136
+
137
+ | Trigger | Use For |
138
+ |---|---|
139
+ | On blur | Email format, required fields, min/max length |
140
+ | On submit | All fields, server-side checks |
141
+ | Real-time (on change) | Password strength, username availability |
142
+ | Never on keystroke | Don't interrupt typing. Wait for blur or 500ms debounce. |
143
+
144
+ ```jsx
145
+ <div className="space-y-1.5">
146
+ <label htmlFor="email" className="text-sm font-medium">Email</label>
147
+ <input
148
+ id="email"
149
+ type="email"
150
+ aria-invalid={error ? "true" : undefined}
151
+ aria-describedby={error ? "email-error" : undefined}
152
+ className={`input-base ${error ? 'border-red' : ''}`}
153
+ />
154
+ {error && (
155
+ <p id="email-error" role="alert" className="text-xs text-red flex items-center gap-1">
156
+ <svg className="w-3.5 h-3.5" aria-hidden="true">...</svg>
157
+ {error}
158
+ </p>
159
+ )}
160
+ </div>
161
+ ```
162
+
163
+ Error messages: specific and helpful. "Enter a valid email" not "Invalid input."
164
+
165
+ ---
166
+
167
+ ## 6. Multi-Step Forms
168
+
169
+ Show a progress indicator. Allow back navigation. Validate per step, not all at once.
170
+
171
+ ```jsx
172
+ <div className="flex items-center gap-2 mb-8">
173
+ {steps.map((step, i) => (
174
+ <Fragment key={i}>
175
+ <div className={`flex items-center justify-center h-8 w-8 rounded-full text-sm font-bold
176
+ ${i < currentStep ? 'bg-accent text-white' :
177
+ i === currentStep ? 'border-2 border-accent text-accent' :
178
+ 'border border-border text-muted'}`}>
179
+ {i < currentStep ? '✓' : i + 1}
180
+ </div>
181
+ {i < steps.length - 1 && (
182
+ <div className={`flex-1 h-0.5 ${i < currentStep ? 'bg-accent' : 'bg-border'}`} />
183
+ )}
184
+ </Fragment>
185
+ ))}
186
+ </div>
187
+ ```
188
+
189
+ Rules:
190
+ - Save progress per step (don't lose data on back).
191
+ - Validate step before advancing (disable Next if invalid).
192
+ - Show step count: "Step 2 of 4".
193
+ - Allow clicking completed steps to go back.
194
+ - Final step: show summary before submit.
195
+
196
+ ---
197
+
198
+ ## 7. Complex Inputs
199
+
200
+ **Date pickers:** Use native `<input type="date">` first. Custom picker only if design requires it. Always allow manual text entry as fallback.
201
+
202
+ **File upload:** Show progress, preview (for images), allow removal.
203
+
204
+ ```jsx
205
+ <label className="flex flex-col items-center gap-2 p-8 border-2 border-dashed border-border
206
+ rounded-xl cursor-pointer hover:border-accent hover:bg-accent/5 transition-colors">
207
+ <svg>...</svg>
208
+ <span className="text-sm text-secondary">Drop files or click to upload</span>
209
+ <input type="file" className="hidden" onChange={handleUpload} />
210
+ </label>
211
+ ```
212
+
213
+ **Address autocomplete:** Use Google Places API or similar. Show suggestions in a dropdown. Parse into structured fields (street, city, state, zip).
214
+
215
+ ---
216
+
217
+ ## 8. Common Mistakes
218
+
219
+ - **Sortable `<th>` without `<button>`.** Clicking a `<th>` isn't keyboard accessible.
220
+ - **No `aria-sort` on sortable columns.** Screen readers can't announce sort state.
221
+ - **Validating on every keystroke.** Annoying. Use blur or 500ms debounce.
222
+ - **Error messages without `role="alert"`.** Screen readers won't announce them.
223
+ - **Multi-step form losing data on back.** Save each step's state.
224
+ - **No horizontal scroll hint on tables.** Users don't know content is hidden. Add fade gradient.
225
+ - **Custom date picker without text input fallback.** Some users prefer typing dates.
226
+ - **Select all selecting ALL rows, not just filtered.** Only select what's visible.
227
+ - **Labels as placeholder text.** Labels must be visible above the input, always.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: picasso
3
- version: 2.0.0
3
+ version: 2.0.1
4
4
  description: >
5
5
  The ultimate frontend design and UI engineering skill. Use this whenever the user asks to build, design, style, or improve any web interface, component, page, application, dashboard, landing page, artifact, poster, or visual output. Covers typography, color systems, spatial design, motion/animation, interaction design, responsive layouts, sound design, haptic feedback, icon systems, generative art, theming, React best practices, and DESIGN.md system generation. Also use when the user asks to audit, critique, polish, simplify, animate, or normalize a frontend. Triggers on any mention of "make it look good," "fix the design," "UI," "UX," "frontend," "component," "landing page," "dashboard," "artifact," "poster," "design system," "theme," "animation," "responsive," or any request to improve visual quality. Use this skill even when the user does not explicitly ask for design help but the task involves producing a visual interface.
6
6
  metadata:
@@ -74,6 +74,15 @@ Before writing any code, read the reference files relevant to the task. Each cov
74
74
  | `references/brand-and-identity.md` | Logo sizing, brand color usage, consistency, lockup variants |
75
75
  | `references/animation-performance.md` | Compositor-only props, will-change, layout thrashing, contain |
76
76
  | `references/code-typography.md` | Monospace fonts, syntax highlighting, code blocks, diff views |
77
+ | `references/accessibility-wcag.md` | WCAG 2.2, ARIA patterns, keyboard nav, screen reader testing |
78
+ | `references/conversion-design.md` | Landing pages, CTAs, pricing tables, friction reduction |
79
+ | `references/data-visualization.md` | Chart selection matrix, dashboard patterns, accessible charts |
80
+ | `references/modern-css-performance.md` | CSS nesting, :has(), View Transitions, Tailwind v4, container queries |
81
+ | `references/performance-optimization.md` | Core Web Vitals, Lighthouse, image optimization, 45 Vercel rules |
82
+ | `references/style-presets.md` | 22 curated design presets with exact OKLCH values and font pairings |
83
+ | `references/tools-catalog.md` | Tool recommendations: torph, soundcn, Lucide, Facehash, better-icons |
84
+ | `references/ux-psychology.md` | Gestalt principles, Fitts's Law, Hick's Law, cognitive load, heuristics |
85
+ | `references/ux-writing.md` | Error messages, microcopy, terminology, voice and tone, CTAs |
77
86
 
78
87
  ---
79
88
 
@@ -0,0 +1,53 @@
1
+ # .picasso.md -- Project Design Configuration
2
+
3
+ <!-- Drop this file in your project root. The Picasso agent reads it before every
4
+ audit to understand your project's design preferences. Any field left as the
5
+ default placeholder (brackets) will be ignored and Picasso defaults apply. -->
6
+
7
+ ## Brand
8
+ <!-- Core identity. Guides tone-of-voice checks and overall aesthetic expectations. -->
9
+ - **Name:** [Your product name]
10
+ - **Tone:** [e.g., professional, playful, minimal, bold]
11
+ - **Industry:** [e.g., fintech, health, creative, education, developer tools]
12
+
13
+ ## Typography
14
+ <!-- Picasso flags generic fonts (Inter, Roboto, Arial) as AI-slop by default.
15
+ If your project intentionally uses one of those, declare it here and it
16
+ will be treated as an approved choice. -->
17
+ - **Display Font:** [e.g., Satoshi, Cabinet Grotesk]
18
+ - **Body Font:** [e.g., DM Sans, Outfit]
19
+ - **Mono Font:** [e.g., Geist Mono, JetBrains Mono]
20
+ - **Type Scale Ratio:** [e.g., 1.25 (Major Third)]
21
+
22
+ ## Color
23
+ <!-- Picasso uses OKLCH as its default color model.
24
+ Declaring your palette here prevents false positives when auditing
25
+ color usage across the codebase. -->
26
+ - **Primary Accent:** [e.g., oklch(0.55 0.25 250)]
27
+ - **Neutral Tint:** [e.g., cool (blue), warm (amber), neutral]
28
+ - **Dark Mode:** [yes/no/both]
29
+
30
+ ## Component Library
31
+ <!-- Tells Picasso which component primitives and CSS framework to expect
32
+ so it can tailor advice and auto-fixes accordingly. -->
33
+ - **Framework:** [e.g., shadcn/ui + Radix, Chakra, custom]
34
+ - **CSS:** [e.g., Tailwind v4, CSS Modules, Panda CSS]
35
+
36
+ ## Design Settings
37
+ <!-- These knobs control how aggressively Picasso suggests changes.
38
+ Scale is 1-10 for each. -->
39
+ - **DESIGN_VARIANCE:** [1-10, default 6]
40
+ <!-- How far Picasso can deviate from safe/conventional choices.
41
+ 1 = strictly conservative, 10 = experimental and opinionated. -->
42
+ - **MOTION_INTENSITY:** [1-10, default 5]
43
+ <!-- Controls animation suggestions.
44
+ 1 = almost no motion, 10 = rich choreographed animations. -->
45
+ - **VISUAL_DENSITY:** [1-10, default 5]
46
+ <!-- How packed the UI should feel.
47
+ 1 = lots of whitespace, 10 = information-dense dashboard style. -->
48
+
49
+ ## Constraints
50
+ <!-- Hard requirements that override all other Picasso recommendations.
51
+ Add one bullet per constraint. Remove the examples below and add your own. -->
52
+ - [e.g., "Must support IE11", "No animations", "508 compliance required"]
53
+ - [e.g., "Match existing app at app.example.com"]
@@ -1,83 +0,0 @@
1
- # Pre-Ship Design Checklist
2
-
3
- Run through before shipping any frontend work. Each item is a concrete pass/fail check, not a guideline.
4
-
5
- ---
6
-
7
- ## Typography
8
- - [ ] Primary font is NOT Inter, Roboto, Arial, Helvetica, or system-ui
9
- - [ ] Heading hierarchy is correct (h1 > h2 > h3, no skipping)
10
- - [ ] Body text line-height is 1.5-1.6
11
- - [ ] Large headings have negative letter-spacing (-0.01 to -0.02em)
12
- - [ ] Prose max-width is ~65ch or 640px
13
- - [ ] `tabular-nums` on any data/numbers displayed
14
- - [ ] Font loading is optimized (preload, font-display)
15
-
16
- ## Color & Contrast
17
- - [ ] No pure black (#000) or pure gray -- neutrals are tinted
18
- - [ ] Body text passes 4.5:1 contrast ratio
19
- - [ ] Large text passes 3:1 contrast ratio
20
- - [ ] UI components pass 3:1 contrast ratio
21
- - [ ] Colors defined in OKLCH (not hex or HSL)
22
- - [ ] Dark mode tested (if applicable)
23
- - [ ] Accent color is not a Tailwind default
24
-
25
- ## Spatial Design
26
- - [ ] Spacing follows 4px scale consistently
27
- - [ ] Intra-group spacing < inter-group spacing (2:1 ratio)
28
- - [ ] No uniform padding/margin everywhere
29
- - [ ] Layout is NOT just centered columns
30
- - [ ] Cards are not nested within cards
31
-
32
- ## Depth & Elevation
33
- - [ ] Important elements are visually elevated
34
- - [ ] Shadow hierarchy exists (not same shadow everywhere)
35
- - [ ] Hover states show elevation change where appropriate
36
- - [ ] Dark mode shadows are adjusted (more opacity or border-based)
37
-
38
- ## Motion & Animation
39
- - [ ] `prefers-reduced-motion` is respected
40
- - [ ] No `transition: all` (specific properties only)
41
- - [ ] Easing is NOT linear or default `ease`
42
- - [ ] Page load has some choreography (staggered reveals)
43
- - [ ] Animations use `transform` and `opacity` only (GPU-composited)
44
-
45
- ## Interaction
46
- - [ ] All interactive elements have hover, focus, active, disabled states
47
- - [ ] Focus indicators are visible (`:focus-visible`, 2px outline)
48
- - [ ] Touch targets are 44x44px minimum
49
- - [ ] Forms have proper labels (not just placeholders)
50
- - [ ] Error messages are inline and descriptive
51
- - [ ] Destructive actions have confirmation or undo
52
- - [ ] Loading states use skeletons (not just spinners)
53
-
54
- ## Accessibility
55
- - [ ] Semantic HTML used (`<button>`, `<a>`, `<nav>`, `<main>`, etc.)
56
- - [ ] All images have meaningful alt text (or `alt=""` for decorative)
57
- - [ ] Keyboard navigation works throughout (Tab, Enter, Escape)
58
- - [ ] Skip link exists for main content
59
- - [ ] Page works at 200% zoom
60
- - [ ] Color is not the only means of conveying information
61
-
62
- ## Responsive
63
- - [ ] Mobile-first CSS (`min-width` queries)
64
- - [ ] Tested on real mobile viewport (not just DevTools)
65
- - [ ] `dvh` used with `vh` fallback for full-height sections
66
- - [ ] Hover effects scoped with `@media (hover: hover)`
67
- - [ ] Safe areas handled for notched devices
68
- - [ ] Tables are scrollable or stacked on mobile
69
-
70
- ## Performance
71
- - [ ] Hero image has `fetchpriority="high"`
72
- - [ ] Below-fold images have `loading="lazy"`
73
- - [ ] No barrel file imports (direct imports only)
74
- - [ ] Critical CSS is inlined or prioritized
75
- - [ ] Fonts are subsetted and self-hosted where possible
76
- - [ ] SVGs are optimized (svgo)
77
-
78
- ## Anti-Slop Final Check
79
- - [ ] The 3-Second Test: Would someone identify this as "AI-generated"?
80
- - [ ] The Squint Test: Can you see hierarchy and groupings when blurred?
81
- - [ ] No 3+ AI fingerprints present simultaneously
82
- - [ ] At least ONE memorable design choice exists
83
- - [ ] Design varies between projects (not converging on same look)