real-prototypes-skill 0.1.3 → 1.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.
@@ -4,6 +4,22 @@ Copy this to your project's CLAUDE.md and fill in your platform details.
4
4
 
5
5
  ---
6
6
 
7
+ ## ⚠️ IMPORTANT: This Skill Extends EXISTING Platforms
8
+
9
+ This skill is for **adding features to existing platforms**, NOT creating new designs.
10
+
11
+ **Before generating any code:**
12
+ 1. You MUST have an existing platform to capture
13
+ 2. Run `capture` to get screenshots, HTML, and design tokens
14
+ 3. Only then can you generate prototype code
15
+
16
+ **The CLI will BLOCK you if:**
17
+ - You try to create a new project without `--force-create`
18
+ - You try to generate code without captures
19
+ - You try to generate a plan without captures
20
+
21
+ ---
22
+
7
23
  ## Platform Credentials
8
24
 
9
25
  ```
@@ -45,29 +61,33 @@ VIEWPORT_HEIGHT=1080
45
61
  WAIT_AFTER_LOAD=2000
46
62
  ```
47
63
 
48
- ## Advanced Settings (Optional)
64
+ ## Workflow
49
65
 
50
- ```
51
- # Maximum wait timeout (milliseconds)
52
- MAX_WAIT_TIMEOUT=10000
66
+ ```bash
67
+ # 1. Create a new project (requires --force-create)
68
+ node cli.js new --project my-app --force-create
69
+
70
+ # 2. Capture the existing platform
71
+ node cli.js capture --project my-app --url https://your-platform.com
72
+
73
+ # 3. Check for existing prototype (if any)
74
+ node cli.js detect --project my-app
53
75
 
54
- # Retry settings
55
- MAX_RETRIES=3
56
- TIMEOUT_RETRIES=2
57
- RETRY_DELAY_BASE=1000
76
+ # 4. Generate implementation plan
77
+ node cli.js plan --project my-app --feature "Add chatbot widget"
58
78
 
59
- # Validation thresholds
60
- MIN_SCREENSHOT_SIZE=102400
61
- MIN_HTML_SIZE=10240
62
- MIN_PAGE_HEIGHT=500
79
+ # 5. Generate prototype guidance (shows paths and colors)
80
+ node cli.js generate --project my-app
63
81
 
