design-clone 1.2.0 → 2.3.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/README.md +32 -39
- package/SKILL.md +69 -45
- package/bin/cli.js +22 -4
- package/bin/commands/clone-site.js +31 -106
- package/bin/commands/help.js +19 -6
- package/bin/commands/init.js +11 -56
- package/bin/commands/uninstall.js +105 -0
- package/bin/commands/update.js +70 -0
- package/bin/commands/verify.js +11 -16
- package/bin/utils/paths.js +28 -0
- package/bin/utils/validate.js +24 -28
- package/bin/utils/version.js +23 -0
- package/docs/code-standards.md +789 -0
- package/docs/codebase-summary.md +556 -0
- package/docs/index.md +74 -0
- package/docs/project-overview-pdr.md +797 -0
- package/docs/system-architecture.md +718 -0
- package/package.json +20 -21
- package/src/ai/prompts/design-tokens/basic.md +80 -0
- package/src/ai/prompts/design-tokens/section-with-css.md +41 -0
- package/src/ai/prompts/design-tokens/section.md +48 -0
- package/src/ai/prompts/design-tokens/with-css.md +87 -0
- package/src/ai/prompts/structure-analysis/basic.md +55 -0
- package/src/ai/prompts/structure-analysis/with-context.md +59 -0
- package/src/ai/prompts/structure-analysis/with-dimensions.md +63 -0
- package/src/ai/prompts/structure-analysis/with-hierarchy.md +73 -0
- package/src/ai/prompts/ux-audit/aggregation.md +42 -0
- package/src/ai/prompts/ux-audit/desktop.md +92 -0
- package/src/ai/prompts/ux-audit/mobile.md +93 -0
- package/src/ai/prompts/ux-audit/tablet.md +92 -0
- package/src/core/animation/animation-extractor-ast.js +183 -0
- package/src/core/animation/animation-extractor-output.js +152 -0
- package/src/core/animation/animation-extractor.js +178 -0
- package/src/core/animation/state-capture-detection.js +200 -0
- package/src/core/animation/state-capture.js +193 -0
- package/src/core/capture/browser-context-pool.js +96 -0
- package/src/core/capture/multi-page-screenshot-page.js +110 -0
- package/src/core/capture/multi-page-screenshot.js +208 -0
- package/src/core/capture/screenshot-extraction.js +186 -0
- package/src/core/capture/screenshot-helpers.js +175 -0
- package/src/core/capture/screenshot-orchestrator.js +174 -0
- package/src/core/capture/screenshot-viewport.js +93 -0
- package/src/core/capture/screenshot.js +192 -0
- package/src/core/content/content-counter-dom.js +191 -0
- package/src/core/content/content-counter.js +76 -0
- package/src/core/css/breakpoint-detector.js +66 -0
- package/src/core/css/chromium-defaults.json +23 -0
- package/src/core/css/computed-style-extractor.js +102 -0
- package/src/core/css/css-chunker.js +103 -0
- package/src/core/{css-extractor.js → css/css-extractor.js} +4 -4
- package/src/core/css/filter-css-dead-code.js +120 -0
- package/src/core/css/filter-css-html-analyzer.js +110 -0
- package/src/core/css/filter-css-selector-matcher.js +172 -0
- package/src/core/css/filter-css.js +206 -0
- package/src/core/css/merge-css-atrule-processor.js +158 -0
- package/src/core/css/merge-css-file-io.js +68 -0
- package/src/core/css/merge-css.js +148 -0
- package/src/core/detection/framework-detector-routing.js +68 -0
- package/src/core/detection/framework-detector-signals.js +65 -0
- package/src/core/detection/framework-detector.js +198 -0
- package/src/core/dimension/dimension-extractor-card-detector.js +82 -0
- package/src/core/dimension/dimension-extractor.js +317 -0
- package/src/core/dimension/dimension-output-ai-summary.js +111 -0
- package/src/core/dimension/dimension-output.js +173 -0
- package/src/core/dimension/dom-tree-analyzer-tree-builders.js +95 -0
- package/src/core/dimension/dom-tree-analyzer.js +191 -0
- package/src/core/discovery/app-state-snapshot-capture.js +195 -0
- package/src/core/discovery/app-state-snapshot-utils.js +178 -0
- package/src/core/discovery/app-state-snapshot.js +131 -0
- package/src/core/discovery/discover-pages-routes.js +84 -0
- package/src/core/discovery/discover-pages-utils.js +177 -0
- package/src/core/discovery/discover-pages.js +191 -0
- package/src/core/html/html-extractor-inline-styler.js +70 -0
- package/src/core/html/html-extractor.js +147 -0
- package/src/core/html/semantic-enhancer-mappings.js +200 -0
- package/src/core/html/semantic-enhancer-page.js +148 -0
- package/src/core/html/semantic-enhancer.js +135 -0
- package/src/core/links/rewrite-links-css-rewriter.js +53 -0
- package/src/core/links/rewrite-links.js +173 -0
- package/src/core/media/asset-validator.js +118 -0
- package/src/core/media/extract-assets-downloader.js +187 -0
- package/src/core/media/extract-assets-page-scraper.js +115 -0
- package/src/core/media/extract-assets.js +159 -0
- package/src/core/media/video-capture-convert.js +200 -0
- package/src/core/media/video-capture.js +201 -0
- package/src/core/{cookie-handler.js → page-prep/cookie-handler.js} +1 -1
- package/src/core/{lazy-loader.js → page-prep/lazy-loader.js} +44 -46
- package/src/core/{page-readiness.js → page-prep/page-readiness.js} +8 -8
- package/src/core/section/section-cropper-helpers.js +43 -0
- package/src/core/section/section-cropper.js +132 -0
- package/src/core/section/section-detector-strategies.js +139 -0
- package/src/core/section/section-detector-utils.js +100 -0
- package/src/core/section/section-detector.js +88 -0
- package/src/core/tests/test-section-cropper.js +177 -0
- package/src/core/tests/test-section-detector.js +55 -0
- package/src/post-process/enhance-assets.js +29 -4
- package/src/post-process/fetch-images-unsplash-client.js +123 -0
- package/src/post-process/fetch-images.js +60 -263
- package/src/post-process/inject-gosnap.js +88 -0
- package/src/post-process/inject-icons-svg-replacer.js +76 -0
- package/src/post-process/inject-icons.js +47 -200
- package/src/route-discoverers/angular-discoverer.js +157 -0
- package/src/route-discoverers/astro-discoverer.js +123 -0
- package/src/route-discoverers/base-discoverer-utils.js +137 -0
- package/src/route-discoverers/base-discoverer.js +153 -0
- package/src/route-discoverers/index.js +106 -0
- package/src/route-discoverers/next-discoverer.js +130 -0
- package/src/route-discoverers/nuxt-discoverer.js +138 -0
- package/src/route-discoverers/react-discoverer.js +139 -0
- package/src/route-discoverers/svelte-discoverer.js +109 -0
- package/src/route-discoverers/universal-discoverer.js +227 -0
- package/src/route-discoverers/vue-discoverer.js +118 -0
- package/src/shared/config.js +38 -0
- package/src/shared/error-codes.js +31 -0
- package/src/shared/viewports.js +46 -0
- package/src/utils/browser.js +11 -44
- package/src/utils/helpers.js +4 -0
- package/src/utils/log.js +12 -0
- package/src/utils/playwright-loader.js +76 -0
- package/src/utils/playwright.js +147 -0
- package/src/utils/progress.js +32 -0
- package/src/verification/generate-audit-report-css-fixes.js +52 -0
- package/src/verification/generate-audit-report-sections.js +158 -0
- package/src/verification/generate-audit-report.js +122 -0
- package/src/verification/quality-scorer.js +92 -0
- package/src/verification/verify-footer-checks.js +103 -0
- package/src/verification/verify-footer-helpers.js +178 -0
- package/src/verification/verify-footer.js +135 -0
- package/src/verification/verify-header-checks.js +104 -0
- package/src/verification/verify-header-helpers.js +156 -0
- package/src/verification/verify-header.js +144 -0
- package/src/verification/verify-layout-report.js +101 -0
- package/src/verification/verify-layout.js +14 -260
- package/src/verification/verify-menu-checks.js +104 -0
- package/src/verification/verify-menu-helpers.js +112 -0
- package/src/verification/verify-menu.js +18 -302
- package/src/verification/verify-slider-checks.js +115 -0
- package/src/verification/verify-slider-constants.js +65 -0
- package/src/verification/verify-slider-helpers.js +164 -0
- package/src/verification/verify-slider.js +142 -0
- package/.env.example +0 -14
- package/docs/basic-clone.md +0 -63
- package/docs/cli-reference.md +0 -118
- package/docs/design-clone-architecture.md +0 -275
- package/docs/pixel-perfect.md +0 -86
- package/docs/troubleshooting.md +0 -169
- package/requirements.txt +0 -5
- package/src/ai/analyze-structure.py +0 -305
- package/src/ai/extract-design-tokens.py +0 -439
- package/src/ai/prompts/__init__.py +0 -2
- package/src/ai/prompts/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/ai/prompts/__pycache__/design_tokens.cpython-313.pyc +0 -0
- package/src/ai/prompts/__pycache__/structure_analysis.cpython-313.pyc +0 -0
- package/src/ai/prompts/design_tokens.py +0 -183
- package/src/ai/prompts/structure_analysis.py +0 -273
- package/src/core/animation-extractor.js +0 -526
- package/src/core/design-tokens.js +0 -103
- package/src/core/dimension-extractor.js +0 -366
- package/src/core/dimension-output.js +0 -208
- package/src/core/discover-pages.js +0 -314
- package/src/core/extract-assets.js +0 -468
- package/src/core/filter-css.js +0 -499
- package/src/core/html-extractor.js +0 -171
- package/src/core/merge-css.js +0 -407
- package/src/core/multi-page-screenshot.js +0 -377
- package/src/core/rewrite-links.js +0 -226
- package/src/core/screenshot.js +0 -572
- package/src/core/state-capture.js +0 -602
- package/src/core/video-capture.js +0 -540
- package/src/utils/__init__.py +0 -16
- package/src/utils/__pycache__/__init__.cpython-313.pyc +0 -0
- package/src/utils/__pycache__/env.cpython-313.pyc +0 -0
- package/src/utils/env.py +0 -134
- package/src/utils/puppeteer.js +0 -281
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "design-clone",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Claude Code skill for cloning website designs via multi-viewport screenshots, HTML/CSS extraction, and
|
|
5
|
+
"description": "Claude Code skill for cloning website designs via multi-viewport screenshots, HTML/CSS extraction, and AI analysis",
|
|
6
6
|
"bin": {
|
|
7
7
|
"design-clone": "./bin/cli.js"
|
|
8
8
|
},
|
|
@@ -13,16 +13,19 @@
|
|
|
13
13
|
"templates/",
|
|
14
14
|
"docs/",
|
|
15
15
|
"SKILL.md",
|
|
16
|
-
"requirements.txt",
|
|
17
16
|
".env.example"
|
|
18
17
|
],
|
|
19
18
|
"scripts": {
|
|
20
|
-
"screenshot": "node src/core/screenshot.js",
|
|
21
|
-
"filter-css": "node src/core/filter-css.js",
|
|
22
|
-
"extract-assets": "node src/core/extract-assets.js",
|
|
19
|
+
"screenshot": "node src/core/capture/screenshot.js",
|
|
20
|
+
"filter-css": "node src/core/css/filter-css.js",
|
|
21
|
+
"extract-assets": "node src/core/media/extract-assets.js",
|
|
23
22
|
"verify-menu": "node src/verification/verify-menu.js",
|
|
24
23
|
"verify-layout": "node src/verification/verify-layout.js",
|
|
25
|
-
"test": "node tests/run-all-tests.js"
|
|
24
|
+
"test": "c8 node tests/run-all-tests.js",
|
|
25
|
+
"test:no-coverage": "node tests/run-all-tests.js",
|
|
26
|
+
"docs:dev": "npm run docs:dev --prefix docs",
|
|
27
|
+
"docs:build": "npm run docs:build --prefix docs",
|
|
28
|
+
"docs:preview": "npm run docs:preview --prefix docs"
|
|
26
29
|
},
|
|
27
30
|
"keywords": [
|
|
28
31
|
"claude",
|
|
@@ -31,8 +34,7 @@
|
|
|
31
34
|
"design",
|
|
32
35
|
"clone",
|
|
33
36
|
"screenshot",
|
|
34
|
-
"
|
|
35
|
-
"gemini",
|
|
37
|
+
"playwright",
|
|
36
38
|
"website"
|
|
37
39
|
],
|
|
38
40
|
"author": "",
|
|
@@ -45,18 +47,15 @@
|
|
|
45
47
|
"node": ">=18.0.0"
|
|
46
48
|
},
|
|
47
49
|
"dependencies": {
|
|
48
|
-
"css-tree": "^2.3.1"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"puppeteer": ">=21.0.0"
|
|
52
|
-
},
|
|
53
|
-
"peerDependenciesMeta": {
|
|
54
|
-
"puppeteer": {
|
|
55
|
-
"optional": true
|
|
56
|
-
}
|
|
50
|
+
"css-tree": "^2.3.1",
|
|
51
|
+
"playwright": "^1.58.1",
|
|
52
|
+
"sharp": "^0.34.5"
|
|
57
53
|
},
|
|
58
54
|
"optionalDependencies": {
|
|
59
|
-
"
|
|
60
|
-
"
|
|
55
|
+
"@ffmpeg-installer/ffmpeg": "^1.1.0",
|
|
56
|
+
"fluent-ffmpeg": "^2.1.2"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"c8": "^10.1.3"
|
|
61
60
|
}
|
|
62
|
-
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Design Token Extraction Prompt (Basic)
|
|
2
|
+
|
|
3
|
+
Analyze these website screenshots (desktop, tablet, mobile) and extract design tokens.
|
|
4
|
+
|
|
5
|
+
Return ONLY valid JSON in this exact format:
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"colors": {
|
|
10
|
+
"primary": "#hex",
|
|
11
|
+
"secondary": "#hex",
|
|
12
|
+
"accent": "#hex",
|
|
13
|
+
"background": "#hex",
|
|
14
|
+
"surface": "#hex",
|
|
15
|
+
"text": {
|
|
16
|
+
"primary": "#hex",
|
|
17
|
+
"secondary": "#hex",
|
|
18
|
+
"muted": "#hex"
|
|
19
|
+
},
|
|
20
|
+
"border": "#hex"
|
|
21
|
+
},
|
|
22
|
+
"typography": {
|
|
23
|
+
"fontFamily": {
|
|
24
|
+
"heading": "Font Name, sans-serif",
|
|
25
|
+
"body": "Font Name, sans-serif"
|
|
26
|
+
},
|
|
27
|
+
"fontSize": {
|
|
28
|
+
"xs": "12px",
|
|
29
|
+
"sm": "14px",
|
|
30
|
+
"base": "16px",
|
|
31
|
+
"lg": "18px",
|
|
32
|
+
"xl": "20px",
|
|
33
|
+
"2xl": "24px",
|
|
34
|
+
"3xl": "30px",
|
|
35
|
+
"4xl": "36px"
|
|
36
|
+
},
|
|
37
|
+
"fontWeight": {
|
|
38
|
+
"normal": 400,
|
|
39
|
+
"medium": 500,
|
|
40
|
+
"semibold": 600,
|
|
41
|
+
"bold": 700
|
|
42
|
+
},
|
|
43
|
+
"lineHeight": {
|
|
44
|
+
"tight": 1.25,
|
|
45
|
+
"normal": 1.5,
|
|
46
|
+
"relaxed": 1.75
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"spacing": {
|
|
50
|
+
"1": "4px",
|
|
51
|
+
"2": "8px",
|
|
52
|
+
"3": "12px",
|
|
53
|
+
"4": "16px",
|
|
54
|
+
"6": "24px",
|
|
55
|
+
"8": "32px",
|
|
56
|
+
"12": "48px",
|
|
57
|
+
"16": "64px"
|
|
58
|
+
},
|
|
59
|
+
"borderRadius": {
|
|
60
|
+
"sm": "4px",
|
|
61
|
+
"md": "8px",
|
|
62
|
+
"lg": "16px",
|
|
63
|
+
"full": "9999px"
|
|
64
|
+
},
|
|
65
|
+
"shadows": {
|
|
66
|
+
"sm": "0 1px 2px rgba(0,0,0,0.05)",
|
|
67
|
+
"md": "0 4px 6px rgba(0,0,0,0.1)",
|
|
68
|
+
"lg": "0 10px 15px rgba(0,0,0,0.1)"
|
|
69
|
+
},
|
|
70
|
+
"notes": []
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
RULES:
|
|
75
|
+
1. Use exact 6-digit hex codes (#RRGGBB), not color names
|
|
76
|
+
2. Identify Google Fonts: Inter, Roboto, Open Sans, Poppins, Montserrat, Lato, Nunito, Raleway, Playfair Display, Merriweather
|
|
77
|
+
3. If font unknown, use reasonable fallback (sans-serif or serif)
|
|
78
|
+
4. Extract observed values; use sensible defaults if unclear
|
|
79
|
+
5. Detect spacing patterns (8px grid common)
|
|
80
|
+
6. Add any observations or accessibility concerns to notes array
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Design Token Extraction Prompt (Section-Specific With CSS)
|
|
2
|
+
|
|
3
|
+
Analyze the section screenshot you are currently viewing, using the CSS context you read above.
|
|
4
|
+
|
|
5
|
+
Extract design tokens visible in THIS section. Use EXACT values from CSS when possible.
|
|
6
|
+
|
|
7
|
+
Return ONLY valid JSON:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"colors": {
|
|
12
|
+
"background": "#exact-hex from CSS or screenshot",
|
|
13
|
+
"text": "#exact-hex for text color",
|
|
14
|
+
"heading": "#exact-hex for heading color",
|
|
15
|
+
"accent": "#exact-hex for accent/CTA",
|
|
16
|
+
"border": "#exact-hex if borders visible"
|
|
17
|
+
},
|
|
18
|
+
"typography": {
|
|
19
|
+
"fontFamily": "exact font-family from CSS",
|
|
20
|
+
"headingSize": "exact font-size for headings",
|
|
21
|
+
"bodySize": "exact body font-size",
|
|
22
|
+
"fontWeight": {
|
|
23
|
+
"heading": "exact weight from CSS",
|
|
24
|
+
"body": "exact weight from CSS"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"spacing": {
|
|
28
|
+
"sectionPadding": "exact padding from CSS",
|
|
29
|
+
"elementGap": "exact gap/margin",
|
|
30
|
+
"containerPadding": "exact container padding"
|
|
31
|
+
},
|
|
32
|
+
"borderRadius": "exact radius from CSS or null",
|
|
33
|
+
"shadow": "exact box-shadow from CSS or null",
|
|
34
|
+
"notes": ["list any CSS custom properties found"]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
RULES:
|
|
39
|
+
1. Extract EXACT hex codes from CSS
|
|
40
|
+
2. Use null for values not visible in this section
|
|
41
|
+
3. Note any CSS variables (--color-*, --space-*)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Design Token Extraction Prompt (Section-Specific)
|
|
2
|
+
|
|
3
|
+
Analyze the section screenshot you are currently viewing and extract design tokens.
|
|
4
|
+
|
|
5
|
+
Focus on elements visible in THIS section only:
|
|
6
|
+
- Background colors and gradients
|
|
7
|
+
- Text colors (headings, body, links)
|
|
8
|
+
- Typography (font family, sizes, weights)
|
|
9
|
+
- Spacing patterns (padding, margins, gaps)
|
|
10
|
+
- Border radius and shadows
|
|
11
|
+
- Any accent or highlight colors
|
|
12
|
+
|
|
13
|
+
Return ONLY valid JSON:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"colors": {
|
|
18
|
+
"background": "#hex or null if transparent",
|
|
19
|
+
"text": "#hex for main text",
|
|
20
|
+
"heading": "#hex for headings",
|
|
21
|
+
"accent": "#hex for buttons/links/highlights",
|
|
22
|
+
"border": "#hex if borders visible"
|
|
23
|
+
},
|
|
24
|
+
"typography": {
|
|
25
|
+
"fontFamily": "observed font or best guess",
|
|
26
|
+
"headingSize": "largest heading size in px",
|
|
27
|
+
"bodySize": "body text size in px",
|
|
28
|
+
"fontWeight": {
|
|
29
|
+
"heading": 700,
|
|
30
|
+
"body": 400
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"spacing": {
|
|
34
|
+
"sectionPadding": "vertical padding estimate",
|
|
35
|
+
"elementGap": "gap between elements",
|
|
36
|
+
"containerPadding": "horizontal padding"
|
|
37
|
+
},
|
|
38
|
+
"borderRadius": "observed radius or null",
|
|
39
|
+
"shadow": "observed shadow or null",
|
|
40
|
+
"notes": ["observations about this section"]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
RULES:
|
|
45
|
+
1. Use exact 6-digit hex codes (#RRGGBB)
|
|
46
|
+
2. If a value is not visible/applicable, use null
|
|
47
|
+
3. Focus only on what's visible in this section image
|
|
48
|
+
4. Add section-specific observations to notes
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Design Token Extraction Prompt (With CSS Context)
|
|
2
|
+
|
|
3
|
+
Extract design tokens from the provided CSS and screenshots.
|
|
4
|
+
|
|
5
|
+
You have access to:
|
|
6
|
+
1. Screenshots showing the visual design
|
|
7
|
+
2. The actual CSS from `source.css` you read above
|
|
8
|
+
|
|
9
|
+
CRITICAL: Extract EXACT values from the CSS. Do not estimate colors or fonts.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
Based on the CSS above, return ONLY valid JSON:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"colors": {
|
|
18
|
+
"primary": "[exact hex from CSS, look for primary/brand colors]",
|
|
19
|
+
"secondary": "[exact hex from CSS]",
|
|
20
|
+
"accent": "[exact hex for accent/highlight colors]",
|
|
21
|
+
"background": "[exact hex, usually body background]",
|
|
22
|
+
"surface": "[exact hex for cards/sections]",
|
|
23
|
+
"text": {
|
|
24
|
+
"primary": "[exact hex, usually body color]",
|
|
25
|
+
"secondary": "[exact hex for muted text]",
|
|
26
|
+
"muted": "[exact hex for very light text]"
|
|
27
|
+
},
|
|
28
|
+
"border": "[exact hex for borders]"
|
|
29
|
+
},
|
|
30
|
+
"typography": {
|
|
31
|
+
"fontFamily": {
|
|
32
|
+
"heading": "[exact font-family from CSS h1-h6 rules]",
|
|
33
|
+
"body": "[exact font-family from CSS body rule]"
|
|
34
|
+
},
|
|
35
|
+
"fontSize": {
|
|
36
|
+
"xs": "[smallest font-size from CSS]",
|
|
37
|
+
"sm": "[small font-size]",
|
|
38
|
+
"base": "[body font-size]",
|
|
39
|
+
"lg": "[larger font-size]",
|
|
40
|
+
"xl": "[heading font-size]",
|
|
41
|
+
"2xl": "[h3 font-size]",
|
|
42
|
+
"3xl": "[h2 font-size]",
|
|
43
|
+
"4xl": "[h1 font-size]"
|
|
44
|
+
},
|
|
45
|
+
"fontWeight": {
|
|
46
|
+
"normal": "[normal weight from CSS]",
|
|
47
|
+
"medium": "[medium weight]",
|
|
48
|
+
"semibold": "[semibold weight]",
|
|
49
|
+
"bold": "[bold weight from CSS]"
|
|
50
|
+
},
|
|
51
|
+
"lineHeight": {
|
|
52
|
+
"tight": "[tight line-height, usually 1.2-1.3]",
|
|
53
|
+
"normal": "[normal line-height, usually 1.5-1.6]",
|
|
54
|
+
"relaxed": "[relaxed line-height, usually 1.7-1.8]"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"spacing": {
|
|
58
|
+
"1": "[4px or smallest spacing]",
|
|
59
|
+
"2": "[8px]",
|
|
60
|
+
"3": "[12px]",
|
|
61
|
+
"4": "[16px - common padding]",
|
|
62
|
+
"6": "[24px]",
|
|
63
|
+
"8": "[32px]",
|
|
64
|
+
"12": "[48px - section padding]",
|
|
65
|
+
"16": "[64px - large section padding]"
|
|
66
|
+
},
|
|
67
|
+
"borderRadius": {
|
|
68
|
+
"sm": "[small radius from CSS]",
|
|
69
|
+
"md": "[medium radius]",
|
|
70
|
+
"lg": "[large radius]",
|
|
71
|
+
"full": "9999px"
|
|
72
|
+
},
|
|
73
|
+
"shadows": {
|
|
74
|
+
"sm": "[small shadow from CSS box-shadow]",
|
|
75
|
+
"md": "[medium shadow]",
|
|
76
|
+
"lg": "[large shadow]"
|
|
77
|
+
},
|
|
78
|
+
"notes": ["List exact CSS custom properties/variables if found", "Note any @import URLs"]
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
RULES:
|
|
83
|
+
1. Extract EXACT hex codes from CSS, not approximate
|
|
84
|
+
2. Copy font-family values exactly as written
|
|
85
|
+
3. Extract actual px/rem values, convert rem to px if needed (1rem = 16px)
|
|
86
|
+
4. Look for CSS custom properties (--color-*, --font-*, --space-*)
|
|
87
|
+
5. If a value isn't in CSS, use screenshot to estimate
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Structure Analysis Prompt (Basic)
|
|
2
|
+
|
|
3
|
+
Analyze this website screenshot and describe the page structure in detail.
|
|
4
|
+
|
|
5
|
+
Output a markdown document with the following sections:
|
|
6
|
+
|
|
7
|
+
# Page Structure Analysis
|
|
8
|
+
|
|
9
|
+
## 1. Header Section
|
|
10
|
+
- Logo: [position, size, type (text/image)]
|
|
11
|
+
- Navigation: [number of items, layout (horizontal/vertical)]
|
|
12
|
+
- CTA Button: [text, position, style]
|
|
13
|
+
- Mobile menu: [hamburger icon visible?]
|
|
14
|
+
|
|
15
|
+
## 2. Hero Section
|
|
16
|
+
- Layout: [centered/left-aligned/split]
|
|
17
|
+
- Headline: [estimated font size, weight, color]
|
|
18
|
+
- Subheadline: [if present, describe]
|
|
19
|
+
- Primary CTA: [button text, style]
|
|
20
|
+
- Secondary CTA: [if present]
|
|
21
|
+
- Background: [solid color/gradient/image]
|
|
22
|
+
- Visual elements: [images, illustrations, icons]
|
|
23
|
+
|
|
24
|
+
## 3. Content Sections
|
|
25
|
+
For each distinct section, describe:
|
|
26
|
+
- Section name/purpose: [features, testimonials, pricing, etc.]
|
|
27
|
+
- Layout pattern: [grid columns, cards, alternating left-right]
|
|
28
|
+
- Number of items: [e.g., 3 feature cards, 4 testimonials]
|
|
29
|
+
- Key components: [icons, images, headings, descriptions]
|
|
30
|
+
|
|
31
|
+
## 4. Footer Section
|
|
32
|
+
- Layout: [columns, stacked]
|
|
33
|
+
- Content blocks: [logo, links, social, newsletter]
|
|
34
|
+
- Copyright: [position, content]
|
|
35
|
+
|
|
36
|
+
## 5. Global Patterns
|
|
37
|
+
- Container max-width: [estimated px]
|
|
38
|
+
- Section padding: [estimated vertical spacing]
|
|
39
|
+
- Card/component style: [shadows, borders, rounded corners]
|
|
40
|
+
- Color scheme: [light/dark mode, accent colors]
|
|
41
|
+
- Typography style: [modern/classic, serif/sans-serif]
|
|
42
|
+
|
|
43
|
+
## 6. Responsive Hints
|
|
44
|
+
- Mobile-friendly indicators
|
|
45
|
+
- Collapsible elements
|
|
46
|
+
- Stack vs grid on small screens
|
|
47
|
+
|
|
48
|
+
## 7. BEM Class Suggestions
|
|
49
|
+
Suggest semantic BEM class names for main components:
|
|
50
|
+
- header, header__logo, header__nav, header__cta
|
|
51
|
+
- hero, hero__title, hero__subtitle, hero__cta
|
|
52
|
+
- section--features, feature-card, feature-card__icon
|
|
53
|
+
- footer, footer__links, footer__social
|
|
54
|
+
|
|
55
|
+
Be specific and detailed. This analysis will be used to generate HTML/CSS.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Structure Analysis Prompt (With HTML/CSS Context)
|
|
2
|
+
|
|
3
|
+
Analyze this website using the screenshot AND the provided source HTML/CSS.
|
|
4
|
+
|
|
5
|
+
You have access to:
|
|
6
|
+
1. A screenshot showing the visual design
|
|
7
|
+
2. The actual HTML structure of the page (from `source.html` you read above)
|
|
8
|
+
3. The CSS rules used on the page (from `source.css` you read above)
|
|
9
|
+
|
|
10
|
+
IMPORTANT: Use the actual HTML/CSS to provide ACCURATE information, not estimates.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
Based on the above context, output a markdown document:
|
|
15
|
+
|
|
16
|
+
# Page Structure Analysis
|
|
17
|
+
|
|
18
|
+
## 1. Header Section
|
|
19
|
+
- Logo: [exact class/id from HTML, position from CSS]
|
|
20
|
+
- Navigation: [exact nav structure from HTML]
|
|
21
|
+
- CTA Button: [exact button text and classes]
|
|
22
|
+
- Mobile menu: [presence and class name if exists]
|
|
23
|
+
|
|
24
|
+
## 2. Hero Section
|
|
25
|
+
- Layout: [from CSS flexbox/grid rules]
|
|
26
|
+
- Headline: [exact text and classes from HTML]
|
|
27
|
+
- Subheadline: [exact text if present]
|
|
28
|
+
- Primary CTA: [exact button text and styles]
|
|
29
|
+
- Background: [from CSS background rules]
|
|
30
|
+
- Visual elements: [images/icons from HTML]
|
|
31
|
+
|
|
32
|
+
## 3. Content Sections
|
|
33
|
+
For each section found in HTML, describe:
|
|
34
|
+
- Section class/id: [exact from HTML]
|
|
35
|
+
- Layout: [from CSS grid/flex rules]
|
|
36
|
+
- Items: [exact count from HTML]
|
|
37
|
+
- Components: [exact structure]
|
|
38
|
+
|
|
39
|
+
## 4. Footer Section
|
|
40
|
+
- Layout: [from CSS]
|
|
41
|
+
- Content blocks: [exact from HTML]
|
|
42
|
+
- Links: [exact href patterns]
|
|
43
|
+
|
|
44
|
+
## 5. Actual CSS Values (from source)
|
|
45
|
+
- Container max-width: [exact from CSS]
|
|
46
|
+
- Section padding: [exact from CSS]
|
|
47
|
+
- Border-radius values: [exact from CSS]
|
|
48
|
+
- Primary color: [exact hex from CSS]
|
|
49
|
+
- Font-family: [exact from CSS]
|
|
50
|
+
- Font-sizes: [exact from CSS]
|
|
51
|
+
|
|
52
|
+
## 6. Responsive Breakpoints (from CSS @media queries)
|
|
53
|
+
- Breakpoint values: [exact from CSS]
|
|
54
|
+
- Layout changes: [what changes at each breakpoint]
|
|
55
|
+
|
|
56
|
+
## 7. Recommended BEM Classes
|
|
57
|
+
Based on the actual HTML structure, suggest clean BEM names that map to existing classes.
|
|
58
|
+
|
|
59
|
+
CRITICAL: Extract EXACT values from the CSS where possible. Do not estimate.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Structure Analysis Prompt (With Extracted Dimensions)
|
|
2
|
+
|
|
3
|
+
Analyze this website screenshot using the EXACT extracted dimensions from `dimensions-summary.json` you read above.
|
|
4
|
+
|
|
5
|
+
## CRITICAL INSTRUCTIONS
|
|
6
|
+
1. USE ONLY the exact values from `dimensions-summary.json` - DO NOT estimate or approximate
|
|
7
|
+
2. All measurements were extracted from the actual DOM via getBoundingClientRect + getComputedStyle
|
|
8
|
+
3. When describing layout, reference these exact numbers
|
|
9
|
+
4. Section 5 MUST repeat these exact values verbatim
|
|
10
|
+
|
|
11
|
+
Use the following fields from `dimensions-summary.json`:
|
|
12
|
+
- `EXACT_DIMENSIONS.container_max_width` for container width
|
|
13
|
+
- `EXACT_DIMENSIONS.section_padding` for section padding
|
|
14
|
+
- `EXACT_DIMENSIONS.gap` for element gaps
|
|
15
|
+
- `EXACT_DIMENSIONS.card_dimensions.width/height/padding` for card measurements
|
|
16
|
+
- `EXACT_TYPOGRAPHY.h1/h2/h3/body` for font sizes
|
|
17
|
+
- `RESPONSIVE.desktop_breakpoint/tablet_breakpoint/mobile_breakpoint` for breakpoints
|
|
18
|
+
- `RESPONSIVE.typography_scaling` for responsive font scaling
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
Now output a markdown document following this structure.
|
|
23
|
+
IMPORTANT: In section 5, you MUST repeat the exact values from the JSON - do not change them.
|
|
24
|
+
|
|
25
|
+
# Page Structure Analysis
|
|
26
|
+
|
|
27
|
+
## 1. Header Section
|
|
28
|
+
- Logo: [describe position and layout]
|
|
29
|
+
- Navigation: [describe navigation structure]
|
|
30
|
+
- CTA Button: [if present]
|
|
31
|
+
- Mobile menu: [hamburger toggle if visible]
|
|
32
|
+
|
|
33
|
+
## 2. Hero Section
|
|
34
|
+
- Layout: [describe arrangement]
|
|
35
|
+
- Headline: font-size from EXACT_TYPOGRAPHY.h1 (EXACT), [describe style]
|
|
36
|
+
- Subheadline: [if present]
|
|
37
|
+
- Primary CTA: [button description]
|
|
38
|
+
- Background: [describe]
|
|
39
|
+
|
|
40
|
+
## 3. Content Sections
|
|
41
|
+
For each section describe:
|
|
42
|
+
- Section name/purpose
|
|
43
|
+
- Layout pattern using the EXACT gap value from EXACT_DIMENSIONS.gap
|
|
44
|
+
- Card dimensions from EXACT_DIMENSIONS.card_dimensions (EXACT)
|
|
45
|
+
- Components within
|
|
46
|
+
|
|
47
|
+
## 4. Footer Section
|
|
48
|
+
- Layout: [describe]
|
|
49
|
+
- Content blocks
|
|
50
|
+
|
|
51
|
+
## 5. EXACT CSS Values (use these for generation - DO NOT MODIFY)
|
|
52
|
+
Copy ALL values directly from `dimensions-summary.json`:
|
|
53
|
+
- Container max-width, section padding, card dimensions, card padding, gap
|
|
54
|
+
- H1, H2, H3, body font sizes
|
|
55
|
+
- Desktop, tablet, mobile breakpoints
|
|
56
|
+
|
|
57
|
+
## 6. Responsive Behavior
|
|
58
|
+
- At tablet breakpoint: [describe layout changes]
|
|
59
|
+
- At mobile breakpoint: [describe layout changes]
|
|
60
|
+
- Typography scales from RESPONSIVE.typography_scaling
|
|
61
|
+
|
|
62
|
+
## 7. BEM Class Suggestions
|
|
63
|
+
[Suggest semantic class names for main components]
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Structure Analysis Prompt (With DOM Hierarchy)
|
|
2
|
+
|
|
3
|
+
Analyze this website screenshot using the EXACT extracted dimensions and DOM hierarchy.
|
|
4
|
+
|
|
5
|
+
## CRITICAL INSTRUCTIONS
|
|
6
|
+
1. USE ONLY the exact values from the JSON files you read above - DO NOT estimate
|
|
7
|
+
2. All measurements are from actual DOM via getBoundingClientRect + getComputedStyle
|
|
8
|
+
3. Typography varies BY SECTION - use section-specific values from TYPOGRAPHY_BY_SECTION
|
|
9
|
+
4. Reference DOM hierarchy from `dom-hierarchy.json` for nesting structure
|
|
10
|
+
|
|
11
|
+
Use data from `dom-hierarchy.json`:
|
|
12
|
+
- `landmarks` for header, main, footer, aside, nav detection
|
|
13
|
+
- `headingTree` for heading hierarchy by section
|
|
14
|
+
- `root` for DOM nesting structure
|
|
15
|
+
|
|
16
|
+
Use data from `dimensions-summary.json`:
|
|
17
|
+
- `EXACT_DIMENSIONS` for container, section, gap, card measurements
|
|
18
|
+
- `TYPOGRAPHY_BY_SECTION.hero` for hero-specific typography
|
|
19
|
+
- `TYPOGRAPHY_BY_SECTION.content` for content-specific typography
|
|
20
|
+
- `TYPOGRAPHY_BY_SECTION.footer` for footer-specific typography
|
|
21
|
+
- `RESPONSIVE` for breakpoints and typography scaling
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
Output a markdown document following this structure.
|
|
26
|
+
IMPORTANT: Use section-specific typography values. Hero H1 differs from Content H1.
|
|
27
|
+
|
|
28
|
+
# Page Structure Analysis
|
|
29
|
+
|
|
30
|
+
## 1. Header Section
|
|
31
|
+
- Logo: [describe position and layout]
|
|
32
|
+
- Navigation: [count items from hierarchy]
|
|
33
|
+
- CTA: [if present]
|
|
34
|
+
|
|
35
|
+
## 2. Hero Section
|
|
36
|
+
- Layout: [from section structure]
|
|
37
|
+
- Headline: font-size from TYPOGRAPHY_BY_SECTION.hero.h1 (EXACT)
|
|
38
|
+
- Subheadline: [if present]
|
|
39
|
+
- CTA: [button description]
|
|
40
|
+
|
|
41
|
+
## 3. Content Sections
|
|
42
|
+
For each section in the hierarchy:
|
|
43
|
+
- Heading sizes: Use CONTENT section typography (content.h2, content.h3)
|
|
44
|
+
- Layout: Reference section structure
|
|
45
|
+
- Card dimensions from EXACT_DIMENSIONS with gap
|
|
46
|
+
- Components: [describe]
|
|
47
|
+
|
|
48
|
+
## 4. Footer Section
|
|
49
|
+
- Layout: [from hierarchy]
|
|
50
|
+
- Typography: footer body text size from TYPOGRAPHY_BY_SECTION.footer
|
|
51
|
+
|
|
52
|
+
## 5. EXACT CSS Values (DO NOT MODIFY)
|
|
53
|
+
### Layout
|
|
54
|
+
- Container max-width, section padding, card dimensions, card padding, gap
|
|
55
|
+
|
|
56
|
+
### Typography per Section
|
|
57
|
+
- Hero H1, Hero H2
|
|
58
|
+
- Content H2, Content H3, Content Body
|
|
59
|
+
- Footer Body
|
|
60
|
+
|
|
61
|
+
### Breakpoints
|
|
62
|
+
- Desktop, Tablet, Mobile breakpoints
|
|
63
|
+
|
|
64
|
+
## 6. Responsive Behavior
|
|
65
|
+
- At tablet breakpoint: [describe layout changes]
|
|
66
|
+
- At mobile breakpoint: [describe layout changes]
|
|
67
|
+
- Typography scales from RESPONSIVE.typography_scaling
|
|
68
|
+
|
|
69
|
+
## 7. DOM Nesting Structure
|
|
70
|
+
Reproduce the exact nesting from `dom-hierarchy.json` root in generated HTML.
|
|
71
|
+
|
|
72
|
+
## 8. BEM Class Suggestions
|
|
73
|
+
[Based on hierarchy, suggest semantic names]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# UX Audit Aggregation Prompt
|
|
2
|
+
|
|
3
|
+
Combine the viewport-specific UX audit results you produced above into a final assessment.
|
|
4
|
+
|
|
5
|
+
Using the desktop, tablet, and mobile audit JSON results from your prior analysis steps, create a unified report that:
|
|
6
|
+
|
|
7
|
+
1. Averages scores across viewports (weighted: desktop 40%, tablet 30%, mobile 30%)
|
|
8
|
+
2. Prioritizes issues by severity and viewport impact
|
|
9
|
+
3. Consolidates duplicate issues
|
|
10
|
+
4. Ranks recommendations by impact
|
|
11
|
+
|
|
12
|
+
Return ONLY valid JSON:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"overall_scores": {
|
|
17
|
+
"visual_hierarchy": 0,
|
|
18
|
+
"navigation": 0,
|
|
19
|
+
"typography": 0,
|
|
20
|
+
"spacing": 0,
|
|
21
|
+
"interactivity": 0,
|
|
22
|
+
"responsive": 0
|
|
23
|
+
},
|
|
24
|
+
"overall_ux_score": 0,
|
|
25
|
+
"accessibility_score": 0,
|
|
26
|
+
"viewport_breakdown": {
|
|
27
|
+
"desktop": 0,
|
|
28
|
+
"tablet": 0,
|
|
29
|
+
"mobile": 0
|
|
30
|
+
},
|
|
31
|
+
"top_issues": [
|
|
32
|
+
{
|
|
33
|
+
"category": "<category>",
|
|
34
|
+
"severity": "<severity>",
|
|
35
|
+
"issue": "<description>",
|
|
36
|
+
"fix": "<suggestion>",
|
|
37
|
+
"viewports_affected": ["<viewport>"]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"prioritized_recommendations": ["<ranked by impact>"]
|
|
41
|
+
}
|
|
42
|
+
```
|