design-clone 2.1.0 → 3.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/README.md +13 -34
- package/SKILL.md +69 -45
- package/bin/cli.js +22 -4
- package/bin/commands/clone-site.js +31 -171
- package/bin/commands/help.js +19 -6
- package/bin/commands/init.js +9 -86
- package/bin/commands/uninstall.js +105 -0
- package/bin/commands/update.js +70 -0
- package/bin/commands/verify.js +7 -14
- package/bin/utils/paths.js +28 -0
- package/bin/utils/validate.js +2 -22
- package/bin/utils/version.js +23 -0
- package/docs/code-standards.md +789 -0
- package/docs/codebase-summary.md +533 -286
- package/docs/index.md +74 -0
- package/docs/project-overview-pdr.md +797 -0
- package/docs/system-architecture.md +718 -0
- package/package.json +14 -17
- 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/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/{lazy-loader.js → page-prep/lazy-loader.js} +37 -39
- package/src/core/section/section-cropper-helpers.js +43 -0
- package/src/core/{section-cropper.js → section/section-cropper.js} +11 -88
- 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 +2 -2
- package/src/core/tests/test-section-detector.js +2 -2
- 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/base-discoverer-utils.js +137 -0
- package/src/route-discoverers/base-discoverer.js +29 -118
- package/src/route-discoverers/index.js +1 -1
- 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 +0 -7
- 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 +3 -69
- 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 +5 -281
- 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 +23 -381
- package/src/verification/verify-header-checks.js +104 -0
- package/src/verification/verify-header-helpers.js +156 -0
- package/src/verification/verify-header.js +23 -365
- package/src/verification/verify-layout-report.js +101 -0
- package/src/verification/verify-layout.js +13 -259
- package/src/verification/verify-menu-checks.js +104 -0
- package/src/verification/verify-menu-helpers.js +112 -0
- package/src/verification/verify-menu.js +17 -285
- 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 +23 -414
- package/.env.example +0 -14
- package/docs/basic-clone.md +0 -63
- package/docs/cli-reference.md +0 -316
- package/docs/design-clone-architecture.md +0 -492
- package/docs/pixel-perfect.md +0 -117
- package/docs/project-roadmap.md +0 -382
- package/docs/troubleshooting.md +0 -170
- package/requirements.txt +0 -5
- package/src/ai/__pycache__/analyze-structure.cpython-313.pyc +0 -0
- package/src/ai/__pycache__/extract-design-tokens.cpython-313.pyc +0 -0
- package/src/ai/analyze-structure.py +0 -375
- package/src/ai/extract-design-tokens.py +0 -782
- 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/__pycache__/ux_audit.cpython-313.pyc +0 -0
- package/src/ai/prompts/design_tokens.py +0 -316
- package/src/ai/prompts/structure_analysis.py +0 -592
- package/src/ai/prompts/ux_audit.py +0 -198
- package/src/ai/ux-audit.js +0 -596
- package/src/core/animation-extractor.js +0 -526
- package/src/core/app-state-snapshot.js +0 -511
- package/src/core/content-counter.js +0 -342
- package/src/core/design-tokens.js +0 -103
- package/src/core/dimension-extractor.js +0 -438
- package/src/core/dimension-output.js +0 -305
- package/src/core/discover-pages.js +0 -542
- package/src/core/dom-tree-analyzer.js +0 -298
- package/src/core/extract-assets.js +0 -468
- package/src/core/filter-css.js +0 -499
- package/src/core/framework-detector.js +0 -538
- package/src/core/html-extractor.js +0 -212
- package/src/core/merge-css.js +0 -407
- package/src/core/multi-page-screenshot.js +0 -380
- package/src/core/rewrite-links.js +0 -226
- package/src/core/screenshot.js +0 -701
- package/src/core/section-detector.js +0 -386
- package/src/core/semantic-enhancer.js +0 -492
- package/src/core/state-capture.js +0 -598
- package/src/core/video-capture.js +0 -546
- 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/core/{css-extractor.js → css/css-extractor.js} +0 -0
- /package/src/core/{cookie-handler.js → page-prep/cookie-handler.js} +0 -0
- /package/src/core/{page-readiness.js → page-prep/page-readiness.js} +0 -0
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
UX Audit Prompts
|
|
3
|
-
|
|
4
|
-
Prompts for analyzing screenshots with Gemini Vision for UX quality assessment.
|
|
5
|
-
Evaluates visual hierarchy, navigation, typography, spacing, interactivity, and responsive design.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
# Main UX audit prompt
|
|
9
|
-
UX_AUDIT_PROMPT = """Analyze this website screenshot for UX quality.
|
|
10
|
-
|
|
11
|
-
Evaluate these categories (score 0-100 each):
|
|
12
|
-
|
|
13
|
-
1. VISUAL HIERARCHY
|
|
14
|
-
- Primary content prominence
|
|
15
|
-
- Clear scanning patterns (F/Z pattern)
|
|
16
|
-
- Call-to-action visibility
|
|
17
|
-
- Information grouping and prioritization
|
|
18
|
-
- White space utilization
|
|
19
|
-
|
|
20
|
-
2. NAVIGATION
|
|
21
|
-
- Tappable area size (44x44px minimum for mobile)
|
|
22
|
-
- Current page indicator clarity
|
|
23
|
-
- Menu discoverability
|
|
24
|
-
- Breadcrumb/location awareness
|
|
25
|
-
- Navigation consistency
|
|
26
|
-
|
|
27
|
-
3. TYPOGRAPHY
|
|
28
|
-
- Body text size (16px+ recommended)
|
|
29
|
-
- Line height (1.4-1.6 ideal)
|
|
30
|
-
- Contrast ratio (WCAG AA: 4.5:1 for text)
|
|
31
|
-
- Font hierarchy clarity
|
|
32
|
-
- Readability at viewport size
|
|
33
|
-
|
|
34
|
-
4. SPACING
|
|
35
|
-
- Consistent padding/margins
|
|
36
|
-
- Element breathing room
|
|
37
|
-
- Touch target spacing (8px minimum between)
|
|
38
|
-
- Grid alignment
|
|
39
|
-
- Section separation
|
|
40
|
-
|
|
41
|
-
5. INTERACTIVE ELEMENTS
|
|
42
|
-
- Button affordance (looks clickable)
|
|
43
|
-
- Link distinguishability
|
|
44
|
-
- Focus state visibility
|
|
45
|
-
- Hover state indication
|
|
46
|
-
- Form field clarity
|
|
47
|
-
|
|
48
|
-
6. RESPONSIVE
|
|
49
|
-
- Content reflow appropriateness
|
|
50
|
-
- No horizontal scroll
|
|
51
|
-
- Image scaling quality
|
|
52
|
-
- Text truncation handling
|
|
53
|
-
- Breakpoint transitions
|
|
54
|
-
|
|
55
|
-
Return ONLY valid JSON in this exact format:
|
|
56
|
-
{
|
|
57
|
-
"viewport": "<mobile|tablet|desktop>",
|
|
58
|
-
"scores": {
|
|
59
|
-
"visual_hierarchy": <0-100>,
|
|
60
|
-
"navigation": <0-100>,
|
|
61
|
-
"typography": <0-100>,
|
|
62
|
-
"spacing": <0-100>,
|
|
63
|
-
"interactivity": <0-100>,
|
|
64
|
-
"responsive": <0-100>
|
|
65
|
-
},
|
|
66
|
-
"overall_ux_score": <0-100>,
|
|
67
|
-
"accessibility_score": <0-100>,
|
|
68
|
-
"issues": [
|
|
69
|
-
{
|
|
70
|
-
"category": "<visual_hierarchy|navigation|typography|spacing|interactivity|responsive>",
|
|
71
|
-
"severity": "<critical|major|minor>",
|
|
72
|
-
"issue": "<concise description>",
|
|
73
|
-
"fix": "<actionable suggestion>"
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
"recommendations": ["<actionable improvement item>"]
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
SEVERITY GUIDELINES:
|
|
80
|
-
- critical: Blocks user tasks or causes confusion (0-30 score range issues)
|
|
81
|
-
- major: Degrades experience significantly (31-60 score range issues)
|
|
82
|
-
- minor: Polish improvements (61-80 score range issues)
|
|
83
|
-
|
|
84
|
-
SCORING GUIDELINES:
|
|
85
|
-
- 90-100: Excellent, industry-leading UX
|
|
86
|
-
- 70-89: Good, meets modern standards
|
|
87
|
-
- 50-69: Adequate, room for improvement
|
|
88
|
-
- 30-49: Poor, significant issues
|
|
89
|
-
- 0-29: Critical, requires immediate attention"""
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# Viewport-specific prompt suffix
|
|
93
|
-
VIEWPORT_CONTEXT = {
|
|
94
|
-
'mobile': """
|
|
95
|
-
MOBILE-SPECIFIC CHECKS:
|
|
96
|
-
- Touch targets minimum 44x44px
|
|
97
|
-
- Thumb zone accessibility
|
|
98
|
-
- Single-column layout efficiency
|
|
99
|
-
- Mobile navigation pattern (hamburger/tab bar)
|
|
100
|
-
- Text readable without zooming
|
|
101
|
-
- Forms optimized for mobile input""",
|
|
102
|
-
|
|
103
|
-
'tablet': """
|
|
104
|
-
TABLET-SPECIFIC CHECKS:
|
|
105
|
-
- Two-column layout utilization
|
|
106
|
-
- Touch and mouse input support
|
|
107
|
-
- Landscape/portrait adaptability
|
|
108
|
-
- Sidebar vs content balance
|
|
109
|
-
- Split-view readiness""",
|
|
110
|
-
|
|
111
|
-
'desktop': """
|
|
112
|
-
DESKTOP-SPECIFIC CHECKS:
|
|
113
|
-
- Maximum content width (1200-1440px ideal)
|
|
114
|
-
- Multi-column layout efficiency
|
|
115
|
-
- Hover states and micro-interactions
|
|
116
|
-
- Keyboard navigation support
|
|
117
|
-
- Large screen real estate utilization"""
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def build_ux_audit_prompt(viewport: str = 'desktop') -> str:
|
|
122
|
-
"""Build viewport-specific UX audit prompt.
|
|
123
|
-
|
|
124
|
-
Args:
|
|
125
|
-
viewport: 'mobile', 'tablet', or 'desktop'
|
|
126
|
-
|
|
127
|
-
Returns:
|
|
128
|
-
Complete prompt string with viewport-specific checks
|
|
129
|
-
"""
|
|
130
|
-
base_prompt = UX_AUDIT_PROMPT
|
|
131
|
-
|
|
132
|
-
viewport_lower = viewport.lower()
|
|
133
|
-
if viewport_lower in VIEWPORT_CONTEXT:
|
|
134
|
-
base_prompt += f"\n\n{VIEWPORT_CONTEXT[viewport_lower]}"
|
|
135
|
-
|
|
136
|
-
return base_prompt
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
# Aggregation prompt for combining viewport results
|
|
140
|
-
AGGREGATION_PROMPT = """Combine these viewport-specific UX audit results into a final assessment.
|
|
141
|
-
|
|
142
|
-
Desktop results: {desktop_results}
|
|
143
|
-
Tablet results: {tablet_results}
|
|
144
|
-
Mobile results: {mobile_results}
|
|
145
|
-
|
|
146
|
-
Create a unified report that:
|
|
147
|
-
1. Averages scores across viewports (weighted: desktop 40%, tablet 30%, mobile 30%)
|
|
148
|
-
2. Prioritizes issues by severity and viewport impact
|
|
149
|
-
3. Consolidates duplicate issues
|
|
150
|
-
4. Ranks recommendations by impact
|
|
151
|
-
|
|
152
|
-
Return JSON:
|
|
153
|
-
{
|
|
154
|
-
"overall_scores": {
|
|
155
|
-
"visual_hierarchy": <weighted_avg>,
|
|
156
|
-
"navigation": <weighted_avg>,
|
|
157
|
-
"typography": <weighted_avg>,
|
|
158
|
-
"spacing": <weighted_avg>,
|
|
159
|
-
"interactivity": <weighted_avg>,
|
|
160
|
-
"responsive": <weighted_avg>
|
|
161
|
-
},
|
|
162
|
-
"overall_ux_score": <weighted_avg>,
|
|
163
|
-
"accessibility_score": <weighted_avg>,
|
|
164
|
-
"viewport_breakdown": {
|
|
165
|
-
"desktop": <ux_score>,
|
|
166
|
-
"tablet": <ux_score>,
|
|
167
|
-
"mobile": <ux_score>
|
|
168
|
-
},
|
|
169
|
-
"top_issues": [
|
|
170
|
-
{
|
|
171
|
-
"category": "<category>",
|
|
172
|
-
"severity": "<severity>",
|
|
173
|
-
"issue": "<description>",
|
|
174
|
-
"fix": "<suggestion>",
|
|
175
|
-
"viewports_affected": ["<viewport>"]
|
|
176
|
-
}
|
|
177
|
-
],
|
|
178
|
-
"prioritized_recommendations": ["<ranked by impact>"]
|
|
179
|
-
}"""
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
def build_aggregation_prompt(desktop: dict, tablet: dict, mobile: dict) -> str:
|
|
183
|
-
"""Build prompt for aggregating viewport results.
|
|
184
|
-
|
|
185
|
-
Args:
|
|
186
|
-
desktop: Desktop viewport audit results
|
|
187
|
-
tablet: Tablet viewport audit results
|
|
188
|
-
mobile: Mobile viewport audit results
|
|
189
|
-
|
|
190
|
-
Returns:
|
|
191
|
-
Aggregation prompt with results embedded
|
|
192
|
-
"""
|
|
193
|
-
import json
|
|
194
|
-
return AGGREGATION_PROMPT.format(
|
|
195
|
-
desktop_results=json.dumps(desktop, indent=2) if desktop else "Not available",
|
|
196
|
-
tablet_results=json.dumps(tablet, indent=2) if tablet else "Not available",
|
|
197
|
-
mobile_results=json.dumps(mobile, indent=2) if mobile else "Not available"
|
|
198
|
-
)
|