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/bin/cli.js ADDED
@@ -0,0 +1,319 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Real Prototypes - npx installer
5
+ *
6
+ * Installs the platform prototyping skill to your Claude Code environment.
7
+ *
8
+ * Usage:
9
+ * npx real-prototypes-skill # Install the skill
10
+ * npx real-prototypes-skill --help # Show help
11
+ */
12
+
13
+ const fs = require('fs');
14
+ const path = require('path');
15
+ const os = require('os');
16
+
17
+ const VERSION = '2.0.0';
18
+ const SKILL_NAME = 'real-prototypes-skill';
19
+
20
+ function log(message, type = 'info') {
21
+ const styles = {
22
+ info: '\x1b[36m→\x1b[0m',
23
+ success: '\x1b[32m✓\x1b[0m',
24
+ warning: '\x1b[33m⚠\x1b[0m',
25
+ error: '\x1b[31m✗\x1b[0m',
26
+ title: '\x1b[1m\x1b[35m'
27
+ };
28
+ console.log(`${styles[type] || ''} ${message}${type === 'title' ? '\x1b[0m' : ''}`);
29
+ }
30
+
31
+ function showBanner() {
32
+ console.log(`
33
+ \x1b[35m╔═══════════════════════════════════════════════════════════╗
34
+ ║ ║
35
+ ║ \x1b[1mReal Prototypes\x1b[0m\x1b[35m ║
36
+ ║ Capture any platform. Generate pixel-perfect prototypes.║
37
+ ║ ║
38
+ ║ Version: ${VERSION} ║
39
+ ║ ║
40
+ ╚═══════════════════════════════════════════════════════════╝\x1b[0m
41
+ `);
42
+ }
43
+
44
+ function showHelp() {
45
+ showBanner();
46
+ console.log(`
47
+ \x1b[1mUSAGE\x1b[0m
48
+ npx real-prototypes-skill [command] [options]
49
+
50
+ \x1b[1mCOMMANDS\x1b[0m
51
+ install Install the skill to your Claude Code environment (default)
52
+ uninstall Remove the skill from your Claude Code environment
53
+ help Show this help message
54
+
55
+ \x1b[1mOPTIONS\x1b[0m
56
+ --global Install to global Claude Code skills (~/.claude/skills/)
57
+ --local Install to current project (.claude/skills/)
58
+ --force Overwrite existing installation
59
+
60
+ \x1b[1mEXAMPLES\x1b[0m
61
+ # Install to current project
62
+ npx real-prototypes-skill
63
+
64
+ # Install globally
65
+ npx real-prototypes-skill --global
66
+
67
+ # Force reinstall
68
+ npx real-prototypes-skill --force
69
+
70
+ \x1b[1mAFTER INSTALLATION\x1b[0m
71
+ 1. Add platform credentials to your CLAUDE.md:
72
+
73
+ ## Platform Credentials
74
+ \`\`\`
75
+ PLATFORM_URL=https://your-platform.com
76
+ PLATFORM_EMAIL=your@email.com
77
+ PLATFORM_PASSWORD=your-password
78
+ \`\`\`
79
+
80
+ 2. Use the /real-prototypes-skill skill in Claude Code to capture and prototype
81
+
82
+ \x1b[1mLEARN MORE\x1b[0m
83
+ https://github.com/kaidhar/real-prototypes-skill
84
+ `);
85
+ }
86
+
87
+ function copyRecursive(src, dest) {
88
+ const stat = fs.statSync(src);
89
+
90
+ if (stat.isDirectory()) {
91
+ if (!fs.existsSync(dest)) {
92
+ fs.mkdirSync(dest, { recursive: true });
93
+ }
94
+
95
+ const files = fs.readdirSync(src);
96
+ for (const file of files) {
97
+ // Skip node_modules, .git, and temp files
98
+ if (file === 'node_modules' || file === '.git' || file.startsWith('.temp')) {
99
+ continue;
100
+ }
101
+ copyRecursive(path.join(src, file), path.join(dest, file));
102
+ }
103
+ } else {
104
+ fs.copyFileSync(src, dest);
105
+ }
106
+ }
107
+
108
+ function getSkillSource() {
109
+ // When installed via npm, the skill files are in .claude/skills/real-prototypes-skill
110
+ // relative to the package root
111
+ const packageRoot = path.resolve(__dirname, '..');
112
+ const skillDir = path.join(packageRoot, '.claude', 'skills', SKILL_NAME);
113
+
114
+ if (fs.existsSync(skillDir)) {
115
+ return skillDir;
116
+ }
117
+
118
+ // Fallback: check if we're in development
119
+ const devSkillDir = path.join(packageRoot, '.claude', 'skills', SKILL_NAME);
120
+ if (fs.existsSync(devSkillDir)) {
121
+ return devSkillDir;
122
+ }
123
+
124
+ return null;
125
+ }
126
+
127
+ function install(options) {
128
+ showBanner();
129
+
130
+ const skillSource = getSkillSource();
131
+ if (!skillSource) {
132
+ log('Could not find skill source files', 'error');
133
+ log('This might be a packaging issue. Please report at:', 'info');
134
+ log('https://github.com/kaidhar/real-prototypes-skill/issues', 'info');
135
+ process.exit(1);
136
+ }
137
+
138
+ // Determine target directory
139
+ let targetBase;
140
+ if (options.global) {
141
+ targetBase = path.join(os.homedir(), '.claude', 'skills');
142
+ log('Installing globally to ~/.claude/skills/', 'info');
143
+ } else {
144
+ targetBase = path.join(process.cwd(), '.claude', 'skills');
145
+ log('Installing to current project .claude/skills/', 'info');
146
+ }
147
+
148
+ const targetDir = path.join(targetBase, SKILL_NAME);
149
+
150
+ // Check if already installed
151
+ if (fs.existsSync(targetDir) && !options.force) {
152
+ log(`Skill already installed at ${targetDir}`, 'warning');
153
+ log('Use --force to overwrite', 'info');
154
+ process.exit(1);
155
+ }
156
+
157
+ // Create target directory
158
+ if (!fs.existsSync(targetBase)) {
159
+ fs.mkdirSync(targetBase, { recursive: true });
160
+ }
161
+
162
+ // Remove existing if force
163
+ if (fs.existsSync(targetDir) && options.force) {
164
+ log('Removing existing installation...', 'info');
165
+ fs.rmSync(targetDir, { recursive: true, force: true });
166
+ }
167
+
168
+ // Copy skill files
169
+ log('Copying skill files...', 'info');
170
+ copyRecursive(skillSource, targetDir);
171
+
172
+ log(`Skill installed to ${targetDir}`, 'success');
173
+
174
+ // Also copy the agent-browser-skill if it exists and not already present
175
+ const agentBrowserSource = path.join(path.dirname(skillSource), 'agent-browser-skill');
176
+ const agentBrowserTarget = path.join(targetBase, 'agent-browser-skill');
177
+
178
+ if (fs.existsSync(agentBrowserSource) && !fs.existsSync(agentBrowserTarget)) {
179
+ log('Installing dependency: agent-browser-skill...', 'info');
180
+ copyRecursive(agentBrowserSource, agentBrowserTarget);
181
+ log('agent-browser-skill installed', 'success');
182
+ }
183
+
184
+ console.log(`
185
+ \x1b[1mInstallation Complete!\x1b[0m
186
+
187
+ \x1b[1mNext Steps:\x1b[0m
188
+
189
+ 1. Add platform credentials to your CLAUDE.md (or copy .env.example):
190
+
191
+ \x1b[36m## Platform Credentials
192
+ \`\`\`
193
+ PLATFORM_URL=https://your-platform.com
194
+ PLATFORM_EMAIL=your@email.com
195
+ PLATFORM_PASSWORD=your-password
196
+ \`\`\`\x1b[0m
197
+
198
+ 2. \x1b[1m(Optional)\x1b[0m Configure capture settings in CLAUDE.md:
199
+
200
+ \x1b[36m## Capture Settings
201
+ \`\`\`
202
+ # Pages to capture (comma-separated paths, or "auto" for auto-discovery)
203
+ PAGES_TO_CAPTURE=/homepage,/products,/checkout
204
+
205
+ # Capture mode: "full" = all pages, "manual" = specified pages only
206
+ CAPTURE_MODE=manual
207
+
208
+ # Maximum pages to capture in auto mode
209
+ MAX_PAGES=50
210
+
211
+ # Viewport dimensions
212
+ VIEWPORT_WIDTH=1920
213
+ VIEWPORT_HEIGHT=1080
214
+
215
+ # Wait time after page load (milliseconds)
216
+ WAIT_AFTER_LOAD=2000
217
+ \`\`\`\x1b[0m
218
+
219
+ 3. Start Claude Code and use the skill:
220
+
221
+ \x1b[36m/real-prototypes-skill\x1b[0m
222
+
223
+ 4. Follow the prompts to capture and prototype!
224
+
225
+ \x1b[1mDocumentation:\x1b[0m
226
+ ${targetDir}/README.md
227
+ ${targetDir}/QUICKSTART.md
228
+
229
+ \x1b[1mExample Config:\x1b[0m
230
+ See .claude/skills/real-prototypes-skill/examples/CLAUDE.md.example for a complete configuration template.
231
+
232
+ \x1b[1mNeed Help?\x1b[0m
233
+ https://github.com/kaidhar/real-prototypes-skill
234
+ `);
235
+ }
236
+
237
+ function uninstall(options) {
238
+ showBanner();
239
+
240
+ let targetBase;
241
+ if (options.global) {
242
+ targetBase = path.join(os.homedir(), '.claude', 'skills');
243
+ } else {
244
+ targetBase = path.join(process.cwd(), '.claude', 'skills');
245
+ }
246
+
247
+ const targetDir = path.join(targetBase, SKILL_NAME);
248
+
249
+ if (!fs.existsSync(targetDir)) {
250
+ log('Skill not found at ' + targetDir, 'warning');
251
+ process.exit(0);
252
+ }
253
+
254
+ log(`Removing skill from ${targetDir}...`, 'info');
255
+ fs.rmSync(targetDir, { recursive: true, force: true });
256
+ log('Skill uninstalled successfully', 'success');
257
+ }
258
+
259
+ function parseArgs(args) {
260
+ const options = {
261
+ command: 'install',
262
+ global: false,
263
+ local: true,
264
+ force: false
265
+ };
266
+
267
+ for (let i = 0; i < args.length; i++) {
268
+ const arg = args[i];
269
+
270
+ switch (arg) {
271
+ case 'install':
272
+ case 'uninstall':
273
+ case 'help':
274
+ options.command = arg;
275
+ break;
276
+ case '--global':
277
+ case '-g':
278
+ options.global = true;
279
+ options.local = false;
280
+ break;
281
+ case '--local':
282
+ case '-l':
283
+ options.local = true;
284
+ options.global = false;
285
+ break;
286
+ case '--force':
287
+ case '-f':
288
+ options.force = true;
289
+ break;
290
+ case '--help':
291
+ case '-h':
292
+ options.command = 'help';
293
+ break;
294
+ case '--version':
295
+ case '-v':
296
+ console.log(VERSION);
297
+ process.exit(0);
298
+ }
299
+ }
300
+
301
+ return options;
302
+ }
303
+
304
+ // Main
305
+ const args = process.argv.slice(2);
306
+ const options = parseArgs(args);
307
+
308
+ switch (options.command) {
309
+ case 'install':
310
+ install(options);
311
+ break;
312
+ case 'uninstall':
313
+ uninstall(options);
314
+ break;
315
+ case 'help':
316
+ default:
317
+ showHelp();
318
+ break;
319
+ }
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "real-prototypes-skill",
3
+ "version": "0.1.0",
4
+ "description": "Capture any web platform and generate pixel-perfect prototypes that match its design. A Claude Code skill for rapid feature prototyping.",
5
+ "keywords": [
6
+ "claude-code",
7
+ "skill",
8
+ "prototype",
9
+ "design-system",
10
+ "web-capture",
11
+ "playwright",
12
+ "nextjs",
13
+ "tailwind"
14
+ ],
15
+ "author": "kaidhar",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/kaidhar/real-prototypes-skill.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/kaidhar/real-prototypes-skill/issues"
23
+ },
24
+ "homepage": "https://github.com/kaidhar/real-prototypes-skill#readme",
25
+ "bin": {
26
+ "real-prototypes-skill": "./bin/cli.js"
27
+ },
28
+ "files": [
29
+ "bin/",
30
+ ".claude/skills/real-prototypes-skill/",
31
+ ".claude/skills/agent-browser-skill/",
32
+ ".env.example",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "scripts": {
37
+ "test:visual": "node scripts/visual-regression-test.js",
38
+ "test:visual:ci": "node scripts/visual-regression-test.js --ci",
39
+ "test:components": "node scripts/test-components.js --all",
40
+ "test:component": "node scripts/test-components.js --component",
41
+ "ci:visual": "./scripts/ci-visual-regression.sh"
42
+ },
43
+ "devDependencies": {
44
+ "@types/pixelmatch": "^5.2.6",
45
+ "@types/pngjs": "^6.0.5",
46
+ "pixelmatch": "^7.1.0",
47
+ "playwright": "^1.58.0",
48
+ "pngjs": "^7.0.0"
49
+ },
50
+ "dependencies": {
51
+ "class-variance-authority": "^0.7.1",
52
+ "clsx": "^2.1.1",
53
+ "jsdom": "^27.4.0",
54
+ "tailwind-merge": "^3.4.0"
55
+ },
56
+ "engines": {
57
+ "node": ">=18.0.0"
58
+ }
59
+ }