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,169 @@
|
|
|
1
|
+
# Manifest Schema
|
|
2
|
+
|
|
3
|
+
The `manifest.json` file is generated by the capture engine and describes all captured pages, their assets, and metadata.
|
|
4
|
+
|
|
5
|
+
## Complete Example
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"platform": {
|
|
10
|
+
"name": "My Platform",
|
|
11
|
+
"baseUrl": "https://app.example.com",
|
|
12
|
+
"capturedAt": "2024-01-15T10:30:00.000Z"
|
|
13
|
+
},
|
|
14
|
+
"pages": [
|
|
15
|
+
{
|
|
16
|
+
"name": "dashboard",
|
|
17
|
+
"url": "/dashboard",
|
|
18
|
+
"screenshot": "screenshots/dashboard-desktop.png",
|
|
19
|
+
"html": "html/dashboard.html",
|
|
20
|
+
"description": "Main dashboard page",
|
|
21
|
+
"captures": [
|
|
22
|
+
{
|
|
23
|
+
"viewport": "desktop",
|
|
24
|
+
"screenshot": "screenshots/dashboard-desktop.png"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"viewport": "tablet",
|
|
28
|
+
"screenshot": "screenshots/dashboard-tablet.png"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"viewport": "mobile",
|
|
32
|
+
"screenshot": "screenshots/dashboard-mobile.png"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"tabs": [
|
|
36
|
+
{
|
|
37
|
+
"name": "Overview",
|
|
38
|
+
"screenshot": "screenshots/dashboard-tab-overview.png"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "Activity",
|
|
42
|
+
"screenshot": "screenshots/dashboard-tab-activity.png"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"interactions": [
|
|
46
|
+
{
|
|
47
|
+
"type": "dropdown",
|
|
48
|
+
"name": "Actions",
|
|
49
|
+
"screenshot": "screenshots/dashboard-dropdown-actions.png"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "accounts-list",
|
|
55
|
+
"url": "/accounts",
|
|
56
|
+
"screenshot": "screenshots/accounts-list-desktop.png",
|
|
57
|
+
"html": "html/accounts-list.html",
|
|
58
|
+
"description": "accounts list page",
|
|
59
|
+
"captures": [
|
|
60
|
+
{
|
|
61
|
+
"viewport": "desktop",
|
|
62
|
+
"screenshot": "screenshots/accounts-list-desktop.png"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"tabs": [],
|
|
66
|
+
"interactions": []
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"stats": {
|
|
70
|
+
"pagesDiscovered": 12,
|
|
71
|
+
"pagesCaptured": 12,
|
|
72
|
+
"screenshotsTaken": 36,
|
|
73
|
+
"htmlCaptured": 12,
|
|
74
|
+
"interactionsPerformed": 8,
|
|
75
|
+
"errorsEncountered": 0
|
|
76
|
+
},
|
|
77
|
+
"designTokens": "design-tokens.json"
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Schema Reference
|
|
82
|
+
|
|
83
|
+
### Root Object
|
|
84
|
+
|
|
85
|
+
| Field | Type | Required | Description |
|
|
86
|
+
|-------|------|----------|-------------|
|
|
87
|
+
| `platform` | object | Yes | Platform metadata |
|
|
88
|
+
| `pages` | array | Yes | List of captured pages |
|
|
89
|
+
| `stats` | object | Yes | Capture statistics |
|
|
90
|
+
| `designTokens` | string | Yes | Path to design tokens file |
|
|
91
|
+
|
|
92
|
+
### `platform`
|
|
93
|
+
|
|
94
|
+
| Field | Type | Required | Description |
|
|
95
|
+
|-------|------|----------|-------------|
|
|
96
|
+
| `name` | string | Yes | Platform name |
|
|
97
|
+
| `baseUrl` | string | Yes | Base URL of the platform |
|
|
98
|
+
| `capturedAt` | string | Yes | ISO 8601 timestamp of capture |
|
|
99
|
+
|
|
100
|
+
### `pages[]`
|
|
101
|
+
|
|
102
|
+
| Field | Type | Required | Description |
|
|
103
|
+
|-------|------|----------|-------------|
|
|
104
|
+
| `name` | string | **Yes** | Unique page identifier (derived from URL path) |
|
|
105
|
+
| `url` | string | Yes | URL path (relative to baseUrl) |
|
|
106
|
+
| `screenshot` | string | Yes | Path to primary screenshot (relative to references dir) |
|
|
107
|
+
| `html` | string | No | Path to HTML file |
|
|
108
|
+
| `description` | string | No | Auto-generated page description |
|
|
109
|
+
| `captures` | array | Yes | Screenshots at different viewports |
|
|
110
|
+
| `tabs` | array | No | Tab state captures |
|
|
111
|
+
| `interactions` | array | No | Interaction state captures |
|
|
112
|
+
|
|
113
|
+
**Important:** The `name` field is required. Validation will fail if pages are missing names.
|
|
114
|
+
|
|
115
|
+
### `pages[].captures[]`
|
|
116
|
+
|
|
117
|
+
| Field | Type | Description |
|
|
118
|
+
|-------|------|-------------|
|
|
119
|
+
| `viewport` | string | Viewport name (e.g., "desktop", "mobile") |
|
|
120
|
+
| `screenshot` | string | Path to screenshot file |
|
|
121
|
+
|
|
122
|
+
### `pages[].tabs[]`
|
|
123
|
+
|
|
124
|
+
| Field | Type | Description |
|
|
125
|
+
|-------|------|-------------|
|
|
126
|
+
| `name` | string | Tab label text |
|
|
127
|
+
| `screenshot` | string | Path to screenshot of tab content |
|
|
128
|
+
|
|
129
|
+
### `pages[].interactions[]`
|
|
130
|
+
|
|
131
|
+
| Field | Type | Description |
|
|
132
|
+
|-------|------|-------------|
|
|
133
|
+
| `type` | string | Interaction type: `"dropdown"`, `"modal"`, `"expanded"` |
|
|
134
|
+
| `name` | string | Element name/label |
|
|
135
|
+
| `screenshot` | string | Path to screenshot of interaction state |
|
|
136
|
+
|
|
137
|
+
### `stats`
|
|
138
|
+
|
|
139
|
+
| Field | Type | Description |
|
|
140
|
+
|-------|------|-------------|
|
|
141
|
+
| `pagesDiscovered` | number | Total pages found during discovery |
|
|
142
|
+
| `pagesCaptured` | number | Pages successfully captured |
|
|
143
|
+
| `screenshotsTaken` | number | Total screenshots taken |
|
|
144
|
+
| `htmlCaptured` | number | HTML files saved |
|
|
145
|
+
| `interactionsPerformed` | number | Interactive elements captured |
|
|
146
|
+
| `errorsEncountered` | number | Errors during capture |
|
|
147
|
+
|
|
148
|
+
## Validation Requirements
|
|
149
|
+
|
|
150
|
+
For validation to pass, the manifest must have:
|
|
151
|
+
|
|
152
|
+
1. **All pages have a `name` field** - This is used for page identification
|
|
153
|
+
2. **All referenced screenshots exist** - Paths in `screenshot` fields must be valid
|
|
154
|
+
3. **Minimum page count** - Default is 5 pages (configurable)
|
|
155
|
+
4. **List-detail pattern** - If list pages exist, detail pages should be captured
|
|
156
|
+
|
|
157
|
+
## File Path Convention
|
|
158
|
+
|
|
159
|
+
All paths in the manifest are relative to the references directory:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
references/
|
|
163
|
+
manifest.json # This file
|
|
164
|
+
design-tokens.json # Referenced as "design-tokens.json"
|
|
165
|
+
screenshots/
|
|
166
|
+
dashboard-desktop.png # Referenced as "screenshots/dashboard-desktop.png"
|
|
167
|
+
html/
|
|
168
|
+
dashboard.html # Referenced as "html/dashboard.html"
|
|
169
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Real Prototypes - Example CLAUDE.md Configuration
|
|
2
|
+
|
|
3
|
+
Copy this to your project's CLAUDE.md and fill in your platform details.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Platform Credentials
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
# Your platform's base URL (no trailing slash)
|
|
11
|
+
PLATFORM_URL=https://app.example.com
|
|
12
|
+
|
|
13
|
+
# Login credentials (if the platform requires authentication)
|
|
14
|
+
PLATFORM_EMAIL=your-email@example.com
|
|
15
|
+
PLATFORM_PASSWORD=your-secure-password
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Capture Settings
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
# Pages to capture
|
|
22
|
+
# Option 1: Specify pages manually (comma-separated paths)
|
|
23
|
+
PAGES_TO_CAPTURE=/dashboard,/settings,/profile,/users
|
|
24
|
+
|
|
25
|
+
# Option 2: Auto-discover all pages
|
|
26
|
+
# PAGES_TO_CAPTURE=auto
|
|
27
|
+
|
|
28
|
+
# Option 3: Disable auto-capture (only capture specified pages)
|
|
29
|
+
# PAGES_TO_CAPTURE=off
|
|
30
|
+
|
|
31
|
+
# Capture mode
|
|
32
|
+
# "full" = capture all discovered pages up to MAX_PAGES
|
|
33
|
+
# "manual" = only capture pages listed in PAGES_TO_CAPTURE
|
|
34
|
+
CAPTURE_MODE=manual
|
|
35
|
+
|
|
36
|
+
# Maximum pages to capture in auto/full mode
|
|
37
|
+
MAX_PAGES=50
|
|
38
|
+
|
|
39
|
+
# Viewport dimensions (pixels)
|
|
40
|
+
VIEWPORT_WIDTH=1920
|
|
41
|
+
VIEWPORT_HEIGHT=1080
|
|
42
|
+
|
|
43
|
+
# Wait time after page load before capturing (milliseconds)
|
|
44
|
+
# Increase this if pages have slow-loading content or animations
|
|
45
|
+
WAIT_AFTER_LOAD=2000
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Advanced Settings (Optional)
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
# Maximum wait timeout (milliseconds)
|
|
52
|
+
MAX_WAIT_TIMEOUT=10000
|
|
53
|
+
|
|
54
|
+
# Retry settings
|
|
55
|
+
MAX_RETRIES=3
|
|
56
|
+
TIMEOUT_RETRIES=2
|
|
57
|
+
RETRY_DELAY_BASE=1000
|
|
58
|
+
|
|
59
|
+
# Validation thresholds
|
|
60
|
+
MIN_SCREENSHOT_SIZE=102400
|
|
61
|
+
MIN_HTML_SIZE=10240
|
|
62
|
+
MIN_PAGE_HEIGHT=500
|
|
63
|
+
|
|
64
|
+
# Exclude URL patterns from capture (comma-separated)
|
|
65
|
+
# EXCLUDE_PATTERNS=/logout,/signout,/delete,/admin
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage Notes
|
|
69
|
+
|
|
70
|
+
- The skill will read these values when running the capture phase
|
|
71
|
+
- Credentials are only used locally for browser automation
|
|
72
|
+
- Never commit this file to version control with real credentials
|
|
73
|
+
- Add CLAUDE.md to your .gitignore
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Amazon India Shopping Chatbot - Example
|
|
2
|
+
|
|
3
|
+
This example demonstrates the Platform Prototype Skill by creating a fully functional shopping chatbot for Amazon India.
|
|
4
|
+
|
|
5
|
+
## Project Configuration
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
PLATFORM_URL=https://www.amazon.in/
|
|
9
|
+
PLATFORM_EMAIL=
|
|
10
|
+
PLATFORM_PASSWORD=
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Capture Settings
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
PAGES_TO_CAPTURE=/homepage
|
|
17
|
+
CAPTURE_MODE=manual
|
|
18
|
+
VIEWPORT_WIDTH=1920
|
|
19
|
+
VIEWPORT_HEIGHT=1080
|
|
20
|
+
WAIT_AFTER_LOAD=2000
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Feature Request
|
|
24
|
+
|
|
25
|
+
The original request was:
|
|
26
|
+
|
|
27
|
+
> "I want to add a new chatbot window in Amazon where users can find any product and place order from there itself."
|
|
28
|
+
|
|
29
|
+
## What Was Generated
|
|
30
|
+
|
|
31
|
+
The skill generated a complete Next.js prototype with:
|
|
32
|
+
|
|
33
|
+
### Components
|
|
34
|
+
- **ChatbotWindow.tsx** - Main chatbot with AI-like conversation
|
|
35
|
+
- **ChatbotButton.tsx** - Floating action button
|
|
36
|
+
- **ProductCard.tsx** - Product display with images and pricing
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
- 🔍 **Smart Product Search** - 11 products across 4 categories (headphones, laptops, phones, watches)
|
|
40
|
+
- 🛒 **Shopping Cart** - Add items, manage quantities, real-time counter
|
|
41
|
+
- 📦 **Order Tracking** - Place orders and track status
|
|
42
|
+
- 💰 **Price Filtering** - Search "laptop under 50000" works
|
|
43
|
+
- ⚡ **Buy Now** - Quick checkout flow
|
|
44
|
+
- 🎯 **Action Buttons** - Contextual quick actions
|
|
45
|
+
|
|
46
|
+
### Design Accuracy
|
|
47
|
+
- Exact Amazon colors captured (#FF9900, #131921, #FFD814)
|
|
48
|
+
- Typography matched (Amazon Ember font family)
|
|
49
|
+
- Spacing and layout from design tokens
|
|
50
|
+
- Mobile responsive design
|
|
51
|
+
|
|
52
|
+
## File Structure
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
amazon-chatbot/
|
|
56
|
+
├── FEATURES.md ← Feature documentation
|
|
57
|
+
├── references/
|
|
58
|
+
│ ├── design-tokens.json ← Captured colors, fonts, spacing
|
|
59
|
+
│ └── screenshots/
|
|
60
|
+
│ ├── homepage-viewport.png ← Original Amazon homepage
|
|
61
|
+
│ ├── prototype-chatbot-final.png ← Generated chatbot
|
|
62
|
+
│ └── prototype-fullpage-v2.png ← Full prototype page
|
|
63
|
+
└── prototype/
|
|
64
|
+
├── src/
|
|
65
|
+
│ ├── app/
|
|
66
|
+
│ │ ├── page.tsx ← Homepage with navbar
|
|
67
|
+
│ │ ├── layout.tsx
|
|
68
|
+
│ │ └── globals.css
|
|
69
|
+
│ └── components/
|
|
70
|
+
│ └── chatbot/
|
|
71
|
+
│ ├── ChatbotWindow.tsx ← Main chatbot logic
|
|
72
|
+
│ ├── ChatbotButton.tsx ← FAB button
|
|
73
|
+
│ ├── ProductCard.tsx ← Product display
|
|
74
|
+
│ ├── types.ts ← TypeScript interfaces
|
|
75
|
+
│ └── index.ts
|
|
76
|
+
├── package.json
|
|
77
|
+
├── tailwind.config.js
|
|
78
|
+
└── tsconfig.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## How to Run
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
cd examples/amazon-chatbot/prototype
|
|
85
|
+
npm install
|
|
86
|
+
npm run dev
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Open http://localhost:3000 and click the chatbot button!
|
|
90
|
+
|
|
91
|
+
## Key Implementation Details
|
|
92
|
+
|
|
93
|
+
### Product Database
|
|
94
|
+
11 products with realistic data:
|
|
95
|
+
- Sony WH-1000XM4 headphones
|
|
96
|
+
- Apple AirPods Pro
|
|
97
|
+
- Dell XPS 15 laptop
|
|
98
|
+
- MacBook Pro M3
|
|
99
|
+
- iPhone 15 Pro
|
|
100
|
+
- Samsung Galaxy S24
|
|
101
|
+
- Apple Watch Series 9
|
|
102
|
+
- Samsung Galaxy Watch 6
|
|
103
|
+
- Boat Airdopes
|
|
104
|
+
- HP Pavilion
|
|
105
|
+
- OnePlus 11
|
|
106
|
+
|
|
107
|
+
### Smart Search Algorithm
|
|
108
|
+
- Category detection (headphone → headphones)
|
|
109
|
+
- Brand matching (Sony, Apple, Dell, etc.)
|
|
110
|
+
- Price filtering with natural language
|
|
111
|
+
- Relevance ranking
|
|
112
|
+
|
|
113
|
+
### State Management
|
|
114
|
+
- Cart stored in React state
|
|
115
|
+
- Order history tracking
|
|
116
|
+
- Real-time navbar counter updates
|
|
117
|
+
|
|
118
|
+
## Try These Prompts
|
|
119
|
+
|
|
120
|
+
In the chatbot, try:
|
|
121
|
+
- "Show me headphones"
|
|
122
|
+
- "I want a laptop under 50000"
|
|
123
|
+
- "Show me iphone"
|
|
124
|
+
- "Add to cart" (after seeing products)
|
|
125
|
+
- "Show my cart"
|
|
126
|
+
- "Track my orders" (after placing order)
|
|
127
|
+
|
|
128
|
+
## Generated with Platform Prototype Skill
|
|
129
|
+
|
|
130
|
+
This entire prototype was generated by describing the feature to Claude Code with the Platform Prototype Skill installed. The skill:
|
|
131
|
+
1. Captured Amazon India's design
|
|
132
|
+
2. Extracted colors and typography
|
|
133
|
+
3. Generated matching React components
|
|
134
|
+
4. Implemented full functionality
|
|
135
|
+
|
|
136
|
+
Total development time: ~10 minutes
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Amazon Chatbot - Functional Features
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The Amazon Shopping Assistant chatbot now has full functionality for product search, cart management, order tracking, and checkout.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## ✨ Features Implemented
|
|
9
|
+
|
|
10
|
+
### 1. **Smart Product Search**
|
|
11
|
+
- **11 products** across 4 categories (Headphones, Laptops, Phones, Smartwatches)
|
|
12
|
+
- **Intelligent category detection** from search queries:
|
|
13
|
+
- "laptop" → shows laptop products
|
|
14
|
+
- "wireless headphones" → shows headphone products
|
|
15
|
+
- "5G phone" → shows phone products
|
|
16
|
+
- "smartwatch" → shows watch products
|
|
17
|
+
- **Brand search** - search by specific brands (Sony, Samsung, boAt, etc.)
|
|
18
|
+
- **Price filtering** - search "laptop under 50000" to filter by price
|
|
19
|
+
- **Relevance ranking** - products sorted by rating × review count
|
|
20
|
+
|
|
21
|
+
### 2. **Shopping Cart Management**
|
|
22
|
+
- **Add to Cart** functionality
|
|
23
|
+
- **Cart counter** updates in chatbot header and main navbar
|
|
24
|
+
- **View Cart** command shows all items with quantities and total
|
|
25
|
+
- **Cart persistence** throughout the session
|
|
26
|
+
- **Clear Cart** option
|
|
27
|
+
- **Interactive cart actions**:
|
|
28
|
+
- "view cart" or "cart" → shows cart summary
|
|
29
|
+
- Quick action buttons after adding items
|
|
30
|
+
|
|
31
|
+
### 3. **Order Tracking System**
|
|
32
|
+
- **Order placement** with unique order IDs (e.g., ORD12345678)
|
|
33
|
+
- **Order status** tracking (confirmed → shipped → delivered)
|
|
34
|
+
- **Estimated delivery dates** (3 days from order)
|
|
35
|
+
- **Order history** view with all past orders
|
|
36
|
+
- **Quick order tracking**:
|
|
37
|
+
- Click "Track Order" button
|
|
38
|
+
- Type "track my order" or "orders"
|
|
39
|
+
|
|
40
|
+
### 4. **Checkout Flow**
|
|
41
|
+
- **Buy Now** button for instant purchase
|
|
42
|
+
- **Delivery address** display (Bengaluru 562130)
|
|
43
|
+
- **Payment method selection**:
|
|
44
|
+
- Cash on Delivery
|
|
45
|
+
- UPI
|
|
46
|
+
- Credit/Debit Card
|
|
47
|
+
- Net Banking
|
|
48
|
+
- **Order confirmation** with all details
|
|
49
|
+
- **Confirm/Cancel** action buttons
|
|
50
|
+
|
|
51
|
+
### 5. **Interactive Action Buttons**
|
|
52
|
+
All bot responses include contextual action buttons:
|
|
53
|
+
- **After adding to cart**: "View Cart" | "Continue Shopping"
|
|
54
|
+
- **Empty cart**: "Browse Laptops" | "Browse Phones" | "Browse Headphones"
|
|
55
|
+
- **Checkout**: "Confirm Order" | "Cancel"
|
|
56
|
+
- **Cart management**: "Proceed to Checkout" | "Clear Cart"
|
|
57
|
+
|
|
58
|
+
### 6. **Quick Action Shortcuts**
|
|
59
|
+
Two persistent buttons in the chatbot header:
|
|
60
|
+
- **🔍 Find Products** - Shows search suggestions
|
|
61
|
+
- **📦 Track Order** - Displays order history
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 🎯 Example Conversations
|
|
66
|
+
|
|
67
|
+
### Product Search
|
|
68
|
+
```
|
|
69
|
+
User: wireless headphones
|
|
70
|
+
Bot: I found 3 great options for "wireless headphones"
|
|
71
|
+
[Shows boAt, Sony, JBL headphones]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Price Filter
|
|
75
|
+
```
|
|
76
|
+
User: laptop under 50000
|
|
77
|
+
Bot: I found 3 great options for "laptop under 50000"
|
|
78
|
+
[Shows HP, Dell, Lenovo laptops under ₹50,000]
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Add to Cart
|
|
82
|
+
```
|
|
83
|
+
User: [Clicks "Add to Cart" on Sony headphones]
|
|
84
|
+
Bot: ✓ Added "Sony WH-1000XM4..." to your cart! You now have 1 items.
|
|
85
|
+
[View Cart] [Continue Shopping]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### View Cart
|
|
89
|
+
```
|
|
90
|
+
User: view cart
|
|
91
|
+
Bot: 🛒 Your Cart (2 items)
|
|
92
|
+
• Sony WH-1000XM4... (₹19,990 × 1)
|
|
93
|
+
• boAt Rockerz 450... (₹1,299 × 1)
|
|
94
|
+
Total: ₹21,289
|
|
95
|
+
[Proceed to Checkout] [Clear Cart]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Place Order
|
|
99
|
+
```
|
|
100
|
+
User: [Clicks "Buy Now" on HP laptop]
|
|
101
|
+
Bot: Processing checkout for "HP 15s Ryzen 5..." at ₹42,990
|
|
102
|
+
|
|
103
|
+
📍 Delivery Address
|
|
104
|
+
Bengaluru 562130
|
|
105
|
+
|
|
106
|
+
💳 Payment Method
|
|
107
|
+
Cash on Delivery / UPI / Card
|
|
108
|
+
|
|
109
|
+
Expected delivery: 2-3 days
|
|
110
|
+
Total: ₹42,990
|
|
111
|
+
[Confirm Order] [Cancel]
|
|
112
|
+
|
|
113
|
+
User: [Clicks "Confirm Order"]
|
|
114
|
+
Bot: 🎉 Order confirmed!
|
|
115
|
+
Order ID: ORD12345678
|
|
116
|
+
Product: HP 15s Ryzen 5...
|
|
117
|
+
Amount: ₹42,990
|
|
118
|
+
Expected Delivery: 1/31/2026
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Track Orders
|
|
122
|
+
```
|
|
123
|
+
User: track my order
|
|
124
|
+
Bot: 📦 Your Orders
|
|
125
|
+
|
|
126
|
+
✓ ORD12345678
|
|
127
|
+
HP 15s Ryzen 5 5500U 15.6 inch FHD...
|
|
128
|
+
Status: CONFIRMED
|
|
129
|
+
Delivery: 1/31/2026
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 📊 Product Database
|
|
135
|
+
|
|
136
|
+
### Categories & Counts
|
|
137
|
+
- **Headphones**: 3 products (₹1,299 - ₹19,990)
|
|
138
|
+
- **Laptops**: 3 products (₹38,490 - ₹49,990)
|
|
139
|
+
- **Phones**: 3 products (₹12,990 - ₹17,999)
|
|
140
|
+
- **Smartwatches**: 2 products (₹2,499 - ₹2,999)
|
|
141
|
+
|
|
142
|
+
### Brands Available
|
|
143
|
+
- boAt, Sony, JBL
|
|
144
|
+
- HP, Dell, Lenovo
|
|
145
|
+
- Samsung, OnePlus, Redmi
|
|
146
|
+
- Fire-Boltt, Noise
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## 🛠️ Technical Implementation
|
|
151
|
+
|
|
152
|
+
### State Management
|
|
153
|
+
- **Cart**: `CartItem[]` with product and quantity
|
|
154
|
+
- **Orders**: `Order[]` with status and delivery tracking
|
|
155
|
+
- **Messages**: `Message[]` with products and action buttons
|
|
156
|
+
- **Price Filter**: Optional min/max price range
|
|
157
|
+
|
|
158
|
+
### Search Algorithm
|
|
159
|
+
1. **Keyword Matching**: Searches title, brand, category
|
|
160
|
+
2. **Category Detection**: Maps keywords to product categories
|
|
161
|
+
3. **Price Filtering**: Applies min/max price constraints
|
|
162
|
+
4. **Relevance Ranking**: Sorts by `rating × log(reviewCount + 1)`
|
|
163
|
+
5. **Limit Results**: Returns top 5 matches
|
|
164
|
+
|
|
165
|
+
### Cart Updates
|
|
166
|
+
- Updates chatbot header badge
|
|
167
|
+
- Syncs with main navbar cart counter
|
|
168
|
+
- Persists across searches
|
|
169
|
+
- Supports quantity increment for duplicate products
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 🎨 UI Features
|
|
174
|
+
|
|
175
|
+
### Cart Badge
|
|
176
|
+
- Red notification badge on chatbot header
|
|
177
|
+
- Shows total item count
|
|
178
|
+
- Updates in real-time
|
|
179
|
+
|
|
180
|
+
### Action Buttons
|
|
181
|
+
- Yellow Amazon-style buttons
|
|
182
|
+
- Contextual actions based on conversation
|
|
183
|
+
- Hover effects matching Amazon design
|
|
184
|
+
|
|
185
|
+
### Message Formatting
|
|
186
|
+
- **User messages**: Dark navy background (right-aligned)
|
|
187
|
+
- **Bot messages**: White background (left-aligned)
|
|
188
|
+
- **Emojis**: ✓ (success), 🛒 (cart), 📦 (orders), 🎉 (celebration)
|
|
189
|
+
- **Bold text**: Order IDs, totals, headers
|
|
190
|
+
- **Multi-line formatting**: Preserved with `whiteSpace: 'pre-line'`
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## 🚀 Usage
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Run the prototype
|
|
198
|
+
cd projects/amazon-chatbot/prototype
|
|
199
|
+
npm run dev
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Visit http://localhost:3000 and click the orange chat button!
|
|
203
|
+
|
|
204
|
+
### Try These Commands:
|
|
205
|
+
- `wireless headphones`
|
|
206
|
+
- `laptop under 50000`
|
|
207
|
+
- `5G phone`
|
|
208
|
+
- `view cart`
|
|
209
|
+
- `track my order`
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## 📈 Future Enhancements (Not Yet Implemented)
|
|
214
|
+
- Product comparison
|
|
215
|
+
- Save for later
|
|
216
|
+
- Wishlist management
|
|
217
|
+
- Product reviews in chat
|
|
218
|
+
- Voice search
|
|
219
|
+
- Image search
|
|
220
|
+
- Live chat with support agent handoff
|
|
221
|
+
- Personalized recommendations based on history
|
|
222
|
+
- Multi-language support
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Amazon India Shopping Chatbot Example
|
|
2
|
+
|
|
3
|
+
A fully functional shopping chatbot prototype generated using the Platform Prototype Skill.
|
|
4
|
+
|
|
5
|
+
## What This Example Shows
|
|
6
|
+
|
|
7
|
+
This example demonstrates how the Platform Prototype Skill can:
|
|
8
|
+
- Capture an existing platform's design (Amazon India)
|
|
9
|
+
- Extract exact colors, fonts, and spacing
|
|
10
|
+
- Generate a pixel-perfect Next.js prototype
|
|
11
|
+
- Implement complex functionality (search, cart, orders)
|
|
12
|
+
|
|
13
|
+
## Quick View
|
|
14
|
+
|
|
15
|
+
### Original Platform
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
### Generated Chatbot
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
### Full Prototype
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- Smart product search across 11 products
|
|
27
|
+
- Shopping cart with real-time counter
|
|
28
|
+
- Order tracking system
|
|
29
|
+
- Price filtering ("laptop under 50000")
|
|
30
|
+
- Buy Now checkout flow
|
|
31
|
+
- Action buttons for quick interactions
|
|
32
|
+
|
|
33
|
+
## Design Tokens
|
|
34
|
+
|
|
35
|
+
Captured from Amazon India:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"colors": {
|
|
40
|
+
"primary": {
|
|
41
|
+
"orange": "#FF9900",
|
|
42
|
+
"dark": "#131921"
|
|
43
|
+
},
|
|
44
|
+
"accent": {
|
|
45
|
+
"yellow": "#FFD814"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"typography": {
|
|
49
|
+
"fontFamily": "Amazon Ember, Arial, sans-serif"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
See full tokens in [references/design-tokens.json](references/design-tokens.json)
|
|
55
|
+
|
|
56
|
+
## Files Included
|
|
57
|
+
|
|
58
|
+
- `FEATURES.md` - Complete feature documentation
|
|
59
|
+
- `CLAUDE.md` - Project setup and configuration
|
|
60
|
+
- `references/design-tokens.json` - Captured design tokens
|
|
61
|
+
- `references/screenshots/` - Platform and prototype screenshots
|
|
62
|
+
|
|
63
|
+
## Note
|
|
64
|
+
|
|
65
|
+
The actual prototype code is not included in this repository to keep it lightweight. However, using the Platform Prototype Skill with the same configuration will generate an identical prototype.
|
|
66
|
+
|
|
67
|
+
## How to Generate This
|
|
68
|
+
|
|
69
|
+
1. Install the Platform Prototype Skill
|
|
70
|
+
2. Create a project with this CLAUDE.md configuration:
|
|
71
|
+
```markdown
|
|
72
|
+
PLATFORM_URL=https://www.amazon.in/
|
|
73
|
+
PAGES_TO_CAPTURE=/homepage
|
|
74
|
+
```
|
|
75
|
+
3. Tell Claude: "Create a shopping chatbot where users can search products and place orders"
|
|
76
|
+
4. Claude will generate the complete prototype
|
|
77
|
+
|
|
78
|
+
## Learn More
|
|
79
|
+
|
|
80
|
+
- [Platform Prototype Skill Documentation](../../README.md)
|
|
81
|
+
- [Quick Start Guide](../../QUICKSTART.md)
|
|
82
|
+
- [Installation Instructions](../../INSTALL.md)
|