File contents 1 --- 2 name: design-system 3 description: 提供设计系统的标准规范,包括设计原则、视觉风格、组件库等。Invoke when designing new features or components for the application. 4 --- 5 6 # 设计系统规范 7 8 ## 1. 设计原则 9 10 ### 1.1 核心原则 11 12 - **简洁性**:保持设计简洁明了,减少视觉干扰 13 - **一致性**:确保整个应用的设计风格一致 14 - **可用性**:优先考虑用户体验和易用性 15 - **可访问性**:确保所有用户都能访问和使用应用 16 - **响应式**:适配不同屏幕尺寸和设备 17 18 ### 1.2 设计理念 19 20 - **以人为本**:以用户需求为中心,设计符合用户期望的界面 21 - **功能驱动**:设计应服务于功能,而非为了设计而设计 22 - **持续改进**:根据用户反馈和使用数据不断优化设计 23 24 ## 2. 视觉风格 25 26 ### 2.1 色彩系统 27 28 #### 2.1.1 主色调 29 - **主色**:绿色系列(`#10B981` - `#059669`) 30 - **辅助色**:蓝色系列(`#3B82F6` - `#2563EB`)、紫色系列(`#8B5CF6` - `#7C3AED`) 31 - **中性色**:灰色系列(`#F9FAFB` - `#111827`) 32 33 #### 2.1.2 语义色彩 34 - **成功**:绿色(`#10B981`) 35 - **警告**:黄色(`#F59E0B`) 36 - **错误**:红色(`#EF4444`) 37 - **信息**:蓝色(`#3B82F6`) 38 39 ### 2.2 字体系统 40 41 #### 2.2.1 字体选择 42 - **主要字体**:无衬线字体,如 `Inter` 或系统默认无衬线字体 43 - **次要字体**:等宽字体,用于代码和数据展示 44 45 #### 2.2.2 字体大小 46 - **标题**:`text-2xl`(24px)、`text-xl`(20px)、`text-lg`(18px) 47 - **正文**:`text-base`(16px) 48 - **辅助文字**:`text-sm`(14px)、`text-xs`(12px) 49 50 #### 2.2.3 字重 51 - **粗体**:`font-bold`(700) 52 - **中等**:`font-medium`(500) 53 - **常规**:`font-normal`(400) 54 55 ### 2.3 间距系统 56 57 - **基础间距**:4px 为一个单位 58 - **常用间距**:`p-4`(16px)、`m-4`(16px)、`space-x-4`(16px) 59 - **响应式间距**:根据屏幕尺寸调整间距 60 61 ### 2.4 阴影系统 62 63 - **轻微阴影**:`shadow-sm` 64 - **中等阴影**:`shadow` 65 - **重度阴影**:`shadow-lg`、`shadow-xl` 66 67 ### 2.5 圆角系统 68 69 - **小圆角**:`rounded`(4px) 70 - **中等圆角**:`rounded-md`(6px) 71 - **大圆角**:`rounded-lg`(8px)、`rounded-xl`(12px) 72 73 ## 3. 组件库 74 75 ### 3.1 基础组件 76 77 #### 3.1.1 按钮 78 - **主要按钮**:`bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded-md shadow hover:shadow-lg transition-all duration-200` 79 - **成功按钮**:`bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-md shadow hover:shadow-lg transition-all duration-200` 80 - **危险按钮**:`bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-md shadow hover:shadow-lg transition-all duration-200` 81 - **次要按钮**:`bg-gray-200 hover:bg-gray-300 text-gray-800 px-4 py-2 rounded-md shadow hover:shadow-lg transition-all duration-200` 82 83 #### 3.1.2 输入框 84 - **基础输入框**:`w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent` 85 - **错误状态**:`border-red-500 focus:ring-red-500` 86 - **禁用状态**:`bg-gray-100 cursor-not-allowed` 87 88 #### 3.1.3 选择框 89 - **基础选择框**:`w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent` 90 91 #### 3.1.4 卡片 92 - **基础卡片**:`bg-white p-6 rounded-lg shadow` 93 - **悬停效果**:`hover:shadow-lg transition-all duration-200` 94 95 #### 3.1.5 表格 96 - **基础表格**:`min-w-full divide-y divide-gray-200` 97 - **表头**:`bg-gray-50` 98 - **表体**:`bg-white divide-y divide-gray-200` 99 - **行悬停**:`hover:bg-gray-50` 100 101 ### 3.2 布局组件 102 103 #### 3.2.1 容器 104 - **固定宽度容器**:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8` 105 - **流体容器**:`w-full px-4` 106 107 #### 3.2.2 网格 108 - **基础网格**:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4` 109 110 #### 3.2.3 弹性布局 111 - **基础弹性布局**:`flex items-center justify-between` 112 - **垂直弹性布局**:`flex flex-col` 113 114 ### 3.3 导航组件 115 116 #### 3.3.1 头部导航 117 - **基础头部**:`bg-white shadow h-16` 118 - **内容布局**:`flex items-center justify-between` 119 120 #### 3.3.2 侧边导航 121 - **基础侧边栏**:`w-64 bg-white shadow-md` 122 - **导航项**:`px-4 py-3 hover:bg-gray-100` 123 124 ### 3.4 反馈组件 125 126 #### 3.4.1 提示框 127 - **成功提示**:`bg-green-100 text-green-800 p-4 rounded-md` 128 - **错误提示**:`bg-red-100 text-red-800 p-4 rounded-md` 129 - **警告提示**:`bg-yellow-100 text-yellow-800 p-4 rounded-md` 130 - **信息提示**:`bg-blue-100 text-blue-800 p-4 rounded-md` 131 132 #### 3.4.2 加载状态 133 - **基础加载**:`flex justify-center items-center` 134 - **加载动画**:使用 spinner 动画 135 136 ## 4. 页面设计 137 138 ### 4.1 页面布局 139 140 - **基础布局**:Header + Main + Footer 141 - **内容区域**:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8` 142 - **响应式布局**:适配不同屏幕尺寸 143 144 ### 4.2 页面类型 145 146 #### 4.2.1 列表页面 147 - **布局**:筛选器 + 列表 + 分页 148 - **表格**:使用标准表格组件 149 - **操作**:每行提供编辑、删除等操作 150 151 #### 4.2.2 详情页面 152 - **布局**:头部信息 + 详情内容 + 相关操作 153 - **信息展示**:使用卡片和表格展示信息 154 155 #### 4.2.3 表单页面 156 - **布局**:表单标题 + 表单内容 + 操作按钮 157 - **表单控件**:使用标准输入框、选择框等组件 158 - **验证**:实时表单验证和错误提示 159 160 ### 4.3 页面示例 161 162 #### 4.3.1 登录页面 163 - **布局**:居中表单,包含邮箱、密码输入框和登录按钮 164 - **样式**:使用卡片组件,添加适当的阴影和间距 165 166 #### 4.3.2 首页 167 - **布局**:网格布局,展示功能卡片 168 - **样式**:使用卡片组件,添加悬停效果 169 170 #### 4.3.3 家族管理页面 171 - **布局**:顶部操作栏 + 家族列表表格 172 - **样式**:使用表格组件,添加适当的间距和阴影 173 174 ## 5. 图标系统 175 176 ### 5.1 图标选择 177 - **图标库**:使用 Heroicons 或其他现代图标库 178 - **风格**:线性图标,保持一致性 179 - **大小**:根据使用场景选择适当的图标大小 180 181 ### 5.2 图标使用 182 - **导航图标**:16px - 20px 183 - **操作图标**:14px - 16px 184 - **状态图标**:12px - 14px 185 186 ## 6. 交互设计 187 188 ### 6.1 微交互 189 190 - **按钮悬停**:轻微放大和阴影变化 191 - **输入框聚焦**:边框和阴影变化 192 - **卡片悬停**:轻微上浮和阴影加深 193 194 ### 6.2 动画效果 195 196 - **页面过渡**:平滑的页面切换动画 197 - **元素进入**:淡入、滑动等动画效果 198 - **加载状态**:旋转、脉冲等动画效果 199 200 ### 6.3 反馈机制 201 202 - **操作反馈**:成功/失败提示 203 - **加载反馈**:加载动画 204 - **错误反馈**:错误提示和表单验证 205 206 ## 7. 响应式设计 207 208 ### 7.1 断点设计 209 210 - **移动端**:< 640px 211 - **平板**:640px - 1024px 212 - **桌面**:> 1024px 213 214 ### 7.2 适配策略 215 216 - **移动端**:单列布局,简化导航 217 - **平板**:双列布局,适当调整间距 218 - **桌面**:多列布局,充分利用空间 219 220 ### 7.3 触摸优化 221 222 - **触摸目标**:至少 44px × 44px 223 - **间距**:适当增加触摸元素之间的间距 224 - **手势**:支持常见的触摸手势 225 226 ## 8. 设计工具 227 228 ### 8.1 设计软件 229 - **Figma**:用于UI设计和原型制作 230 - **Sketch**:用于UI设计 231 - **Adobe XD**:用于UI设计和原型制作 232 233 ### 8.2 协作工具 234 - **Zeplin**:用于设计规范和资产交付 235 - **InVision**:用于原型分享和反馈 236 237 ## 9. 设计流程 238 239 ### 9.1 设计阶段 240 241 1. **需求分析**:理解功能需求和用户需求 242 2. **低保真原型**:创建简单的线框图 243 3. **高保真原型**:创建详细的设计稿 244 4. **设计评审**:团队评审设计方案 245 5. **设计交付**:向开发团队交付设计规范和资产 246 247 ### 9.2 设计规范维护 248 249 - **版本控制**:使用Git或其他版本控制工具 250 - **定期更新**:根据产品迭代更新设计规范 251 - **反馈收集**:收集用户和开发团队的反馈 252 253 ## 10. 页面统一规范 254 255 ### 10.1 页面布局统一 256 257 所有页面应遵循统一的布局结构: 258 259 ``` 260 ┌─────────────────────────────────────────────────────────────┐ 261 │ Header (统一头部导航) │ 262 │ - 返回按钮 + 页面标题 + 操作按钮 + 用户信息 │ 263 ├─────────────────────────────────────────────────────────────┤ 264 │ │ 265 │ Main Content (主内容区) │ 266 │ - 统一容器: max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 │ 267 │ - 背景色: bg-gray-50 │ 268 │ │ 269 ├─────────────────────────────────────────────────────────────┤ 270 │ Footer (可选) │ 271 └─────────────────────────────────────────────────────────────┘ 272 ``` 273 274 ### 10.2 组件样式统一 275 276 #### 按钮规范 277 278 | 按钮类型 | Tailwind 类名 | 279 |----------|---------------| 280 | 主要按钮 | `px-4 py-2 bg-green-500 text-white rounded-md hover:bg-green-600 shadow-md hover:shadow-lg transition-all duration-200` | 281 | 次要按钮 | `px-4 py-2 bg-gray-200 text-gray-800 rounded-md hover:bg-gray-300 shadow-md hover:shadow-lg transition-all duration-200` | 282 | 危险按钮 | `px-4 py-2 bg-red-500 text-white rounded-md hover:bg-red-600 shadow-md hover:shadow-lg transition-all duration-200` | 283 284 #### 表单规范 285 286 | 元素 | Tailwind 类名 | 287 |------|---------------| 288 | 输入框 | `w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent` | 289 | 选择框 | `w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent` | 290 | 错误状态 | `border-red-500 focus:ring-red-500` | 291 292 #### 卡片规范 293 294 | 元素 | Tailwind 类名 | 295 |------|---------------| 296 | 基础卡片 | `bg-white p-6 rounded-lg shadow` | 297 | 悬停卡片 | `bg-white p-6 rounded-lg shadow hover:shadow-lg transition-all duration-200` | 298 | 选中卡片 | `border-2 border-green-500 bg-green-50` | 299 300 #### 表格规范 301 302 | 元素 | Tailwind 类名 | 303 |------|---------------| 304 | 表格容器 | `min-w-full divide-y divide-gray-200` | 305 | 表头 | `bg-gray-50` | 306 | 行悬停 | `hover:bg-gray-50` | 307 308 ### 10.3 页面统一范围 309 310 | 页面类别 | 包含页面 | 统一内容 | 311 |----------|----------|----------| 312 | 认证页面 | 登录页、注册页 | 表单样式、按钮样式、错误提示 | 313 | 首页 | 首页 | 卡片样式、导航交互 | 314 | 家族管理 | 家族管理页、家族树页 | 家族选择器、操作按钮、数据展示 | 315 | 成员管理 | 成员列表页、成员详情页、成员搜索页 | 成员卡片、列表样式、编辑表单 | 316 | 关系管理 | 关系管理页 | 关系选择器、表单布局 | 317 | 历史记录 | 历史记录页、成员大事件页 | 时间轴样式、事件卡片 | 318 | 多媒体 | 多媒体库页 | 网格布局、媒体卡片、上传交互 | 319 | 系统管理 | 操作日志页、项目进度页 | 表格样式、筛选器 | 320 | AI功能 | AI关系分析页、家族故事页、图片导入页 | 结果展示、加载状态 | 321 | 地图功能 | 成员位置页 | 地图容器、标记样式 | 322 | 个人中心 | 个人信息页 | 表单样式、头像上传 | 323 324 ### 10.4 交互反馈统一 325 326 #### 加载状态 327 328 | 场景 | 样式 | 329 |------|------| 330 | 页面加载 | `flex justify-center py-8` + 旋转动画 | 331 | 旋转动画 | `animate-spin rounded-full h-12 w-12 border-b-2 border-green-500` | 332 333 #### Toast提示 334 335 | 类型 | 颜色 | 用途 | 336 |------|------|------| 337 | success | 绿色背景 | 操作成功 | 338 | error | 红色背景 | 操作失败 | 339 | warning | 黄色背景 | 警告信息 | 340 | info | 蓝色背景 | 一般信息 | 341 342 ## 11. 最佳实践 343 344 - **组件复用**:使用设计系统中的组件,保持一致性 345 - **设计系统维护**:定期更新和优化设计系统 346 - **用户测试**:进行用户测试,验证设计效果 347 - **性能考虑**:设计时考虑性能影响,如图片大小和动画复杂度 348 - **可访问性**:确保设计符合可访问性标准 349 - **页面统一**:遵循页面统一规范,确保所有页面风格一致 350 351 通过遵循本设计系统规范,可以确保应用的设计风格一致、用户体验良好,同时提高设计和开发效率。
bage2014/study/tree/main/study-ai-myapp-fimaly/.trae/skills/design-system commit 7fe6ac463e
Frequently asked questions How do I install the Design System skill? Run npx skillmds@latest add bage2014/design-system in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Design System skill do? 提供设计系统的标准规范,包括设计原则、视觉风格、组件库等。Invoke when designing new features or components for the application. It is listed under Coding & Dev Tools on SkillMD.
Is Design System safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Design System? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Design System free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Design System? bage2014 (@bage2014) published this skill. Their other Agent Skills are listed on their SkillMD profile.