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.
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 +375 -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
package/README.md ADDED
@@ -0,0 +1,444 @@
1
+ # Real Prototypes
2
+
3
+ > **Capture any web platform's design and generate pixel-perfect Next.js prototypes that match the original style**
4
+
5
+ A Claude Code skill that helps product managers and developers rapidly prototype new features for existing platforms by capturing visual references and generating production-ready Next.js + Tailwind code.
6
+
7
+ [![npm version](https://img.shields.io/npm/v/real-prototypes-skill.svg)](https://www.npmjs.com/package/real-prototypes-skill)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+ [![Claude Code](https://img.shields.io/badge/Claude-Code-orange)](https://claude.ai/code)
10
+
11
+ ---
12
+
13
+ ## What This Skill Does
14
+
15
+ This skill enables Claude Code to:
16
+ 1. **Capture** - Screenshot and extract design tokens (colors, fonts) from any web platform
17
+ 2. **Analyze** - Understand the platform's visual language and component patterns
18
+ 3. **Generate** - Create new feature prototypes that perfectly match the original platform's design
19
+
20
+ Perfect for:
21
+ - Product managers prototyping new features
22
+ - Developers building feature mockups
23
+ - Design teams maintaining design consistency
24
+ - Agencies creating client prototypes
25
+
26
+ ---
27
+
28
+ ## Quick Start
29
+
30
+ ### Installation
31
+
32
+ **Option 1: npx (Recommended)**
33
+
34
+ ```bash
35
+ # Install to current project
36
+ npx real-prototypes-skill
37
+
38
+ # Or install globally
39
+ npx real-prototypes-skill --global
40
+ ```
41
+
42
+ **Option 2: Clone Repository**
43
+
44
+ ```bash
45
+ # Navigate to your Claude Code skills directory
46
+ cd ~/.claude/skills
47
+
48
+ # Clone this repository
49
+ git clone https://github.com/kaidhar/real-prototypes-skill.git
50
+ ```
51
+
52
+ **Option 3: Add to Existing Project**
53
+
54
+ ```bash
55
+ # In your project directory
56
+ cd your-project/.claude/skills
57
+
58
+ # Clone or add as submodule
59
+ git clone https://github.com/kaidhar/real-prototypes-skill.git
60
+ ```
61
+
62
+ ### Verify Installation
63
+
64
+ After installation, you should see the skill in your `.claude/skills/` directory:
65
+
66
+ ```
67
+ .claude/skills/
68
+ └── real-prototypes-skill/
69
+ ├── SKILL.md
70
+ ├── scripts/
71
+ ├── templates/
72
+ └── ...
73
+ ```
74
+
75
+ ---
76
+
77
+ ## Usage
78
+
79
+ ### Example 1: Build an Amazon-Style Chatbot
80
+
81
+ ```bash
82
+ # Open Claude Code in your project
83
+ cd your-project
84
+ claude
85
+ ```
86
+
87
+ Then tell Claude:
88
+ ```
89
+ I want to create a shopping chatbot for Amazon India that matches
90
+ their design. It should allow users to search products, add to cart,
91
+ and place orders.
92
+ ```
93
+
94
+ Claude will:
95
+ 1. Capture Amazon India's design (colors, fonts, spacing)
96
+ 2. Extract design tokens to `references/design-tokens.json`
97
+ 3. Generate a functional Next.js chatbot prototype
98
+ 4. Create components with TypeScript + Tailwind CSS
99
+
100
+ ### Example 2: Create a Dashboard Widget
101
+
102
+ ```
103
+ Create a notifications panel for Slack that matches their design system.
104
+ It should show recent messages and allow marking as read.
105
+ ```
106
+
107
+ ### Example 3: Build a Checkout Flow
108
+
109
+ ```
110
+ Generate a checkout modal for Shopify that matches their merchant admin
111
+ design. Include payment selection and order summary.
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Prerequisites
117
+
118
+ ### Required
119
+
120
+ - **Claude Code CLI** (v0.5.0+)
121
+ ```bash
122
+ # Install from https://claude.ai/code
123
+ npm install -g @anthropic-ai/claude-code
124
+ ```
125
+
126
+ - **Node.js 18+**
127
+ ```bash
128
+ node --version # Should be v18.0.0 or higher
129
+ ```
130
+
131
+ - **agent-browser-skill** (installed automatically with npx)
132
+
133
+ ### Optional (Enhances Features)
134
+
135
+ - **vercel-react-best-practices** - For optimized React code
136
+ - **web-design-guidelines** - For WCAG 2.1 AA accessibility
137
+
138
+ ---
139
+
140
+ ## What Gets Generated
141
+
142
+ ### Project Structure
143
+
144
+ ```
145
+ projects/
146
+ └── your-prototype-name/
147
+ ├── project.json # Project metadata
148
+ ├── references/ # Captured platform assets
149
+ │ ├── manifest.json # Page inventory
150
+ │ ├── design-tokens.json # Extracted design system
151
+ │ ├── screenshots/ # Platform screenshots
152
+ │ │ ├── homepage-desktop.png
153
+ │ │ ├── product-page.png
154
+ │ │ └── ...
155
+ │ └── html/ # Saved HTML for reference
156
+ └── prototype/ # Generated Next.js app
157
+ ├── src/
158
+ │ ├── app/
159
+ │ │ ├── page.tsx # Main page
160
+ │ │ └── layout.tsx
161
+ │ └── components/ # Feature components
162
+ ├── package.json
163
+ ├── tailwind.config.js
164
+ └── tsconfig.json
165
+ ```
166
+
167
+ ### Design Tokens Example
168
+
169
+ ```json
170
+ {
171
+ "colors": {
172
+ "primary": {
173
+ "orange": "#FF9900",
174
+ "dark": "#131921"
175
+ },
176
+ "text": {
177
+ "primary": "#0F1111",
178
+ "secondary": "#565959",
179
+ "link": "#007185"
180
+ },
181
+ "button": {
182
+ "yellow": "#FFD814",
183
+ "orange": "#FFA41C"
184
+ }
185
+ },
186
+ "typography": {
187
+ "fontFamily": "Amazon Ember, Arial, sans-serif",
188
+ "fontSize": {
189
+ "xs": "11px",
190
+ "sm": "12px",
191
+ "base": "14px",
192
+ "lg": "18px"
193
+ }
194
+ },
195
+ "spacing": {
196
+ "xs": "4px",
197
+ "sm": "8px",
198
+ "md": "12px",
199
+ "lg": "16px"
200
+ }
201
+ }
202
+ ```
203
+
204
+ ---
205
+
206
+ ## Running Your Prototype
207
+
208
+ ```bash
209
+ # Navigate to the generated prototype
210
+ cd projects/your-prototype-name/prototype
211
+
212
+ # Install dependencies
213
+ npm install
214
+
215
+ # Start development server
216
+ npm run dev
217
+
218
+ # Open browser
219
+ open http://localhost:3000
220
+ ```
221
+
222
+ ---
223
+
224
+ ## Configuration (Optional)
225
+
226
+ ### Set Platform Credentials
227
+
228
+ Create `CLAUDE.md` in your project root:
229
+
230
+ ```markdown
231
+ ## Platform Credentials
232
+
233
+ PLATFORM_URL=https://www.example.com
234
+ PLATFORM_EMAIL=demo@example.com
235
+ PLATFORM_PASSWORD=demo_password
236
+
237
+ ## Capture Settings
238
+
239
+ PAGES_TO_CAPTURE=/dashboard,/settings,/profile
240
+ CAPTURE_MODE=manual
241
+ VIEWPORT_WIDTH=1920
242
+ VIEWPORT_HEIGHT=1080
243
+ ```
244
+
245
+ ### Customize Capture Behavior
246
+
247
+ Create `capture-config.json`:
248
+
249
+ ```json
250
+ {
251
+ "platform": {
252
+ "name": "My Platform",
253
+ "baseUrl": "https://app.example.com"
254
+ },
255
+ "capture": {
256
+ "mode": "auto",
257
+ "maxPages": 50,
258
+ "viewports": [
259
+ { "name": "desktop", "width": 1920, "height": 1080 },
260
+ { "name": "mobile", "width": 375, "height": 812 }
261
+ ]
262
+ }
263
+ }
264
+ ```
265
+
266
+ ---
267
+
268
+ ## Examples
269
+
270
+ Check out the [examples directory](./.claude/skills/real-prototypes-skill/examples/) for complete projects:
271
+
272
+ ### Amazon Chatbot
273
+ A fully functional shopping assistant with:
274
+ - Smart product search (11 products, 4 categories)
275
+ - Shopping cart with real-time counter
276
+ - Order tracking system
277
+ - Checkout flow
278
+
279
+ **[View Example →](./.claude/skills/real-prototypes-skill/examples/amazon-chatbot/)**
280
+
281
+ ---
282
+
283
+ ## How It Works
284
+
285
+ ### Phase 1: Capture (Automatic)
286
+
287
+ ```mermaid
288
+ graph LR
289
+ A[Claude opens platform] --> B[Takes screenshots]
290
+ B --> C[Extracts CSS/styles]
291
+ C --> D[Saves design tokens]
292
+ D --> E[Creates manifest]
293
+ ```
294
+
295
+ The skill uses `agent-browser-skill` to:
296
+ - Navigate to the target platform
297
+ - Capture full-page screenshots
298
+ - Extract computed styles from DOM
299
+ - Identify color palette, fonts, spacing
300
+ - Save everything to `references/`
301
+
302
+ ### Phase 2: Discovery (Interactive)
303
+
304
+ Claude asks you:
305
+ - What feature are you building?
306
+ - What functionality is needed?
307
+ - Any specific interactions?
308
+ - Mobile or desktop (or both)?
309
+
310
+ ### Phase 3: Generation (Automatic)
311
+
312
+ Claude generates:
313
+ - TypeScript React components
314
+ - Tailwind CSS styling using exact colors
315
+ - Functional features (state management, API calls, etc.)
316
+ - Responsive layouts
317
+ - Accessible markup (ARIA labels, semantic HTML)
318
+
319
+ ---
320
+
321
+ ## Advanced Usage
322
+
323
+ ### CLI Tool
324
+
325
+ The skill includes a CLI for project management:
326
+
327
+ ```bash
328
+ # Create new project
329
+ npx real-prototypes-skill
330
+ cd .claude/skills/real-prototypes-skill
331
+ node cli.js new --project my-app
332
+
333
+ # Capture platform design
334
+ node cli.js capture --project my-app --url https://example.com
335
+
336
+ # Validate design tokens
337
+ node cli.js validate --project my-app --phase post-capture
338
+
339
+ # Run full pipeline
340
+ node cli.js pipeline --project my-app --url https://example.com
341
+ ```
342
+
343
+ ### Validation Gates
344
+
345
+ The skill enforces quality gates:
346
+
347
+ - **Post-Capture**: Ensures minimum pages, colors, and screenshots
348
+ - **Pre-Generation**: Verifies design tokens and manifests exist
349
+ - **Post-Generation**: Checks colors match design tokens
350
+
351
+ ---
352
+
353
+ ## Contributing
354
+
355
+ Contributions welcome! Here's how:
356
+
357
+ 1. **Fork** this repository
358
+ 2. **Create** a feature branch: `git checkout -b feature/my-feature`
359
+ 3. **Commit** your changes: `git commit -m 'Add my feature'`
360
+ 4. **Push** to the branch: `git push origin feature/my-feature`
361
+ 5. **Open** a Pull Request
362
+
363
+ ### Development Setup
364
+
365
+ ```bash
366
+ # Clone the repository
367
+ git clone https://github.com/kaidhar/real-prototypes-skill.git
368
+ cd real-prototypes-skill
369
+
370
+ # Test locally
371
+ cd .claude/skills/real-prototypes-skill/examples/amazon-chatbot/prototype
372
+ npm install
373
+ npm run dev
374
+ ```
375
+
376
+ ---
377
+
378
+ ## Troubleshooting
379
+
380
+ ### "agent-browser-skill not found"
381
+
382
+ The npx installer should install this automatically. If not:
383
+ ```bash
384
+ cd ~/.claude/skills
385
+ git clone https://github.com/anthropics/agent-browser-skill.git
386
+ ```
387
+
388
+ ### "Colors don't match the captured design"
389
+
390
+ Ensure you're using design tokens:
391
+ ```typescript
392
+ // Correct - using exact hex values
393
+ style={{ backgroundColor: "#FF9900" }}
394
+
395
+ // Wrong - using Tailwind defaults
396
+ className="bg-orange-500"
397
+ ```
398
+
399
+ ### "Next.js compilation errors"
400
+
401
+ ```bash
402
+ # Clear Next.js cache
403
+ rm -rf .next
404
+ npm install
405
+ npm run dev
406
+ ```
407
+
408
+ ### "Port 3000 already in use"
409
+
410
+ ```bash
411
+ # Kill process on port 3000
412
+ npx kill-port 3000
413
+
414
+ # Or specify different port
415
+ PORT=3001 npm run dev
416
+ ```
417
+
418
+ ---
419
+
420
+ ## License
421
+
422
+ MIT License - See [LICENSE](LICENSE) file for details.
423
+
424
+ ---
425
+
426
+ ## Acknowledgments
427
+
428
+ - **Anthropic** - For Claude Code and Claude AI
429
+ - **Vercel** - For Next.js framework
430
+ - **Tailwind CSS** - For utility-first styling
431
+ - **Playwright** - For browser automation
432
+
433
+ ---
434
+
435
+ ## Links
436
+
437
+ - [Documentation](./.claude/skills/real-prototypes-skill/SKILL.md)
438
+ - [Report Issues](https://github.com/kaidhar/real-prototypes-skill/issues)
439
+ - [Discussions](https://github.com/kaidhar/real-prototypes-skill/discussions)
440
+ - [Examples](./.claude/skills/real-prototypes-skill/examples/)
441
+
442
+ ---
443
+
444
+ Made with care for the Claude Code community