real-prototypes-skill 1.0.0 → 1.0.2
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.
|
@@ -6,6 +6,23 @@ allowed-tools: Bash(agent-browser:*)
|
|
|
6
6
|
|
|
7
7
|
# Browser Automation with agent-browser
|
|
8
8
|
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
`agent-browser` is a **Vercel Labs npm package** for headless browser automation.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Install globally
|
|
15
|
+
npm install -g agent-browser
|
|
16
|
+
|
|
17
|
+
# Download Chromium (required after npm install)
|
|
18
|
+
agent-browser install
|
|
19
|
+
|
|
20
|
+
# Verify installation
|
|
21
|
+
agent-browser --version
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Repository:** https://github.com/vercel-labs/agent-browser
|
|
25
|
+
|
|
9
26
|
## Quick start
|
|
10
27
|
|
|
11
28
|
```bash
|
|
@@ -38,6 +38,38 @@ Enterprise-grade tool for capturing web platforms and generating pixel-perfect p
|
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
+
## Prerequisites
|
|
42
|
+
|
|
43
|
+
### Required: agent-browser
|
|
44
|
+
This skill requires **agent-browser** for browser automation.
|
|
45
|
+
|
|
46
|
+
`agent-browser` is a **Vercel Labs npm package** for headless browser automation.
|
|
47
|
+
|
|
48
|
+
**Installation:**
|
|
49
|
+
```bash
|
|
50
|
+
# Install globally
|
|
51
|
+
npm install -g agent-browser
|
|
52
|
+
|
|
53
|
+
# Download Chromium (required after npm install)
|
|
54
|
+
agent-browser install
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Verify installation:**
|
|
58
|
+
```bash
|
|
59
|
+
agent-browser --version
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Note:** The `npx real-prototypes-skill` installer will attempt to install agent-browser automatically.
|
|
63
|
+
|
|
64
|
+
### Alternative: Manual Capture
|
|
65
|
+
If you can't install `agent-browser`, you can still use this skill by:
|
|
66
|
+
1. Manually taking screenshots and saving to `references/screenshots/`
|
|
67
|
+
2. Manually saving HTML to `references/html/`
|
|
68
|
+
3. Running `node cli.js extract-tokens` to generate design tokens from HTML
|
|
69
|
+
4. Then using `generate`, `plan`, and other commands
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
41
73
|
## 🏢 ENTERPRISE PIPELINE - MANDATORY FOR ALL PROTOTYPES
|
|
42
74
|
|
|
43
75
|
**This pipeline MUST be followed. Validation gates will BLOCK generation if prerequisites are missing.**
|
|
@@ -16,6 +16,41 @@ const fs = require('fs');
|
|
|
16
16
|
const path = require('path');
|
|
17
17
|
const { execSync } = require('child_process');
|
|
18
18
|
|
|
19
|
+
// Check for required dependencies
|
|
20
|
+
function checkDependencies() {
|
|
21
|
+
const required = ['jsdom'];
|
|
22
|
+
const missing = [];
|
|
23
|
+
|
|
24
|
+
for (const dep of required) {
|
|
25
|
+
try {
|
|
26
|
+
require.resolve(dep);
|
|
27
|
+
} catch (e) {
|
|
28
|
+
missing.push(dep);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (missing.length > 0) {
|
|
33
|
+
console.log(`
|
|
34
|
+
\x1b[31m════════════════════════════════════════════════════════════\x1b[0m
|
|
35
|
+
\x1b[31m MISSING DEPENDENCIES\x1b[0m
|
|
36
|
+
\x1b[31m════════════════════════════════════════════════════════════\x1b[0m
|
|
37
|
+
|
|
38
|
+
The following required packages are not installed:
|
|
39
|
+
${missing.join(', ')}
|
|
40
|
+
|
|
41
|
+
\x1b[1mTo fix, run:\x1b[0m
|
|
42
|
+
cd ${__dirname} && npm install
|
|
43
|
+
|
|
44
|
+
\x1b[1mOr reinstall the skill:\x1b[0m
|
|
45
|
+
npx real-prototypes-skill@latest --force
|
|
46
|
+
`);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Run dependency check before anything else
|
|
52
|
+
checkDependencies();
|
|
53
|
+
|
|
19
54
|
const SKILL_DIR = __dirname;
|
|
20
55
|
const PROJECTS_DIR = path.resolve(SKILL_DIR, '../../../projects');
|
|
21
56
|
const VERSION = '1.4.0';
|
package/README.md
CHANGED
|
@@ -117,18 +117,32 @@ design. Include payment selection and order summary.
|
|
|
117
117
|
|
|
118
118
|
### Required
|
|
119
119
|
|
|
120
|
-
- **
|
|
120
|
+
- **agent-browser** - Vercel Labs browser automation package
|
|
121
121
|
```bash
|
|
122
|
-
# Install
|
|
123
|
-
npm install -g
|
|
122
|
+
# Install globally
|
|
123
|
+
npm install -g agent-browser
|
|
124
|
+
|
|
125
|
+
# Download Chromium (required after npm install)
|
|
126
|
+
agent-browser install
|
|
127
|
+
|
|
128
|
+
# Verify installation
|
|
129
|
+
agent-browser --version
|
|
124
130
|
```
|
|
125
131
|
|
|
132
|
+
**Note:** The `npx real-prototypes-skill` installer will attempt to install agent-browser automatically.
|
|
133
|
+
|
|
126
134
|
- **Node.js 18+**
|
|
127
135
|
```bash
|
|
128
136
|
node --version # Should be v18.0.0 or higher
|
|
129
137
|
```
|
|
130
138
|
|
|
131
|
-
|
|
139
|
+
### If You Can't Install agent-browser
|
|
140
|
+
|
|
141
|
+
You can still use this skill with **manual capture**:
|
|
142
|
+
1. Take screenshots manually and save to `references/screenshots/`
|
|
143
|
+
2. Save HTML files to `references/html/`
|
|
144
|
+
3. Run `node cli.js extract-tokens` to generate design tokens
|
|
145
|
+
4. Then use `generate`, `plan`, and other commands
|
|
132
146
|
|
|
133
147
|
### Optional (Enhances Features)
|
|
134
148
|
|
|
@@ -377,12 +391,48 @@ npm run dev
|
|
|
377
391
|
|
|
378
392
|
## Troubleshooting
|
|
379
393
|
|
|
380
|
-
### "agent-browser
|
|
394
|
+
### "agent-browser not found"
|
|
395
|
+
|
|
396
|
+
`agent-browser` is a **Vercel Labs npm package** that needs to be installed separately.
|
|
381
397
|
|
|
382
|
-
|
|
398
|
+
**Install agent-browser:**
|
|
383
399
|
```bash
|
|
384
|
-
|
|
385
|
-
|
|
400
|
+
# Install globally
|
|
401
|
+
npm install -g agent-browser
|
|
402
|
+
|
|
403
|
+
# Download Chromium (required after npm install)
|
|
404
|
+
agent-browser install
|
|
405
|
+
|
|
406
|
+
# Verify installation
|
|
407
|
+
agent-browser --version
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
**Alternative - Manual capture workflow:**
|
|
411
|
+
```bash
|
|
412
|
+
# 1. Take screenshots manually, save to:
|
|
413
|
+
projects/<name>/references/screenshots/
|
|
414
|
+
|
|
415
|
+
# 2. Save HTML files to:
|
|
416
|
+
projects/<name>/references/html/
|
|
417
|
+
|
|
418
|
+
# 3. Extract design tokens from HTML:
|
|
419
|
+
node cli.js extract-tokens --project <name>
|
|
420
|
+
|
|
421
|
+
# 4. Continue with generate/plan commands
|
|
422
|
+
node cli.js generate --project <name>
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### "Missing dependencies (jsdom, etc.)"
|
|
426
|
+
|
|
427
|
+
The skill requires dependencies to be installed:
|
|
428
|
+
```bash
|
|
429
|
+
cd .claude/skills/real-prototypes-skill
|
|
430
|
+
npm install
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Or reinstall the skill:
|
|
434
|
+
```bash
|
|
435
|
+
npx real-prototypes-skill@latest --force
|
|
386
436
|
```
|
|
387
437
|
|
|
388
438
|
### "Colors don't match the captured design"
|
package/bin/cli.js
CHANGED
|
@@ -215,6 +215,61 @@ function install(options) {
|
|
|
215
215
|
|
|
216
216
|
log(`Skill installed to ${targetDir}`, 'success');
|
|
217
217
|
|
|
218
|
+
// Install dependencies in the skill directory
|
|
219
|
+
const skillPackageJson = {
|
|
220
|
+
"name": "real-prototypes-skill-deps",
|
|
221
|
+
"private": true,
|
|
222
|
+
"dependencies": {
|
|
223
|
+
"jsdom": "^27.4.0",
|
|
224
|
+
"@babel/parser": "^7.29.0",
|
|
225
|
+
"@babel/traverse": "^7.29.0",
|
|
226
|
+
"@babel/generator": "^7.29.0",
|
|
227
|
+
"class-variance-authority": "^0.7.1",
|
|
228
|
+
"clsx": "^2.1.1",
|
|
229
|
+
"tailwind-merge": "^3.4.0"
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
const skillPkgPath = path.join(targetDir, 'package.json');
|
|
234
|
+
fs.writeFileSync(skillPkgPath, JSON.stringify(skillPackageJson, null, 2));
|
|
235
|
+
log('Installing skill dependencies...', 'info');
|
|
236
|
+
|
|
237
|
+
try {
|
|
238
|
+
const { execSync } = require('child_process');
|
|
239
|
+
execSync('npm install --production', {
|
|
240
|
+
cwd: targetDir,
|
|
241
|
+
stdio: 'pipe'
|
|
242
|
+
});
|
|
243
|
+
log('Dependencies installed', 'success');
|
|
244
|
+
} catch (e) {
|
|
245
|
+
log('Warning: Could not auto-install dependencies', 'warning');
|
|
246
|
+
log(`Run manually: cd ${targetDir} && npm install`, 'info');
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Install agent-browser globally (required for browser automation)
|
|
250
|
+
log('Installing agent-browser (Vercel Labs browser automation)...', 'info');
|
|
251
|
+
try {
|
|
252
|
+
const { execSync } = require('child_process');
|
|
253
|
+
// Check if already installed
|
|
254
|
+
try {
|
|
255
|
+
execSync('agent-browser --version', { stdio: 'pipe' });
|
|
256
|
+
log('agent-browser already installed', 'success');
|
|
257
|
+
} catch {
|
|
258
|
+
// Not installed, install it
|
|
259
|
+
execSync('npm install -g agent-browser', { stdio: 'pipe' });
|
|
260
|
+
log('agent-browser installed globally', 'success');
|
|
261
|
+
|
|
262
|
+
// Download Chromium browser
|
|
263
|
+
log('Downloading Chromium for agent-browser...', 'info');
|
|
264
|
+
execSync('agent-browser install', { stdio: 'pipe' });
|
|
265
|
+
log('Chromium downloaded', 'success');
|
|
266
|
+
}
|
|
267
|
+
} catch (e) {
|
|
268
|
+
log('Warning: Could not install agent-browser automatically', 'warning');
|
|
269
|
+
log('Install manually: npm install -g agent-browser && agent-browser install', 'info');
|
|
270
|
+
log('Without agent-browser, you can still use manual capture mode', 'info');
|
|
271
|
+
}
|
|
272
|
+
|
|
218
273
|
// Copy CLAUDE.md.example to current directory if local install
|
|
219
274
|
if (!options.global) {
|
|
220
275
|
const exampleSource = path.join(path.dirname(__dirname), 'CLAUDE.md.example');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "real-prototypes-skill",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
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",
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
+
"release:patch": "npm version patch && npm publish && git push && git push --tags",
|
|
39
|
+
"release:minor": "npm version minor && npm publish && git push && git push --tags",
|
|
40
|
+
"release:major": "npm version major && npm publish && git push && git push --tags",
|
|
38
41
|
"test:visual": "node scripts/visual-regression-test.js",
|
|
39
42
|
"test:visual:ci": "node scripts/visual-regression-test.js --ci",
|
|
40
43
|
"test:components": "node scripts/test-components.js --all",
|
|
@@ -48,6 +51,14 @@
|
|
|
48
51
|
"playwright": "^1.58.0",
|
|
49
52
|
"pngjs": "^7.0.0"
|
|
50
53
|
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"agent-browser": ">=0.1.0"
|
|
56
|
+
},
|
|
57
|
+
"peerDependenciesMeta": {
|
|
58
|
+
"agent-browser": {
|
|
59
|
+
"optional": true
|
|
60
|
+
}
|
|
61
|
+
},
|
|
51
62
|
"dependencies": {
|
|
52
63
|
"@babel/generator": "^7.29.0",
|
|
53
64
|
"@babel/parser": "^7.29.0",
|