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