@ytspar/sweetlink 1.15.0 → 1.16.1
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/claude-agents/sweetlink-visual-iterative.md +453 -0
- package/claude-context/sweetlink-architecture.md +352 -0
- package/claude-context/sweetlink-cdp-guide.md +385 -0
- package/claude-context/ui-verification-mandate.md +65 -0
- package/claude-skills/console-check-sweetlink/SKILL.md +330 -0
- package/claude-skills/console-check-sweetlink/evals/evals.json +35 -0
- package/claude-skills/console-check-sweetlink/examples.md +394 -0
- package/claude-skills/resize-for-claude/SKILL.md +97 -0
- package/claude-skills/resize-for-claude/evals/evals.json +23 -0
- package/claude-skills/responsive-screenshots/SKILL.md +366 -0
- package/claude-skills/responsive-screenshots/evals/evals.json +23 -0
- package/claude-skills/responsive-screenshots/examples.md +441 -0
- package/claude-skills/screenshot/evals/evals.json +35 -0
- package/dist/cli/sweetlink-dev.js +0 -0
- package/dist/cli/sweetlink.js +0 -0
- package/dist/daemon/index.js +0 -0
- package/package.json +49 -28
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: responsive-screenshots
|
|
3
|
+
description: "Capture screenshots at mobile/tablet/desktop breakpoints via Sweetlink. Triggers on: \"responsive screenshots\", \"test breakpoints\", \"check mobile/tablet/desktop\", \"viewport screenshots\". NOT for single screenshots (use screenshot) or Playwright-based design review (use design-review agent)."
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Responsive Screenshots Skill
|
|
8
|
+
|
|
9
|
+
Capture screenshots at standard responsive breakpoints to verify designs work across all device sizes.
|
|
10
|
+
|
|
11
|
+
## Purpose
|
|
12
|
+
|
|
13
|
+
This skill automates responsive design testing by capturing screenshots at common viewport sizes. It ensures layouts adapt correctly and maintains visual quality across mobile, tablet, and desktop devices.
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
**Automatically use this skill when:**
|
|
18
|
+
|
|
19
|
+
- Implementing responsive layouts or components
|
|
20
|
+
- After making CSS/styling changes
|
|
21
|
+
- During design reviews and QA
|
|
22
|
+
- User asks to "test responsive design"
|
|
23
|
+
- Verifying Tailwind breakpoint behavior
|
|
24
|
+
- Before marking UI tasks as complete
|
|
25
|
+
- Testing navigation, grids, or complex layouts
|
|
26
|
+
|
|
27
|
+
## How It Works
|
|
28
|
+
|
|
29
|
+
The skill captures screenshots at three standard breakpoints:
|
|
30
|
+
|
|
31
|
+
1. **Mobile**: 375px width (iPhone SE, common mobile)
|
|
32
|
+
2. **Tablet**: 768px width (iPad, tablet devices)
|
|
33
|
+
3. **Desktop**: 1440px width (standard desktop/laptop)
|
|
34
|
+
|
|
35
|
+
Screenshots are saved to `.tmp/screenshots/` with descriptive names.
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### Capture All Breakpoints
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Mobile (375px)
|
|
43
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/mobile.png
|
|
44
|
+
|
|
45
|
+
# Tablet (768px)
|
|
46
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/tablet.png
|
|
47
|
+
|
|
48
|
+
# Desktop (1440px)
|
|
49
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/desktop.png
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Capture Specific Component
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Mobile view of header
|
|
56
|
+
pnpm sweetlink screenshot --viewport mobile --selector "header" --output .tmp/screenshots/header-mobile.png
|
|
57
|
+
|
|
58
|
+
# Tablet view of card grid
|
|
59
|
+
pnpm sweetlink screenshot --viewport tablet --selector ".card-grid" --output .tmp/screenshots/cards-tablet.png
|
|
60
|
+
|
|
61
|
+
# Desktop view of dashboard
|
|
62
|
+
pnpm sweetlink screenshot --viewport desktop --selector "main" --output .tmp/screenshots/dashboard-desktop.png
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Standard Breakpoints
|
|
66
|
+
|
|
67
|
+
### Mobile (375px)
|
|
68
|
+
|
|
69
|
+
- **Devices**: iPhone SE, small phones
|
|
70
|
+
- **Tailwind**: Default styles, before `sm:` breakpoint
|
|
71
|
+
- **Use case**: Verify mobile-first design works on smallest screens
|
|
72
|
+
- **Common issues**: Text overflow, cramped layouts, touch targets too small
|
|
73
|
+
|
|
74
|
+
### Tablet (768px)
|
|
75
|
+
|
|
76
|
+
- **Devices**: iPad, tablets, small laptops
|
|
77
|
+
- **Tailwind**: `md:` breakpoint
|
|
78
|
+
- **Use case**: Verify intermediate layouts between mobile and desktop
|
|
79
|
+
- **Common issues**: Awkward grid columns, navbar behavior
|
|
80
|
+
|
|
81
|
+
### Desktop (1440px)
|
|
82
|
+
|
|
83
|
+
- **Devices**: Laptops, desktop monitors
|
|
84
|
+
- **Tailwind**: `lg:` and `xl:` breakpoints
|
|
85
|
+
- **Use case**: Verify full desktop experience with all features visible
|
|
86
|
+
- **Common issues**: Too much whitespace, misaligned grids
|
|
87
|
+
|
|
88
|
+
## Output Format
|
|
89
|
+
|
|
90
|
+
### Success
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
✅ Responsive Screenshots Captured
|
|
94
|
+
|
|
95
|
+
📱 Mobile (375px): .tmp/screenshots/mobile.png
|
|
96
|
+
💻 Tablet (768px): .tmp/screenshots/tablet.png
|
|
97
|
+
🖥️ Desktop (1440px): .tmp/screenshots/desktop.png
|
|
98
|
+
|
|
99
|
+
All viewports captured successfully.
|
|
100
|
+
Review screenshots for responsive behavior.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### With Analysis
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
📸 Responsive Design Review
|
|
107
|
+
|
|
108
|
+
### Mobile (375px)
|
|
109
|
+
Screenshot: .tmp/screenshots/mobile.png
|
|
110
|
+
✅ Layout: Adapts correctly
|
|
111
|
+
✅ Text: Readable, no overflow
|
|
112
|
+
✅ Touch targets: Adequate size (48px min)
|
|
113
|
+
⚠️ Issue: Navigation menu slightly cramped
|
|
114
|
+
|
|
115
|
+
### Tablet (768px)
|
|
116
|
+
Screenshot: .tmp/screenshots/tablet.png
|
|
117
|
+
✅ Layout: Two-column grid works well
|
|
118
|
+
✅ Navigation: Expanded header looks good
|
|
119
|
+
✅ Images: Scaled appropriately
|
|
120
|
+
|
|
121
|
+
### Desktop (1440px)
|
|
122
|
+
Screenshot: .tmp/screenshots/desktop.png
|
|
123
|
+
✅ Layout: Three-column grid displays properly
|
|
124
|
+
✅ Whitespace: Professional spacing
|
|
125
|
+
✅ Typography: Excellent hierarchy
|
|
126
|
+
|
|
127
|
+
### Overall Assessment:
|
|
128
|
+
✅ Responsive design PASSED
|
|
129
|
+
Minor fix needed: Mobile navigation spacing
|
|
130
|
+
|
|
131
|
+
Recommendation: Increase padding on mobile nav items
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Best Practices
|
|
135
|
+
|
|
136
|
+
### Complete Responsive Check
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# 1. Capture all breakpoints
|
|
140
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/mobile.png
|
|
141
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/tablet.png
|
|
142
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/desktop.png
|
|
143
|
+
|
|
144
|
+
# 2. Read screenshots back to analyze
|
|
145
|
+
# (Use Read tool to view each screenshot)
|
|
146
|
+
|
|
147
|
+
# 3. Compare against design requirements
|
|
148
|
+
|
|
149
|
+
# 4. Document any issues found
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Component-Specific Testing
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Test specific component across breakpoints
|
|
156
|
+
pnpm sweetlink screenshot --viewport mobile --selector ".hero" --output .tmp/screenshots/hero-mobile.png
|
|
157
|
+
pnpm sweetlink screenshot --viewport tablet --selector ".hero" --output .tmp/screenshots/hero-tablet.png
|
|
158
|
+
pnpm sweetlink screenshot --viewport desktop --selector ".hero" --output .tmp/screenshots/hero-desktop.png
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Before/After Comparison
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Before changes
|
|
165
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/before-mobile.png
|
|
166
|
+
|
|
167
|
+
# Make CSS changes
|
|
168
|
+
|
|
169
|
+
# After changes
|
|
170
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/after-mobile.png
|
|
171
|
+
|
|
172
|
+
# Compare to verify improvement
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Common Responsive Issues
|
|
176
|
+
|
|
177
|
+
### Issue 1: Text Overflow on Mobile
|
|
178
|
+
|
|
179
|
+
**Symptom:** Text gets cut off or wraps awkwardly
|
|
180
|
+
**Check:** Mobile screenshot shows truncated content
|
|
181
|
+
**Fix:** Reduce font size or adjust container width
|
|
182
|
+
|
|
183
|
+
### Issue 2: Awkward Tablet Layout
|
|
184
|
+
|
|
185
|
+
**Symptom:** Layout looks worse on tablet than mobile or desktop
|
|
186
|
+
**Check:** Tablet screenshot shows misaligned elements
|
|
187
|
+
**Fix:** Add explicit `md:` breakpoint styles
|
|
188
|
+
|
|
189
|
+
### Issue 3: Too Much Whitespace on Desktop
|
|
190
|
+
|
|
191
|
+
**Symptom:** Content looks lost on large screens
|
|
192
|
+
**Check:** Desktop screenshot shows excessive margins
|
|
193
|
+
**Fix:** Add max-width container or adjust grid columns
|
|
194
|
+
|
|
195
|
+
### Issue 4: Navigation Breaks on Mobile
|
|
196
|
+
|
|
197
|
+
**Symptom:** Menu items overlap or are inaccessible
|
|
198
|
+
**Check:** Mobile screenshot shows broken navigation
|
|
199
|
+
**Fix:** Implement hamburger menu or vertical layout
|
|
200
|
+
|
|
201
|
+
### Issue 5: Images Don't Scale
|
|
202
|
+
|
|
203
|
+
**Symptom:** Images overflow or are too small
|
|
204
|
+
**Check:** Screenshots show images breaking layout
|
|
205
|
+
**Fix:** Add responsive image classes (w-full, max-w-*)
|
|
206
|
+
|
|
207
|
+
## Tailwind Breakpoint Mapping
|
|
208
|
+
|
|
209
|
+
```typescript
|
|
210
|
+
// Tailwind default breakpoints
|
|
211
|
+
const breakpoints = {
|
|
212
|
+
sm: '640px', // Small devices
|
|
213
|
+
md: '768px', // Medium devices (tablet)
|
|
214
|
+
lg: '1024px', // Large devices
|
|
215
|
+
xl: '1280px', // Extra large
|
|
216
|
+
'2xl': '1536px' // 2X extra large
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// Our test viewports
|
|
220
|
+
const testViewports = {
|
|
221
|
+
mobile: '375px', // Below 'sm' - tests default mobile styles
|
|
222
|
+
tablet: '768px', // 'md' breakpoint - tests tablet layout
|
|
223
|
+
desktop: '1440px' // Between 'xl' and '2xl' - tests desktop layout
|
|
224
|
+
};
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Integration with Development Workflow
|
|
228
|
+
|
|
229
|
+
### During Implementation
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# After writing responsive CSS
|
|
233
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/check-mobile.png
|
|
234
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/check-tablet.png
|
|
235
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/check-desktop.png
|
|
236
|
+
|
|
237
|
+
# Review and iterate until perfect
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### During Code Review
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Capture PR changes across breakpoints
|
|
244
|
+
git checkout feature-branch
|
|
245
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/pr-mobile.png
|
|
246
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/pr-tablet.png
|
|
247
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/pr-desktop.png
|
|
248
|
+
|
|
249
|
+
# Verify responsive behavior before approving
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Before Deployment
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# Final responsive verification
|
|
256
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/deploy-mobile.png
|
|
257
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/deploy-tablet.png
|
|
258
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/deploy-desktop.png
|
|
259
|
+
|
|
260
|
+
# Confirm all viewports look good
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Quality Checklist
|
|
264
|
+
|
|
265
|
+
Use this checklist when reviewing responsive screenshots:
|
|
266
|
+
|
|
267
|
+
### Mobile (375px)
|
|
268
|
+
|
|
269
|
+
- [ ] Text is readable (minimum 14px)
|
|
270
|
+
- [ ] No horizontal scrolling
|
|
271
|
+
- [ ] Touch targets are 48px minimum
|
|
272
|
+
- [ ] Navigation is accessible
|
|
273
|
+
- [ ] Images scale properly
|
|
274
|
+
- [ ] Forms are usable
|
|
275
|
+
- [ ] Layout is single column or appropriate grid
|
|
276
|
+
|
|
277
|
+
### Tablet (768px)
|
|
278
|
+
|
|
279
|
+
- [ ] Layout adapts from mobile (not just scaled)
|
|
280
|
+
- [ ] Navigation shows appropriate state
|
|
281
|
+
- [ ] Grid uses 2-3 columns effectively
|
|
282
|
+
- [ ] Images are properly sized
|
|
283
|
+
- [ ] Whitespace is balanced
|
|
284
|
+
- [ ] Interactive elements are appropriately sized
|
|
285
|
+
|
|
286
|
+
### Desktop (1440px)
|
|
287
|
+
|
|
288
|
+
- [ ] Full desktop layout is shown
|
|
289
|
+
- [ ] Content uses available space well
|
|
290
|
+
- [ ] Grid/columns display correctly (3-4 columns)
|
|
291
|
+
- [ ] Navigation is fully expanded
|
|
292
|
+
- [ ] Typography scales appropriately
|
|
293
|
+
- [ ] Images are high quality and properly sized
|
|
294
|
+
- [ ] Whitespace creates professional appearance
|
|
295
|
+
|
|
296
|
+
## Advanced Usage
|
|
297
|
+
|
|
298
|
+
### Custom Viewport Sizes
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Test at specific width (requires CDP)
|
|
302
|
+
pnpm sweetlink screenshot --viewport-width 320 --output .tmp/screenshots/small.png
|
|
303
|
+
pnpm sweetlink screenshot --viewport-width 1920 --output .tmp/screenshots/xl.png
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Landscape Orientation
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
# Tablet landscape (1024x768)
|
|
310
|
+
pnpm sweetlink screenshot --viewport-width 1024 --viewport-height 768 --output .tmp/screenshots/tablet-landscape.png
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### High-DPI Devices
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
# Capture at 2x resolution for retina displays
|
|
317
|
+
pnpm sweetlink screenshot --viewport mobile --device-scale-factor 2 --output .tmp/screenshots/mobile-retina.png
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Troubleshooting
|
|
321
|
+
|
|
322
|
+
### Screenshots Look Blurry
|
|
323
|
+
|
|
324
|
+
**Cause:** Default image optimization
|
|
325
|
+
**Solution:** Screenshots are optimized to ~250KB. For pixel-perfect reviews, use CDP mode with `--force-cdp`
|
|
326
|
+
|
|
327
|
+
### Layout Doesn't Change
|
|
328
|
+
|
|
329
|
+
**Cause:** CSS breakpoints not configured correctly
|
|
330
|
+
**Solution:** Verify Tailwind classes like `md:` and `lg:` are applied
|
|
331
|
+
|
|
332
|
+
### Mobile Screenshot Shows Desktop
|
|
333
|
+
|
|
334
|
+
**Cause:** Viewport emulation not working
|
|
335
|
+
**Solution:** Use `--force-cdp` flag or check Sweetlink connection
|
|
336
|
+
|
|
337
|
+
## Integration with Other Skills
|
|
338
|
+
|
|
339
|
+
**Works well with:**
|
|
340
|
+
|
|
341
|
+
- `console-check-sweetlink` - Check for layout errors at each breakpoint
|
|
342
|
+
- `quick-typecheck` - Ensure responsive code is type-safe
|
|
343
|
+
- `screenshot` - Extended from base screenshot skill
|
|
344
|
+
|
|
345
|
+
**Complete responsive workflow:**
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
# 1. Implement responsive design
|
|
349
|
+
# 2. Check types
|
|
350
|
+
pnpm run typecheck
|
|
351
|
+
|
|
352
|
+
# 3. Capture responsive screenshots
|
|
353
|
+
pnpm sweetlink screenshot --viewport mobile --output .tmp/screenshots/mobile.png
|
|
354
|
+
pnpm sweetlink screenshot --viewport tablet --output .tmp/screenshots/tablet.png
|
|
355
|
+
pnpm sweetlink screenshot --viewport desktop --output .tmp/screenshots/desktop.png
|
|
356
|
+
|
|
357
|
+
# 4. Check console for errors
|
|
358
|
+
pnpm sweetlink logs --filter error
|
|
359
|
+
|
|
360
|
+
# 5. Review all screenshots for quality
|
|
361
|
+
# 6. Iterate until all viewports are perfect
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Examples
|
|
365
|
+
|
|
366
|
+
See `examples.md` for detailed responsive testing scenarios.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "responsive-screenshots",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Capture responsive screenshots at mobile, tablet, and desktop to verify the new hero section",
|
|
7
|
+
"expected_output": "Triggers responsive-screenshots skill to capture at 375px, 768px, and 1440px viewports via Sweetlink",
|
|
8
|
+
"expectations": ["Should trigger responsive-screenshots skill", "Should capture at all three standard breakpoints (375, 768, 1440)", "Should save to .tmp/screenshots/ and review for responsive issues"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 2,
|
|
12
|
+
"prompt": "Test the breakpoints on the pricing page -- I want to see how it looks on mobile vs desktop",
|
|
13
|
+
"expected_output": "Triggers responsive-screenshots skill to capture the pricing page across viewports",
|
|
14
|
+
"expectations": ["Should trigger responsive-screenshots skill", "Should use pnpm sweetlink screenshot with --viewport flags", "Should analyze screenshots against the quality checklist"]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": 3,
|
|
18
|
+
"prompt": "Take a quick screenshot of the current page to verify my CSS change",
|
|
19
|
+
"expected_output": "Should NOT trigger responsive-screenshots - this is a single screenshot, not multi-viewport testing",
|
|
20
|
+
"expectations": ["Should NOT trigger responsive-screenshots - use screenshot skill for single screenshots"]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|