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,203 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Platform Capture Orchestrator
|
|
5
|
+
*
|
|
6
|
+
* This script generates agent-browser commands for capturing a platform.
|
|
7
|
+
* It reads configuration from CLAUDE.md and outputs a capture script.
|
|
8
|
+
*
|
|
9
|
+
* Usage: node capture-platform.js [claude-md-path] [output-dir]
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const fs = require('fs');
|
|
13
|
+
const path = require('path');
|
|
14
|
+
|
|
15
|
+
// Parse CLAUDE.md for platform configuration
|
|
16
|
+
function parseClaudeMd(filePath) {
|
|
17
|
+
if (!fs.existsSync(filePath)) {
|
|
18
|
+
console.error(`Error: CLAUDE.md not found at ${filePath}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
23
|
+
const config = {};
|
|
24
|
+
|
|
25
|
+
// Extract key=value pairs
|
|
26
|
+
const patterns = {
|
|
27
|
+
PLATFORM_URL: /PLATFORM_URL=(.+)/,
|
|
28
|
+
PLATFORM_EMAIL: /PLATFORM_EMAIL=(.+)/,
|
|
29
|
+
PLATFORM_PASSWORD: /PLATFORM_PASSWORD=(.+)/,
|
|
30
|
+
PAGES_TO_CAPTURE: /PAGES_TO_CAPTURE=(.+)/,
|
|
31
|
+
VIEWPORT_WIDTH: /VIEWPORT_WIDTH=(\d+)/,
|
|
32
|
+
VIEWPORT_HEIGHT: /VIEWPORT_HEIGHT=(\d+)/,
|
|
33
|
+
PAGE_LOAD_WAIT: /PAGE_LOAD_WAIT=(\d+)/,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
for (const [key, pattern] of Object.entries(patterns)) {
|
|
37
|
+
const match = content.match(pattern);
|
|
38
|
+
if (match) {
|
|
39
|
+
config[key] = match[1].trim();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return config;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Generate capture commands
|
|
47
|
+
function generateCaptureScript(config, outputDir) {
|
|
48
|
+
const {
|
|
49
|
+
PLATFORM_URL,
|
|
50
|
+
PLATFORM_EMAIL,
|
|
51
|
+
PLATFORM_PASSWORD,
|
|
52
|
+
PAGES_TO_CAPTURE = '/dashboard',
|
|
53
|
+
VIEWPORT_WIDTH = '1920',
|
|
54
|
+
VIEWPORT_HEIGHT = '1080',
|
|
55
|
+
PAGE_LOAD_WAIT = '2000',
|
|
56
|
+
} = config;
|
|
57
|
+
|
|
58
|
+
if (!PLATFORM_URL) {
|
|
59
|
+
console.error('Error: PLATFORM_URL not found in CLAUDE.md');
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const pages = PAGES_TO_CAPTURE.split(',').map(p => p.trim());
|
|
64
|
+
const commands = [];
|
|
65
|
+
|
|
66
|
+
// Setup directories
|
|
67
|
+
commands.push(`# Platform Capture Script`);
|
|
68
|
+
commands.push(`# Generated for: ${PLATFORM_URL}`);
|
|
69
|
+
commands.push(`# Pages: ${pages.join(', ')}`);
|
|
70
|
+
commands.push('');
|
|
71
|
+
commands.push('# Create directories');
|
|
72
|
+
commands.push(`mkdir -p ${outputDir}/screenshots ${outputDir}/html ${outputDir}/styles`);
|
|
73
|
+
commands.push('');
|
|
74
|
+
|
|
75
|
+
// Set viewport
|
|
76
|
+
commands.push('# Set viewport');
|
|
77
|
+
commands.push(`agent-browser set viewport ${VIEWPORT_WIDTH} ${VIEWPORT_HEIGHT}`);
|
|
78
|
+
commands.push('');
|
|
79
|
+
|
|
80
|
+
// Authentication (if credentials provided)
|
|
81
|
+
if (PLATFORM_EMAIL && PLATFORM_PASSWORD) {
|
|
82
|
+
commands.push('# Authenticate');
|
|
83
|
+
commands.push(`agent-browser open ${PLATFORM_URL}/login`);
|
|
84
|
+
commands.push(`agent-browser wait ${PAGE_LOAD_WAIT}`);
|
|
85
|
+
commands.push('agent-browser snapshot -i');
|
|
86
|
+
commands.push('# Find email/password fields from snapshot and fill them:');
|
|
87
|
+
commands.push(`# agent-browser fill @e<email_ref> "${PLATFORM_EMAIL}"`);
|
|
88
|
+
commands.push(`# agent-browser fill @e<password_ref> "${PLATFORM_PASSWORD}"`);
|
|
89
|
+
commands.push('# agent-browser click @e<submit_ref>');
|
|
90
|
+
commands.push('agent-browser wait --load networkidle');
|
|
91
|
+
commands.push('');
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Capture each page
|
|
95
|
+
commands.push('# Capture pages');
|
|
96
|
+
for (const page of pages) {
|
|
97
|
+
const pageName = page.replace(/\//g, '-').replace(/^-/, '') || 'home';
|
|
98
|
+
commands.push('');
|
|
99
|
+
commands.push(`# Capture: ${page}`);
|
|
100
|
+
commands.push(`agent-browser open ${PLATFORM_URL}${page}`);
|
|
101
|
+
commands.push(`agent-browser wait ${PAGE_LOAD_WAIT}`);
|
|
102
|
+
commands.push('agent-browser wait --load networkidle');
|
|
103
|
+
commands.push(`agent-browser screenshot --full ${outputDir}/screenshots/${pageName}.png`);
|
|
104
|
+
commands.push(`agent-browser eval "document.documentElement.outerHTML" > ${outputDir}/html/${pageName}.html`);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Extract styles
|
|
108
|
+
commands.push('');
|
|
109
|
+
commands.push('# Extract computed styles');
|
|
110
|
+
commands.push(`agent-browser eval "JSON.stringify(Object.fromEntries(Array.from(getComputedStyle(document.body)).map(k => [k, getComputedStyle(document.body).getPropertyValue(k)])))" > ${outputDir}/styles/body-computed.json`);
|
|
111
|
+
|
|
112
|
+
// Close browser
|
|
113
|
+
commands.push('');
|
|
114
|
+
commands.push('# Close browser');
|
|
115
|
+
commands.push('agent-browser close');
|
|
116
|
+
|
|
117
|
+
return commands.join('\n');
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Generate manifest template
|
|
121
|
+
function generateManifestTemplate(config, outputDir) {
|
|
122
|
+
const { PLATFORM_URL, PAGES_TO_CAPTURE = '/dashboard' } = config;
|
|
123
|
+
const pages = PAGES_TO_CAPTURE.split(',').map(p => p.trim());
|
|
124
|
+
|
|
125
|
+
const manifest = {
|
|
126
|
+
platform: {
|
|
127
|
+
name: new URL(PLATFORM_URL).hostname,
|
|
128
|
+
baseUrl: PLATFORM_URL,
|
|
129
|
+
capturedAt: new Date().toISOString(),
|
|
130
|
+
},
|
|
131
|
+
pages: pages.map(page => {
|
|
132
|
+
const pageName = page.replace(/\//g, '-').replace(/^-/, '') || 'home';
|
|
133
|
+
return {
|
|
134
|
+
name: pageName,
|
|
135
|
+
path: page,
|
|
136
|
+
screenshot: `screenshots/${pageName}.png`,
|
|
137
|
+
html: `html/${pageName}.html`,
|
|
138
|
+
};
|
|
139
|
+
}),
|
|
140
|
+
designTokens: {
|
|
141
|
+
colors: {
|
|
142
|
+
primary: '#3B82F6',
|
|
143
|
+
secondary: '#10B981',
|
|
144
|
+
background: '#FFFFFF',
|
|
145
|
+
foreground: '#1F2937',
|
|
146
|
+
muted: '#F3F4F6',
|
|
147
|
+
border: '#E5E7EB',
|
|
148
|
+
},
|
|
149
|
+
fonts: {
|
|
150
|
+
heading: 'Inter',
|
|
151
|
+
body: 'Inter',
|
|
152
|
+
},
|
|
153
|
+
spacing: {
|
|
154
|
+
xs: '0.25rem',
|
|
155
|
+
sm: '0.5rem',
|
|
156
|
+
md: '1rem',
|
|
157
|
+
lg: '1.5rem',
|
|
158
|
+
xl: '2rem',
|
|
159
|
+
},
|
|
160
|
+
borderRadius: {
|
|
161
|
+
sm: '0.25rem',
|
|
162
|
+
md: '0.375rem',
|
|
163
|
+
lg: '0.5rem',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
return JSON.stringify(manifest, null, 2);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// Main
|
|
172
|
+
function main() {
|
|
173
|
+
const args = process.argv.slice(2);
|
|
174
|
+
const claudeMdPath = args[0] || path.join(process.cwd(), 'CLAUDE.md');
|
|
175
|
+
const outputDir = args[1] || path.join(process.cwd(), 'references');
|
|
176
|
+
|
|
177
|
+
console.log(`Reading configuration from: ${claudeMdPath}`);
|
|
178
|
+
console.log(`Output directory: ${outputDir}`);
|
|
179
|
+
console.log('');
|
|
180
|
+
|
|
181
|
+
const config = parseClaudeMd(claudeMdPath);
|
|
182
|
+
|
|
183
|
+
// Generate and output capture script
|
|
184
|
+
const captureScript = generateCaptureScript(config, outputDir);
|
|
185
|
+
console.log('=== CAPTURE COMMANDS ===');
|
|
186
|
+
console.log(captureScript);
|
|
187
|
+
console.log('');
|
|
188
|
+
|
|
189
|
+
// Generate manifest template
|
|
190
|
+
const manifest = generateManifestTemplate(config, outputDir);
|
|
191
|
+
console.log('=== MANIFEST TEMPLATE ===');
|
|
192
|
+
console.log(`Save to: ${outputDir}/manifest.json`);
|
|
193
|
+
console.log(manifest);
|
|
194
|
+
|
|
195
|
+
// Save manifest template
|
|
196
|
+
const manifestPath = path.join(outputDir, 'manifest.template.json');
|
|
197
|
+
fs.mkdirSync(outputDir, { recursive: true });
|
|
198
|
+
fs.writeFileSync(manifestPath, manifest);
|
|
199
|
+
console.log('');
|
|
200
|
+
console.log(`Manifest template saved to: ${manifestPath}`);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
main();
|