@ytspar/sweetlink 1.24.5 → 1.24.6-canary.889a040
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,394 @@
|
|
|
1
|
+
# Console Check Sweetlink - Examples
|
|
2
|
+
|
|
3
|
+
Common usage patterns for checking console errors during development.
|
|
4
|
+
|
|
5
|
+
## Example 1: Clean Console (Zero Errors)
|
|
6
|
+
|
|
7
|
+
**User Request:**
|
|
8
|
+
> "Check the console for errors"
|
|
9
|
+
|
|
10
|
+
**Skill Action:**
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pnpm sweetlink logs --filter error
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Output:**
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
✅ Console Check: CLEAN
|
|
20
|
+
|
|
21
|
+
Errors: 0
|
|
22
|
+
Warnings: 0
|
|
23
|
+
Last checked: 14:30:45
|
|
24
|
+
|
|
25
|
+
Application is running without console errors.
|
|
26
|
+
Zero-error policy maintained ✓
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Example 2: Errors Found After Changes
|
|
32
|
+
|
|
33
|
+
**User Request:**
|
|
34
|
+
> "I added a new feature, check for errors"
|
|
35
|
+
|
|
36
|
+
**Skill Action:**
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm sweetlink logs --filter error
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Output:**
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
❌ Console Check: 3 ERRORS FOUND
|
|
46
|
+
|
|
47
|
+
### Error 1:
|
|
48
|
+
[ERROR] TypeError: Cannot read property 'data' of undefined
|
|
49
|
+
File: src/components/Card.tsx:45
|
|
50
|
+
Time: 14:28:12.234
|
|
51
|
+
Stack: at Card.render (Card.tsx:45)
|
|
52
|
+
|
|
53
|
+
### Error 2:
|
|
54
|
+
[ERROR] Failed to fetch: NetworkError
|
|
55
|
+
File: src/api/client.ts:89
|
|
56
|
+
Time: 14:28:13.891
|
|
57
|
+
Message: Network request failed
|
|
58
|
+
|
|
59
|
+
### Error 3:
|
|
60
|
+
[ERROR] Hydration failed
|
|
61
|
+
File: src/pages/index.tsx:12
|
|
62
|
+
Time: 14:28:14.023
|
|
63
|
+
Details: Server: "Loading..." Client: "Data loaded"
|
|
64
|
+
|
|
65
|
+
### Next Steps:
|
|
66
|
+
1. Fix null check in Card.tsx (add optional chaining)
|
|
67
|
+
2. Add error handling to API fetch
|
|
68
|
+
3. Fix hydration by using useEffect for dynamic content
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Example 3: Before Committing
|
|
74
|
+
|
|
75
|
+
**User Request:**
|
|
76
|
+
> "I'm ready to commit, make sure there are no console errors"
|
|
77
|
+
|
|
78
|
+
**Skill Action:**
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Check console
|
|
82
|
+
pnpm sweetlink logs --filter error
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Output (Clean):**
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
✅ Console Check: CLEAN
|
|
89
|
+
|
|
90
|
+
Pre-commit verification:
|
|
91
|
+
- Console errors: 0 ✓
|
|
92
|
+
- Warnings: 0 ✓
|
|
93
|
+
- Application state: Healthy ✓
|
|
94
|
+
|
|
95
|
+
Safe to commit!
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Output (With Errors):**
|
|
99
|
+
|
|
100
|
+
```text
|
|
101
|
+
❌ Console Check: BLOCKED
|
|
102
|
+
|
|
103
|
+
Cannot commit - 2 console errors found:
|
|
104
|
+
|
|
105
|
+
1. [ERROR] TypeError in Card component
|
|
106
|
+
2. [ERROR] API fetch failed
|
|
107
|
+
|
|
108
|
+
Fix these errors before committing to maintain zero-error policy.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Example 4: Debugging Workflow
|
|
114
|
+
|
|
115
|
+
**User Request:**
|
|
116
|
+
> "The page isn't loading correctly, debug it"
|
|
117
|
+
|
|
118
|
+
**Skill Action:**
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Step 1: Check console
|
|
122
|
+
pnpm sweetlink logs --filter error
|
|
123
|
+
|
|
124
|
+
# Step 2: Get all logs for context
|
|
125
|
+
pnpm sweetlink logs
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Output:**
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
🔍 Debugging Console Analysis
|
|
132
|
+
|
|
133
|
+
### Errors (2):
|
|
134
|
+
1. [ERROR] Failed to fetch /api/data
|
|
135
|
+
Time: 14:25:10
|
|
136
|
+
|
|
137
|
+
2. [ERROR] Cannot render: data is undefined
|
|
138
|
+
Time: 14:25:11
|
|
139
|
+
|
|
140
|
+
### Recent Logs (context):
|
|
141
|
+
[INFO] Fetching data from API... (14:25:09)
|
|
142
|
+
[ERROR] Failed to fetch /api/data (14:25:10)
|
|
143
|
+
[WARN] Using fallback data (14:25:10)
|
|
144
|
+
[ERROR] Cannot render: data is undefined (14:25:11)
|
|
145
|
+
|
|
146
|
+
### Root Cause Identified:
|
|
147
|
+
API fetch is failing → fallback data is undefined → render fails
|
|
148
|
+
|
|
149
|
+
### Fix:
|
|
150
|
+
Add proper fallback data or loading state
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Example 5: After HMR Reload
|
|
156
|
+
|
|
157
|
+
**User Request:**
|
|
158
|
+
> "I just saved my changes, check the console"
|
|
159
|
+
|
|
160
|
+
**Skill Action:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Wait 2 seconds for HMR
|
|
164
|
+
sleep 2
|
|
165
|
+
|
|
166
|
+
# Check console
|
|
167
|
+
pnpm sweetlink logs --filter error
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Output:**
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
✅ HMR Reload: Clean
|
|
174
|
+
|
|
175
|
+
Changes detected at 14:32:15
|
|
176
|
+
HMR completed at 14:32:17
|
|
177
|
+
Console errors: 0 ✓
|
|
178
|
+
|
|
179
|
+
Your changes loaded successfully with no errors!
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Example 6: Hydration Error Detection
|
|
185
|
+
|
|
186
|
+
**User Request:**
|
|
187
|
+
> "There's a hydration warning, what's causing it?"
|
|
188
|
+
|
|
189
|
+
**Skill Action:**
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
pnpm sweetlink logs --filter hydration
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Output:**
|
|
196
|
+
|
|
197
|
+
```typescript
|
|
198
|
+
⚠️ Hydration Issues Found
|
|
199
|
+
|
|
200
|
+
1. [ERROR] Hydration failed because the initial UI does not match
|
|
201
|
+
Component: src/pages/dashboard.tsx:23
|
|
202
|
+
Time: 14:20:15.123
|
|
203
|
+
|
|
204
|
+
Server HTML: <div>Loading...</div>
|
|
205
|
+
Client HTML: <div>December 24, 2025</div>
|
|
206
|
+
|
|
207
|
+
Cause: Date() called during SSR creates different output on client
|
|
208
|
+
|
|
209
|
+
Fix: Use useEffect for client-only dynamic content
|
|
210
|
+
```tsx
|
|
211
|
+
const [date, setDate] = useState('');
|
|
212
|
+
useEffect(() => {
|
|
213
|
+
setDate(new Date().toLocaleDateString());
|
|
214
|
+
}, []);
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Example 7: Warning Triage
|
|
222
|
+
|
|
223
|
+
**User Request:**
|
|
224
|
+
> "Check for warnings too"
|
|
225
|
+
|
|
226
|
+
**Skill Action:**
|
|
227
|
+
```bash
|
|
228
|
+
pnpm sweetlink logs --filter warning
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Output:**
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
⚠️ Console Warnings: 5 found
|
|
235
|
+
|
|
236
|
+
High Priority:
|
|
237
|
+
1. [WARN] Each child in list should have unique key prop
|
|
238
|
+
File: src/components/List.tsx:34
|
|
239
|
+
Impact: Can cause rendering bugs
|
|
240
|
+
|
|
241
|
+
Medium Priority:
|
|
242
|
+
2. [WARN] React does not recognize `customProp` on DOM element
|
|
243
|
+
File: src/components/Button.tsx:12
|
|
244
|
+
Impact: Console clutter
|
|
245
|
+
|
|
246
|
+
3. [WARN] componentWillReceiveProps has been renamed
|
|
247
|
+
File: src/legacy/OldComponent.tsx:45
|
|
248
|
+
Impact: Deprecated API
|
|
249
|
+
|
|
250
|
+
Low Priority:
|
|
251
|
+
4. [WARN] Missing alt attribute on img
|
|
252
|
+
File: src/components/Card.tsx:67
|
|
253
|
+
Impact: Accessibility
|
|
254
|
+
|
|
255
|
+
5. [WARN] Unrecognized CSS property
|
|
256
|
+
File: src/styles/custom.css:23
|
|
257
|
+
Impact: Style won't apply
|
|
258
|
+
|
|
259
|
+
Recommendation: Fix high priority warnings before merge
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Example 8: API Error Detection
|
|
265
|
+
|
|
266
|
+
**User Request:**
|
|
267
|
+
> "The data isn't loading, check console"
|
|
268
|
+
|
|
269
|
+
**Skill Action:**
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
pnpm sweetlink logs --filter "fetch"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
**Output:**
|
|
276
|
+
|
|
277
|
+
```markdown
|
|
278
|
+
🌐 Network/Fetch Analysis
|
|
279
|
+
|
|
280
|
+
### Fetch Errors (3):
|
|
281
|
+
|
|
282
|
+
1. [ERROR] Failed to fetch: /api/users
|
|
283
|
+
Time: 14:15:22.123
|
|
284
|
+
Status: 500 Internal Server Error
|
|
285
|
+
Message: Database connection failed
|
|
286
|
+
|
|
287
|
+
2. [ERROR] Failed to fetch: /api/posts
|
|
288
|
+
Time: 14:15:23.456
|
|
289
|
+
Status: 404 Not Found
|
|
290
|
+
Message: Endpoint does not exist
|
|
291
|
+
|
|
292
|
+
3. [ERROR] Failed to fetch: /api/settings
|
|
293
|
+
Time: 14:15:24.789
|
|
294
|
+
Status: 401 Unauthorized
|
|
295
|
+
Message: Missing authentication token
|
|
296
|
+
|
|
297
|
+
### Root Causes:
|
|
298
|
+
- Backend server error (500)
|
|
299
|
+
- Invalid API endpoint (404)
|
|
300
|
+
- Missing auth token (401)
|
|
301
|
+
|
|
302
|
+
### Next Steps:
|
|
303
|
+
1. Check backend logs for database issue
|
|
304
|
+
2. Verify API route exists
|
|
305
|
+
3. Add authentication token to request
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
---
|
|
309
|
+
|
|
310
|
+
## Example 9: Zero-Error Enforcement
|
|
311
|
+
|
|
312
|
+
**Task Completion Check:**
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
# Before marking task complete, enforce zero errors
|
|
316
|
+
pnpm sweetlink logs --filter error
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Output (Passed):**
|
|
320
|
+
|
|
321
|
+
```text
|
|
322
|
+
✅ Task Completion: APPROVED
|
|
323
|
+
|
|
324
|
+
Console Check: PASSED ✓
|
|
325
|
+
- Errors: 0
|
|
326
|
+
- Warnings: 0
|
|
327
|
+
- Application: Stable
|
|
328
|
+
|
|
329
|
+
Task can be marked as complete.
|
|
330
|
+
Zero-error policy maintained.
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
**Output (Failed):**
|
|
334
|
+
|
|
335
|
+
```text
|
|
336
|
+
❌ Task Completion: BLOCKED
|
|
337
|
+
|
|
338
|
+
Console Check: FAILED ✗
|
|
339
|
+
- Errors: 2
|
|
340
|
+
- Warnings: 1
|
|
341
|
+
|
|
342
|
+
Cannot mark task as complete until console is clean.
|
|
343
|
+
Fix errors and re-check.
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Example 10: Integration with Complete Quality Check
|
|
349
|
+
|
|
350
|
+
**User Request:**
|
|
351
|
+
> "Run a complete quality check before deploying"
|
|
352
|
+
|
|
353
|
+
**Skill Action:**
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
# 1. TypeScript check
|
|
357
|
+
pnpm run typecheck
|
|
358
|
+
|
|
359
|
+
# 2. Console errors check
|
|
360
|
+
pnpm sweetlink logs --filter error
|
|
361
|
+
|
|
362
|
+
# 3. Build check
|
|
363
|
+
pnpm run build
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
**Output:**
|
|
367
|
+
|
|
368
|
+
```markdown
|
|
369
|
+
🎯 Complete Quality Check
|
|
370
|
+
|
|
371
|
+
1. TypeScript Check: ✅ PASSED (0 errors)
|
|
372
|
+
2. Console Check: ✅ PASSED (0 errors)
|
|
373
|
+
3. Build Check: ✅ PASSED (built successfully)
|
|
374
|
+
|
|
375
|
+
### Summary:
|
|
376
|
+
All quality gates passed ✓
|
|
377
|
+
- Type safety: Maintained
|
|
378
|
+
- Runtime errors: Zero
|
|
379
|
+
- Build: Successful
|
|
380
|
+
|
|
381
|
+
✅ APPROVED FOR DEPLOYMENT
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Best Practices Demonstrated
|
|
387
|
+
|
|
388
|
+
1. **Check after every change** - Catch errors immediately
|
|
389
|
+
2. **Use filters** - Focus on errors first, then warnings
|
|
390
|
+
3. **Zero-error policy** - Don't accumulate technical debt
|
|
391
|
+
4. **Integrated checks** - Combine with typecheck and builds
|
|
392
|
+
5. **Root cause analysis** - Understand error context
|
|
393
|
+
6. **Fix before commit** - Maintain code quality
|
|
394
|
+
7. **HMR awareness** - Wait for reload before checking
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: resize-for-claude
|
|
3
|
+
description: Resize images for optimal Claude vision consumption. Scales images so the longest side is ≤1568px. Splits very tall images (3:1+ ratio) into overlapping tiles. Use when preparing screenshots, mockups, or design files for Claude analysis.
|
|
4
|
+
allowed-tools: Bash, Read
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Resize for Claude Skill
|
|
8
|
+
|
|
9
|
+
Resize images to optimal dimensions for Claude's vision capabilities. Claude processes images best when the longest side is ≤1568px. This skill handles both standard images and very tall images (full-page mockups, long screenshots) by splitting them into readable tiles.
|
|
10
|
+
|
|
11
|
+
## When to Use
|
|
12
|
+
|
|
13
|
+
- Preparing large screenshots or mockups for Claude to analyze
|
|
14
|
+
- Resizing Figma exports before feeding them to Claude
|
|
15
|
+
- Processing any image that's too large for efficient Claude vision consumption
|
|
16
|
+
- User asks to "resize for Claude" or "optimize image for Claude"
|
|
17
|
+
|
|
18
|
+
## How It Works
|
|
19
|
+
|
|
20
|
+
The script at `scripts/resize-for-claude` (in the tools repo):
|
|
21
|
+
|
|
22
|
+
1. Reads the image dimensions
|
|
23
|
+
2. If the image aspect ratio is < 3:1, resizes proportionally so the longest side = 1568px
|
|
24
|
+
3. If the image is very tall (≥ 3:1 height:width), splits into overlapping tiles before resizing each
|
|
25
|
+
4. Outputs to a `<filename>-claude/` directory next to the original
|
|
26
|
+
|
|
27
|
+
### Claude Vision Limits
|
|
28
|
+
|
|
29
|
+
| Property | Optimal | Maximum |
|
|
30
|
+
|----------|---------|---------|
|
|
31
|
+
| Longest side | ≤1568px | 8000px |
|
|
32
|
+
| File size | <1MB | 20MB |
|
|
33
|
+
| Aspect ratio | ≤2:1 | - |
|
|
34
|
+
|
|
35
|
+
Images exceeding these dimensions get downscaled by Claude anyway, wasting tokens on pixels that are thrown away.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Find the script (works from any project linked to tools)
|
|
41
|
+
TOOLS_ROOT="$(readlink -f .claude/skills/../../)"
|
|
42
|
+
|
|
43
|
+
# Basic usage — resize to 1568px longest side
|
|
44
|
+
"$TOOLS_ROOT/scripts/resize-for-claude" ~/Downloads/mockup.jpg
|
|
45
|
+
|
|
46
|
+
# Custom max side
|
|
47
|
+
"$TOOLS_ROOT/scripts/resize-for-claude" ~/Downloads/mockup.png 1200
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Direct invocation (if you know the tools path)
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
$TOOLS_ROOT/scripts/resize-for-claude ~/Downloads/image.jpg
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Output
|
|
57
|
+
|
|
58
|
+
**Standard image (< 3:1 ratio):**
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
Input: ~/Downloads/mockup.jpg
|
|
62
|
+
Size: 5120x11732 (2881KB)
|
|
63
|
+
|
|
64
|
+
Output: ~/Downloads/mockup-claude/mockup.jpg
|
|
65
|
+
Size: 684x1568 (84KB)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Very tall image (≥ 3:1 ratio):**
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
Input: ~/Downloads/full-page.png
|
|
72
|
+
Size: 1440x8640 (4200KB)
|
|
73
|
+
|
|
74
|
+
Image is very tall (6:1 ratio). Splitting into tiles...
|
|
75
|
+
Part 1: 1440x1568 (180KB) -> ~/Downloads/full-page-claude/full-page-part1.png
|
|
76
|
+
Part 2: 1440x1568 (165KB) -> ~/Downloads/full-page-claude/full-page-part2.png
|
|
77
|
+
Part 3: 1440x1568 (172KB) -> ~/Downloads/full-page-claude/full-page-part3.png
|
|
78
|
+
|
|
79
|
+
Output: ~/Downloads/full-page-claude/ (3 parts)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Requirements
|
|
83
|
+
|
|
84
|
+
- macOS (uses `sips` — the built-in macOS image processing tool)
|
|
85
|
+
|
|
86
|
+
## After Resizing
|
|
87
|
+
|
|
88
|
+
Use the Read tool to view the resized image(s):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Single image
|
|
92
|
+
Read ~/Downloads/mockup-claude/mockup.jpg
|
|
93
|
+
|
|
94
|
+
# Tiled parts — read each sequentially
|
|
95
|
+
Read ~/Downloads/full-page-claude/full-page-part1.png
|
|
96
|
+
Read ~/Downloads/full-page-claude/full-page-part2.png
|
|
97
|
+
```
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
# Responsive Screenshots - Examples
|
|
2
|
+
|
|
3
|
+
Common usage patterns for testing responsive design across breakpoints.
|
|
4
|
+
|
|
5
|
+
## Example 1: Complete Responsive Test
|
|
6
|
+
|
|
7
|
+
**User Request:**
|
|
8
|
+
> "Test the new landing page across all breakpoints"
|
|
9
|
+
|
|
10
|
+
**Skill Action:**
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Capture all breakpoints
|
|
14
|
+
pnpm sweetlink screenshot --viewport mobile --output /tmp/screenshots/landing-mobile.png
|
|
15
|
+
pnpm sweetlink screenshot --viewport tablet --output /tmp/screenshots/landing-tablet.png
|
|
16
|
+
pnpm sweetlink screenshot --viewport desktop --output /tmp/screenshots/landing-desktop.png
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Output:**
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
✅ Responsive Test: Landing Page
|
|
23
|
+
|
|
24
|
+
📱 Mobile (375px)
|
|
25
|
+
Screenshot: /tmp/screenshots/landing-mobile.png
|
|
26
|
+
✅ Single column layout
|
|
27
|
+
✅ Touch-friendly navigation
|
|
28
|
+
✅ Images scale correctly
|
|
29
|
+
✅ Text readable at 16px
|
|
30
|
+
|
|
31
|
+
💻 Tablet (768px)
|
|
32
|
+
Screenshot: /tmp/screenshots/landing-tablet.png
|
|
33
|
+
✅ Two-column grid
|
|
34
|
+
✅ Navigation bar expanded
|
|
35
|
+
✅ Hero image displays properly
|
|
36
|
+
✅ Call-to-action buttons visible
|
|
37
|
+
|
|
38
|
+
🖥️ Desktop (1440px)
|
|
39
|
+
Screenshot: /tmp/screenshots/landing-desktop.png
|
|
40
|
+
✅ Three-column grid
|
|
41
|
+
✅ Full navigation with all items
|
|
42
|
+
✅ Hero section uses full width
|
|
43
|
+
✅ Professional whitespace
|
|
44
|
+
|
|
45
|
+
Overall: ✅ PASSED - All breakpoints look great!
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Example 2: Component-Specific Testing
|
|
51
|
+
|
|
52
|
+
**User Request:**
|
|
53
|
+
> "Check how the navigation menu looks on mobile vs desktop"
|
|
54
|
+
|
|
55
|
+
**Skill Action:**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pnpm sweetlink screenshot --viewport mobile --selector "nav" --output /tmp/screenshots/nav-mobile.png
|
|
59
|
+
pnpm sweetlink screenshot --viewport desktop --selector "nav" --output /tmp/screenshots/nav-desktop.png
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Output:**
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
🔍 Navigation Component Analysis
|
|
66
|
+
|
|
67
|
+
📱 Mobile (375px)
|
|
68
|
+
Screenshot: /tmp/screenshots/nav-mobile.png
|
|
69
|
+
Status: ⚠️ NEEDS WORK
|
|
70
|
+
|
|
71
|
+
Issues:
|
|
72
|
+
- Menu items are cramped (only 8px padding)
|
|
73
|
+
- Logo is too large for mobile screen
|
|
74
|
+
- Menu overlaps content slightly
|
|
75
|
+
|
|
76
|
+
Recommendations:
|
|
77
|
+
- Increase padding to 16px
|
|
78
|
+
- Reduce logo size by 30%
|
|
79
|
+
- Add z-index to ensure menu is above content
|
|
80
|
+
|
|
81
|
+
🖥️ Desktop (1440px)
|
|
82
|
+
Screenshot: /tmp/screenshots/nav-desktop.png
|
|
83
|
+
Status: ✅ PERFECT
|
|
84
|
+
|
|
85
|
+
- Horizontal layout works well
|
|
86
|
+
- All menu items visible
|
|
87
|
+
- Logo is appropriately sized
|
|
88
|
+
- Spacing is professional
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Example 3: Before/After Comparison
|
|
94
|
+
|
|
95
|
+
**User Request:**
|
|
96
|
+
> "I updated the responsive styles, show me the difference"
|
|
97
|
+
|
|
98
|
+
**Skill Action:**
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Before (git stash to revert)
|
|
102
|
+
git stash
|
|
103
|
+
pnpm sweetlink screenshot --viewport mobile --output /tmp/screenshots/before-mobile.png
|
|
104
|
+
git stash pop
|
|
105
|
+
|
|
106
|
+
# After (with changes)
|
|
107
|
+
pnpm sweetlink screenshot --viewport mobile --output /tmp/screenshots/after-mobile.png
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Output:**
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
📊 Before/After Comparison (Mobile)
|
|
114
|
+
|
|
115
|
+
### Before:
|
|
116
|
+
Screenshot: /tmp/screenshots/before-mobile.png
|
|
117
|
+
Issues:
|
|
118
|
+
- Text overflows container
|
|
119
|
+
- Images don't scale
|
|
120
|
+
- Buttons are too small
|
|
121
|
+
|
|
122
|
+
### After:
|
|
123
|
+
Screenshot: /tmp/screenshots/after-mobile.png
|
|
124
|
+
Improvements:
|
|
125
|
+
✅ Text wraps properly with word-break
|
|
126
|
+
✅ Images use w-full class
|
|
127
|
+
✅ Buttons increased to min-h-12
|
|
128
|
+
|
|
129
|
+
Result: Significant improvement in mobile usability!
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Example 4: Grid Layout Verification
|
|
135
|
+
|
|
136
|
+
**User Request:**
|
|
137
|
+
> "Verify the card grid works at all breakpoints"
|
|
138
|
+
|
|
139
|
+
**Skill Action:**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
pnpm sweetlink screenshot --viewport mobile --selector ".card-grid" --output /tmp/screenshots/grid-mobile.png
|
|
143
|
+
pnpm sweetlink screenshot --viewport tablet --selector ".card-grid" --output /tmp/screenshots/grid-tablet.png
|
|
144
|
+
pnpm sweetlink screenshot --viewport desktop --selector ".card-grid" --output /tmp/screenshots/grid-desktop.png
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Output:**
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
🎯 Card Grid Responsive Analysis
|
|
151
|
+
|
|
152
|
+
📱 Mobile (375px)
|
|
153
|
+
Screenshot: /tmp/screenshots/grid-mobile.png
|
|
154
|
+
Layout: 1 column
|
|
155
|
+
Cards: 3 visible (stack vertically)
|
|
156
|
+
✅ Works perfectly - easy to scroll through
|
|
157
|
+
|
|
158
|
+
💻 Tablet (768px)
|
|
159
|
+
Screenshot: /tmp/screenshots/grid-tablet.png
|
|
160
|
+
Layout: 2 columns
|
|
161
|
+
Cards: 6 visible (3 rows × 2 columns)
|
|
162
|
+
✅ Good use of space
|
|
163
|
+
|
|
164
|
+
🖥️ Desktop (1440px)
|
|
165
|
+
Screenshot: /tmp/screenshots/grid-desktop.png
|
|
166
|
+
Layout: 3 columns
|
|
167
|
+
Cards: 9 visible (3 rows × 3 columns)
|
|
168
|
+
✅ Excellent grid layout
|
|
169
|
+
|
|
170
|
+
Responsive Grid: ✅ APPROVED
|
|
171
|
+
Grid scales perfectly from 1 → 2 → 3 columns
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Example 5: Detecting Layout Issues
|
|
177
|
+
|
|
178
|
+
**User Request:**
|
|
179
|
+
> "The page looks weird on tablet, debug it"
|
|
180
|
+
|
|
181
|
+
**Skill Action:**
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
pnpm sweetlink screenshot --viewport tablet --output /tmp/screenshots/tablet-debug.png
|
|
185
|
+
pnpm sweetlink logs --filter error
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**Output:**
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
🐛 Tablet Layout Debug
|
|
192
|
+
|
|
193
|
+
Screenshot: /tmp/screenshots/tablet-debug.png
|
|
194
|
+
|
|
195
|
+
Issues Detected:
|
|
196
|
+
1. ⚠️ Awkward 2-column layout
|
|
197
|
+
- Sidebar too narrow (only 200px)
|
|
198
|
+
- Main content area cramped
|
|
199
|
+
|
|
200
|
+
2. ⚠️ Navigation partially hidden
|
|
201
|
+
- Menu items cut off at 768px
|
|
202
|
+
- Dropdown doesn't fit viewport
|
|
203
|
+
|
|
204
|
+
3. ⚠️ Images not scaling
|
|
205
|
+
- Fixed width images (500px) overflow
|
|
206
|
+
- Should use max-w-full
|
|
207
|
+
|
|
208
|
+
Console Errors:
|
|
209
|
+
[ERROR] Element width exceeds viewport
|
|
210
|
+
|
|
211
|
+
Root Cause:
|
|
212
|
+
Missing md: breakpoint styles. Layout jumps from mobile
|
|
213
|
+
to desktop without tablet-specific styling.
|
|
214
|
+
|
|
215
|
+
Fix:
|
|
216
|
+
Add explicit md: classes:
|
|
217
|
+
- md:grid-cols-2
|
|
218
|
+
- md:gap-4
|
|
219
|
+
- md:max-w-full
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Example 6: Accessibility Testing
|
|
225
|
+
|
|
226
|
+
**User Request:**
|
|
227
|
+
> "Check if touch targets are large enough on mobile"
|
|
228
|
+
|
|
229
|
+
**Skill Action:**
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
pnpm sweetlink screenshot --viewport mobile --output /tmp/screenshots/mobile-touch.png
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Output:**
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
📱 Mobile Touch Target Analysis
|
|
239
|
+
|
|
240
|
+
Screenshot: /tmp/screenshots/mobile-touch.png
|
|
241
|
+
|
|
242
|
+
Touch Target Audit:
|
|
243
|
+
✅ Primary CTA button: 56px height (good)
|
|
244
|
+
✅ Navigation menu items: 48px height (minimum)
|
|
245
|
+
⚠️ Close icon: 32px (too small)
|
|
246
|
+
⚠️ Dropdown arrows: 24px (too small)
|
|
247
|
+
❌ Footer links: 20px (far too small)
|
|
248
|
+
|
|
249
|
+
Recommendations:
|
|
250
|
+
1. Increase close icon to 48px minimum
|
|
251
|
+
2. Increase dropdown touch area to 44px
|
|
252
|
+
3. Add padding to footer links (min 48px total)
|
|
253
|
+
|
|
254
|
+
Touch targets below 44px are hard to tap on mobile devices.
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Example 7: Typography Scaling
|
|
260
|
+
|
|
261
|
+
**User Request:**
|
|
262
|
+
> "Check if the heading sizes look good across devices"
|
|
263
|
+
|
|
264
|
+
**Skill Action:**
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
pnpm sweetlink screenshot --viewport mobile --selector "h1" --output /tmp/screenshots/h1-mobile.png
|
|
268
|
+
pnpm sweetlink screenshot --viewport desktop --selector "h1" --output /tmp/screenshots/h1-desktop.png
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Output:**
|
|
272
|
+
|
|
273
|
+
```text
|
|
274
|
+
📝 Typography Analysis
|
|
275
|
+
|
|
276
|
+
📱 Mobile H1:
|
|
277
|
+
Screenshot: /tmp/screenshots/h1-mobile.png
|
|
278
|
+
Font size: 28px (via computed style)
|
|
279
|
+
Line height: 1.2
|
|
280
|
+
⚠️ Slightly small - recommend 32px minimum
|
|
281
|
+
|
|
282
|
+
🖥️ Desktop H1:
|
|
283
|
+
Screenshot: /tmp/screenshots/h1-desktop.png
|
|
284
|
+
Font size: 48px (via computed style)
|
|
285
|
+
Line height: 1.2
|
|
286
|
+
✅ Perfect size for desktop
|
|
287
|
+
|
|
288
|
+
Recommendation:
|
|
289
|
+
Update Tailwind classes:
|
|
290
|
+
- Mobile: text-3xl (30px) or text-4xl (36px)
|
|
291
|
+
- Desktop: text-5xl (48px) - current ✓
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Example 8: Full Page Responsive Audit
|
|
297
|
+
|
|
298
|
+
**User Request:**
|
|
299
|
+
> "Do a complete responsive audit of the dashboard"
|
|
300
|
+
|
|
301
|
+
**Skill Action:**
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# Capture all viewports
|
|
305
|
+
for viewport in mobile tablet desktop; do
|
|
306
|
+
pnpm sweetlink screenshot --viewport $viewport --output /tmp/screenshots/dashboard-$viewport.png
|
|
307
|
+
pnpm sweetlink logs --filter error
|
|
308
|
+
done
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Output:**
|
|
312
|
+
|
|
313
|
+
```text
|
|
314
|
+
📋 Complete Responsive Audit: Dashboard
|
|
315
|
+
|
|
316
|
+
### Mobile (375px)
|
|
317
|
+
Screenshot: /tmp/screenshots/dashboard-mobile.png
|
|
318
|
+
✅ Layout: Single column works
|
|
319
|
+
✅ Cards: Stack vertically
|
|
320
|
+
✅ Navigation: Hamburger menu
|
|
321
|
+
⚠️ Issue: Charts are too small to read
|
|
322
|
+
Fix: Consider horizontal scrolling for charts
|
|
323
|
+
|
|
324
|
+
### Tablet (768px)
|
|
325
|
+
Screenshot: /tmp/screenshots/dashboard-tablet.png
|
|
326
|
+
✅ Layout: 2-column works well
|
|
327
|
+
✅ Navigation: Expanded header
|
|
328
|
+
✅ Charts: Adequate size
|
|
329
|
+
✅ Sidebar: Collapsible design works
|
|
330
|
+
|
|
331
|
+
### Desktop (1440px)
|
|
332
|
+
Screenshot: /tmp/screenshots/dashboard-desktop.png
|
|
333
|
+
✅ Layout: 3-column grid optimal
|
|
334
|
+
✅ Navigation: All items visible
|
|
335
|
+
✅ Charts: Full size, very readable
|
|
336
|
+
✅ Sidebar: Persistent and useful
|
|
337
|
+
|
|
338
|
+
Console Errors: 0 across all viewports ✓
|
|
339
|
+
|
|
340
|
+
Overall Grade: B+ (Mobile charts need improvement)
|
|
341
|
+
|
|
342
|
+
Next Steps:
|
|
343
|
+
1. Make charts horizontally scrollable on mobile
|
|
344
|
+
2. Add touch gestures for chart interaction
|
|
345
|
+
3. Consider hiding less critical data on mobile
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Example 9: Navigation State Testing
|
|
351
|
+
|
|
352
|
+
**User Request:**
|
|
353
|
+
> "Test the navigation menu at different breakpoints"
|
|
354
|
+
|
|
355
|
+
**Skill Action:**
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
pnpm sweetlink screenshot --viewport mobile --selector ".nav-menu" --output /tmp/screenshots/nav-mobile.png
|
|
359
|
+
pnpm sweetlink screenshot --viewport tablet --selector ".nav-menu" --output /tmp/screenshots/nav-tablet.png
|
|
360
|
+
pnpm sweetlink screenshot --viewport desktop --selector ".nav-menu" --output /tmp/screenshots/nav-desktop.png
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
**Output:**
|
|
364
|
+
|
|
365
|
+
```text
|
|
366
|
+
🧭 Navigation Responsive States
|
|
367
|
+
|
|
368
|
+
📱 Mobile (375px): Hamburger Menu
|
|
369
|
+
Screenshot: /tmp/screenshots/nav-mobile.png
|
|
370
|
+
State: Collapsed by default
|
|
371
|
+
✅ Hamburger icon visible (32px)
|
|
372
|
+
✅ Menu slides from left
|
|
373
|
+
✅ Full screen overlay works
|
|
374
|
+
|
|
375
|
+
💻 Tablet (768px): Hybrid Layout
|
|
376
|
+
Screenshot: /tmp/screenshots/nav-tablet.png
|
|
377
|
+
State: Partial expansion
|
|
378
|
+
✅ Logo + key items visible
|
|
379
|
+
✅ Overflow items in dropdown
|
|
380
|
+
✅ Balanced use of space
|
|
381
|
+
|
|
382
|
+
🖥️ Desktop (1440px): Full Navigation
|
|
383
|
+
Screenshot: /tmp/screenshots/nav-desktop.png
|
|
384
|
+
State: Fully expanded
|
|
385
|
+
✅ All menu items visible
|
|
386
|
+
✅ Dropdown menus on hover
|
|
387
|
+
✅ Professional spacing
|
|
388
|
+
|
|
389
|
+
Navigation Pattern: ✅ EXCELLENT
|
|
390
|
+
Progressive disclosure works perfectly across devices
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Example 10: Image Scaling Test
|
|
396
|
+
|
|
397
|
+
**User Request:**
|
|
398
|
+
> "Verify the hero image scales properly"
|
|
399
|
+
|
|
400
|
+
**Skill Action:**
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
pnpm sweetlink screenshot --viewport mobile --selector ".hero" --output /tmp/screenshots/hero-mobile.png
|
|
404
|
+
pnpm sweetlink screenshot --viewport desktop --selector ".hero" --output /tmp/screenshots/hero-desktop.png
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
**Output:**
|
|
408
|
+
|
|
409
|
+
```text
|
|
410
|
+
🖼️ Hero Image Scaling Analysis
|
|
411
|
+
|
|
412
|
+
📱 Mobile (375px)
|
|
413
|
+
Screenshot: /tmp/screenshots/hero-mobile.png
|
|
414
|
+
Image: 375×250px (aspect ratio 3:2)
|
|
415
|
+
✅ Scales to full width
|
|
416
|
+
✅ No overflow or distortion
|
|
417
|
+
✅ Loading: lazy ✓
|
|
418
|
+
|
|
419
|
+
🖥️ Desktop (1440px)
|
|
420
|
+
Screenshot: /tmp/screenshots/hero-desktop.png
|
|
421
|
+
Image: 1440×600px (aspect ratio 2.4:1)
|
|
422
|
+
✅ Uses full container width
|
|
423
|
+
✅ High resolution (retina ready)
|
|
424
|
+
✅ Object-fit: cover maintains aspect
|
|
425
|
+
|
|
426
|
+
Image Handling: ✅ PERFECT
|
|
427
|
+
Responsive images working correctly with proper aspect ratios
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
## Best Practices Demonstrated
|
|
433
|
+
|
|
434
|
+
1. **Test all three breakpoints** - Mobile, tablet, desktop coverage
|
|
435
|
+
2. **Component-specific tests** - Focus on specific areas
|
|
436
|
+
3. **Before/after comparisons** - Verify improvements
|
|
437
|
+
4. **Touch target validation** - Ensure mobile usability
|
|
438
|
+
5. **Typography scaling** - Check readability across sizes
|
|
439
|
+
6. **Layout verification** - Confirm grid behavior
|
|
440
|
+
7. **Console monitoring** - Check for layout errors
|
|
441
|
+
8. **Complete audits** - Systematic full-page reviews
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ytspar/sweetlink",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.6-canary.889a040",
|
|
4
4
|
"description": "Autonomous development toolkit for AI agents - screenshots, DOM queries, console logs, and JavaScript execution via WebSocket and Chrome DevTools Protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"autonomous-development",
|