@tinkcarlos/skillora 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/.temp-skill-index.md +245 -0
- package/.claude/skills/SKILL.md +264 -0
- package/.claude/skills/api-scaffolding/SKILL.md +431 -0
- package/.claude/skills/api-scaffolding/agents/backend-architect.md +282 -0
- package/.claude/skills/api-scaffolding/agents/django-pro.md +144 -0
- package/.claude/skills/api-scaffolding/agents/fastapi-pro.md +156 -0
- package/.claude/skills/api-scaffolding/agents/graphql-architect.md +146 -0
- package/.claude/skills/api-scaffolding/skills/fastapi-templates/SKILL.md +171 -0
- package/.claude/skills/api-testing-observability/SKILL.md +583 -0
- package/.claude/skills/api-testing-observability/agents/api-documenter.md +146 -0
- package/.claude/skills/api-testing-observability/commands/api-mock.md +1320 -0
- package/.claude/skills/brainstorming/SKILL.md +283 -0
- package/.claude/skills/bug-fixing/SKILL.md +382 -0
- package/.claude/skills/bug-fixing/references/backend-guide.md +132 -0
- package/.claude/skills/bug-fixing/references/bug-guide.md +354 -0
- package/.claude/skills/bug-fixing/references/bug-record-template.md +134 -0
- package/.claude/skills/bug-fixing/references/bug-records.md +88 -0
- package/.claude/skills/bug-fixing/references/code-review-gate.md +81 -0
- package/.claude/skills/bug-fixing/references/common-bugs.md +140 -0
- package/.claude/skills/bug-fixing/references/complete-workflow.md +361 -0
- package/.claude/skills/bug-fixing/references/config-driven-fixes.md +136 -0
- package/.claude/skills/bug-fixing/references/context-isolation-protocol.md +268 -0
- package/.claude/skills/bug-fixing/references/cross-surface-regression.md +120 -0
- package/.claude/skills/bug-fixing/references/database-investigation.md +129 -0
- package/.claude/skills/bug-fixing/references/dependency-and-integrity-protocol.md +369 -0
- package/.claude/skills/bug-fixing/references/fix-completeness-checklist.md +239 -0
- package/.claude/skills/bug-fixing/references/frontend-guide.md +219 -0
- package/.claude/skills/bug-fixing/references/fullstack-joint-guide.md +123 -0
- package/.claude/skills/bug-fixing/references/functional-breakage.md +117 -0
- package/.claude/skills/bug-fixing/references/ide-lint-errors-guide.md +176 -0
- package/.claude/skills/bug-fixing/references/impact-analysis.md +511 -0
- package/.claude/skills/bug-fixing/references/investigation-checklist.md +263 -0
- package/.claude/skills/bug-fixing/references/knowledge-extraction-guide.md +531 -0
- package/.claude/skills/bug-fixing/references/knowledge-workflow.md +212 -0
- package/.claude/skills/bug-fixing/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/bug-fixing/references/python-env-and-testing.md +126 -0
- package/.claude/skills/bug-fixing/references/rca-guide.md +428 -0
- package/.claude/skills/bug-fixing/references/similar-bug-patterns.md +113 -0
- package/.claude/skills/bug-fixing/references/skill-delegation-guide.md +350 -0
- package/.claude/skills/bug-fixing/references/skill-orchestration.md +155 -0
- package/.claude/skills/bug-fixing/references/testing-strategy.md +350 -0
- package/.claude/skills/bug-fixing/references/tooling-build-scripts.md +162 -0
- package/.claude/skills/bug-fixing/references/user-input-validation.md +77 -0
- package/.claude/skills/bug-fixing/references/ux-patterns.md +158 -0
- package/.claude/skills/bug-fixing/references/windows-terminal-hygiene.md +106 -0
- package/.claude/skills/bug-fixing/references/zero-regression-matrix.md +239 -0
- package/.claude/skills/bug-fixing/references/zero-risk-protocol.md +102 -0
- package/.claude/skills/bug-fixing/scripts/format_code.py +611 -0
- package/.claude/skills/bug-fixing/scripts/generate_report_template.py +74 -0
- package/.claude/skills/bug-fixing/scripts/lint_check.py +816 -0
- package/.claude/skills/bug-fixing/scripts/requirements.txt +36 -0
- package/.claude/skills/cicd-pipeline/SKILL.md +300 -0
- package/.claude/skills/code-review/SKILL.md +535 -0
- package/.claude/skills/code-review/references/anti-pattern-scan.md +102 -0
- package/.claude/skills/code-review/references/automated-analysis.md +456 -0
- package/.claude/skills/code-review/references/backend-common-issues.md +589 -0
- package/.claude/skills/code-review/references/backend-expert-guide.md +415 -0
- package/.claude/skills/code-review/references/backend-review.md +868 -0
- package/.claude/skills/code-review/references/batch-processing-strategy.md +198 -0
- package/.claude/skills/code-review/references/call-chain-analysis-protocol.md +166 -0
- package/.claude/skills/code-review/references/common-patterns.md +321 -0
- package/.claude/skills/code-review/references/configuration-review.md +425 -0
- package/.claude/skills/code-review/references/control-flow-completeness.md +114 -0
- package/.claude/skills/code-review/references/database-review.md +298 -0
- package/.claude/skills/code-review/references/dependency-and-integrity-protocol.md +313 -0
- package/.claude/skills/code-review/references/external-standards.md +51 -0
- package/.claude/skills/code-review/references/feature-review.md +329 -0
- package/.claude/skills/code-review/references/file-review-template.md +326 -0
- package/.claude/skills/code-review/references/frontend-advanced.md +654 -0
- package/.claude/skills/code-review/references/frontend-common-issues.md +482 -0
- package/.claude/skills/code-review/references/frontend-expert-guide.md +342 -0
- package/.claude/skills/code-review/references/frontend-review.md +783 -0
- package/.claude/skills/code-review/references/fullstack-consistency.md +418 -0
- package/.claude/skills/code-review/references/fullstack-review.md +477 -0
- package/.claude/skills/code-review/references/functional-completeness.md +386 -0
- package/.claude/skills/code-review/references/hidden-bugs-detection.md +473 -0
- package/.claude/skills/code-review/references/ide-lint-errors-guide.md +173 -0
- package/.claude/skills/code-review/references/infrastructure-review.md +453 -0
- package/.claude/skills/code-review/references/iteration-review.md +264 -0
- package/.claude/skills/code-review/references/job-review.md +335 -0
- package/.claude/skills/code-review/references/layered-checklist-protocol.md +157 -0
- package/.claude/skills/code-review/references/logic-completeness.md +535 -0
- package/.claude/skills/code-review/references/mandatory-checklist.md +288 -0
- package/.claude/skills/code-review/references/multi-language-guide.md +800 -0
- package/.claude/skills/code-review/references/new-project-review.md +226 -0
- package/.claude/skills/code-review/references/non-code-files-review.md +451 -0
- package/.claude/skills/code-review/references/overlooked-issues.md +657 -0
- package/.claude/skills/code-review/references/platform-specific-review.md +195 -0
- package/.claude/skills/code-review/references/precision-analysis-protocol.md +260 -0
- package/.claude/skills/code-review/references/python-patterns.md +494 -0
- package/.claude/skills/code-review/references/rca-techniques.md +362 -0
- package/.claude/skills/code-review/references/report-template.md +430 -0
- package/.claude/skills/code-review/references/resource-limits-and-degradation.md +137 -0
- package/.claude/skills/code-review/references/review-dimensions.md +311 -0
- package/.claude/skills/code-review/references/review-guide.md +202 -0
- package/.claude/skills/code-review/references/review-knowledge-workflow.md +257 -0
- package/.claude/skills/code-review/references/review-progress-tracker-protocol.md +172 -0
- package/.claude/skills/code-review/references/review-record-template.md +195 -0
- package/.claude/skills/code-review/references/skill-orchestration.md +143 -0
- package/.claude/skills/code-review/references/ui-ux-review.md +470 -0
- package/.claude/skills/containerization/SKILL.md +313 -0
- package/.claude/skills/database-migrations/agents/database-admin.md +142 -0
- package/.claude/skills/database-migrations/agents/database-optimizer.md +144 -0
- package/.claude/skills/database-migrations/commands/migration-observability.md +408 -0
- package/.claude/skills/database-migrations/commands/sql-migrations.md +492 -0
- package/.claude/skills/finishing-a-development-branch/SKILL.md +319 -0
- package/.claude/skills/frontend-design/LICENSE.txt +177 -0
- package/.claude/skills/frontend-design/SKILL.md +587 -0
- package/.claude/skills/frontend-design/references/color-consistency.md +487 -0
- package/.claude/skills/frontend-design/references/color-palettes-full.md +657 -0
- package/.claude/skills/frontend-design/references/design-system-generator.md +285 -0
- package/.claude/skills/frontend-design/references/font-pairings-full.md +705 -0
- package/.claude/skills/frontend-design/references/industry-anti-patterns.md +281 -0
- package/.claude/skills/frontend-design/references/layout-anti-patterns.md +582 -0
- package/.claude/skills/frontend-design/references/motion-patterns.md +659 -0
- package/.claude/skills/frontend-design/references/pre-delivery-checklist.md +153 -0
- package/.claude/skills/frontend-design/references/responsive-design.md +555 -0
- package/.claude/skills/frontend-design/references/style-modification-rules.md +335 -0
- package/.claude/skills/frontend-design/references/ui-styles-full.md +383 -0
- package/.claude/skills/frontend-design/references/ui-styles-rating.md +191 -0
- package/.claude/skills/frontend-design/references/ux-guidelines.md +640 -0
- package/.claude/skills/fullstack-developer/SKILL.md +512 -0
- package/.claude/skills/fullstack-developer/references/api-contract-guide.md +312 -0
- package/.claude/skills/fullstack-developer/references/api-response-patterns.md +223 -0
- package/.claude/skills/fullstack-developer/references/async-patterns.md +220 -0
- package/.claude/skills/fullstack-developer/references/bug-prevention.md +914 -0
- package/.claude/skills/fullstack-developer/references/code-quality-checklist.md +271 -0
- package/.claude/skills/fullstack-developer/references/complete-development-workflow.md +278 -0
- package/.claude/skills/fullstack-developer/references/context-isolation-protocol.md +256 -0
- package/.claude/skills/fullstack-developer/references/database-migration.md +331 -0
- package/.claude/skills/fullstack-developer/references/dependency-and-integrity-protocol.md +390 -0
- package/.claude/skills/fullstack-developer/references/development-phases.md +333 -0
- package/.claude/skills/fullstack-developer/references/expert-guide.md +214 -0
- package/.claude/skills/fullstack-developer/references/file-import-patterns.md +114 -0
- package/.claude/skills/fullstack-developer/references/graceful-degradation-patterns.md +78 -0
- package/.claude/skills/fullstack-developer/references/ide-lint-errors-guide.md +183 -0
- package/.claude/skills/fullstack-developer/references/integration-testing.md +301 -0
- package/.claude/skills/fullstack-developer/references/mock-api-patterns.md +307 -0
- package/.claude/skills/fullstack-developer/references/phase-gate-template.md +249 -0
- package/.claude/skills/fullstack-developer/references/post-edit-quality-gate.md +30 -0
- package/.claude/skills/fullstack-developer/references/python-engineering.md +79 -0
- package/.claude/skills/fullstack-developer/references/skill-orchestration.md +214 -0
- package/.claude/skills/fullstack-developer/references/skill-router-table.md +304 -0
- package/.claude/skills/fullstack-developer/references/state-sync.md +217 -0
- package/.claude/skills/fullstack-developer/references/ui-testing-checklist.md +292 -0
- package/.claude/skills/fullstack-developer/scripts/format_code.py +611 -0
- package/.claude/skills/fullstack-developer/scripts/lint_check.py +816 -0
- package/.claude/skills/fullstack-developer/scripts/requirements.txt +36 -0
- package/.claude/skills/performance-optimization/SKILL.md +250 -0
- package/.claude/skills/product-requirements/SKILL.md +357 -0
- package/.claude/skills/product-requirements/references/acceptance-criteria.md +335 -0
- package/.claude/skills/product-requirements/references/answer-first-questioning-protocol.md +299 -0
- package/.claude/skills/product-requirements/references/competitive-analysis-guide.md +183 -0
- package/.claude/skills/product-requirements/references/document-accuracy-protocol.md +253 -0
- package/.claude/skills/product-requirements/references/document-management-protocol.md +278 -0
- package/.claude/skills/product-requirements/references/external-standards.md +62 -0
- package/.claude/skills/product-requirements/references/feature-spec-template.md +359 -0
- package/.claude/skills/product-requirements/references/knowledge-acquisition-protocol.md +251 -0
- package/.claude/skills/product-requirements/references/plan-execution-protocol.md +334 -0
- package/.claude/skills/product-requirements/references/plan-generation-protocol.md +264 -0
- package/.claude/skills/product-requirements/references/prioritization-frameworks.md +80 -0
- package/.claude/skills/product-requirements/references/requirement-decomposition-protocol.md +291 -0
- package/.claude/skills/product-requirements/references/user-story-examples.md +297 -0
- package/.claude/skills/product-requirements/references/workflow-templates.md +266 -0
- package/.claude/skills/react-best-practices/SKILL.md +198 -0
- package/.claude/skills/react-best-practices/references/advanced-patterns.md +94 -0
- package/.claude/skills/react-best-practices/references/bundle-optimization.md +182 -0
- package/.claude/skills/react-best-practices/references/client-data-fetching.md +112 -0
- package/.claude/skills/react-best-practices/references/complete-guide.md +2249 -0
- package/.claude/skills/react-best-practices/references/eliminating-waterfalls.md +169 -0
- package/.claude/skills/react-best-practices/references/javascript-performance.md +256 -0
- package/.claude/skills/react-best-practices/references/rendering-performance.md +230 -0
- package/.claude/skills/react-best-practices/references/rerender-optimization.md +214 -0
- package/.claude/skills/react-best-practices/references/server-performance.md +182 -0
- package/.claude/skills/security-audit/SKILL.md +226 -0
- package/.claude/skills/shared-references/advanced-debugging-techniques.md +186 -0
- package/.claude/skills/shared-references/code-quality-checklist.md +218 -0
- package/.claude/skills/shared-references/code-review-efficiency-guide.md +125 -0
- package/.claude/skills/shared-references/mcp-dependency-compatibility-protocol.md +276 -0
- package/.claude/skills/shared-references/skill-call-graph.md +230 -0
- package/.claude/skills/shared-references/skill-orchestration-protocol.md +281 -0
- package/.claude/skills/shared-references/subagent-dispatch-templates.md +199 -0
- package/.claude/skills/skill-expert-skills/LICENSE.txt +204 -0
- package/.claude/skills/skill-expert-skills/QUICK_NAVIGATION.md +374 -0
- package/.claude/skills/skill-expert-skills/SKILL.md +247 -0
- package/.claude/skills/skill-expert-skills/docs/_index.md +91 -0
- package/.claude/skills/skill-expert-skills/references/deep-research-methodology.md +389 -0
- package/.claude/skills/skill-expert-skills/references/docs-generation-workflow.md +398 -0
- package/.claude/skills/skill-expert-skills/references/domain-expertise-protocol.md +343 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/_index.md +54 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/backend-expertise.md +517 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/bug-fixing-expertise.md +363 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/code-review-expertise.md +392 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge/frontend-expertise.md +410 -0
- package/.claude/skills/skill-expert-skills/references/domain-knowledge-template.md +503 -0
- package/.claude/skills/skill-expert-skills/references/examples.md +782 -0
- package/.claude/skills/skill-expert-skills/references/integration-examples.md +655 -0
- package/.claude/skills/skill-expert-skills/references/knowledge-validation-checklist.md +246 -0
- package/.claude/skills/skill-expert-skills/references/latest-knowledge-acquisition.md +461 -0
- package/.claude/skills/skill-expert-skills/references/mcp-tools-guide.md +439 -0
- package/.claude/skills/skill-expert-skills/references/official-best-practices.md +616 -0
- package/.claude/skills/skill-expert-skills/references/patterns.md +218 -0
- package/.claude/skills/skill-expert-skills/references/plugin-skills-guide.md +432 -0
- package/.claude/skills/skill-expert-skills/references/requirement-elicitation-protocol.md +290 -0
- package/.claude/skills/skill-expert-skills/references/skill-creator-SKILL.md +353 -0
- package/.claude/skills/skill-expert-skills/references/skill-templates.md +583 -0
- package/.claude/skills/skill-expert-skills/references/skills-knowledge-base.md +561 -0
- package/.claude/skills/skill-expert-skills/references/tools-guide.md +379 -0
- package/.claude/skills/skill-expert-skills/references/troubleshooting.md +378 -0
- package/.claude/skills/skill-expert-skills/references/universality-guide.md +205 -0
- package/.claude/skills/skill-expert-skills/references/writing-style-guide.md +466 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/quick_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/__pycache__/universal_validate.cpython-313.pyc +0 -0
- package/.claude/skills/skill-expert-skills/scripts/analyze_trigger.py +425 -0
- package/.claude/skills/skill-expert-skills/scripts/diff_with_official.py +188 -0
- package/.claude/skills/skill-expert-skills/scripts/init_skill.py +349 -0
- package/.claude/skills/skill-expert-skills/scripts/package_skill.py +156 -0
- package/.claude/skills/skill-expert-skills/scripts/quick_validate.py +493 -0
- package/.claude/skills/skill-expert-skills/scripts/requirements.txt +2 -0
- package/.claude/skills/skill-expert-skills/scripts/universal_validate.py +182 -0
- package/.claude/skills/skill-expert-skills/scripts/upgrade_skill.py +431 -0
- package/.claude/skills/subagent-driven-development/SKILL.md +268 -0
- package/.claude/skills/test-driven-development/SKILL.md +246 -0
- package/.claude/skills/test-driven-development/references/testing-anti-patterns.md +192 -0
- package/.claude/skills/using-git-worktrees/SKILL.md +266 -0
- package/.claude/skills/using-skillstack/SKILL.md +127 -0
- package/.claude/skills/vercel-deploy/SKILL.md +166 -0
- package/.claude/skills/vercel-deploy/scripts/deploy.sh +249 -0
- package/.claude/skills/verification-before-completion/SKILL.md +305 -0
- package/.claude/skills/writing-plans/SKILL.md +259 -0
- package/README.md +69 -0
- package/bin/cli.js +468 -0
- package/lib/init.js +333 -0
- package/package.json +29 -0
|
@@ -0,0 +1,587 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design
|
|
3
|
+
user-invocable: true
|
|
4
|
+
description: |
|
|
5
|
+
Create and review production-grade frontend interfaces with high design quality.
|
|
6
|
+
Dual-mode: CREATE mode for building UI, REVIEW mode for auditing compliance.
|
|
7
|
+
|
|
8
|
+
Use when:
|
|
9
|
+
- BUILD: web components, pages, dashboards, landing pages
|
|
10
|
+
- BUILD: "make it look better", "design a page", "UI for...", "beautiful interface"
|
|
11
|
+
- BUILD: 美化界面, 优化样式, 设计页面, 前端设计, 组件开发
|
|
12
|
+
- REVIEW: "review my UI", "check accessibility", "audit design", "review UX"
|
|
13
|
+
- REVIEW: 审查UI, 检查可访问性, 设计审计
|
|
14
|
+
|
|
15
|
+
Key Features:
|
|
16
|
+
- 🎨 CREATE MODE: 57 UI styles + 95 palettes + 56 font pairings
|
|
17
|
+
- 🔍 REVIEW MODE: 100+ rules (accessibility, performance, UX)
|
|
18
|
+
- 28-item pre-delivery checklist
|
|
19
|
+
- Layout anti-patterns prevention
|
|
20
|
+
- Color consistency (Light/Dark, 4.5:1 contrast)
|
|
21
|
+
- 8px spacing grid system
|
|
22
|
+
- Industry-specific anti-patterns
|
|
23
|
+
|
|
24
|
+
Not for: backend API, database design, pure business logic without UI.
|
|
25
|
+
license: MIT
|
|
26
|
+
allowed-tools: [Read, Write, Edit, Glob, Grep]
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
# Frontend Design Skill
|
|
30
|
+
|
|
31
|
+
Create and review production-grade frontend interfaces.
|
|
32
|
+
**Dual-mode**: 🎨 CREATE (build UI) | 🔍 REVIEW (audit compliance)
|
|
33
|
+
|
|
34
|
+
## 🔴 Mode Selection
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
用户请求
|
|
38
|
+
│
|
|
39
|
+
├── "设计/创建/美化/UI" → 🎨 CREATE MODE
|
|
40
|
+
│
|
|
41
|
+
└── "审查/检查/audit" → 🔍 REVIEW MODE
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
# 🎨 CREATE MODE
|
|
47
|
+
|
|
48
|
+
Create distinctive interfaces that avoid generic "AI slop" aesthetics.
|
|
49
|
+
**Prevents**: element overlap, layout shift, excessive whitespace, inconsistent colors, poor responsive scaling.
|
|
50
|
+
|
|
51
|
+
## 🔴 MANDATORY: Design System Generation Flow
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
55
|
+
│ 设计系统生成流程 (MUST FOLLOW) │
|
|
56
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
57
|
+
│ Step 1: 识别行业/产品类型 │
|
|
58
|
+
│ ↓ │
|
|
59
|
+
│ Step 2: 加载行业反模式 (→ references/industry-anti-patterns.md) │
|
|
60
|
+
│ ↓ │
|
|
61
|
+
│ Step 3: 选择 UI 风格 (→ references/ui-styles-full.md) │
|
|
62
|
+
│ ↓ │
|
|
63
|
+
│ Step 4: 选择调色板 (60-30-10 法则) │
|
|
64
|
+
│ ↓ │
|
|
65
|
+
│ Step 5: 选择字体配对 │
|
|
66
|
+
│ ↓ │
|
|
67
|
+
│ Step 6: 应用布局约束 (防重叠/错乱/空白) │
|
|
68
|
+
│ ↓ │
|
|
69
|
+
│ Step 7: 响应式断点测试 (320px → 1440px) │
|
|
70
|
+
│ ↓ │
|
|
71
|
+
│ Step 8: 预交付检查 (28项必检) │
|
|
72
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 🔴 Core Rules (MANDATORY)
|
|
76
|
+
|
|
77
|
+
### 1. Element Overlap Prevention (防止元素重叠)
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
81
|
+
│ 🔴 防止重叠黄金法则 │
|
|
82
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
83
|
+
│ ✅ 固定导航栏: 内容区添加 pt-16 或 pt-20 预留空间 │
|
|
84
|
+
│ ✅ 浮动导航栏: 使用 top-4 left-4 right-4 边距 │
|
|
85
|
+
│ ✅ z-index 层级: dropdown(10) < navbar(30) < modal(50) │
|
|
86
|
+
│ ✅ 使用 Flexbox/Grid 替代绝对定位 │
|
|
87
|
+
│ ❌ 禁止: position: absolute 布局 (除非必要) │
|
|
88
|
+
│ ❌ 禁止: 负 margin 导致重叠 │
|
|
89
|
+
│ │
|
|
90
|
+
│ → 详细指南: references/layout-anti-patterns.md │
|
|
91
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 2. Responsive Design Rule (防止元素错乱/变形)
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
98
|
+
│ 🔴 响应式设计黄金法则 │
|
|
99
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
100
|
+
│ ✅ 使用: clamp(), min(), max(), minmax() │
|
|
101
|
+
│ ✅ 使用: Flexbox + Grid 自适应布局 │
|
|
102
|
+
│ ✅ 使用: Container Queries (@container) │
|
|
103
|
+
│ ✅ 使用: auto-fit/auto-fill + minmax(280px, 1fr) │
|
|
104
|
+
│ ✅ 图片: aspect-ratio + object-fit: cover │
|
|
105
|
+
│ ❌ 禁止: 固定 px 宽高 (除非有 min/max 约束) │
|
|
106
|
+
│ ❌ 禁止: 绝对定位布局 (position: absolute) │
|
|
107
|
+
│ │
|
|
108
|
+
│ → 详细指南: references/responsive-design.md │
|
|
109
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### 3. Layout Optimization Rule (防止空白/动态高度)
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
116
|
+
│ 🔴 布局优化黄金法则 │
|
|
117
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
118
|
+
│ ✅ 使用: height: auto + min-height: fit-content (动态高度) │
|
|
119
|
+
│ ✅ 使用: max-height + overflow-y: auto (长内容滚动) │
|
|
120
|
+
│ ✅ 使用: flex: 1 填充剩余空间 (无空白) │
|
|
121
|
+
│ ✅ 使用: grid-auto-rows: min-content (按内容行高) │
|
|
122
|
+
│ ✅ 空状态: 友好插图 + 说明 + 操作按钮 │
|
|
123
|
+
│ ❌ 禁止: 固定高度导致大片空白 │
|
|
124
|
+
│ ❌ 禁止: 长内容无限拉长页面 │
|
|
125
|
+
│ │
|
|
126
|
+
│ → 详细指南: references/layout-anti-patterns.md │
|
|
127
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 4. Color Consistency Rule (配色统一高级)
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
134
|
+
│ 🔴 配色一致性黄金法则 │
|
|
135
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
136
|
+
│ ✅ 60-30-10 法则: 主背景(60%) + 次要色(30%) + 强调色(10%) │
|
|
137
|
+
│ ✅ 对比度: 正文 ≥4.5:1, 大标题 ≥3:1 (WCAG AA) │
|
|
138
|
+
│ ✅ Light Mode: text-slate-900(正文), text-slate-600(辅助) │
|
|
139
|
+
│ ✅ Dark Mode: text-white(标题), text-gray-100(正文) │
|
|
140
|
+
│ ✅ 玻璃效果: Light用bg-white/80, Dark用bg-gray-900/80 │
|
|
141
|
+
│ ❌ 禁止: 硬编码颜色值 (使用CSS变量或Tailwind类) │
|
|
142
|
+
│ ❌ 禁止: text-gray-400 作为正文 (对比度不足) │
|
|
143
|
+
│ │
|
|
144
|
+
│ → 详细指南: references/color-consistency.md │
|
|
145
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### 5. Spacing System Rule (内外间距合适)
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
152
|
+
│ 🔴 间距系统黄金法则 (8px Grid) │
|
|
153
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
154
|
+
│ ✅ 相关元素间距小: 4-8px (gap-1, gap-2) │
|
|
155
|
+
│ ✅ 不相关元素间距大: 16-24px (gap-4, gap-6) │
|
|
156
|
+
│ ✅ 组件内部间距 < 组件外部间距 │
|
|
157
|
+
│ ✅ 按钮: px-4 py-2 (16px/8px) │
|
|
158
|
+
│ ✅ 卡片: p-4 或 p-6 (16px/24px) │
|
|
159
|
+
│ ✅ 表单字段: space-y-4 (16px) │
|
|
160
|
+
│ ✅ 章节: py-12 或 py-16 (48px/64px) │
|
|
161
|
+
│ ❌ 禁止: 奇数间距 (5px, 7px, 13px) │
|
|
162
|
+
│ ❌ 禁止: 过大间距 (>64px 除非章节分隔) │
|
|
163
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 6. Icon & Visual Element Rule (图标与视觉规范)
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
170
|
+
│ 🔴 图标与视觉黄金法则 │
|
|
171
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
172
|
+
│ ✅ 使用 SVG 图标库: Heroicons, Lucide, Simple Icons │
|
|
173
|
+
│ ✅ 图标尺寸统一: viewBox="0 0 24 24" + w-5 h-5 或 w-6 h-6 │
|
|
174
|
+
│ ✅ 品牌 Logo: 从 Simple Icons 获取官方 SVG │
|
|
175
|
+
│ ✅ hover 用 color/opacity 过渡 (不导致布局偏移) │
|
|
176
|
+
│ ❌ 禁止: emoji 作为 UI 图标 (🎨 🚀 ⚙️) │
|
|
177
|
+
│ ❌ 禁止: hover 用 scale 变换 (导致布局抖动) │
|
|
178
|
+
│ ❌ 禁止: 混用不同图标库 │
|
|
179
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 7. Touch Target & Interaction Rule (触摸目标与交互)
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
186
|
+
│ 🔴 交互黄金法则 │
|
|
187
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
188
|
+
│ ✅ 触摸目标最小: 44x44px (min-h-11 min-w-11) │
|
|
189
|
+
│ ✅ 可点击元素: cursor-pointer │
|
|
190
|
+
│ ✅ hover 反馈: 颜色/阴影/边框变化 │
|
|
191
|
+
│ ✅ 焦点状态: focus-visible:ring-2 focus-visible:ring-primary │
|
|
192
|
+
│ ✅ 过渡动画: 150-300ms (transition-colors duration-200) │
|
|
193
|
+
│ ❌ 禁止: 过渡 >500ms (感觉迟钝) │
|
|
194
|
+
│ ❌ 禁止: 无 hover/focus 反馈的交互元素 │
|
|
195
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### 8. Typography Hierarchy Rule (字体层级规范)
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
202
|
+
│ 🔴 字体层级黄金法则 │
|
|
203
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
204
|
+
│ ✅ H1: text-4xl/text-5xl font-bold (页面标题) │
|
|
205
|
+
│ ✅ H2: text-2xl/text-3xl font-semibold (章节标题) │
|
|
206
|
+
│ ✅ H3: text-xl font-medium (子标题) │
|
|
207
|
+
│ ✅ Body: text-base (16px) leading-relaxed │
|
|
208
|
+
│ ✅ Small: text-sm text-muted-foreground (辅助文字) │
|
|
209
|
+
│ ✅ 行高: 标题 1.2-1.3, 正文 1.5-1.75 │
|
|
210
|
+
│ ❌ 禁止: 正文 <14px (可读性差) │
|
|
211
|
+
│ ❌ 禁止: 超过 3 种字重 (视觉混乱) │
|
|
212
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 9. Loading & Empty State Rule (加载与空状态)
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
219
|
+
│ 🔴 状态反馈黄金法则 │
|
|
220
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
221
|
+
│ ✅ 加载状态: Skeleton (内容占位) 或 Spinner (操作等待) │
|
|
222
|
+
│ ✅ Skeleton: 匹配实际内容布局, animate-pulse │
|
|
223
|
+
│ ✅ 空状态: 插图 + 说明文字 + 操作按钮 │
|
|
224
|
+
│ ✅ 错误状态: 红色边框 + 错误图标 + 错误信息 │
|
|
225
|
+
│ ✅ 成功状态: 绿色 + 勾选图标 + 成功信息 │
|
|
226
|
+
│ ❌ 禁止: 无加载指示的异步操作 │
|
|
227
|
+
│ ❌ 禁止: 空白页面无任何提示 │
|
|
228
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 10. Container & Max-Width Rule (容器宽度一致性)
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
235
|
+
│ 🔴 容器宽度黄金法则 │
|
|
236
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
237
|
+
│ ✅ 全局统一: max-w-6xl (1152px) 或 max-w-7xl (1280px) │
|
|
238
|
+
│ ✅ 居中: mx-auto px-4 sm:px-6 lg:px-8 │
|
|
239
|
+
│ ✅ 全宽区域: 背景色全宽, 内容居中 │
|
|
240
|
+
│ ✅ 侧边栏布局: w-64 (256px) 固定 + flex-1 内容区 │
|
|
241
|
+
│ ❌ 禁止: 混用不同 max-width (视觉不一致) │
|
|
242
|
+
│ ❌ 禁止: 内容贴边无 padding │
|
|
243
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### 11. Style-Only Modification Rule
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
250
|
+
│ 🔴 样式修改黄金法则 │
|
|
251
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
252
|
+
│ ✅ 只改外观 (HOW it looks): 颜色、字体、间距、动画、布局 │
|
|
253
|
+
│ ❌ 不改行为 (WHAT it does): 事件、状态、API、路由、验证 │
|
|
254
|
+
│ │
|
|
255
|
+
│ → 详细规则: references/style-modification-rules.md │
|
|
256
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Deep Page Coverage
|
|
260
|
+
|
|
261
|
+
修改 UI 时,必须检查并统一**所有**相关组件:
|
|
262
|
+
- **弹窗类**: Modal, Drawer, Popover, Dropdown
|
|
263
|
+
- **提示类**: Toast, Alert, Tooltip, Badge
|
|
264
|
+
- **表单类**: Input, Select, Checkbox, Switch
|
|
265
|
+
- **数据类**: Table, Card, List, Avatar
|
|
266
|
+
- **导航类**: Navbar, Sidebar, Tabs, Breadcrumb
|
|
267
|
+
- **反馈类**: Loading, Skeleton, Empty State
|
|
268
|
+
|
|
269
|
+
### Diversity Enforcement
|
|
270
|
+
|
|
271
|
+
1. **Theme Rotation**: Light (40%) | Dark (30%) | Mixed (30%)
|
|
272
|
+
2. **Style Exploration**: Consider 3+ styles before committing
|
|
273
|
+
3. **Color Variety**: Each project gets a unique palette
|
|
274
|
+
|
|
275
|
+
## 🔴 Pre-Delivery Checklist (28 Items)
|
|
276
|
+
|
|
277
|
+
交付前必须通过以下检查 → 详细: `references/pre-delivery-checklist.md`
|
|
278
|
+
|
|
279
|
+
### Visual Quality (6 items)
|
|
280
|
+
- [ ] 无 emoji 作为图标 (使用 SVG: Heroicons/Lucide)
|
|
281
|
+
- [ ] 图标来自同一图标库,尺寸统一 (w-5 h-5 或 w-6 h-6)
|
|
282
|
+
- [ ] 品牌 logo 正确 (Simple Icons 验证)
|
|
283
|
+
- [ ] hover 状态不导致布局偏移 (用 color/opacity, 不用 scale)
|
|
284
|
+
- [ ] 直接使用主题色 (bg-primary, 不用 var() 包装)
|
|
285
|
+
- [ ] 字体层级清晰 (H1 > H2 > H3 > Body > Small)
|
|
286
|
+
|
|
287
|
+
### Interaction (5 items)
|
|
288
|
+
- [ ] 所有可点击元素有 `cursor-pointer`
|
|
289
|
+
- [ ] 触摸目标 ≥44x44px (min-h-11 min-w-11)
|
|
290
|
+
- [ ] hover 状态提供视觉反馈
|
|
291
|
+
- [ ] 过渡动画 150-300ms (`transition-colors duration-200`)
|
|
292
|
+
- [ ] 焦点状态可见 (`focus-visible:ring-2`)
|
|
293
|
+
|
|
294
|
+
### Light/Dark Mode (4 items)
|
|
295
|
+
- [ ] Light mode 正文对比度 ≥4.5:1 (text-slate-900)
|
|
296
|
+
- [ ] 玻璃效果 Light mode 可见 (bg-white/80+)
|
|
297
|
+
- [ ] 边框两种模式都可见
|
|
298
|
+
- [ ] 两种模式都测试过
|
|
299
|
+
|
|
300
|
+
### Layout (5 items)
|
|
301
|
+
- [ ] 浮动元素有边距 (top-4 left-4 right-4)
|
|
302
|
+
- [ ] 内容不被固定导航栏遮挡 (pt-20)
|
|
303
|
+
- [ ] 容器宽度统一 (max-w-6xl 或 max-w-7xl)
|
|
304
|
+
- [ ] 响应式测试: 320px, 768px, 1024px, 1440px
|
|
305
|
+
- [ ] 无水平滚动
|
|
306
|
+
|
|
307
|
+
### State Feedback (4 items)
|
|
308
|
+
- [ ] 加载状态有 Skeleton 或 Spinner
|
|
309
|
+
- [ ] 空状态有插图 + 说明 + 操作按钮
|
|
310
|
+
- [ ] 错误状态有红色边框 + 错误信息
|
|
311
|
+
- [ ] 成功状态有绿色 + 成功信息
|
|
312
|
+
|
|
313
|
+
### Accessibility (4 items)
|
|
314
|
+
- [ ] 所有图片有 alt 属性
|
|
315
|
+
- [ ] 表单输入有 label
|
|
316
|
+
- [ ] 颜色不是唯一信息指示 (配合图标)
|
|
317
|
+
- [ ] 尊重 `prefers-reduced-motion`
|
|
318
|
+
|
|
319
|
+
## Decision Tree
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
Step 1: Identify Industry/Context
|
|
323
|
+
SaaS/Tech → Modern, Clean, Gradient accents
|
|
324
|
+
E-commerce → Product-focused, Trust signals
|
|
325
|
+
Healthcare → Calm, Accessible, Professional
|
|
326
|
+
Finance → Trust, Precision, Data-rich
|
|
327
|
+
Creative → Bold, Expressive, Unique
|
|
328
|
+
Gaming → Neon, Dark, Futuristic
|
|
329
|
+
Beauty/Spa → Soft, Organic, Calming
|
|
330
|
+
Food/Restaurant → Warm, Appetizing, Visual
|
|
331
|
+
Education → Friendly, Clear, Progress-focused
|
|
332
|
+
Web3/NFT → Futuristic, Gradient, 3D
|
|
333
|
+
|
|
334
|
+
Step 2: Load Industry Anti-Patterns (🔴 MANDATORY)
|
|
335
|
+
→ references/industry-anti-patterns.md
|
|
336
|
+
Check: What NOT to do for this industry
|
|
337
|
+
|
|
338
|
+
Step 3: Select UI Style (→ references/ui-styles-full.md)
|
|
339
|
+
Check ratings: → references/ui-styles-rating.md
|
|
340
|
+
|
|
341
|
+
Step 4: Choose Color Palette (60-30-10 rule)
|
|
342
|
+
→ references/color-palettes-full.md
|
|
343
|
+
Verify: Not using industry-forbidden colors
|
|
344
|
+
|
|
345
|
+
Step 5: Select Typography (Display + Body font)
|
|
346
|
+
→ references/font-pairings-full.md
|
|
347
|
+
|
|
348
|
+
Step 6: Apply Layout Constraints
|
|
349
|
+
→ references/layout-anti-patterns.md
|
|
350
|
+
→ references/responsive-design.md
|
|
351
|
+
|
|
352
|
+
Step 7: Generate Design System
|
|
353
|
+
→ references/design-system-generator.md
|
|
354
|
+
|
|
355
|
+
Step 8: Implement with Motion + Micro-interactions
|
|
356
|
+
→ references/motion-patterns.md
|
|
357
|
+
|
|
358
|
+
Step 9: Pre-delivery Check (🔴 MANDATORY)
|
|
359
|
+
→ references/pre-delivery-checklist.md
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
## 🔴 Industry-Specific Anti-Patterns (行业禁忌)
|
|
363
|
+
|
|
364
|
+
**必须在设计前查阅** → `references/industry-anti-patterns.md`
|
|
365
|
+
|
|
366
|
+
| 行业 | 禁止主色 | 禁止风格 | 禁止效果 |
|
|
367
|
+
|------|----------|----------|----------|
|
|
368
|
+
| **医疗** | 红色, 黑色 | 深色模式, 卡通 | 快速动画 |
|
|
369
|
+
| **金融** | 霓虹色 | 卡通, 手写 | 过度动画 |
|
|
370
|
+
| **美容** | 霓虹色 | 深色模式 | 生硬动画 |
|
|
371
|
+
| **餐饮** | 蓝色 | 冷色调 | 过度滤镜 |
|
|
372
|
+
| **游戏** | 柔和色 | 企业风格 | 静态界面 |
|
|
373
|
+
| **教育** | - | 深色默认 | 过多动画 |
|
|
374
|
+
| **电商** | - | 深色默认 | 自动播放 |
|
|
375
|
+
|
|
376
|
+
## Quick Reference: 10 Core UI Styles
|
|
377
|
+
|
|
378
|
+
| Style | Visual Signature | Best For |
|
|
379
|
+
|-------|-----------------|----------|
|
|
380
|
+
| **Glassmorphism** | Frosted glass, blur | Dashboards, Cards |
|
|
381
|
+
| **Neumorphism** | Soft shadows, embossed | Buttons, Controls |
|
|
382
|
+
| **Brutalism** | Raw, bold, rough | Creative, Portfolio |
|
|
383
|
+
| **Minimalism** | White space, essential | Corporate, Luxury |
|
|
384
|
+
| **Bento Grid** | Card-based asymmetric | Dashboards, Portfolios |
|
|
385
|
+
| **Claymorphism** | 3D clay-like | Playful, Kids |
|
|
386
|
+
| **Retro/Vintage** | Nostalgic, old-school | Creative, Food |
|
|
387
|
+
| **Cyberpunk** | Neon, dark, futuristic | Gaming, Tech |
|
|
388
|
+
| **Organic/Natural** | Flowing shapes | Wellness, Eco |
|
|
389
|
+
| **Editorial** | Magazine-like | Blogs, News |
|
|
390
|
+
|
|
391
|
+
→ Full 57 styles: `references/ui-styles-full.md`
|
|
392
|
+
|
|
393
|
+
## Quick Reference: Industry Color Palettes
|
|
394
|
+
|
|
395
|
+
| Industry | Primary | Secondary | Accent |
|
|
396
|
+
|----------|---------|-----------|--------|
|
|
397
|
+
| **SaaS/Tech** | `#6366F1` Indigo | `#8B5CF6` Purple | `#F59E0B` Amber |
|
|
398
|
+
| **Healthcare** | `#0EA5E9` Sky | `#14B8A6` Teal | `#F97316` Orange |
|
|
399
|
+
| **Finance** | `#1E3A5F` Navy | `#059669` Emerald | `#EAB308` Gold |
|
|
400
|
+
| **E-commerce** | `#DC2626` Red | `#000000` Black | `#FBBF24` Yellow |
|
|
401
|
+
| **Creative** | `#EC4899` Pink | `#8B5CF6` Violet | `#06B6D4` Cyan |
|
|
402
|
+
|
|
403
|
+
→ Full 95 palettes: `references/color-palettes-full.md`
|
|
404
|
+
|
|
405
|
+
## Quick Reference: Font Pairings
|
|
406
|
+
|
|
407
|
+
| Pairing | Display | Body | Vibe |
|
|
408
|
+
|---------|---------|------|------|
|
|
409
|
+
| **Modern Tech** | Clash Display | Satoshi | Clean |
|
|
410
|
+
| **Editorial** | Playfair Display | Source Serif Pro | Sophisticated |
|
|
411
|
+
| **Geometric** | Bebas Neue | Work Sans | Bold |
|
|
412
|
+
| **Humanist** | DM Serif Display | DM Sans | Warm |
|
|
413
|
+
| **Brutalist** | Anton | IBM Plex Mono | Raw |
|
|
414
|
+
| **Luxury** | Cormorant Garamond | Lato | Elegant |
|
|
415
|
+
|
|
416
|
+
→ Full 56 pairings: `references/font-pairings-full.md`
|
|
417
|
+
|
|
418
|
+
## Design Thinking Process
|
|
419
|
+
|
|
420
|
+
1. **Purpose**: What problem does this interface solve?
|
|
421
|
+
2. **Industry**: Match to industry palette and style
|
|
422
|
+
3. **Tone**: Pick an extreme from the style spectrum
|
|
423
|
+
4. **Differentiation**: What's the ONE thing someone will remember?
|
|
424
|
+
|
|
425
|
+
**CRITICAL**: Bold maximalism and refined minimalism both work - the key is **intentionality**.
|
|
426
|
+
|
|
427
|
+
## NEVER Use (Anti-Patterns)
|
|
428
|
+
|
|
429
|
+
- ❌ Overused fonts: Inter alone, Roboto, Arial
|
|
430
|
+
- ❌ Clichéd colors: Purple gradients on white ("AI slop" look)
|
|
431
|
+
- ❌ Predictable layouts: Standard hero → features → CTA
|
|
432
|
+
- ❌ Safe defaults: Always dark theme, always the same style
|
|
433
|
+
|
|
434
|
+
## Output Contract
|
|
435
|
+
|
|
436
|
+
1. **Working Code**: HTML/CSS/JS or React/Vue component
|
|
437
|
+
2. **Design Rationale**: Why this style, palette, typography
|
|
438
|
+
3. **Key Techniques**: Special CSS/animation techniques used
|
|
439
|
+
4. **Customization Notes**: How to adapt for brand
|
|
440
|
+
5. **Pre-delivery Check**: 🔴 Must pass `references/pre-delivery-checklist.md`
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## 🔴 技能编排 (Skill Orchestration)
|
|
445
|
+
|
|
446
|
+
遵循 `../shared-references/skill-orchestration-protocol.md` 协议。
|
|
447
|
+
|
|
448
|
+
| 触发条件 | 调用技能 | 返回条件 |
|
|
449
|
+
|----------|----------|----------|
|
|
450
|
+
| React/Next.js 项目 | 🔴 `react-best-practices` | 性能优化完成 |
|
|
451
|
+
| UI 审查/可访问性 | 🔴 `web-design-guidelines` | 审查通过 |
|
|
452
|
+
| 设计完成后 | `code-review` | 代码审查通过 |
|
|
453
|
+
|
|
454
|
+
### 强制调用规则
|
|
455
|
+
|
|
456
|
+
| 触发条件 | 必须调用 | 原因 |
|
|
457
|
+
|----------|----------|------|
|
|
458
|
+
| React/Next.js 组件开发 | 🔴 `react-best-practices` | 确保性能最佳实践 |
|
|
459
|
+
| 任何 UI 完成后 | 🔴 `web-design-guidelines` | 确保可访问性和 UX |
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## References Navigation
|
|
464
|
+
|
|
465
|
+
| File | When to Read |
|
|
466
|
+
|------|--------------|
|
|
467
|
+
| 🔴 `references/industry-anti-patterns.md` | **设计前必读 - 行业禁忌** |
|
|
468
|
+
| 🔴 `references/responsive-design.md` | **防止元素错乱/重叠/变形** |
|
|
469
|
+
| 🔴 `references/layout-anti-patterns.md` | **防止重叠/空白/间距问题** |
|
|
470
|
+
| 🔴 `references/color-consistency.md` | **配色统一/Light-Dark模式** |
|
|
471
|
+
| 🔴 `references/style-modification-rules.md` | **修改现有项目时必读** |
|
|
472
|
+
| 🔴 `references/pre-delivery-checklist.md` | **交付前必须检查** |
|
|
473
|
+
| `references/design-system-generator.md` | 生成完整设计系统 |
|
|
474
|
+
| `references/ui-styles-full.md` | 57 种 UI 风格详解 |
|
|
475
|
+
| `references/ui-styles-rating.md` | 风格性能/可访问性评级 |
|
|
476
|
+
| `references/color-palettes-full.md` | 95 种行业调色板 |
|
|
477
|
+
| `references/font-pairings-full.md` | 56 种字体配对 |
|
|
478
|
+
| `references/ux-guidelines.md` | 98 条 UX 最佳实践 |
|
|
479
|
+
| `references/motion-patterns.md` | 动画和微交互 |
|
|
480
|
+
| 🔴 `../react-best-practices/SKILL.md` | **React/Next.js 性能优化** |
|
|
481
|
+
| 🔴 `../web-design-guidelines/SKILL.md` | **UI 审查和可访问性** |
|
|
482
|
+
|
|
483
|
+
---
|
|
484
|
+
|
|
485
|
+
# 🔍 REVIEW MODE
|
|
486
|
+
|
|
487
|
+
Review UI code for compliance with web interface best practices.
|
|
488
|
+
|
|
489
|
+
## Review Process
|
|
490
|
+
|
|
491
|
+
1. Read the specified files
|
|
492
|
+
2. Check against all rules
|
|
493
|
+
3. Output findings in terse `file:line` format
|
|
494
|
+
|
|
495
|
+
## Quick Reference
|
|
496
|
+
|
|
497
|
+
| Category | Priority | Key Rules |
|
|
498
|
+
|----------|----------|-----------|
|
|
499
|
+
| Accessibility | **P0** | aria-labels, semantic HTML, keyboard handlers |
|
|
500
|
+
| Focus States | **P0** | focus-visible:ring-*, never remove outline |
|
|
501
|
+
| Forms | **P1** | autocomplete, labels, inline errors |
|
|
502
|
+
| Animation | **P1** | prefers-reduced-motion, transform/opacity only |
|
|
503
|
+
| Performance | **P1** | virtualize lists, preconnect, lazy loading |
|
|
504
|
+
| Images | **P1** | width/height, loading="lazy", alt text |
|
|
505
|
+
| Navigation | **P2** | URL reflects state, confirmation for destructive |
|
|
506
|
+
| Dark Mode | **P2** | color-scheme, theme-color meta |
|
|
507
|
+
| Touch | **P2** | touch-action, overscroll-behavior |
|
|
508
|
+
|
|
509
|
+
## 🔴 Anti-Patterns to Flag (P0)
|
|
510
|
+
|
|
511
|
+
| Pattern | Problem | Fix |
|
|
512
|
+
|---------|---------|-----|
|
|
513
|
+
| `user-scalable=no` | Blocks zoom | Remove |
|
|
514
|
+
| `onPaste` + `preventDefault` | Blocks paste | Remove |
|
|
515
|
+
| `transition: all` | Performance | List properties |
|
|
516
|
+
| `outline-none` without replacement | No focus | Add focus-visible ring |
|
|
517
|
+
| `<div>` with click handler | Not accessible | Use `<button>` |
|
|
518
|
+
| Images without dimensions | Layout shift | Add width/height |
|
|
519
|
+
| Inputs without labels | Screen reader | Add label |
|
|
520
|
+
|
|
521
|
+
## Review Rules
|
|
522
|
+
|
|
523
|
+
### Accessibility (P0)
|
|
524
|
+
|
|
525
|
+
```tsx
|
|
526
|
+
// ❌ Icon button without label
|
|
527
|
+
<button onClick={close}><XIcon /></button>
|
|
528
|
+
|
|
529
|
+
// ✅ With aria-label
|
|
530
|
+
<button onClick={close} aria-label="Close dialog"><XIcon /></button>
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
### Focus States (P0)
|
|
534
|
+
|
|
535
|
+
```css
|
|
536
|
+
/* ❌ Removes focus indicator */
|
|
537
|
+
button:focus { outline: none; }
|
|
538
|
+
|
|
539
|
+
/* ✅ Custom focus indicator */
|
|
540
|
+
button:focus-visible { @apply ring-2 ring-offset-2 ring-blue-500; }
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
### Forms (P1)
|
|
544
|
+
|
|
545
|
+
```tsx
|
|
546
|
+
// ❌ Missing autocomplete
|
|
547
|
+
<input type="email" />
|
|
548
|
+
|
|
549
|
+
// ✅ With autocomplete
|
|
550
|
+
<input type="email" autocomplete="email" />
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
### Animation (P1)
|
|
554
|
+
|
|
555
|
+
```css
|
|
556
|
+
/* ❌ Ignores motion preference */
|
|
557
|
+
.card { transition: all 0.3s; }
|
|
558
|
+
|
|
559
|
+
/* ✅ Respects motion preference */
|
|
560
|
+
.card { transition: transform 0.3s, opacity 0.3s; }
|
|
561
|
+
@media (prefers-reduced-motion: reduce) {
|
|
562
|
+
.card { transition: none; }
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### Performance (P1)
|
|
567
|
+
|
|
568
|
+
- Virtualize lists >50 items
|
|
569
|
+
- No layout reads in render
|
|
570
|
+
- Preconnect/preload critical assets
|
|
571
|
+
|
|
572
|
+
## Review Output Contract
|
|
573
|
+
|
|
574
|
+
```markdown
|
|
575
|
+
## UI Review: [filename]
|
|
576
|
+
|
|
577
|
+
### Issues Found
|
|
578
|
+
| Priority | Line | Issue | Fix |
|
|
579
|
+
|----------|------|-------|-----|
|
|
580
|
+
| P0 | 15 | Missing aria-label | Add aria-label="Close" |
|
|
581
|
+
| P1 | 42 | transition: all | List specific properties |
|
|
582
|
+
|
|
583
|
+
### Summary
|
|
584
|
+
- P0 (Critical): X issues
|
|
585
|
+
- P1 (Important): X issues
|
|
586
|
+
- P2 (Recommended): X issues
|
|
587
|
+
```
|