real-prototypes-skill 0.1.0
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/skills/agent-browser-skill/SKILL.md +252 -0
- package/.claude/skills/real-prototypes-skill/.gitignore +188 -0
- package/.claude/skills/real-prototypes-skill/ACCESSIBILITY.md +668 -0
- package/.claude/skills/real-prototypes-skill/INSTALL.md +259 -0
- package/.claude/skills/real-prototypes-skill/LICENSE +21 -0
- package/.claude/skills/real-prototypes-skill/PUBLISH.md +310 -0
- package/.claude/skills/real-prototypes-skill/QUICKSTART.md +240 -0
- package/.claude/skills/real-prototypes-skill/README.md +442 -0
- package/.claude/skills/real-prototypes-skill/SKILL.md +375 -0
- package/.claude/skills/real-prototypes-skill/capture/capture-engine.js +1153 -0
- package/.claude/skills/real-prototypes-skill/capture/config.schema.json +170 -0
- package/.claude/skills/real-prototypes-skill/cli.js +596 -0
- package/.claude/skills/real-prototypes-skill/docs/TROUBLESHOOTING.md +278 -0
- package/.claude/skills/real-prototypes-skill/docs/schemas/capture-config.md +167 -0
- package/.claude/skills/real-prototypes-skill/docs/schemas/design-tokens.md +183 -0
- package/.claude/skills/real-prototypes-skill/docs/schemas/manifest.md +169 -0
- package/.claude/skills/real-prototypes-skill/examples/CLAUDE.md.example +73 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/CLAUDE.md +136 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/FEATURES.md +222 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/README.md +82 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/design-tokens.json +87 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/homepage-viewport.png +0 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/prototype-chatbot-final.png +0 -0
- package/.claude/skills/real-prototypes-skill/examples/amazon-chatbot/references/screenshots/prototype-fullpage-v2.png +0 -0
- package/.claude/skills/real-prototypes-skill/references/accessibility-fixes.md +298 -0
- package/.claude/skills/real-prototypes-skill/references/accessibility-report.json +253 -0
- package/.claude/skills/real-prototypes-skill/scripts/CAPTURE-ENHANCEMENTS.md +344 -0
- package/.claude/skills/real-prototypes-skill/scripts/IMPLEMENTATION-SUMMARY.md +517 -0
- package/.claude/skills/real-prototypes-skill/scripts/QUICK-START.md +229 -0
- package/.claude/skills/real-prototypes-skill/scripts/QUICKSTART-layout-analysis.md +148 -0
- package/.claude/skills/real-prototypes-skill/scripts/README-analyze-layout.md +407 -0
- package/.claude/skills/real-prototypes-skill/scripts/analyze-layout.js +880 -0
- package/.claude/skills/real-prototypes-skill/scripts/capture-platform.js +203 -0
- package/.claude/skills/real-prototypes-skill/scripts/comprehensive-capture.js +597 -0
- package/.claude/skills/real-prototypes-skill/scripts/create-manifest.js +338 -0
- package/.claude/skills/real-prototypes-skill/scripts/enterprise-pipeline.js +428 -0
- package/.claude/skills/real-prototypes-skill/scripts/extract-tokens.js +468 -0
- package/.claude/skills/real-prototypes-skill/scripts/full-site-capture.js +738 -0
- package/.claude/skills/real-prototypes-skill/scripts/generate-tailwind-config.js +296 -0
- package/.claude/skills/real-prototypes-skill/scripts/integrate-accessibility.sh +161 -0
- package/.claude/skills/real-prototypes-skill/scripts/manifest-schema.json +302 -0
- package/.claude/skills/real-prototypes-skill/scripts/setup-prototype.sh +167 -0
- package/.claude/skills/real-prototypes-skill/scripts/test-analyze-layout.js +338 -0
- package/.claude/skills/real-prototypes-skill/scripts/test-validation.js +307 -0
- package/.claude/skills/real-prototypes-skill/scripts/validate-accessibility.js +598 -0
- package/.claude/skills/real-prototypes-skill/scripts/validate-manifest.js +499 -0
- package/.claude/skills/real-prototypes-skill/scripts/validate-output.js +361 -0
- package/.claude/skills/real-prototypes-skill/scripts/validate-prerequisites.js +319 -0
- package/.claude/skills/real-prototypes-skill/scripts/verify-layout-analysis.sh +77 -0
- package/.claude/skills/real-prototypes-skill/templates/dashboard-widget.tsx.template +91 -0
- package/.claude/skills/real-prototypes-skill/templates/data-table.tsx.template +193 -0
- package/.claude/skills/real-prototypes-skill/templates/form-section.tsx.template +250 -0
- package/.claude/skills/real-prototypes-skill/templates/modal-dialog.tsx.template +239 -0
- package/.claude/skills/real-prototypes-skill/templates/nav-item.tsx.template +265 -0
- package/.claude/skills/real-prototypes-skill/validation/validation-engine.js +559 -0
- package/.env.example +74 -0
- package/LICENSE +21 -0
- package/README.md +444 -0
- package/bin/cli.js +319 -0
- package/package.json +59 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: real-prototypes-skill
|
|
3
|
+
description: Capture an existing web platform's visual design and generate feature prototypes that match its style. Use when a product manager or developer wants to prototype a new feature for an existing platform.
|
|
4
|
+
allowed-tools: Bash(agent-browser:*), Bash(npm:*), Bash(npx:*), Bash(mkdir:*), Bash(node:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Platform Prototype Skill
|
|
8
|
+
|
|
9
|
+
Enterprise-grade tool for capturing web platforms and generating pixel-perfect prototypes.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 🏢 ENTERPRISE PIPELINE - MANDATORY FOR ALL PROTOTYPES
|
|
14
|
+
|
|
15
|
+
**This pipeline MUST be followed. Validation gates will BLOCK generation if prerequisites are missing.**
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
┌─────────────┐ ┌──────────────┐ ┌──────────┐ ┌──────────────┐ ┌────────┐
|
|
19
|
+
│ Capture │ ──▶ │ Validate Pre │ ──▶ │ Generate │ ──▶ │ Validate Out │ ──▶ │ Output │
|
|
20
|
+
│ (ALL pages │ │ (GATE) │ │ Code │ │ (GATE) │ │ Done │
|
|
21
|
+
│ ALL states)│ │ │ │ │ │ │ │ │
|
|
22
|
+
└─────────────┘ └──────────────┘ └──────────┘ └──────────────┘ └────────┘
|
|
23
|
+
│ │ │
|
|
24
|
+
▼ ▼ ▼
|
|
25
|
+
Captures: BLOCKS if: BLOCKS if:
|
|
26
|
+
- ALL pages - design-tokens.json missing - Colors not in tokens
|
|
27
|
+
- ALL tabs - < 10 colors extracted - Tailwind defaults used
|
|
28
|
+
- ALL detail views - No primary color found - Wrong hex values
|
|
29
|
+
- ALL dropdowns - Screenshots missing
|
|
30
|
+
- ALL modals - Detail pages missing
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## CRITICAL: Browser Automation Setup
|
|
36
|
+
|
|
37
|
+
**BEFORE any capture or screenshot operation, you MUST:**
|
|
38
|
+
|
|
39
|
+
1. **Invoke the agent-browser skill** using the Skill tool:
|
|
40
|
+
```
|
|
41
|
+
Skill: agent-browser-skill
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. **Then use agent-browser commands** for all browser operations:
|
|
45
|
+
```bash
|
|
46
|
+
agent-browser open <url> # Navigate to page
|
|
47
|
+
agent-browser snapshot -i # Get interactive elements
|
|
48
|
+
agent-browser fill @e1 "email" # Fill form fields
|
|
49
|
+
agent-browser click @e2 # Click buttons
|
|
50
|
+
agent-browser screenshot path.png # Take screenshots
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
3. **Do NOT** attempt to run `node cli.js capture` without first having agent-browser available
|
|
54
|
+
|
|
55
|
+
**Why this matters:** The capture engine relies on agent-browser commands. Without invoking the agent-browser skill first, screenshot and navigation commands will fail.
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
### Option 1: Direct Browser Automation (Recommended)
|
|
62
|
+
|
|
63
|
+
1. **First, invoke agent-browser skill** (required before any browser operations)
|
|
64
|
+
2. **Then use browser commands:**
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Navigate and authenticate
|
|
68
|
+
agent-browser open https://app.example.com/login
|
|
69
|
+
agent-browser snapshot -i
|
|
70
|
+
agent-browser fill @e1 "user@test.com"
|
|
71
|
+
agent-browser fill @e2 "password"
|
|
72
|
+
agent-browser click @e3
|
|
73
|
+
agent-browser wait --url "**/dashboard"
|
|
74
|
+
|
|
75
|
+
# Capture screenshots
|
|
76
|
+
agent-browser screenshot projects/my-app/references/screenshots/dashboard.png
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Option 2: CLI Pipeline
|
|
80
|
+
|
|
81
|
+
**Note:** Requires agent-browser to already be available.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Create a new project
|
|
85
|
+
node .claude/skills/real-prototypes-skill/cli.js new --project my-app
|
|
86
|
+
|
|
87
|
+
# Full Pipeline
|
|
88
|
+
node .claude/skills/real-prototypes-skill/cli.js pipeline \
|
|
89
|
+
--project my-app \
|
|
90
|
+
--url https://app.example.com \
|
|
91
|
+
--email user@test.com \
|
|
92
|
+
--password secret
|
|
93
|
+
|
|
94
|
+
# Or Step by Step
|
|
95
|
+
node cli.js capture --project my-app --url https://... --email ... --password ...
|
|
96
|
+
node cli.js validate --project my-app --phase post-capture
|
|
97
|
+
node cli.js validate --project my-app --phase pre-gen
|
|
98
|
+
# [Claude generates prototype]
|
|
99
|
+
node cli.js validate --project my-app --phase post-gen
|
|
100
|
+
|
|
101
|
+
# List all projects
|
|
102
|
+
node cli.js list
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Project Structure
|
|
106
|
+
|
|
107
|
+
All projects are stored in the `projects/` directory:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
real-prototypes-skill/
|
|
111
|
+
├── projects/
|
|
112
|
+
│ ├── my-app/
|
|
113
|
+
│ │ ├── project.json # Project metadata
|
|
114
|
+
│ │ ├── references/ # Captured platform assets
|
|
115
|
+
│ │ │ ├── manifest.json
|
|
116
|
+
│ │ │ ├── design-tokens.json
|
|
117
|
+
│ │ │ ├── screenshots/
|
|
118
|
+
│ │ │ └── html/
|
|
119
|
+
│ │ └── prototype/ # Generated Next.js prototype
|
|
120
|
+
│ │ ├── src/
|
|
121
|
+
│ │ └── package.json
|
|
122
|
+
│ └── another-project/
|
|
123
|
+
│ └── ...
|
|
124
|
+
└── .claude/skills/real-prototypes-skill/
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Capture Engine
|
|
130
|
+
|
|
131
|
+
The capture engine automatically discovers and captures:
|
|
132
|
+
|
|
133
|
+
### Pages
|
|
134
|
+
- ✅ Auto-discovers all navigation links
|
|
135
|
+
- ✅ Follows list → detail page patterns
|
|
136
|
+
- ✅ Captures all tab states
|
|
137
|
+
- ✅ Captures dropdown/menu states
|
|
138
|
+
- ✅ Multiple viewport sizes (desktop, tablet, mobile)
|
|
139
|
+
|
|
140
|
+
### Design Tokens
|
|
141
|
+
- ✅ Extracts ALL colors from HTML
|
|
142
|
+
- ✅ Categorizes colors (primary, text, background, border, status)
|
|
143
|
+
- ✅ Extracts font families
|
|
144
|
+
- ✅ Sorts by usage frequency
|
|
145
|
+
|
|
146
|
+
### Output
|
|
147
|
+
```
|
|
148
|
+
projects/<project-name>/references/
|
|
149
|
+
├── manifest.json # All pages with metadata
|
|
150
|
+
├── design-tokens.json # Extracted colors & fonts
|
|
151
|
+
├── screenshots/
|
|
152
|
+
│ ├── accounts-list-desktop.png
|
|
153
|
+
│ ├── account-details-overview-desktop.png
|
|
154
|
+
│ ├── account-details-tab-activity.png
|
|
155
|
+
│ ├── actions-dropdown.png
|
|
156
|
+
│ └── ...
|
|
157
|
+
└── html/
|
|
158
|
+
├── accounts-list.html
|
|
159
|
+
├── account-details.html
|
|
160
|
+
└── ...
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Validation Gates
|
|
166
|
+
|
|
167
|
+
### Gate 1: Post-Capture Validation
|
|
168
|
+
Runs after capture, blocks if:
|
|
169
|
+
- ❌ Less than 5 pages captured
|
|
170
|
+
- ❌ Missing screenshots
|
|
171
|
+
- ❌ Less than 10 colors extracted
|
|
172
|
+
- ❌ No primary color identified
|
|
173
|
+
- ❌ List pages without detail pages
|
|
174
|
+
|
|
175
|
+
### Gate 2: Pre-Generation Validation
|
|
176
|
+
Runs before prototype generation, blocks if:
|
|
177
|
+
- ❌ manifest.json missing
|
|
178
|
+
- ❌ design-tokens.json missing
|
|
179
|
+
- ❌ Required color categories missing (primary, text, background, border)
|
|
180
|
+
- ❌ No screenshots available
|
|
181
|
+
|
|
182
|
+
### Gate 3: Post-Generation Validation
|
|
183
|
+
Runs after prototype generation, blocks if:
|
|
184
|
+
- ❌ Colors used that aren't in design-tokens.json
|
|
185
|
+
- ❌ Tailwind default colors used (e.g., `bg-blue-500`)
|
|
186
|
+
- ❌ Missing component files
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## CLI Commands
|
|
191
|
+
|
|
192
|
+
### new
|
|
193
|
+
```bash
|
|
194
|
+
node cli.js new --project <name>
|
|
195
|
+
|
|
196
|
+
Creates a new project with folder structure.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### list
|
|
200
|
+
```bash
|
|
201
|
+
node cli.js list
|
|
202
|
+
|
|
203
|
+
Lists all projects with their status.
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### capture
|
|
207
|
+
```bash
|
|
208
|
+
node cli.js capture --project <name> --url <URL> [options]
|
|
209
|
+
|
|
210
|
+
Options:
|
|
211
|
+
--project Project name (required)
|
|
212
|
+
--url Platform URL (required)
|
|
213
|
+
--email Login email (or set PLATFORM_EMAIL env var)
|
|
214
|
+
--password Login password (or set PLATFORM_PASSWORD env var)
|
|
215
|
+
--config Path to JSON config file
|
|
216
|
+
--mode auto|manual|hybrid (default: auto)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### validate
|
|
220
|
+
```bash
|
|
221
|
+
node cli.js validate --project <name> --phase <PHASE>
|
|
222
|
+
|
|
223
|
+
Options:
|
|
224
|
+
--project Project name (required)
|
|
225
|
+
--phase Validation phase (required)
|
|
226
|
+
|
|
227
|
+
Phases:
|
|
228
|
+
pre-capture Before starting capture
|
|
229
|
+
post-capture After capture completes
|
|
230
|
+
pre-generation Before generating prototype
|
|
231
|
+
post-generation After generating prototype
|
|
232
|
+
all Run all validations
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### pipeline
|
|
236
|
+
```bash
|
|
237
|
+
node cli.js pipeline --project <name> --url <URL> [options]
|
|
238
|
+
|
|
239
|
+
Runs: capture → validate → generate guidance
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### init
|
|
243
|
+
```bash
|
|
244
|
+
node cli.js init [--output <path>]
|
|
245
|
+
|
|
246
|
+
Creates capture-config.json template
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Configuration
|
|
252
|
+
|
|
253
|
+
```json
|
|
254
|
+
{
|
|
255
|
+
"platform": {
|
|
256
|
+
"name": "My Platform",
|
|
257
|
+
"baseUrl": "https://app.example.com"
|
|
258
|
+
},
|
|
259
|
+
"auth": {
|
|
260
|
+
"type": "form",
|
|
261
|
+
"loginUrl": "/login",
|
|
262
|
+
"credentials": {
|
|
263
|
+
"emailField": "email",
|
|
264
|
+
"passwordField": "password",
|
|
265
|
+
"submitButton": "Sign in"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"capture": {
|
|
269
|
+
"mode": "auto",
|
|
270
|
+
"maxPages": 100,
|
|
271
|
+
"maxDepth": 5,
|
|
272
|
+
"viewports": [
|
|
273
|
+
{ "name": "desktop", "width": 1920, "height": 1080 },
|
|
274
|
+
{ "name": "tablet", "width": 768, "height": 1024 },
|
|
275
|
+
{ "name": "mobile", "width": 375, "height": 812 }
|
|
276
|
+
],
|
|
277
|
+
"interactions": {
|
|
278
|
+
"clickButtons": true,
|
|
279
|
+
"clickDropdowns": true,
|
|
280
|
+
"clickTabs": true,
|
|
281
|
+
"clickTableRows": true,
|
|
282
|
+
"clickModals": true
|
|
283
|
+
},
|
|
284
|
+
"exclude": ["/logout", "/delete", "/remove"]
|
|
285
|
+
},
|
|
286
|
+
"validation": {
|
|
287
|
+
"minPages": 5,
|
|
288
|
+
"minColors": 10,
|
|
289
|
+
"requireDetailPages": true,
|
|
290
|
+
"requireAllTabs": true
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## For Claude: Prototype Generation Rules
|
|
298
|
+
|
|
299
|
+
### MANDATORY: Color Usage
|
|
300
|
+
```typescript
|
|
301
|
+
// ✅ CORRECT: Use exact hex from design-tokens.json
|
|
302
|
+
style={{ backgroundColor: "#1c64f2" }}
|
|
303
|
+
style={{ color: "#111928" }}
|
|
304
|
+
style={{ borderColor: "#e7e7e6" }}
|
|
305
|
+
|
|
306
|
+
// ❌ WRONG: Tailwind default colors
|
|
307
|
+
className="bg-blue-500"
|
|
308
|
+
className="text-gray-900"
|
|
309
|
+
className="border-gray-200"
|
|
310
|
+
|
|
311
|
+
// ❌ WRONG: Custom Tailwind colors (may not compile)
|
|
312
|
+
className="bg-primary"
|
|
313
|
+
className="text-text-heading"
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### MANDATORY: Before Generating
|
|
317
|
+
1. Read `projects/<project>/references/manifest.json` - understand all captured pages
|
|
318
|
+
2. Read `projects/<project>/references/design-tokens.json` - get exact colors
|
|
319
|
+
3. View screenshots in `projects/<project>/references/screenshots/` - match layout exactly
|
|
320
|
+
4. Use ONLY colors from design-tokens.json
|
|
321
|
+
|
|
322
|
+
### MANDATORY: After Generating
|
|
323
|
+
```bash
|
|
324
|
+
node .claude/skills/real-prototypes-skill/cli.js validate --project <project> --phase post-gen
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Checklist: What Gets Captured
|
|
330
|
+
|
|
331
|
+
### Pages
|
|
332
|
+
- [ ] All sidebar/navigation pages
|
|
333
|
+
- [ ] All detail pages (click into list items)
|
|
334
|
+
- [ ] All tabs within pages
|
|
335
|
+
- [ ] All dropdown/menu states
|
|
336
|
+
- [ ] All modal dialogs
|
|
337
|
+
- [ ] Multiple viewports (if configured)
|
|
338
|
+
|
|
339
|
+
### Design Tokens
|
|
340
|
+
- [ ] Primary color
|
|
341
|
+
- [ ] Text colors (primary, secondary, muted)
|
|
342
|
+
- [ ] Background colors (white, light, gray)
|
|
343
|
+
- [ ] Border colors
|
|
344
|
+
- [ ] Status colors (success, error, warning)
|
|
345
|
+
- [ ] Font families
|
|
346
|
+
|
|
347
|
+
### Validation
|
|
348
|
+
- [ ] Minimum pages captured
|
|
349
|
+
- [ ] All screenshots exist
|
|
350
|
+
- [ ] Design tokens extracted
|
|
351
|
+
- [ ] List-detail pattern complete
|
|
352
|
+
- [ ] All tabs captured
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## Troubleshooting
|
|
357
|
+
|
|
358
|
+
### "Capture missed detail pages"
|
|
359
|
+
- Increase `maxDepth` in config
|
|
360
|
+
- Enable `clickTableRows` in interactions
|
|
361
|
+
- Use `hybrid` mode with manual includes
|
|
362
|
+
|
|
363
|
+
### "Colors don't match"
|
|
364
|
+
- Run post-generation validation
|
|
365
|
+
- Use inline styles, not Tailwind classes
|
|
366
|
+
- Verify design-tokens.json has correct colors
|
|
367
|
+
|
|
368
|
+
### "Tailwind colors not working"
|
|
369
|
+
- Use inline `style={{ }}` for all colors
|
|
370
|
+
- Tailwind custom colors may not compile correctly on Windows/WSL
|
|
371
|
+
|
|
372
|
+
### "Login failed"
|
|
373
|
+
- Check credentials in env vars
|
|
374
|
+
- Verify loginUrl in config
|
|
375
|
+
- Check for CAPTCHA/2FA
|