64
- # Exclude URL patterns from capture (comma-separated)
65
- # EXCLUDE_PATTERNS=/logout,/signout,/delete,/admin
82
+ # 6. Validate colors after implementation
83
+ node cli.js validate-colors --project my-app
66
84
  ```
67
85
 
68
86
  ## Usage Notes
69
87
 
70
- - The skill will read these values when running the capture phase
88
+ - The skill will read credentials when running the capture phase
71
89
  - Credentials are only used locally for browser automation
72
90
  - Never commit this file to version control with real credentials
73
- - Add CLAUDE.md to your .gitignore
91
+ - Add CLAUDE.md to your .gitignore if it contains credentials
92
+ - ALL prototype files must be created in `projects/<project>/prototype/`
93
+ - Use ONLY colors from `design-tokens.json` - no Tailwind defaults
@@ -0,0 +1,93 @@
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
+ ## ⚠️ IMPORTANT: This Skill Extends EXISTING Platforms
8
+
9
+ This skill is for **adding features to existing platforms**, NOT creating new designs.
10
+
11
+ **Before generating any code:**
12
+ 1. You MUST have an existing platform to capture
13
+ 2. Run `capture` to get screenshots, HTML, and design tokens
14
+ 3. Only then can you generate prototype code
15
+
16
+ **The CLI will BLOCK you if:**
17
+ - You try to create a new project without `--force-create`
18
+ - You try to generate code without captures
19
+ - You try to generate a plan without captures
20
+
21
+ ---
22
+
23
+ ## Platform Credentials
24
+
25
+ ```
26
+ # Your platform's base URL (no trailing slash)
27
+ PLATFORM_URL=https://app.example.com
28
+
29
+ # Login credentials (if the platform requires authentication)
30
+ PLATFORM_EMAIL=your-email@example.com
31
+ PLATFORM_PASSWORD=your-secure-password
32
+ ```
33
+
34
+ ## Capture Settings
35
+
36
+ ```
37
+ # Pages to capture
38
+ # Option 1: Specify pages manually (comma-separated paths)
39
+ PAGES_TO_CAPTURE=/dashboard,/settings,/profile,/users
40
+
41
+ # Option 2: Auto-discover all pages
42
+ # PAGES_TO_CAPTURE=auto
43
+
44
+ # Option 3: Disable auto-capture (only capture specified pages)
45
+ # PAGES_TO_CAPTURE=off
46
+
47
+ # Capture mode
48
+ # "full" = capture all discovered pages up to MAX_PAGES
49
+ # "manual" = only capture pages listed in PAGES_TO_CAPTURE
50
+ CAPTURE_MODE=manual
51
+
52
+ # Maximum pages to capture in auto/full mode
53
+ MAX_PAGES=50
54
+
55
+ # Viewport dimensions (pixels)
56
+ VIEWPORT_WIDTH=1920
57
+ VIEWPORT_HEIGHT=1080
58
+
59
+ # Wait time after page load before capturing (milliseconds)
60
+ # Increase this if pages have slow-loading content or animations
61
+ WAIT_AFTER_LOAD=2000
62
+ ```
63
+
64
+ ## Workflow
65
+
66
+ ```bash
67
+ # 1. Create a new project (requires --force-create)
68
+ node cli.js new --project my-app --force-create
69
+
70
+ # 2. Capture the existing platform
71
+ node cli.js capture --project my-app --url https://your-platform.com
72
+
73
+ # 3. Check for existing prototype (if any)
74
+ node cli.js detect --project my-app
75
+
76
+ # 4. Generate implementation plan
77
+ node cli.js plan --project my-app --feature "Add chatbot widget"
78
+
79
+ # 5. Generate prototype guidance (shows paths and colors)
80
+ node cli.js generate --project my-app
81
+
82
+ # 6. Validate colors after implementation
83
+ node cli.js validate-colors --project my-app
84
+ ```
85
+
86
+ ## Usage Notes
87
+
88
+ - The skill will read credentials when running the capture phase
89
+ - Credentials are only used locally for browser automation
90
+ - Never commit this file to version control with real credentials
91
+ - Add CLAUDE.md to your .gitignore if it contains credentials
92
+ - ALL prototype files must be created in `projects/<project>/prototype/`
93
+ - Use ONLY colors from `design-tokens.json` - no Tailwind defaults
package/bin/cli.js CHANGED
@@ -215,6 +215,16 @@ function install(options) {
215
215
 
216
216
  log(`Skill installed to ${targetDir}`, 'success');
217
217
 
218
+ // Copy CLAUDE.md.example to current directory if local install
219
+ if (!options.global) {
220
+ const exampleSource = path.join(path.dirname(__dirname), 'CLAUDE.md.example');
221
+ const exampleTarget = path.join(process.cwd(), 'CLAUDE.md.example');
222
+ if (fs.existsSync(exampleSource) && !fs.existsSync(exampleTarget)) {
223
+ fs.copyFileSync(exampleSource, exampleTarget);
224
+ log('CLAUDE.md.example copied to project root', 'success');
225
+ }
226
+ }
227
+
218
228
  // Also copy the agent-browser-skill if it exists and not already present
219
229
  const agentBrowserSource = path.join(path.dirname(skillSource), 'agent-browser-skill');
220
230
  const agentBrowserTarget = path.join(targetBase, 'agent-browser-skill');
@@ -271,7 +281,8 @@ function install(options) {
271
281
  ${targetDir}/QUICKSTART.md
272
282
 
273
283
  \x1b[1mExample Config:\x1b[0m
274
- See .claude/skills/real-prototypes-skill/examples/CLAUDE.md.example for a complete configuration template.
284
+ See CLAUDE.md.example in the package root for a complete configuration template.
285
+ Or copy from: ${path.join(path.dirname(__dirname), 'CLAUDE.md.example')}
275
286
 
276
287
  \x1b[1mNeed Help?\x1b[0m
277
288
  https://github.com/kaidhar/real-prototypes-skill
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "real-prototypes-skill",
3
- "version": "0.1.3",
3
+ "version": "1.0.0",
4
4
  "description": "Capture any web platform and generate pixel-perfect prototypes that match its design. A Claude Code skill for rapid feature prototyping.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -30,6 +30,7 @@
30
30
  ".claude/skills/real-prototypes-skill/",
31
31
  ".claude/skills/agent-browser-skill/",
32
32
  ".env.example",
33
+ "CLAUDE.md.example",
33
34
  "README.md",
34
35
  "LICENSE"
35
36
  ],
@@ -1,259 +0,0 @@
1
- # Installation Guide
2
-
3
- Quick guide to install the Platform Prototype Skill in your Claude Code setup.
4
-
5
- ---
6
-
7
- ## 🚀 Method 1: Global Installation (Recommended)
8
-
9
- Install the skill globally so it's available in all your Claude Code projects.
10
-
11
- ### Step 1: Navigate to Claude Skills Directory
12
-
13
- ```bash
14
- cd ~/.claude/skills
15
- ```
16
-
17
- If the directory doesn't exist, create it:
18
- ```bash
19
- mkdir -p ~/.claude/skills
20
- cd ~/.claude/skills
21
- ```
22
-
23
- ### Step 2: Clone This Repository
24
-
25
- ```bash
26
- git clone https://github.com/kaidhar/real-prototypes-skill.git
27
- ```
28
-
29
- ### Step 3: Verify Installation
30
-
31
- ```bash
32
- # List the skill directory
33
- ls -la real-prototypes-skill
34
-
35
- # You should see SKILL.md, README.md, cli.js, etc.
36
- ```
37
-
38
- ### Step 4: Restart Claude Code
39
-
40
- ```bash
41
- # Exit Claude Code if running
42
- # Then restart it in any project
43
- cd ~/your-project
44
- claude-code
45
- ```
46
-
47
- ### Step 5: Test the Skill
48
-
49
- Tell Claude:
50
- ```
51
- Use the real-prototypes-skill to capture design from amazon.in
52
- ```
53
-
54
- Claude should recognize and invoke the skill!
55
-
56
- ---
57
-
58
- ## 📁 Method 2: Project-Specific Installation
59
-
60
- Install the skill only for a specific project.
61
-
62
- ### Step 1: Navigate to Your Project
63
-
64
- ```bash
65
- cd your-project
66
- ```
67
-
68
- ### Step 2: Create Skills Directory
69
-
70
- ```bash
71
- mkdir -p .claude/skills
72
- cd .claude/skills
73
- ```
74
-
75
- ### Step 3: Clone the Repository
76
-
77
- ```bash
78
- git clone https://github.com/kaidhar/real-prototypes-skill.git
79
- ```
80
-
81
- Or add as a submodule:
82
- ```bash
83
- git submodule add https://github.com/kaidhar/real-prototypes-skill.git
84
- ```
85
-
86
- ### Step 4: Restart Claude Code in This Project
87
-
88
- ```bash
89
- cd ../.. # Back to project root
90
- claude-code
91
- ```
92
-
93
- ---
94
-
95
- ## ✅ Verify Installation
96
-
97
- ### Check if Skill is Loaded
98
-
99
- ```bash
100
- # In Claude Code, type:
101
- /help
102
- ```
103
-
104
- Look for `real-prototypes-skill` in the list of available skills.
105
-
106
- ### Test Run
107
-
108
- Tell Claude:
109
- ```
110
- I want to create a prototype that matches Amazon's design.
111
- Can you use the real-prototypes-skill?
112
- ```
113
-
114
- If Claude responds that it's using the skill, you're all set! ✅
115
-
116
- ---
117
-
118
- ## 🔧 Troubleshooting
119
-
120
- ### "Skill not found"
121
-
122
- **Problem**: Claude doesn't recognize the skill.
123
-
124
- **Solution**:
125
- 1. Check the installation path:
126
- ```bash
127
- ls ~/.claude/skills/real-prototypes-skill/SKILL.md
128
- ```
129
- 2. Ensure `SKILL.md` exists (this is what Claude reads)
130
- 3. Restart Claude Code completely
131
-
132
- ### "agent-browser-skill not found"
133
-
134
- **Problem**: The platform skill depends on `agent-browser-skill`.
135
-
136
- **Solution**: Install the browser automation skill:
137
- ```bash
138
- cd ~/.claude/skills
139
- git clone https://github.com/anthropics/agent-browser-skill.git
140
- ```
141
-
142
- ### "Permission denied"
143
-
144
- **Problem**: Can't write to `~/.claude/skills/`.
145
-
146
- **Solution**: Create the directory with proper permissions:
147
- ```bash
148
- mkdir -p ~/.claude/skills
149
- chmod 755 ~/.claude/skills
150
- ```
151
-
152
- ### "Git clone failed"
153
-
154
- **Problem**: Repository doesn't exist or network issue.
155
-
156
- **Solution**:
157
- 1. Check if you're using the correct GitHub URL
158
- 2. Try with HTTPS instead of SSH:
159
- ```bash
160
- git clone https://github.com/kaidhar/real-prototypes-skill.git
161
- ```
162
- 3. Check your network connection
163
-
164
- ---
165
-
166
- ## 🔄 Updating the Skill
167
-
168
- ### Global Installation Update
169
-
170
- ```bash
171
- cd ~/.claude/skills/real-prototypes-skill
172
- git pull origin main
173
- ```
174
-
175
- ### Project-Specific Update
176
-
177
- ```bash
178
- cd your-project/.claude/skills/real-prototypes-skill
179
- git pull origin main
180
- ```
181
-
182
- ### Submodule Update
183
-
184
- ```bash
185
- cd your-project
186
- git submodule update --remote .claude/skills/real-prototypes-skill
187
- ```
188
-
189
- ---
190
-
191
- ## 🗑️ Uninstalling
192
-
193
- ### Remove Global Installation
194
-
195
- ```bash
196
- rm -rf ~/.claude/skills/real-prototypes-skill
197
- ```
198
-
199
- ### Remove Project-Specific Installation
200
-
201
- ```bash
202
- cd your-project
203
- rm -rf .claude/skills/real-prototypes-skill
204
- ```
205
-
206
- ### Remove Submodule
207
-
208
- ```bash
209
- cd your-project
210
- git submodule deinit .claude/skills/real-prototypes-skill
211
- git rm .claude/skills/real-prototypes-skill
212
- rm -rf .git/modules/.claude/skills/real-prototypes-skill
213
- ```
214
-
215
- ---
216
-
217
- ## 📦 Dependencies
218
-
219
- Make sure you have these installed:
220
-
221
- ### Required
222
- - **Claude Code CLI** - [Install from claude.ai/code](https://claude.ai/code)
223
- - **Node.js 18+** - [Download from nodejs.org](https://nodejs.org/)
224
- - **npm or pnpm** - Comes with Node.js
225
-
226
- ### Check Versions
227
-
228
- ```bash
229
- # Check Claude Code
230
- claude --version
231
-
232
- # Check Node.js
233
- node --version
234
-
235
- # Check npm
236
- npm --version
237
- ```
238
-
239
- ---
240
-
241
- ## 🎓 Next Steps
242
-
243
- After installation:
244
-
245
- 1. **Read the README** - `cat ~/.claude/skills/real-prototypes-skill/README.md`
246
- 2. **Try the examples** - Check out the Amazon chatbot example
247
- 3. **Build your first prototype** - Follow the usage guide in README.md
248
-
249
- ---
250
-
251
- ## 💬 Getting Help
252
-
253
- - **GitHub Issues**: [Report a problem](https://github.com/kaidhar/real-prototypes-skill/issues)
254
- - **Discussions**: [Ask questions](https://github.com/kaidhar/real-prototypes-skill/discussions)
255
- - **Documentation**: [Read SKILL.md](./SKILL.md)
256
-
257
- ---
258
-
259
- Happy prototyping! 🎨