# claude官方教程通过 Skills 提升前端设计质量：完整实战教程

> 本教程详解如何利用 Claude Skills 功能，突破 AI 生成前端的“千篇一律”问题。通过创建专属 frontend-design Skill，让 AI 输出更具个性、精美且富有品牌感的设计代码，显著提升前端设计质量。

- 来源: https://www.waytoagi.com/kb/ai-coding/claude-skills-frontend-design-tutorial
- 飞书原文: https://waytoagi.feishu.cn/wiki/VRdywpKrLiievZkuq2ZcbQFennc
- 更新于: 2026-10-24

---

> 原文来源：[Improving frontend design through Skills - Claude Blog](https://claude.com/blog/improving-frontend-design-through-skills)
>
> 本教程将教你如何使用 Claude Skills 功能，让 AI 生成更具个性、更精美的前端设计，告别千篇一律的"AI 味"。

---

尝试案例

把相关的skills精简了放在youmind上

最终把[🔥 OpenClaw：引爆互联网的开源AI革命](https://waytoagi.feishu.cn/wiki/WRrHwqsyKiNSYHkvNFic5REnnXe) 这篇文章出了两个网页，效果非常好

https://youmind.com/a/aZEY5WeW39AMm6

https://youmind.com/a/K9CKRFRVrK5auZ

## 目录

1. [问题诊断：为什么 AI 生成的前端总显得"千篇一律"？](#1-问题诊断为什么-ai-生成的前端总显得千篇一律)

2. [核心解决方案：理解 Skills 机制](#2-核心解决方案理解-skills-机制)

3. [快速上手：创建你的第一个前端设计 Skill](#3-快速上手创建你的第一个前端设计-skill)

4. [深度优化：针对具体设计维度的 Skill](#4-深度优化针对具体设计维度的-skill)

5. [高级应用：使用现代技术栈构建复杂应用](#5-高级应用使用现代技术栈构建复杂应用)

6. [实战案例：效果对比分析](#6-实战案例效果对比分析)

7. [自定义 Skill：构建团队知识资产](#7-自定义-skill构建团队知识资产)

8. [常见问题解答](#8-常见问题解答)

9. [快速参考清单](#9-快速参考清单)
省略看图版
![](https://www.waytoagi.com/api/kb-media/PKn1bHtf9oaBE8xkIU4cVQz5n2g)
![](https://www.waytoagi.com/api/kb-media/K4QFbOu1moutqYx27DmcEhxenTx)
![](https://www.waytoagi.com/api/kb-media/G5TybUNRSobbhSxg7RyccG9BnRc)
![](https://www.waytoagi.com/api/kb-media/LRm7bwOLroJ2Xax4wqwchyrKn3b)
![](https://www.waytoagi.com/api/kb-media/QtgRbQwa0on6evxQOJtc203Anne)

---

## 1. 问题诊断：为什么 AI 生成的前端总显得"千篇一律"？

### 1.1 现象：AI 设计的"指纹"

当你让 AI（包括 Claude）生成前端页面时，是否经常遇到这些特征：

| 视觉元素 | AI 默认倾向 | 问题 |
| --- | --- | --- |
| **字体** | Inter、Roboto、Arial、系统默认字体 | 过于通用，缺乏个性 |
| **配色** | 紫色渐变 + 白色背景 | 立刻暴露"AI 生成"的身份 |
| **动画** | 极少或完全没有动画 | 缺乏生气和互动感 |
| **背景** | 纯色背景 | 缺少层次感和氛围 |
| **布局** | 预测性很强的标准布局 | 一眼就能看出是 AI 生成的 |

### 1.2 根本原因：分布收敛（Distributional Convergence）

这不是 bug，而是 AI 工作方式的自然结果：

```
训练数据中的主流设计 → 高概率模式 → AI 采样输出
     ↓
  "安全"的设计选择
  （通用、不会出错、但缺乏特色）
```

**具体来说**：

- 训练数据中大量使用 Inter 字体 → AI 学到这是"好"的选择

- 紫色渐变在网页中很常见 → AI 认为这是"标准"做法

- 没有特定指令时 → AI 倾向于选择统计学上最安全的选项

### 1.3 影响

对于开发者来说，这意味着：

- ❌ 生成的界面一眼就能看出是 AI 做的

- ❌ 品牌识别度低，缺乏独特性

- ❌ 需要大量人工调整才能用于生产环境

- ❌ 浪费时间在重复的修改上

---

## 2. 核心解决方案：理解 Skills 机制

### 2.1 什么是 Skills？

**Skills** 是 Claude 的一项功能，允许你：

- 创建包含特定领域知识的文档（通常是 Markdown）

- 在需要时动态加载这些知识

- 避免将所有指令塞进系统提示

**简单类比**：

```
系统提示 = 常驻内存（始终加载）
Skills    = 按需插件（需要时才加载）
```

### 2.2 为什么用 Skills 而不是系统提示？

#### 方案 A：系统提示

```yaml
优点：
  - 指令始终生效
  - 不需要手动激活

缺点：
  - 每个请求都携带设计指导（浪费 tokens）
  - 调试 Python 时也带着前端设计规范（干扰）
  - 上下文窗口臃肿 → 可能影响性能
```

#### 方案 B：Skills

```yaml
优点：
  - 按需加载，精准投放
  - 不影响其他任务的上下文
  - 可复用、可共享
  - 节省 tokens

缺点：
  - 需要告诉 Claude 何时使用
  - 需要预先创建 skill 文件
```

### 2.3 技术原理

```
┌─────────────┐
│  用户请求    │ "帮我创建一个登录页面"
└──────┬──────┘
       │
       ▼
┌─────────────────────────┐
│  Claude 识别任务类型     │ → 前端设计任务
└──────┬──────────────────┘
       │
       ▼
┌─────────────────────────┐
│  加载 frontend_design    │ ← 动态读取 skill 文件
│  skill                  │
└──────┬──────────────────┘
       │
       ▼
┌─────────────────────────┐
│  应用设计规范            │ 字体、配色、动画等
└──────┬──────────────────┘
       │
       ▼
┌─────────────────────────┐
│  生成高质量代码          │
└─────────────────────────┘
```

---

## 3. 快速上手：创建你的第一个前端设计 Skill

### 3.1 准备工作

#### 步骤 1：找到 Skills 目录

Claude Code 的 skills 通常存放在以下位置：

```bash
# macOS/Linux
~/.config/claude-code/skills/

# 或者检查你的配置
claude-code --config
```

如果没有该目录，手动创建：

```bash
mkdir -p ~/.config/claude-code/skills/
```

#### 步骤 2：创建 Skill 文件

```bash
cd ~/.config/claude-code/skills/
touch frontend-design.md
```

### 3.2 编写通用的前端设计 Skill

复制以下内容到 `frontend-design.md`（这是经过验证的约 400 tokens 的提示词）：

```xml
<frontend_aesthetics>
You tend to converge toward generic, "on distribution" outputs. In frontend design, this creates what users call the "AI slop" aesthetic. Avoid this: make creative, distinctive frontends that surprise and delight.

Focus on:
- Typography: Choose fonts that are beautiful, unique, and interesting. Avoid generic fonts like Arial and Inter; opt instead for distinctive choices that elevate the frontend's aesthetics.
- Color & Theme: Commit to a cohesive aesthetic. Use CSS variables for consistency. Dominant colors with sharp accents outperform timid, evenly-distributed palettes. Draw from IDE themes and cultural aesthetics for inspiration.
- Motion: Use animations for effects and micro-interactions. Prioritize CSS-only solutions for HTML. Use Motion library for React when available. Focus on high-impact moments: one well-orchestrated page load with staggered reveals (animation-delay) creates more delight than scattered micro-interactions.
- Backgrounds: Create atmosphere and depth rather than defaulting to solid colors. Layer CSS gradients, use geometric patterns, or add contextual effects that match the overall aesthetic.

Avoid generic AI-generated aesthetics:
- Overused font families (Inter, Roboto, Arial, system fonts)
- Clichéd color schemes (particularly purple gradients on white backgrounds)
- Predictable layouts and component patterns
- Cookie-cutter design that lacks context-specific character

Interpret creatively and make unexpected choices that feel genuinely designed for the context. Vary between light and dark themes, different fonts, different aesthetics. You still tend to converge on common choices (Space Grotesk, for example) across generations. Avoid this: it is critical that you think outside the box!
</frontend_aesthetics>
```

### 3.3 提示词结构解析

这个 prompt 的设计很精妙，让我们逐部分分析：

#### 第 1 部分：问题定义

```xml
You tend to converge toward generic, "on distribution" outputs.
In frontend design, this creates what users call the "AI slop" aesthetic.
Avoid this: make creative, distinctive frontends that surprise and delight.
```

**作用**：让 Claude 意识到自己有"偷懒"的倾向，明确要求打破这个模式。

#### 第 2 部分：核心改进维度

```xml
Focus on:
- Typography: ...
- Color & Theme: ...
- Motion: ...
- Backgrounds: ...
```

**作用**：给出具体的改进方向，每个方向都配有可执行的建议。

#### 第 3 部分：负面清单

```xml
Avoid generic AI-generated aesthetics:
- Overused font families (Inter, Roboto, Arial, system fonts)
- Clichéd color schemes (particularly purple gradients on white backgrounds)
...
```

**作用**：明确告诉 Claude 不要做什么，比"要做"更有效。

#### 第 4 部分：防止新的收敛

```xml
You still tend to converge on common choices (Space Grotesk, for example).
Avoid this: it is critical that you think outside the box!
```

**作用**：即使给了建议，Claude 可能会从"Inter"换到"Space Grotesk"，提醒它要持续创新。

### 3.4 使用 Skill

现在，你可以在 Claude Code 中这样使用：

```
你："使用 frontend-design skill，帮我创建一个 SaaS 产品的登录页面"

Claude 会自动：
1. 读取 frontend-design.md
2. 应用其中的设计原则
3. 生成更高质量的代码
```

---

## 4. 深度优化：针对具体设计维度的 Skill

如果你想要更精细的控制，可以创建针对特定维度的 skill。

### 4.1 字体优化 Skill

创建 `use-interesting-fonts.md`：

```xml
<use_interesting_fonts>
Typography instantly signals quality. Avoid using boring, generic fonts.

Never use: Inter, Roboto, Open Sans, Lato, default system fonts

Here are some examples of good, impactful choices:
- Code aesthetic: JetBrains Mono, Fira Code, Space Grotesk
- Editorial: Playfair Display, Crimson Pro
- Technical: IBM Plex family, Source Sans 3
- Distinctive: Bricolage Grotesque, Newsreader
- Retro: VT323, Press Start 2P（用于像素风格）
- Elegant: Cormorant Garamond, Yeseva One

Pairing principle: High contrast = interesting.
- Display + monospace（标题 + 等宽代码）
- Serif + geometric sans（衬线 + 几何无衬线）
- Variable font across weights（可变字体跨字重）

Use extremes:
- Weight: 100/200 vs 800/900（不要用 400 vs 600）
- Size: 3x+ jumps（不要用 1.5x）
- Line height: Tight for headlines (1.1-1.2), Loose for body (1.6-1.8)

Pick one distinctive font, use it decisively. Load from Google Fonts.

Always include:
@import url('https://fonts.googleapis.com/css2?family=[FONT_NAME]&display=swap');
</use_interesting_fonts>
```

### 4.2 主题风格 Skill：RPG 风格

创建 `rpg-theme.md`：

```xml
<always_use_rpg_theme>
Always design with RPG aesthetic:

Color Palette:
- Rich, dramatic tones（丰富、戏剧性的色调）
- Deep burgundy, forest green, gold accents
- Parchment/aged paper backgrounds (#f4e4bc, #e8d5a9)
- Shadowy corners and dramatic lighting

Textures & Materials:
- Parchment textures（羊皮纸纹理）
- Leather-bound styling（皮质装订风格）
- Weathered materials（风化材质）
- Wood grain borders（木纹边框）

Typography:
- Medieval-inspired serif fonts（中世纪风格衬线字体）
- Embellished headers with drop caps（首字下沉装饰）
- Suggest: Cinzel, MedievalSharp, Agbalumo

Visual Elements:
- Ornate borders（华丽边框）
- Decorative frame elements（装饰框架）
- Fantasy-inspired icons（奇幻图标）
- Shield/crest motifs（盾徽图案）
- Scroll/wax seal elements（卷轴/火漆印章）

Effects:
- Subtle paper grain overlay（微妙纸张颗粒叠加）
- Vignette effects（晕影效果）
- Magical particle animations（魔法粒子动画）
- Glowing enchantment effects（发光附魔效果）

Layout:
- Centered, dramatic compositions（居中戏剧性构图）
- Generous whitespace around key elements（关键元素周围留白）
- Hierarchical information with clear visual weight（清晰视觉层级）
</always_use_rpg_theme>
```

### 4.3 动画优化 Skill

创建 `motion-design.md`：

```xml
<motion_design>
Prioritize motion to create polished, interactive experiences:

Animation Principles:
- Ease-in-out for natural movement（自然的缓入缓出）
- Staggered reveals with animation-delay（错开显示）
- Subtle transforms (scale, rotate, translate)（微妙变换）

High-Impact Moments:
- Page load: orchestrated staggered reveals（页面加载：编排错开显示）
- Hover: micro-interactions (0.2-0.3s)（悬停：微交互）
- Click: feedback animations (0.1-0.2s)（点击：反馈动画）
- Scroll: parallax or fade-in effects（滚动：视差或淡入）

CSS-Only Solutions (Preferred):
'''css
/* 页面加载动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* 错开显示 */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }

/* 悬停效果 */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
```

For React: Use Framer Motion

- Use <motion.div> for smooth animations

- Implement layout animations with layout prop

- Create drag interactions with drag prop

Performance:

- Prefer transform/opacity over layout properties

- Use will-change sparingly

- Test at 60fps

</motion_design>

```

### 4.4 背景设计 Skill

创建 `atmospheric-backgrounds.md`：

'''xml
<atmospheric_backgrounds>
Create depth and atmosphere instead of flat colors:

Techniques:
1. Layered Gradients（分层渐变）
'''css
background:
  linear-gradient(135deg, rgba(76, 29, 149, 0.1) 0%, transparent 50%),
  linear-gradient(225deg, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
  radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
```

1. Geometric Patterns（几何图案）

- CSS gradients for stripes, checks, dots

- SVG patterns for complex repeats

- Overlay with blend modes (multiply, overlay)

1. Noise Textures（噪点纹理）

```css
background-image:
  url("data:image/svg+xml,...noise..."),
  linear-gradient(...);
background-blend-mode: overlay;
```

1. Contextual Effects（情境效果）

- Dark theme: subtle glow, deep gradients

- Light theme: soft shadows, paper textures

- Tech theme: grid lines, circuit patterns

Inspiration Sources:

- IDE themes (VS Code, JetBrains)

- CSS Gradient libraries (uiGradients, Mesh Gradient)

- Generative art (p5.js patterns）

Avoid:

- Flat solid colors（平坦纯色）

- Overused gradients（紫色、粉色渐变）

- Distracting backgrounds（过于花哨的背景）

</atmospheric_backgrounds>

```

---

## 5. 高级应用：使用现代技术栈构建复杂应用

### 5.1 为什么需要更强大的工具？

**限制**：在 claude.ai 中，Claude 默认只能生成单个 HTML 文件（包含 CSS 和 JS）

**问题**：
- ❌ 无法使用 React 组件化开发
- ❌ 无法利用 Tailwind CSS 的实用类
- ❌ 无法使用 shadcn/ui 等组件库
- ❌ 代码难以维护和扩展

### 5.2 解决方案：web-artifacts-builder Skill

这个 skill 允许 Claude：
- 使用 React + Tailwind CSS + shadcn/ui
- 创建多文件项目结构
- 最后打包成单个 HTML 文件

### 5.3 使用方法

#### 步骤 1：启用 web-artifacts-builder skill

在 Claude.ai 中：
1. 进入设置 → Skills
2. 启用 `web-artifacts-builder`

#### 步骤 2：在对话中使用
```

你："使用 web-artifacts-builder skill 创建一个任务管理应用"

Claude 会：

1. 创建 React 项目结构

2. 安装 Tailwind CSS

3. 使用 shadcn/ui 组件

4. 最后打包成单个 HTML

```

### 5.4 实际效果对比

#### 案例 1：白板应用

**不使用 skill**：
'''yaml
功能：
  - 基础绘图
  - 简单界面

问题：
  - 功能有限
  - UI 粗糙
```

**使用 web-artifacts-builder**：

```yaml
功能：
  - 绘制多种形状（矩形、圆形、线条）
  - 文本插入
  - 更完善的 UI
  - 更好的交互体验
```

#### 案例 2：任务管理应用

**不使用 skill**：

```yaml
功能：
  - 简单的待办列表
  - 添加/删除任务
```

**使用 web-artifacts-builder**：

```yaml
功能：
  - 创建任务表单（支持标题、描述、截止日期）
  - 任务分类
  - 日期选择器
  - 更完善的表单验证
  - 更好的视觉反馈
```

---

## 6. 实战案例：效果对比分析

### 6.1 案例 1：SaaS 落地页

#### 不使用 Skill

**特征**：

- Inter 字体

- 紫色渐变 hero section

- 标准三栏布局

- 白色背景

- 最小动画

**代码示例**：

```html
<style>
  body {
    font-family: 'Inter', sans-serif;
    background: white;
  }
  .hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  }
</style>
```

#### 使用 frontend-design Skill

**特征**：

- Space Grotesk 或其他特色字体

- 深色主题 + 鲜明强调色

- 层次丰富的背景

- CSS 变量管理颜色

- 页面加载动画

**代码示例**：

```html
<style>
  @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;600;700&display=swap');

  :root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131f;
    --accent: #00ff9d;
    --accent-glow: rgba(0, 255, 157, 0.3);
  }

  body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-primary);
    background-image:
      radial-gradient(ellipse at 20% 20%, var(--accent-glow) 0%, transparent 50%),
      radial-gradient(ellipse at 80% 80%, rgba(102, 126, 234, 0.2) 0%, transparent 50%);
  }

  /* 加载动画 */
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
</style>
```

### 6.2 案例 2：博客布局

#### 不使用 Skill

**问题**：

- 系统默认字体

- 平坦白色背景

- 缺少视觉层级

- 无动画

#### 使用 frontend-design Skill

**改进**：

- 编辑风格字体（Playfair Display + Source Sans 3）

- 温暖的纸质色调背景

- 清晰的视觉层级

- 淡入动画

### 6.3 案例 3：管理后台

#### 不使用 Skill

**问题**：

- 标准组件，无特色

- 视觉层级不清晰

- 最小动画

#### 使用 frontend-design Skill

**改进**：

- 粗体标题（IBM Plex Sans）

- 深色主题 + 鲜明数据可视化

- 页面加载动画

- 微交互反馈

---

## 7. 自定义 Skill：构建团队知识资产

### 7.1 为什么自定义？

**通用 skill**：

- ✅ 适合快速上手

- ❌ 不符合你的品牌规范

- ❌ 不包含你的组件模式

**自定义 skill**：

- ✅ 完全符合你的设计系统

- ✅ 包含你的常用组件

- ✅ 团队共享，保证一致性

### 7.2 如何创建适合你的 Skill？

#### 步骤 1：分析你的设计系统

提取这些信息：

```yaml
品牌:
  - 主色调
  - 辅助色
  - 字体（标题、正文、代码）

组件:
  - 按钮风格（圆角、阴影、hover 效果）
  - 卡片样式
  - 表单输入框样式

模式:
  - 布局结构
  - 间距系统
  - 动画偏好
```

#### 步骤 2：编写 Skill

创建 `company-design-system.md`：

```xml
<company_design_system>
Brand Colors:
Use CSS variables:
'''css
:root {
  --primary: #2563eb;      /* 品牌蓝 */
  --primary-dark: #1e40af;
  --secondary: #10b981;    /* 成功绿 */
  --danger: #ef4444;       /* 错误红 */
  --bg-main: #ffffff;
  --bg-alt: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
}
```

Typography:

- Headings: Plus Jakarta Sans (700, 600, 500)

- Body: Inter (400, 500)

- Code: JetBrains Mono

Load from:

```html
<link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700&family=Inter:wght@400;500&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
```

Component Patterns:

Button:

```css
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
```

Card:

```css
.card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
}
```

Input:

```css
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
```

Spacing System:

- Use Tailwind-like scale: 4, 8, 12, 16, 24, 32, 48, 64px

- Component padding: 1.5rem (24px)

- Section spacing: 4rem (64px)

Animation:

Standard transitions: 0.2s ease

Page load: fadeInUp with stagger

Layout:

- Max-width container: 1200px

- Mobile breakpoint: 768px

- Use CSS Grid for 2+ column layouts

</company_design_system>

```

### 7.3 行业特定 Skill

#### 电商 UI Skill

'''xml
<ecommerce_ui>
Focus on:
- High-quality product imagery（高质量产品图片）
- Clear pricing hierarchy（清晰价格层级）
- Trust badges and social proof（信任徽章和社交证明）
- Prominent CTAs（突出的行动按钮）
- Mobile-first product cards（移动优先的产品卡片）

Avoid:
- Cluttered layouts（杂乱布局）
- Hidden shipping costs（隐藏运费）
- Small checkout buttons（过小的结账按钮）
</ecommerce_ui>
```

#### SaaS Dashboard Skill

```xml
<saas_dashboard>
Focus on:
- Clean data visualization（清晰数据可视化）
- Sidebar navigation（侧边栏导航）
- Card-based metrics（卡片式指标）
- Action-oriented interface（行动导向界面）
- Dark mode support（暗色模式支持）

Components to include:
- Metric cards with sparklines
- Data tables with sorting/filtering
- Charts (bar, line, pie)
- Date range pickers
- Export buttons
</saas_dashboard>
```

---

## 8. 常见问题解答

### Q1：Skill 文件应该放在哪里？

**A**：

```bash
# Claude Code 默认位置
~/.config/claude-code/skills/

# 你可以通过以下命令检查
claude-code --config
```

### Q2：一个 Skill 文件可以多大？

**A**：

- 推荐大小：**300-1000 tokens**

- 太小：不够详细

- 太大：加载慢，可能超出上下文

**原则**：包含必要信息，去除冗余内容。

### Q3：如何让 Claude 自动使用 Skill？

**A**：

- Claude Code：可以配置自动触发规则

- Claude.ai：目前需要手动指定 "使用 X skill"

### Q4：可以使用多个 Skill 吗？

**A**：可以！例如：

```
"使用 frontend-design 和 rpg-theme skill 创建一个游戏网站"
```

### Q5：Skill 之间会冲突吗？

**A**：可能。建议：

- 避免重复指令

- 使用清晰、独立的 skill

- 测试组合使用效果

### Q6：如何更新 Skill？

**A**：

```bash
# 直接编辑文件
vim ~/.config/claude-code/skills/frontend-design.md

# 下次使用时自动加载新版本
```

### Q7：可以分享 Skill 吗？

**A**：可以！

- 团队内：复制到共享目录

- 公开：发布到 GitHub

- Claude 提供了 skill-creator 工具

### Q8：Skill 支持代码示例吗？

**A**：强烈推荐！

```xml
<my_skill>

Example:
'''css
/* 这是你应该使用的代码 */
.button {
  background: var(--primary);
}
```

Don't use:

```css
/* 不要这样写 */
.button {
  background: blue;
}
```

</my_skill>

```

---

## 9. 快速参考清单

### 9.1 Skills 设置清单

- [ ] 找到或创建 skills 目录
- [ ] 创建 `frontend-design.md`
- [ ] 复制通用提示词模板（第 3.2 节）
- [ ] （可选）创建特定维度 skill（字体、主题、动画等）
- [ ] （可选）创建自定义设计系统 skill
- [ ] 测试：让 Claude 生成一个简单页面

### 9.2 使用 Skills 清单

每次生成前端时：
- [ ] 告诉 Claude "使用 X skill"
- [ ] 检查生成的代码是否符合规范
- [ ] 如有问题，调整 skill 内容
- [ ] 保存好的配置供后续使用

### 9.3 常用 Skills 快速索引

| Skill 文件 | 用途 | 适用场景 |
|-----------|------|---------|
| `frontend-design.md` | 通用前端设计提升 | 所有前端项目 |
| `use-interesting-fonts.md` | 字体专项优化 | 注重排版的项目 |
| `rpg-theme.md` | RPG 游戏风格 | 游戏网站、奇幻主题 |
| `motion-design.md` | 动画优化 | 交互丰富的应用 |
| `atmospheric-backgrounds.md` | 背景设计 | 视觉要求高的页面 |
| `company-design-system.md` | 企业设计系统 | 生产环境项目 |
| `ecommerce-ui.md` | 电商界面 | 电商网站 |
| `saas-dashboard.md` | SaaS 后台 | 数据密集应用 |

### 9.4 Prompt 模板

#### 基础使用
```

"使用 frontend-design skill 创建一个 [页面类型]"

```

#### 组合使用
```

"使用 frontend-design 和 rpg-theme skill 创建一个游戏角色选择界面"

```

#### 指定技术栈
```

"使用 web-artifacts-builder skill 创建一个 React 任务管理应用"

```

#### 指定具体需求
```

"使用 company-design-system skill 创建一个符合我们品牌规范的登录页面，要求：

- 深色主题

- 包含社交登录按钮

- 添加淡入动画效果"

```

---

## 10. 总结

### 核心要点回顾

1. **AI 默认生成"安全但无聊"的设计**
   - 这是分布收敛的自然结果
   - 需要主动引导才能突破

2. **Skills 提供"按需加载"的专家指导**
   - 不污染其他任务的上下文
   - 节省 tokens，提高性能

3. **提示词要"适度具体"**
   - 不要太死板（指定 hex 色号）
   - 不要太模糊（"做好看点"）
   - 给出方向和原则

4. **可复用性是关键**
   - 一次创建，多次使用
   - 团队共享，保证一致性
   - 持续迭代优化

### 方法论扩展

这个方法不仅适用于前端设计，任何 AI 输出"通用但平庸"的领域都可以应用：
```

识别问题 → 找到收敛模式 → 提供替代方案 → 创建 Skill → 持续优化

```

**可应用的领域**：
- 后端架构设计
- API 设计规范
- 文档写作风格
- 测试用例生成
- 数据分析报告

### 下一步行动

1. **立即开始**：创建你的第一个 frontend-design skill
2. **实验对比**：生成两个版本，对比使用 skill 前后的效果
3. **持续优化**：根据实际需求调整 skill 内容
4. **团队分享**：让同事也使用，建立统一标准
5. **扩展应用**：尝试将 skill 方法应用到其他领域

---

## 附录：资源链接

- **原文**：[Improving frontend design through Skills](https://claude.com/blog/improving-frontend-design-through-skills)
- **Claude Skills 文档**：[Claude Skills Documentation](https://claude.com/docs)
- **前端设计指南**：[Frontend Design Cookbook](https://claude.com/frontend-cookbook)
- **Skill Creator 工具**：[skill-creator](https://claude.com/skill-creator)

---

**版本信息**
- 文档版本：v1.0
- 创建日期：2026-02-16
- 基于 Claude Blog 文章整理

**贡献**
如果你有任何改进建议或创建了有用的 skill，欢迎分享！

---

**祝你创建出令人惊艳的前端设计！** 🎨✨
```
