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