web-design-reviewer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWeb Design Reviewer
Web Design Reviewer
This skill enables visual inspection and validation of website design quality, identifying and fixing issues at the source code level.
该Skill可对网站设计质量进行视觉检查与验证,在源代码层面识别并修复问题。
Scope of Application
适用范围
- Static sites (HTML/CSS/JS)
- SPA frameworks such as React / Vue / Angular / Svelte
- Full-stack frameworks such as Next.js / Nuxt / SvelteKit
- CMS platforms such as WordPress / Drupal
- Any other web application
- 静态网站(HTML/CSS/JS)
- 单页应用框架,如React、Vue、Angular、Svelte
- 全栈框架,如Next.js、Nuxt、SvelteKit
- CMS平台,如WordPress、Drupal
- 其他任何Web应用
Prerequisites
前置条件
Required
必要条件
-
Target website must be running
- Local development server (e.g., )
http://localhost:3000 - Staging environment
- Production environment (for read-only reviews)
- Local development server (e.g.,
-
Browser automation must be available
- Screenshot capture
- Page navigation
- DOM information retrieval
-
Access to source code (when making fixes)
- Project must exist within the workspace
-
目标网站必须处于运行状态
- 本地开发服务器(例如:)
http://localhost:3000 - 预发布环境
- 生产环境(仅用于只读审查)
- 本地开发服务器(例如:
-
必须具备浏览器自动化能力
- 截图捕获
- 页面导航
- DOM信息获取
-
具备源代码访问权限(当需要修复问题时)
- 项目必须存在于工作区内
Workflow Overview
工作流程概述
mermaid
flowchart TD
A[Step 1: Information Gathering] --> B[Step 2: Visual Inspection]
B --> C[Step 3: Issue Fixing]
C --> D[Step 4: Re-verification]
D --> E{Issues Remaining?}
E -->|Yes| B
E -->|No| F[Completion Report]mermaid
flowchart TD
A[Step 1: Information Gathering] --> B[Step 2: Visual Inspection]
B --> C[Step 3: Issue Fixing]
C --> D[Step 4: Re-verification]
D --> E{Issues Remaining?}
E -->|Yes| B
E -->|No| F[Completion Report]Step 1: Information Gathering Phase
步骤1:信息收集阶段
1.1 URL Confirmation
1.1 URL确认
If the URL is not provided, ask the user:
Please provide the URL of the website to review (e.g.,)http://localhost:3000
如果未提供URL,请询问用户:
请提供需要审查的网站URL(例如:)http://localhost:3000
1.2 Understanding Project Structure
1.2 了解项目结构
When making fixes, gather the following information:
| Item | Example Question |
|---|---|
| Framework | Are you using React / Vue / Next.js, etc.? |
| Styling Method | CSS / SCSS / Tailwind / CSS-in-JS, etc. |
| Source Location | Where are style files and components located? |
| Review Scope | Specific pages only or entire site? |
当需要修复问题时,收集以下信息:
| 项 | 示例问题 |
|---|---|
| 框架 | 你是否使用React、Vue、Next.js等框架? |
| 样式方法 | CSS/SCSS/Tailwind/CSS-in-JS等? |
| 源码位置 | 样式文件和组件位于何处? |
| 审查范围 | 仅特定页面还是整个网站? |
1.3 Automatic Project Detection
1.3 自动项目检测
Attempt automatic detection from files in the workspace:
Detection targets:
├── package.json → Framework and dependencies
├── tsconfig.json → TypeScript usage
├── tailwind.config → Tailwind CSS
├── next.config → Next.js
├── vite.config → Vite
├── nuxt.config → Nuxt
└── src/ or app/ → Source directory尝试从工作区的文件中自动检测:
Detection targets:
├── package.json → Framework and dependencies
├── tsconfig.json → TypeScript usage
├── tailwind.config → Tailwind CSS
├── next.config → Next.js
├── vite.config → Vite
├── nuxt.config → Nuxt
└── src/ or app/ → Source directory1.4 Identifying Styling Method
1.4 识别样式方法
| Method | Detection | Edit Target |
|---|---|---|
| Pure CSS | | Global CSS or component CSS |
| SCSS/Sass | | SCSS files |
| CSS Modules | | Module CSS files |
| Tailwind CSS | | className in components |
| styled-components | | JS/TS files |
| Emotion | | JS/TS files |
| CSS-in-JS (other) | Inline styles | JS/TS files |
| 方法 | 检测方式 | 编辑目标 |
|---|---|---|
| 纯CSS | | 全局CSS或组件CSS |
| SCSS/Sass | | SCSS文件 |
| CSS Modules | | 模块CSS文件 |
| Tailwind CSS | | 组件中的className |
| styled-components | 代码中的 | JS/TS文件 |
| Emotion | | JS/TS文件 |
| 其他CSS-in-JS | 内联样式 | JS/TS文件 |
Step 2: Visual Inspection Phase
步骤2:视觉检查阶段
2.1 Page Traversal
2.1 页面遍历
- Navigate to the specified URL
- Capture screenshots
- Retrieve DOM structure/snapshot (if possible)
- If additional pages exist, traverse through navigation
- 导航至指定URL
- 捕获截图
- 检索DOM结构/快照(如果可能)
- 如果存在其他页面,通过导航遍历
2.2 Inspection Items
2.2 检查项
Layout Issues
布局问题
| Issue | Description | Severity |
|---|---|---|
| Element Overflow | Content overflows from parent element or viewport | High |
| Element Overlap | Unintended overlapping of elements | High |
| Alignment Issues | Grid or flex alignment problems | Medium |
| Inconsistent Spacing | Padding/margin inconsistencies | Medium |
| Text Clipping | Long text not handled properly | Medium |
| 问题 | 描述 | 严重程度 |
|---|---|---|
| 元素溢出 | 内容从父元素或视口溢出 | 高 |
| 元素重叠 | 元素意外重叠 | 高 |
| 对齐问题 | Grid或Flex布局对齐错误 | 中 |
| 间距不一致 | 内边距/外边距不一致 | 中 |
| 文本截断 | 长文本未正确处理 | 中 |
Responsive Issues
响应式问题
| Issue | Description | Severity |
|---|---|---|
| Non-mobile Friendly | Layout breaks on small screens | High |
| Breakpoint Issues | Unnatural transitions when screen size changes | Medium |
| Touch Targets | Buttons too small on mobile | Medium |
| 问题 | 描述 | 严重程度 |
|---|---|---|
| 非移动端友好 | 小屏幕上布局断裂 | 高 |
| 断点问题 | 屏幕尺寸变化时过渡不自然 | 中 |
| 触摸目标过小 | 移动端按钮尺寸过小 | 中 |
Accessibility Issues
可访问性问题
| Issue | Description | Severity |
|---|---|---|
| Insufficient Contrast | Low contrast ratio between text and background | High |
| No Focus State | Cannot determine state during keyboard navigation | High |
| Missing alt Text | No alternative text for images | Medium |
| 问题 | 描述 | 严重程度 |
|---|---|---|
| 对比度不足 | 文本与背景的对比度比率过低 | 高 |
| 无焦点状态 | 键盘导航时无法确定状态 | 高 |
| 缺少替代文本 | 图片无替代文本 | 中 |
Visual Consistency
视觉一致性
| Issue | Description | Severity |
|---|---|---|
| Font Inconsistency | Mixed font families | Medium |
| Color Inconsistency | Non-unified brand colors | Medium |
| Spacing Inconsistency | Non-uniform spacing between similar elements | Low |
| 问题 | 描述 | 严重程度 |
|---|---|---|
| 字体不一致 | 混合使用多种字体 | 中 |
| 颜色不一致 | 品牌颜色不统一 | 中 |
| 间距不一致 | 相似元素间的间距不统一 | 低 |
2.3 Viewport Testing (Responsive)
2.3 视口测试(响应式)
Test at the following viewports:
| Name | Width | Representative Device |
|---|---|---|
| Mobile | 375px | iPhone SE/12 mini |
| Tablet | 768px | iPad |
| Desktop | 1280px | Standard PC |
| Wide | 1920px | Large display |
在以下视口尺寸下测试:
| 名称 | 宽度 | 代表设备 |
|---|---|---|
| 移动端 | 375px | iPhone SE/12 mini |
| 平板 | 768px | iPad |
| 桌面端 | 1280px | 标准PC |
| 宽屏 | 1920px | 大型显示器 |
Step 3: Issue Fixing Phase
步骤3:问题修复阶段
3.1 Issue Prioritization
3.1 问题优先级
mermaid
block-beta
columns 1
block:priority["Priority Matrix"]
P1["P1: Fix Immediately\n(Layout issues affecting functionality)"]
P2["P2: Fix Next\n(Visual issues degrading UX)"]
P3["P3: Fix If Possible\n(Minor visual inconsistencies)"]
endmermaid
block-beta
columns 1
block:priority["Priority Matrix"]
P1["P1: 立即修复\n(影响功能的布局问题)"]
P2["P2: 下一步修复\n(降低用户体验的视觉问题)"]
P3["P3: 尽可能修复\n(轻微的视觉不一致)"]
end3.2 Identifying Source Files
3.2 识别源文件
Identify source files from problematic elements:
-
Selector-based Search
- Search codebase by class name or ID
- Explore style definitions with
grep_search
-
Component-based Search
- Identify components from element text or structure
- Explore related files with
semantic_search
-
File Pattern Filtering
Style files: src/**/*.css, styles/**/* Components: src/components/**/* Pages: src/pages/**, app/**
从有问题的元素中识别源文件:
-
基于选择器的搜索
- 通过类名或ID搜索代码库
- 使用探索样式定义
grep_search
-
基于组件的搜索
- 从元素文本或结构识别组件
- 使用探索相关文件
semantic_search
-
文件模式过滤
Style files: src/**/*.css, styles/**/* Components: src/components/**/* Pages: src/pages/**, app/**
3.3 Applying Fixes
3.3 应用修复
Framework-specific Fix Guidelines
框架特定修复指南
See references/framework-fixes.md for details.
详情请参考references/framework-fixes.md。
Fix Principles
修复原则
- Minimal Changes: Only make the minimum changes necessary to resolve the issue
- Respect Existing Patterns: Follow existing code style in the project
- Avoid Breaking Changes: Be careful not to affect other areas
- Add Comments: Add comments to explain the reason for fixes where appropriate
- 最小变更:仅进行解决问题所需的最小变更
- 遵循现有模式:遵循项目中的现有代码风格
- 避免破坏性变更:注意不要影响其他区域
- 添加注释:在适当的地方添加注释说明修复原因
Step 4: Re-verification Phase
步骤4:重新验证阶段
4.1 Post-fix Confirmation
4.1 修复后确认
- Reload browser (or wait for development server HMR)
- Capture screenshots of fixed areas
- Compare before and after
- 重新加载浏览器(或等待开发服务器HMR)
- 捕获修复区域的截图
- 对比修复前后
4.2 Regression Testing
4.2 回归测试
- Verify that fixes haven't affected other areas
- Confirm responsive display is not broken
- 验证修复未影响其他区域
- 确认响应式显示未被破坏
4.3 Iteration Decision
4.3 迭代决策
mermaid
flowchart TD
A{Issues Remaining?}
A -->|Yes| B[Return to Step 2]
A -->|No| C[Proceed to Completion Report]Iteration Limit: If more than 3 fix attempts are needed for a specific issue, consult the user
mermaid
flowchart TD
A{Issues Remaining?}
A -->|Yes| B[返回步骤2]
A -->|No| C[生成完成报告]迭代限制:如果某个问题需要超过3次修复尝试,请咨询用户
Output Format
输出格式
Review Results Report
审查结果报告
markdown
undefinedmarkdown
undefinedWeb Design Review Results
网页设计审查结果
Summary
摘要
| Item | Value |
|---|---|
| Target URL | {URL} |
| Framework | {Detected framework} |
| Styling | {CSS / Tailwind / etc.} |
| Tested Viewports | Desktop, Mobile |
| Issues Detected | {N} |
| Issues Fixed | {M} |
| 项 | 值 |
|---|---|
| 目标URL | {URL} |
| 框架 | {检测到的框架} |
| 样式方案 | {CSS/Tailwind等} |
| 测试视口 | 桌面端、移动端 |
| 检测到的问题 | {N} |
| 已修复问题 | {M} |
Detected Issues
检测到的问题
[P1] {Issue Title}
[P1] {问题标题}
- Page: {Page path}
- Element: {Selector or description}
- Issue: {Detailed description of the issue}
- Fixed File:
{File path} - Fix Details: {Description of changes}
- Screenshot: Before/After
- 页面:{页面路径}
- 元素:{选择器或描述}
- 问题:{问题详细描述}
- 修复文件:
{文件路径} - 修复详情:{变更描述}
- 截图:修复前后对比
[P2] {Issue Title}
[P2] {问题标题}
...
...
Unfixed Issues (if any)
未修复问题(如有)
{Issue Title}
{问题标题}
- Reason: {Why it was not fixed/could not be fixed}
- Recommended Action: {Recommendations for user}
- 原因:{未修复/无法修复的原因}
- 建议操作:{给用户的建议}
Recommendations
推荐方案
- {Suggestions for future improvements}
---- {未来改进的建议}
---Required Capabilities
所需能力
| Capability | Description | Required |
|---|---|---|
| Web Page Navigation | Access URLs, page transitions | ✅ |
| Screenshot Capture | Page image capture | ✅ |
| Image Analysis | Visual issue detection | ✅ |
| DOM Retrieval | Page structure retrieval | Recommended |
| File Read/Write | Source code reading and editing | Required for fixes |
| Code Search | Code search within project | Required for fixes |
| 能力 | 描述 | 是否必需 |
|---|---|---|
| 网页导航 | 访问URL、页面跳转 | ✅ |
| 截图捕获 | 页面图像捕获 | ✅ |
| 图像分析 | 视觉问题检测 | ✅ |
| DOM检索 | 页面结构检索 | 推荐 |
| 文件读写 | 源代码读取和编辑 | 修复时必需 |
| 代码搜索 | 项目内代码搜索 | 修复时必需 |
Reference Implementation
参考实现
Implementation with Playwright MCP
使用Playwright MCP的实现
Playwright MCP is recommended as the reference implementation for this skill.
| Capability | Playwright MCP Tool | Purpose |
|---|---|---|
| Navigation | | Access URLs |
| Snapshot | | Retrieve DOM structure |
| Screenshot | | Images for visual inspection |
| Click | | Interact with interactive elements |
| Resize | | Responsive testing |
| Console | | Detect JS errors |
推荐使用Playwright MCP作为该Skill的参考实现。
| 能力 | Playwright MCP工具 | 用途 |
|---|---|---|
| 导航 | | 访问URL |
| 快照 | | 检索DOM结构 |
| 截图 | | 视觉检查用图像 |
| 点击 | | 与交互元素交互 |
| 调整尺寸 | | 响应式测试 |
| 控制台 | | 检测JS错误 |
Configuration Example (MCP Server)
配置示例(MCP服务器)
json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest", "--caps=vision"]
}
}
}json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest", "--caps=vision"]
}
}
}Other Compatible Browser Automation Tools
其他兼容的浏览器自动化工具
| Tool | Features |
|---|---|
| Selenium | Broad browser support, multi-language support |
| Puppeteer | Chrome/Chromium focused, Node.js |
| Cypress | Easy integration with E2E testing |
| WebDriver BiDi | Standardized next-generation protocol |
The same workflow can be implemented with these tools. As long as they provide the necessary capabilities (navigation, screenshot, DOM retrieval), the choice of tool is flexible.
| 工具 | 特性 |
|---|---|
| Selenium | 广泛的浏览器支持、多语言支持 |
| Puppeteer | 专注Chrome/Chromium、Node.js |
| Cypress | 易于与E2E测试集成 |
| WebDriver BiDi | 标准化的下一代协议 |
使用这些工具也可实现相同的工作流程。只要它们提供必要的能力(导航、截图、DOM检索),工具选择灵活。
Best Practices
最佳实践
DO (Recommended)
推荐做法
- ✅ Always save screenshots before making fixes
- ✅ Fix one issue at a time and verify each
- ✅ Follow the project's existing code style
- ✅ Confirm with user before major changes
- ✅ Document fix details thoroughly
- ✅ 修复前始终保存截图
- ✅ 一次修复一个问题并逐一验证
- ✅ 遵循项目现有的代码风格
- ✅ 重大变更前与用户确认
- ✅ 详细记录修复详情
DON'T (Not Recommended)
不推荐做法
- ❌ Large-scale refactoring without confirmation
- ❌ Ignoring design systems or brand guidelines
- ❌ Fixes that ignore performance
- ❌ Fixing multiple issues at once (difficult to verify)
- ❌ 未经确认进行大规模重构
- ❌ 忽视设计系统或品牌指南
- ❌ 忽视性能的修复
- ❌ 同时修复多个问题(难以验证)
Troubleshooting
故障排除
Problem: Style files not found
问题:样式文件未找到
- Check dependencies in
package.json - Consider the possibility of CSS-in-JS
- Consider CSS generated at build time
- Ask user about styling method
- 检查中的依赖
package.json - 考虑CSS-in-JS的可能性
- 考虑构建时生成的CSS
- 询问用户样式方案
Problem: Fixes not reflected
问题:修复未生效
- Check if development server HMR is working
- Clear browser cache
- Rebuild if project requires build
- Check CSS specificity issues
- 检查开发服务器HMR是否工作
- 清除浏览器缓存
- 如果项目需要构建,重新构建
- 检查CSS优先级问题
Problem: Fixes affecting other areas
问题:修复影响其他区域
- Rollback changes
- Use more specific selectors
- Consider using CSS Modules or scoped styles
- Consult user to confirm impact scope
- 回滚变更
- 使用更具体的选择器
- 考虑使用CSS Modules或作用域样式
- 咨询用户确认影响范围