Skip to content

Commit b547ddf

Browse files
authored
GH-5713 Explain in workbench (and some other small bug fixes) (#5714)
1 parent 13ca7b6 commit b547ddf

242 files changed

Lines changed: 34618 additions & 824 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codex/skills/adapt/SKILL.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
---
2+
name: adapt
3+
description: Adapt designs to work across different screen sizes, devices, contexts, or platforms. Ensures consistent experience across varied environments.
4+
args:
5+
- name: target
6+
description: The feature or component to adapt (optional)
7+
required: false
8+
- name: context
9+
description: What to adapt for (mobile, tablet, desktop, print, email, etc.)
10+
required: false
11+
user-invokable: true
12+
---
13+
14+
Adapt existing designs to work effectively across different contexts - different screen sizes, devices, platforms, or use cases.
15+
16+
## Assess Adaptation Challenge
17+
18+
Understand what needs adaptation and why:
19+
20+
1. **Identify the source context**:
21+
- What was it designed for originally? (Desktop web? Mobile app?)
22+
- What assumptions were made? (Large screen? Mouse input? Fast connection?)
23+
- What works well in current context?
24+
25+
2. **Understand target context**:
26+
- **Device**: Mobile, tablet, desktop, TV, watch, print?
27+
- **Input method**: Touch, mouse, keyboard, voice, gamepad?
28+
- **Screen constraints**: Size, resolution, orientation?
29+
- **Connection**: Fast wifi, slow 3G, offline?
30+
- **Usage context**: On-the-go vs desk, quick glance vs focused reading?
31+
- **User expectations**: What do users expect on this platform?
32+
33+
3. **Identify adaptation challenges**:
34+
- What won't fit? (Content, navigation, features)
35+
- What won't work? (Hover states on touch, tiny touch targets)
36+
- What's inappropriate? (Desktop patterns on mobile, mobile patterns on desktop)
37+
38+
**CRITICAL**: Adaptation is not just scaling - it's rethinking the experience for the new context.
39+
40+
## Plan Adaptation Strategy
41+
42+
Create context-appropriate strategy:
43+
44+
### Mobile Adaptation (Desktop → Mobile)
45+
46+
**Layout Strategy**:
47+
- Single column instead of multi-column
48+
- Vertical stacking instead of side-by-side
49+
- Full-width components instead of fixed widths
50+
- Bottom navigation instead of top/side navigation
51+
52+
**Interaction Strategy**:
53+
- Touch targets 44x44px minimum (not hover-dependent)
54+
- Swipe gestures where appropriate (lists, carousels)
55+
- Bottom sheets instead of dropdowns
56+
- Thumbs-first design (controls within thumb reach)
57+
- Larger tap areas with more spacing
58+
59+
**Content Strategy**:
60+
- Progressive disclosure (don't show everything at once)
61+
- Prioritize primary content (secondary content in tabs/accordions)
62+
- Shorter text (more concise)
63+
- Larger text (16px minimum)
64+
65+
**Navigation Strategy**:
66+
- Hamburger menu or bottom navigation
67+
- Reduce navigation complexity
68+
- Sticky headers for context
69+
- Back button in navigation flow
70+
71+
### Tablet Adaptation (Hybrid Approach)
72+
73+
**Layout Strategy**:
74+
- Two-column layouts (not single or three-column)
75+
- Side panels for secondary content
76+
- Master-detail views (list + detail)
77+
- Adaptive based on orientation (portrait vs landscape)
78+
79+
**Interaction Strategy**:
80+
- Support both touch and pointer
81+
- Touch targets 44x44px but allow denser layouts than phone
82+
- Side navigation drawers
83+
- Multi-column forms where appropriate
84+
85+
### Desktop Adaptation (Mobile → Desktop)
86+
87+
**Layout Strategy**:
88+
- Multi-column layouts (use horizontal space)
89+
- Side navigation always visible
90+
- Multiple information panels simultaneously
91+
- Fixed widths with max-width constraints (don't stretch to 4K)
92+
93+
**Interaction Strategy**:
94+
- Hover states for additional information
95+
- Keyboard shortcuts
96+
- Right-click context menus
97+
- Drag and drop where helpful
98+
- Multi-select with Shift/Cmd
99+
100+
**Content Strategy**:
101+
- Show more information upfront (less progressive disclosure)
102+
- Data tables with many columns
103+
- Richer visualizations
104+
- More detailed descriptions
105+
106+
### Print Adaptation (Screen → Print)
107+
108+
**Layout Strategy**:
109+
- Page breaks at logical points
110+
- Remove navigation, footer, interactive elements
111+
- Black and white (or limited color)
112+
- Proper margins for binding
113+
114+
**Content Strategy**:
115+
- Expand shortened content (show full URLs, hidden sections)
116+
- Add page numbers, headers, footers
117+
- Include metadata (print date, page title)
118+
- Convert charts to print-friendly versions
119+
120+
### Email Adaptation (Web → Email)
121+
122+
**Layout Strategy**:
123+
- Narrow width (600px max)
124+
- Single column only
125+
- Inline CSS (no external stylesheets)
126+
- Table-based layouts (for email client compatibility)
127+
128+
**Interaction Strategy**:
129+
- Large, obvious CTAs (buttons not text links)
130+
- No hover states (not reliable)
131+
- Deep links to web app for complex interactions
132+
133+
## Implement Adaptations
134+
135+
Apply changes systematically:
136+
137+
### Responsive Breakpoints
138+
139+
Choose appropriate breakpoints:
140+
- Mobile: 320px-767px
141+
- Tablet: 768px-1023px
142+
- Desktop: 1024px+
143+
- Or content-driven breakpoints (where design breaks)
144+
145+
### Layout Adaptation Techniques
146+
147+
- **CSS Grid/Flexbox**: Reflow layouts automatically
148+
- **Container Queries**: Adapt based on container, not viewport
149+
- **`clamp()`**: Fluid sizing between min and max
150+
- **Media queries**: Different styles for different contexts
151+
- **Display properties**: Show/hide elements per context
152+
153+
### Touch Adaptation
154+
155+
- Increase touch target sizes (44x44px minimum)
156+
- Add more spacing between interactive elements
157+
- Remove hover-dependent interactions
158+
- Add touch feedback (ripples, highlights)
159+
- Consider thumb zones (easier to reach bottom than top)
160+
161+
### Content Adaptation
162+
163+
- Use `display: none` sparingly (still downloads)
164+
- Progressive enhancement (core content first, enhancements on larger screens)
165+
- Lazy loading for off-screen content
166+
- Responsive images (`srcset`, `picture` element)
167+
168+
### Navigation Adaptation
169+
170+
- Transform complex nav to hamburger/drawer on mobile
171+
- Bottom nav bar for mobile apps
172+
- Persistent side navigation on desktop
173+
- Breadcrumbs on smaller screens for context
174+
175+
**IMPORTANT**: Test on real devices, not just browser DevTools. Device emulation is helpful but not perfect.
176+
177+
**NEVER**:
178+
- Hide core functionality on mobile (if it matters, make it work)
179+
- Assume desktop = powerful device (consider accessibility, older machines)
180+
- Use different information architecture across contexts (confusing)
181+
- Break user expectations for platform (mobile users expect mobile patterns)
182+
- Forget landscape orientation on mobile/tablet
183+
- Use generic breakpoints blindly (use content-driven breakpoints)
184+
- Ignore touch on desktop (many desktop devices have touch)
185+
186+
## Verify Adaptations
187+
188+
Test thoroughly across contexts:
189+
190+
- **Real devices**: Test on actual phones, tablets, desktops
191+
- **Different orientations**: Portrait and landscape
192+
- **Different browsers**: Safari, Chrome, Firefox, Edge
193+
- **Different OS**: iOS, Android, Windows, macOS
194+
- **Different input methods**: Touch, mouse, keyboard
195+
- **Edge cases**: Very small screens (320px), very large screens (4K)
196+
- **Slow connections**: Test on throttled network
197+
198+
Remember: You're a cross-platform design expert. Make experiences that feel native to each context while maintaining brand and functionality consistency. Adapt intentionally, test thoroughly.
199+

.codex/skills/animate/SKILL.md

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
---
2+
name: animate
3+
description: Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight.
4+
args:
5+
- name: target
6+
description: The feature or component to animate (optional)
7+
required: false
8+
user-invokable: true
9+
---
10+
11+
Analyze a feature and strategically add animations and micro-interactions that enhance understanding, provide feedback, and create delight.
12+
13+
## MANDATORY PREPARATION
14+
15+
### Context Gathering (Do This First)
16+
17+
You cannot do a great job without having necessary context, such as target audience (critical), desired use-cases (critical), brand personality/tone (playful vs serious, energetic vs calm), and performance constraints.
18+
19+
Attempt to gather these from the current thread or codebase.
20+
21+
1. If you don't find *exact* information and have to infer from existing design and functionality, you MUST STOP and {{ask_instruction}} whether you got it right.
22+
2. Otherwise, if you can't fully infer or your level of confidence is medium or lower, you MUST {{ask_instruction}} clarifying questions first to complete your context.
23+
24+
Do NOT proceed until you have answers. Guessing leads to inappropriate or excessive animation.
25+
26+
### Use frontend-design skill
27+
28+
Use the frontend-design skill for design principles and anti-patterns. Do NOT proceed until it has executed and you know all DO's and DON'Ts.
29+
30+
---
31+
32+
## Assess Animation Opportunities
33+
34+
Analyze where motion would improve the experience:
35+
36+
1. **Identify static areas**:
37+
- **Missing feedback**: Actions without visual acknowledgment (button clicks, form submission, etc.)
38+
- **Jarring transitions**: Instant state changes that feel abrupt (show/hide, page loads, route changes)
39+
- **Unclear relationships**: Spatial or hierarchical relationships that aren't obvious
40+
- **Lack of delight**: Functional but joyless interactions
41+
- **Missed guidance**: Opportunities to direct attention or explain behavior
42+
43+
2. **Understand the context**:
44+
- What's the personality? (Playful vs serious, energetic vs calm)
45+
- What's the performance budget? (Mobile-first? Complex page?)
46+
- Who's the audience? (Motion-sensitive users? Power users who want speed?)
47+
- What matters most? (One hero animation vs many micro-interactions?)
48+
49+
If any of these are unclear from the codebase, {{ask_instruction}}
50+
51+
**CRITICAL**: Respect `prefers-reduced-motion`. Always provide non-animated alternatives for users who need them.
52+
53+
## Plan Animation Strategy
54+
55+
Create a purposeful animation plan:
56+
57+
- **Hero moment**: What's the ONE signature animation? (Page load? Hero section? Key interaction?)
58+
- **Feedback layer**: Which interactions need acknowledgment?
59+
- **Transition layer**: Which state changes need smoothing?
60+
- **Delight layer**: Where can we surprise and delight?
61+
62+
**IMPORTANT**: One well-orchestrated experience beats scattered animations everywhere. Focus on high-impact moments.
63+
64+
## Implement Animations
65+
66+
Add motion systematically across these categories:
67+
68+
### Entrance Animations
69+
- **Page load choreography**: Stagger element reveals (100-150ms delays), fade + slide combinations
70+
- **Hero section**: Dramatic entrance for primary content (scale, parallax, or creative effects)
71+
- **Content reveals**: Scroll-triggered animations using intersection observer
72+
- **Modal/drawer entry**: Smooth slide + fade, backdrop fade, focus management
73+
74+
### Micro-interactions
75+
- **Button feedback**:
76+
- Hover: Subtle scale (1.02-1.05), color shift, shadow increase
77+
- Click: Quick scale down then up (0.95 → 1), ripple effect
78+
- Loading: Spinner or pulse state
79+
- **Form interactions**:
80+
- Input focus: Border color transition, slight scale or glow
81+
- Validation: Shake on error, check mark on success, smooth color transitions
82+
- **Toggle switches**: Smooth slide + color transition (200-300ms)
83+
- **Checkboxes/radio**: Check mark animation, ripple effect
84+
- **Like/favorite**: Scale + rotation, particle effects, color transition
85+
86+
### State Transitions
87+
- **Show/hide**: Fade + slide (not instant), appropriate timing (200-300ms)
88+
- **Expand/collapse**: Height transition with overflow handling, icon rotation
89+
- **Loading states**: Skeleton screen fades, spinner animations, progress bars
90+
- **Success/error**: Color transitions, icon animations, gentle scale pulse
91+
- **Enable/disable**: Opacity transitions, cursor changes
92+
93+
### Navigation & Flow
94+
- **Page transitions**: Crossfade between routes, shared element transitions
95+
- **Tab switching**: Slide indicator, content fade/slide
96+
- **Carousel/slider**: Smooth transforms, snap points, momentum
97+
- **Scroll effects**: Parallax layers, sticky headers with state changes, scroll progress indicators
98+
99+
### Feedback & Guidance
100+
- **Hover hints**: Tooltip fade-ins, cursor changes, element highlights
101+
- **Drag & drop**: Lift effect (shadow + scale), drop zone highlights, smooth repositioning
102+
- **Copy/paste**: Brief highlight flash on paste, "copied" confirmation
103+
- **Focus flow**: Highlight path through form or workflow
104+
105+
### Delight Moments
106+
- **Empty states**: Subtle floating animations on illustrations
107+
- **Completed actions**: Confetti, check mark flourish, success celebrations
108+
- **Easter eggs**: Hidden interactions for discovery
109+
- **Contextual animation**: Weather effects, time-of-day themes, seasonal touches
110+
111+
## Technical Implementation
112+
113+
Use appropriate techniques for each animation:
114+
115+
### Timing & Easing
116+
117+
**Durations by purpose:**
118+
- **100-150ms**: Instant feedback (button press, toggle)
119+
- **200-300ms**: State changes (hover, menu open)
120+
- **300-500ms**: Layout changes (accordion, modal)
121+
- **500-800ms**: Entrance animations (page load)
122+
123+
**Easing curves (use these, not CSS defaults):**
124+
```css
125+
/* Recommended - natural deceleration */
126+
--ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1); /* Smooth, refined */
127+
--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1); /* Slightly snappier */
128+
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1); /* Confident, decisive */
129+
130+
/* AVOID - feel dated and tacky */
131+
/* bounce: cubic-bezier(0.34, 1.56, 0.64, 1); */
132+
/* elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6); */
133+
```
134+
135+
**Exit animations are faster than entrances.** Use ~75% of enter duration.
136+
137+
### CSS Animations
138+
```css
139+
/* Prefer for simple, declarative animations */
140+
- transitions for state changes
141+
- @keyframes for complex sequences
142+
- transform + opacity only (GPU-accelerated)
143+
```
144+
145+
### JavaScript Animation
146+
```javascript
147+
/* Use for complex, interactive animations */
148+
- Web Animations API for programmatic control
149+
- Framer Motion for React
150+
- GSAP for complex sequences
151+
```
152+
153+
### Performance
154+
- **GPU acceleration**: Use `transform` and `opacity`, avoid layout properties
155+
- **will-change**: Add sparingly for known expensive animations
156+
- **Reduce paint**: Minimize repaints, use `contain` where appropriate
157+
- **Monitor FPS**: Ensure 60fps on target devices
158+
159+
### Accessibility
160+
```css
161+
@media (prefers-reduced-motion: reduce) {
162+
* {
163+
animation-duration: 0.01ms !important;
164+
animation-iteration-count: 1 !important;
165+
transition-duration: 0.01ms !important;
166+
}
167+
}
168+
```
169+
170+
**NEVER**:
171+
- Use bounce or elastic easing curves—they feel dated and draw attention to the animation itself
172+
- Animate layout properties (width, height, top, left)—use transform instead
173+
- Use durations over 500ms for feedback—it feels laggy
174+
- Animate without purpose—every animation needs a reason
175+
- Ignore `prefers-reduced-motion`—this is an accessibility violation
176+
- Animate everything—animation fatigue makes interfaces feel exhausting
177+
- Block interaction during animations unless intentional
178+
179+
## Verify Quality
180+
181+
Test animations thoroughly:
182+
183+
- **Smooth at 60fps**: No jank on target devices
184+
- **Feels natural**: Easing curves feel organic, not robotic
185+
- **Appropriate timing**: Not too fast (jarring) or too slow (laggy)
186+
- **Reduced motion works**: Animations disabled or simplified appropriately
187+
- **Doesn't block**: Users can interact during/after animations
188+
- **Adds value**: Makes interface clearer or more delightful
189+
190+
Remember: Motion should enhance understanding and provide feedback, not just add decoration. Animate with purpose, respect performance constraints, and always consider accessibility. Great animation is invisible - it just makes everything feel right.

0 commit comments

Comments
 (0)