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
package/docs/project-roadmap.md
DELETED
|
@@ -1,382 +0,0 @@
|
|
|
1
|
-
# Design Clone Project Roadmap
|
|
2
|
-
|
|
3
|
-
**Last Updated:** 2026-02-04
|
|
4
|
-
**Current Status:** In Progress (Phase 2/3 Complete)
|
|
5
|
-
**Overall Progress:** 66% (8/12 hours estimated effort completed)
|
|
6
|
-
|
|
7
|
-
## Executive Summary
|
|
8
|
-
|
|
9
|
-
Design Clone is an AI-powered website cloning tool with enhanced verification, UX audit, and semantic HTML capabilities. Phase 2 (UX Audit Integration) is now complete with production-ready code and comprehensive testing.
|
|
10
|
-
|
|
11
|
-
## Project Phases
|
|
12
|
-
|
|
13
|
-
### Phase 1: Component Verification
|
|
14
|
-
**Status:** ✅ COMPLETE
|
|
15
|
-
**Completed:** 2026-02-04T14:33:00Z
|
|
16
|
-
**Effort:** 5h
|
|
17
|
-
**Progress:** 100%
|
|
18
|
-
|
|
19
|
-
#### Deliverables
|
|
20
|
-
- [x] Component verifiers (header, footer, slider detection)
|
|
21
|
-
- [x] Visual diff generation (Playwright screenshots, side-by-side layout)
|
|
22
|
-
- [x] Audit report generation (Markdown format with checklist)
|
|
23
|
-
- [x] Verification test suite (20+ tests)
|
|
24
|
-
|
|
25
|
-
#### Key Files
|
|
26
|
-
- `src/verification/verify-header.js` - Header structure validation
|
|
27
|
-
- `src/verification/verify-footer.js` - Footer verification
|
|
28
|
-
- `src/verification/verify-slider.js` - Carousel/slider detection
|
|
29
|
-
- `src/verification/generate-audit-report.js` - Report generation
|
|
30
|
-
- `tests/test-verification.js` - Comprehensive tests
|
|
31
|
-
|
|
32
|
-
#### Success Criteria Met
|
|
33
|
-
- [x] All verifiers run standalone: `node verify-header.js --url <url>`
|
|
34
|
-
- [x] Audit report generated with actionable checklist
|
|
35
|
-
- [x] No breaking changes to existing clone workflow
|
|
36
|
-
- [x] Visual diff with clear original vs cloned comparison
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
### Phase 2: UX Audit Integration
|
|
41
|
-
**Status:** ✅ COMPLETE
|
|
42
|
-
**Completed:** 2026-02-04T14:56:00Z
|
|
43
|
-
**Effort:** 3h
|
|
44
|
-
**Progress:** 100%
|
|
45
|
-
|
|
46
|
-
#### Deliverables
|
|
47
|
-
- [x] UX audit prompt definition (src/ai/prompts/ux_audit.py)
|
|
48
|
-
- [x] UX audit runner (src/ai/ux-audit.js) with Gemini Vision integration
|
|
49
|
-
- [x] CLI flag integration (--ux-audit)
|
|
50
|
-
- [x] Report generation (analysis/ux-audit.md)
|
|
51
|
-
- [x] Comprehensive test suite (20/20 tests passing)
|
|
52
|
-
|
|
53
|
-
#### Key Files
|
|
54
|
-
- `src/ai/prompts/ux_audit.py` - 199 lines, UX evaluation criteria
|
|
55
|
-
- `src/ai/ux-audit.js` - 594 lines, Gemini integration and report generation
|
|
56
|
-
- `bin/commands/clone-site.js` - Updated with --ux-audit flag
|
|
57
|
-
- `tests/test-ux-audit.js` - 361 lines, 20 unit tests
|
|
58
|
-
- `package.json` - Added @google/generative-ai to optionalDependencies
|
|
59
|
-
|
|
60
|
-
#### Success Criteria Met
|
|
61
|
-
- [x] `design-clone clone-site <url> --ux-audit` generates audit report
|
|
62
|
-
- [x] Report includes scores for 6 categories (visual hierarchy, navigation, typography, spacing, interactivity, responsive)
|
|
63
|
-
- [x] Issues list with severity levels (critical, major, minor) and suggested fixes
|
|
64
|
-
- [x] Report generated in <10s (3 viewport analysis: desktop, tablet, mobile)
|
|
65
|
-
- [x] Graceful degradation if GEMINI_API_KEY not set
|
|
66
|
-
- [x] Follows existing architecture patterns (verify-layout.js Gemini integration)
|
|
67
|
-
- [x] Excellent test coverage (20/20 passing)
|
|
68
|
-
- [x] Code review score: 9/10
|
|
69
|
-
|
|
70
|
-
#### UX Audit Features
|
|
71
|
-
- **Category Analysis:** Visual hierarchy, navigation, typography, spacing, interactive elements, responsive design
|
|
72
|
-
- **Severity Levels:** Critical, major, minor issue classification
|
|
73
|
-
- **Multi-viewport:** Analyzes desktop, tablet, and mobile viewports
|
|
74
|
-
- **Actionable Output:** Specific recommendations for improvement
|
|
75
|
-
- **Error Handling:** Graceful degradation with clear user feedback
|
|
76
|
-
|
|
77
|
-
#### Review & Code Quality
|
|
78
|
-
- Code Review Score: 9/10
|
|
79
|
-
- All tests passing: 20/20 (unit tests) + 82/82 (full suite)
|
|
80
|
-
- Architecture alignment: Excellent (follows verify-layout.js patterns)
|
|
81
|
-
- Security: Best practices followed
|
|
82
|
-
- Documentation: Complete with examples
|
|
83
|
-
|
|
84
|
-
#### Recommendations for Future
|
|
85
|
-
1. Document `@google/generative-ai` dependency in README
|
|
86
|
-
2. Consider consolidating prompt definitions (py/js)
|
|
87
|
-
3. Add API response caching for dev workflows
|
|
88
|
-
4. Monitor Gemini API rate limits in production
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
### Phase 3: WordPress Semantic HTML
|
|
93
|
-
**Status:** 🔄 NOT STARTED
|
|
94
|
-
**Expected Start:** 2026-02-04 (after Phase 2 complete)
|
|
95
|
-
**Estimated Effort:** 4h
|
|
96
|
-
**Expected Progress:** 0%
|
|
97
|
-
|
|
98
|
-
#### Planned Deliverables
|
|
99
|
-
- [ ] Semantic HTML enhancer (semantic-enhancer.js)
|
|
100
|
-
- [ ] WordPress-compatible landmark detection
|
|
101
|
-
- [ ] HTML extraction update (html-extractor.js)
|
|
102
|
-
- [ ] W3C landmark validation
|
|
103
|
-
- [ ] Test suite with semantic validation
|
|
104
|
-
|
|
105
|
-
#### Key Files (Planned)
|
|
106
|
-
- `src/core/semantic-enhancer.js` - Landmark injection without style breaking
|
|
107
|
-
- `src/core/html-extractor.js` - Update for semantic support
|
|
108
|
-
- `tests/test-semantic-enhancer.js` - Semantic validation tests
|
|
109
|
-
|
|
110
|
-
#### Architecture Notes
|
|
111
|
-
- Reuses `dom-tree-analyzer.js` landmark detection
|
|
112
|
-
- Adds IDs/classes alongside original classes (preserves styling)
|
|
113
|
-
- Targets common WordPress patterns (nav, main, footer, etc.)
|
|
114
|
-
- Graceful degradation if DOM structure differs
|
|
115
|
-
|
|
116
|
-
#### Success Criteria (Target)
|
|
117
|
-
- [ ] Semantic HTML passes W3C landmark validation
|
|
118
|
-
- [ ] No breaking changes to existing clone workflow
|
|
119
|
-
- [ ] Performance impact <500ms per page
|
|
120
|
-
- [ ] Works with WordPress and custom themes
|
|
121
|
-
|
|
122
|
-
---
|
|
123
|
-
|
|
124
|
-
## Timeline
|
|
125
|
-
|
|
126
|
-
| Date | Milestone | Status |
|
|
127
|
-
|------|-----------|--------|
|
|
128
|
-
| 2026-02-04 | Phase 1 Component Verification | ✅ COMPLETE |
|
|
129
|
-
| 2026-02-04 | Phase 2 UX Audit Integration | ✅ COMPLETE |
|
|
130
|
-
| 2026-02-04 | Phase 3 Planning | 🔄 IN PROGRESS |
|
|
131
|
-
| 2026-02-05 | Phase 3 Implementation | ⏳ PLANNED |
|
|
132
|
-
| 2026-02-05 | Full Test Suite Integration | ⏳ PLANNED |
|
|
133
|
-
| 2026-02-06 | Documentation Updates | ⏳ PLANNED |
|
|
134
|
-
| 2026-02-06 | Code Review & QA | ⏳ PLANNED |
|
|
135
|
-
| 2026-02-07 | Release Preparation | ⏳ PLANNED |
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Architecture Overview
|
|
140
|
-
|
|
141
|
-
### Component Stack
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
design-clone/
|
|
145
|
-
├── bin/commands/
|
|
146
|
-
│ ├── clone.js (Main entry point)
|
|
147
|
-
│ └── clone-site.js (Site-specific cloning with --ux-audit flag)
|
|
148
|
-
│
|
|
149
|
-
├── src/
|
|
150
|
-
│ ├── verification/ (Phase 1)
|
|
151
|
-
│ │ ├── verify-header.js
|
|
152
|
-
│ │ ├── verify-footer.js
|
|
153
|
-
│ │ ├── verify-slider.js
|
|
154
|
-
│ │ └── generate-audit-report.js
|
|
155
|
-
│ │
|
|
156
|
-
│ ├── ai/ (Phase 2)
|
|
157
|
-
│ │ ├── prompts/
|
|
158
|
-
│ │ │ └── ux_audit.py
|
|
159
|
-
│ │ ├── ux-audit.js
|
|
160
|
-
│ │ └── analyze-structure.py
|
|
161
|
-
│ │
|
|
162
|
-
│ └── core/ (Phase 3 - Planned)
|
|
163
|
-
│ ├── semantic-enhancer.js
|
|
164
|
-
│ ├── html-extractor.js
|
|
165
|
-
│ └── dom-tree-analyzer.js
|
|
166
|
-
│
|
|
167
|
-
├── tests/
|
|
168
|
-
│ ├── test-verification.js (Phase 1)
|
|
169
|
-
│ ├── test-ux-audit.js (Phase 2)
|
|
170
|
-
│ └── test-semantic.js (Phase 3 - Planned)
|
|
171
|
-
│
|
|
172
|
-
└── analysis/
|
|
173
|
-
├── visual-diffs/ (Phase 1 outputs)
|
|
174
|
-
├── audit-reports/ (Phase 1 outputs)
|
|
175
|
-
└── ux-audit.md (Phase 2 outputs)
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Integration Points
|
|
179
|
-
|
|
180
|
-
1. **CLI Entry Point:** `bin/commands/clone-site.js`
|
|
181
|
-
- Detects `--ux-audit` flag
|
|
182
|
-
- Routes to Phase 2 UX audit runner
|
|
183
|
-
|
|
184
|
-
2. **Screenshot Pipeline:**
|
|
185
|
-
- Playwright generates screenshots (desktop, tablet, mobile)
|
|
186
|
-
- Passed to Gemini Vision API for analysis
|
|
187
|
-
- Results aggregated into markdown report
|
|
188
|
-
|
|
189
|
-
3. **Report Generation:**
|
|
190
|
-
- Each phase generates independent reports
|
|
191
|
-
- Reports stored in `analysis/` directory
|
|
192
|
-
- Can be combined for comprehensive site analysis
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## Risks & Mitigations
|
|
197
|
-
|
|
198
|
-
| Risk | Phase | Impact | Mitigation |
|
|
199
|
-
|------|-------|--------|-----------|
|
|
200
|
-
| Slider framework variations | 1 | Medium | Focus common patterns; graceful degradation |
|
|
201
|
-
| Semantic injection breaks styles | 3 | High | Add classes only, preserve originals; extensive testing |
|
|
202
|
-
| Gemini API rate limits | 2 | Medium | Cache responses, batch viewport analysis |
|
|
203
|
-
| Inconsistent UX scores | 2 | Low | Structured prompt, JSON schema validation |
|
|
204
|
-
| API response parsing failures | 2 | Low | Regex fallback, comprehensive error handling |
|
|
205
|
-
| DOM structure variations | 3 | Medium | Pattern matching, fallback to generic landmarks |
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
## Testing Strategy
|
|
210
|
-
|
|
211
|
-
### Test Coverage
|
|
212
|
-
|
|
213
|
-
| Phase | Unit Tests | Integration Tests | E2E Tests |
|
|
214
|
-
|-------|------------|------------------|-----------|
|
|
215
|
-
| 1 | ✅ Complete | ✅ In progress | ⏳ Planned |
|
|
216
|
-
| 2 | ✅ Complete (20/20) | ✅ Complete | ⏳ Planned |
|
|
217
|
-
| 3 | ⏳ Planned | ⏳ Planned | ⏳ Planned |
|
|
218
|
-
|
|
219
|
-
### Current Test Results
|
|
220
|
-
- **Phase 1:** 20+ verification tests
|
|
221
|
-
- **Phase 2:** 20/20 UX audit tests passing
|
|
222
|
-
- **Full Suite:** 82/82 tests passing
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
## Dependencies & Requirements
|
|
227
|
-
|
|
228
|
-
### External Services
|
|
229
|
-
- **Gemini API:** Required for UX audit analysis (Phase 2)
|
|
230
|
-
- Model: `gemini-2.5-flash`
|
|
231
|
-
- Authentication: `GEMINI_API_KEY` environment variable
|
|
232
|
-
- Fallback behavior: Graceful degradation if key not set
|
|
233
|
-
|
|
234
|
-
### NPM Packages
|
|
235
|
-
- `@google/generative-ai` - Optional dependency for Phase 2
|
|
236
|
-
- `playwright` - For screenshot generation
|
|
237
|
-
- Existing: `puppeteer`, `axios`, etc.
|
|
238
|
-
|
|
239
|
-
### System Requirements
|
|
240
|
-
- Node.js 16+
|
|
241
|
-
- 100MB+ disk space for analysis outputs
|
|
242
|
-
- API rate limits for Gemini (handled via batch processing)
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## Performance Metrics
|
|
247
|
-
|
|
248
|
-
| Task | Target | Phase 1 | Phase 2 | Phase 3 |
|
|
249
|
-
|------|--------|---------|---------|---------|
|
|
250
|
-
| Single page clone | <30s | ✅ Met | ✅ Met | TBD |
|
|
251
|
-
| Screenshot generation | <10s | ✅ 8s | ✅ 8s | TBD |
|
|
252
|
-
| Gemini API call | <5s/viewport | N/A | ✅ 4s avg | N/A |
|
|
253
|
-
| Report generation | <5s | ✅ 2s | ✅ 3s | TBD |
|
|
254
|
-
| Total with audit | <60s | ✅ 30s | ✅ 45s | TBD |
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## Success Metrics
|
|
259
|
-
|
|
260
|
-
### Phase 1: ✅ ACHIEVED
|
|
261
|
-
- Component verification accuracy: 95%+
|
|
262
|
-
- Audit report completeness: 100%
|
|
263
|
-
- Zero breaking changes: ✅
|
|
264
|
-
- Test coverage: 100% for verification module
|
|
265
|
-
|
|
266
|
-
### Phase 2: ✅ ACHIEVED
|
|
267
|
-
- UX audit availability: 100% when API key set
|
|
268
|
-
- Category analysis completeness: 6/6 categories
|
|
269
|
-
- Issue detection accuracy: 90%+
|
|
270
|
-
- Report generation time: 3-5s
|
|
271
|
-
- Test coverage: 20/20 passing
|
|
272
|
-
|
|
273
|
-
### Phase 3: IN PROGRESS
|
|
274
|
-
- Semantic HTML validation: W3C compliant (target)
|
|
275
|
-
- Style preservation: 100% (target)
|
|
276
|
-
- Performance impact: <500ms (target)
|
|
277
|
-
- Compatibility: WordPress + custom themes (target)
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
## Known Issues & Limitations
|
|
282
|
-
|
|
283
|
-
### Phase 2
|
|
284
|
-
1. **Gemini API Rate Limits:** Implement caching for development workflows
|
|
285
|
-
2. **Score Consistency:** Minor variance in scores between API calls (expected)
|
|
286
|
-
3. **Complex Layouts:** May not detect all interactive elements in complex SPAs
|
|
287
|
-
4. **Dark Mode:** Only analyzes default viewport appearance
|
|
288
|
-
|
|
289
|
-
### Future Phases
|
|
290
|
-
- Semantic injection not yet implemented (Phase 3)
|
|
291
|
-
- No custom rule support yet
|
|
292
|
-
- Limited to web-based analysis (no PDF output)
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## Next Steps
|
|
297
|
-
|
|
298
|
-
### Immediate (This Week)
|
|
299
|
-
1. **Phase 3 Implementation:** Start WordPress semantic HTML enhancement
|
|
300
|
-
2. **Documentation:** Update CLI reference with --ux-audit examples
|
|
301
|
-
3. **Monitoring:** Set up API usage tracking for Gemini
|
|
302
|
-
|
|
303
|
-
### Short Term (Next Sprint)
|
|
304
|
-
1. Review Phase 3 integration points
|
|
305
|
-
2. Set up semantic validation test suite
|
|
306
|
-
3. Gather WordPress theme compatibility data
|
|
307
|
-
|
|
308
|
-
### Medium Term
|
|
309
|
-
1. API caching implementation
|
|
310
|
-
2. Custom rule support
|
|
311
|
-
3. Advanced analytics dashboard
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
## Changelog
|
|
316
|
-
|
|
317
|
-
### [2026-02-04] - Phase 2 Completion
|
|
318
|
-
|
|
319
|
-
#### Added
|
|
320
|
-
- UX Audit Integration with Gemini Vision API
|
|
321
|
-
- UX audit runner (src/ai/ux-audit.js)
|
|
322
|
-
- UX audit prompt definition (src/ai/prompts/ux_audit.py)
|
|
323
|
-
- CLI flag: `--ux-audit` for clone-site command
|
|
324
|
-
- Multi-viewport UX analysis (desktop, tablet, mobile)
|
|
325
|
-
- Comprehensive UX report generation (analysis/ux-audit.md)
|
|
326
|
-
- 20-test UX audit test suite (all passing)
|
|
327
|
-
|
|
328
|
-
#### Modified
|
|
329
|
-
- bin/commands/clone-site.js: Added --ux-audit flag integration
|
|
330
|
-
- package.json: Added @google/generative-ai to optionalDependencies
|
|
331
|
-
|
|
332
|
-
#### Quality
|
|
333
|
-
- Code review score: 9/10
|
|
334
|
-
- Test passing rate: 20/20 (100%)
|
|
335
|
-
- Architecture compliance: Excellent
|
|
336
|
-
- Security validation: Passed
|
|
337
|
-
|
|
338
|
-
#### Specifications Met
|
|
339
|
-
- ✅ 6-category UX analysis (visual hierarchy, navigation, typography, spacing, interactivity, responsive)
|
|
340
|
-
- ✅ Severity levels (critical, major, minor)
|
|
341
|
-
- ✅ Actionable recommendations
|
|
342
|
-
- ✅ <10s report generation per 3 viewports
|
|
343
|
-
- ✅ Graceful API key degradation
|
|
344
|
-
|
|
345
|
-
---
|
|
346
|
-
|
|
347
|
-
### [2026-02-04] - Phase 1 Completion
|
|
348
|
-
|
|
349
|
-
#### Added
|
|
350
|
-
- Component verification system (header, footer, slider)
|
|
351
|
-
- Visual diff generation with Playwright
|
|
352
|
-
- Audit report generation in Markdown
|
|
353
|
-
- Verification test suite (20+ tests)
|
|
354
|
-
|
|
355
|
-
#### Quality
|
|
356
|
-
- All success criteria met
|
|
357
|
-
- Zero breaking changes
|
|
358
|
-
- Comprehensive test coverage
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## Contact & Resources
|
|
363
|
-
|
|
364
|
-
- **Architecture Docs:** `./docs/design-clone-architecture.md`
|
|
365
|
-
- **CLI Reference:** `./docs/cli-reference.md`
|
|
366
|
-
- **Implementation Plans:** `./plans/260204-1333-design-clone-improvements/`
|
|
367
|
-
- **Code Review Reports:** `./plans/reports/`
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
## Status Summary
|
|
372
|
-
|
|
373
|
-
| Aspect | Status | Notes |
|
|
374
|
-
|--------|--------|-------|
|
|
375
|
-
| Phase 1 | ✅ COMPLETE | 100% complete, all tests passing |
|
|
376
|
-
| Phase 2 | ✅ COMPLETE | 100% complete, 9/10 code review score |
|
|
377
|
-
| Phase 3 | 🔄 PLANNED | Ready to start, architecture defined |
|
|
378
|
-
| Testing | ✅ 82/82 passing | Full test suite operational |
|
|
379
|
-
| Documentation | ✅ Updated | All phase deliverables documented |
|
|
380
|
-
| Code Quality | ✅ High | Architecture-aligned, best practices followed |
|
|
381
|
-
| Security | ✅ Compliant | API key handling, error management validated |
|
|
382
|
-
|
package/docs/troubleshooting.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# Troubleshooting
|
|
2
|
-
|
|
3
|
-
Common issues and solutions.
|
|
4
|
-
|
|
5
|
-
## Browser Issues
|
|
6
|
-
|
|
7
|
-
### Chrome/Chromium not found
|
|
8
|
-
|
|
9
|
-
**Error:** `Could not find Chrome`
|
|
10
|
-
|
|
11
|
-
**Solution:**
|
|
12
|
-
```bash
|
|
13
|
-
# macOS
|
|
14
|
-
brew install --cask google-chrome
|
|
15
|
-
|
|
16
|
-
# Ubuntu
|
|
17
|
-
sudo apt install chromium-browser
|
|
18
|
-
|
|
19
|
-
# Or set path manually
|
|
20
|
-
export CHROME_PATH="/path/to/chrome"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Playwright launch fails
|
|
24
|
-
|
|
25
|
-
**Error:** `Failed to launch browser`
|
|
26
|
-
|
|
27
|
-
**Solutions:**
|
|
28
|
-
1. Install Playwright: `npm install playwright` (includes bundled browsers)
|
|
29
|
-
- Or lighter: `npm install playwright-core` (requires Chrome installed)
|
|
30
|
-
2. Verify Chrome is installed or use full `playwright` package
|
|
31
|
-
3. Docker: Already includes `--no-sandbox` flag automatically
|
|
32
|
-
|
|
33
|
-
## CSS Issues
|
|
34
|
-
|
|
35
|
-
### CORS-blocked stylesheets
|
|
36
|
-
|
|
37
|
-
**Symptom:** CSS extraction returns empty or partial styles.
|
|
38
|
-
|
|
39
|
-
**Solution:** Some sites block cross-origin stylesheet access. Use browser DevTools manually or try `--wait 3000` for dynamic CSS.
|
|
40
|
-
|
|
41
|
-
### CSS too large
|
|
42
|
-
|
|
43
|
-
**Error:** `CSS file exceeds 10MB limit`
|
|
44
|
-
|
|
45
|
-
**Solution:** filter-css.js has 10MB limit. Split manually or increase `MAX_CSS_INPUT_SIZE` in filter-css.js.
|
|
46
|
-
|
|
47
|
-
## Python Issues
|
|
48
|
-
|
|
49
|
-
### Module not found
|
|
50
|
-
|
|
51
|
-
**Error:** `ModuleNotFoundError: google.genai`
|
|
52
|
-
|
|
53
|
-
**Solution:**
|
|
54
|
-
```bash
|
|
55
|
-
pip install -r requirements.txt
|
|
56
|
-
# Or: pip install google-genai
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Wrong Python version
|
|
60
|
-
|
|
61
|
-
**Error:** `SyntaxError` on type hints
|
|
62
|
-
|
|
63
|
-
**Solution:** Requires Python 3.9+. Check: `python3 --version`
|
|
64
|
-
|
|
65
|
-
## Gemini API Issues
|
|
66
|
-
|
|
67
|
-
### API key not set
|
|
68
|
-
|
|
69
|
-
**Error:** `GEMINI_API_KEY not found`
|
|
70
|
-
|
|
71
|
-
**Solution:** Create `.env` file:
|
|
72
|
-
```bash
|
|
73
|
-
GEMINI_API_KEY=your-api-key-here
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Rate limit exceeded
|
|
77
|
-
|
|
78
|
-
**Error:** `429 Too Many Requests`
|
|
79
|
-
|
|
80
|
-
**Solution:** Wait 1 minute, or use `--model gemini-1.5-flash` for lower limits.
|
|
81
|
-
|
|
82
|
-
## Screenshot Issues
|
|
83
|
-
|
|
84
|
-
### Incomplete page capture
|
|
85
|
-
|
|
86
|
-
**Symptom:** Missing sections in screenshot.
|
|
87
|
-
|
|
88
|
-
**Solutions:**
|
|
89
|
-
1. Increase wait: `--wait 5000`
|
|
90
|
-
2. Use full page: `--full-page`
|
|
91
|
-
3. Check for lazy-loaded content
|
|
92
|
-
|
|
93
|
-
### Wrong viewport size
|
|
94
|
-
|
|
95
|
-
**Solution:** Specify custom viewports:
|
|
96
|
-
```bash
|
|
97
|
-
--viewports '[{"width":1440,"height":900,"name":"custom"}]'
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## clone-site Issues
|
|
101
|
-
|
|
102
|
-
### No pages discovered
|
|
103
|
-
|
|
104
|
-
**Symptom:** Only homepage cloned, other pages not found.
|
|
105
|
-
|
|
106
|
-
**Causes:**
|
|
107
|
-
- Site uses JS-rendered navigation (React/Vue/Angular)
|
|
108
|
-
- Navigation not in standard selectors (header nav, footer nav)
|
|
109
|
-
|
|
110
|
-
**Solutions:**
|
|
111
|
-
```bash
|
|
112
|
-
# Specify pages manually
|
|
113
|
-
design-clone clone-site https://example.com --pages /,/about,/contact,/services
|
|
114
|
-
|
|
115
|
-
# Increase max pages if hitting limit
|
|
116
|
-
design-clone clone-site https://example.com --max-pages 20
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Links not working in cloned pages
|
|
120
|
-
|
|
121
|
-
**Symptom:** Internal links point to original URLs.
|
|
122
|
-
|
|
123
|
-
**Causes:**
|
|
124
|
-
- Page not in discovered list
|
|
125
|
-
- HTML file not found for rewriting
|
|
126
|
-
|
|
127
|
-
**Solutions:**
|
|
128
|
-
1. Check `manifest.json` for page list
|
|
129
|
-
2. Ensure all pages captured successfully (check `capture-results.json`)
|
|
130
|
-
3. Re-run with manual `--pages` flag including missing pages
|
|
131
|
-
|
|
132
|
-
### CSS broken on some pages
|
|
133
|
-
|
|
134
|
-
**Symptom:** Styling differs between cloned pages.
|
|
135
|
-
|
|
136
|
-
**Causes:**
|
|
137
|
-
- Page-specific CSS not merged
|
|
138
|
-
- CSS extraction failed for some pages
|
|
139
|
-
|
|
140
|
-
**Solutions:**
|
|
141
|
-
1. Check `css/` folder for per-page CSS files
|
|
142
|
-
2. Review merge stats in output
|
|
143
|
-
3. Try with fewer pages to isolate issue
|
|
144
|
-
|
|
145
|
-
### Timeout during capture
|
|
146
|
-
|
|
147
|
-
**Error:** `Navigation timeout`
|
|
148
|
-
|
|
149
|
-
**Causes:**
|
|
150
|
-
- Large pages
|
|
151
|
-
- Slow server
|
|
152
|
-
- Too many pages
|
|
153
|
-
|
|
154
|
-
**Solutions:**
|
|
155
|
-
```bash
|
|
156
|
-
# Reduce pages
|
|
157
|
-
design-clone clone-site https://example.com --max-pages 5
|
|
158
|
-
|
|
159
|
-
# Use specific viewports only
|
|
160
|
-
design-clone clone-site https://example.com --viewports desktop
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### Memory issues
|
|
164
|
-
|
|
165
|
-
**Symptom:** Process crashes or hangs.
|
|
166
|
-
|
|
167
|
-
**Solutions:**
|
|
168
|
-
1. Reduce `--max-pages` to 5 or fewer
|
|
169
|
-
2. Clone in batches
|
|
170
|
-
3. Close other applications
|
package/requirements.txt
DELETED
|
Binary file
|
|
Binary file
|