npx skills add https://github.com/vudovn/antigravity-kit --skill frontend-design设计哲学: 每个像素都有其目的。克制即是奢华。用户心理学驱动决策。核心原则: 思考,而非记忆。询问,而非假设。
始终阅读 REQUIRED 文件,仅在需要时阅读 OPTIONAL 文件:
| 文件 | 状态 | 何时阅读 |
|---|---|---|
| ux-psychology.md | 🔴 REQUIRED | 始终首先阅读! |
| color-system.md | ⚪ Optional | 颜色/调色板决策时 |
| typography-system.md | ⚪ Optional | 字体选择/配对时 |
| visual-effects.md |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| ⚪ Optional |
| 需要玻璃态、阴影、渐变时 |
| animation-guide.md | ⚪ Optional | 需要动画时 |
| motion-graphics.md | ⚪ Optional | 需要 Lottie、GSAP、3D 时 |
| decision-trees.md | ⚪ Optional | 需要上下文模板时 |
🔴 ux-psychology.md = 必须阅读。其他文件 = 仅在相关时阅读。
执行以下脚本进行审核(无需阅读,直接运行):
| 脚本 | 目的 | 用法 |
|---|---|---|
scripts/ux_audit.py | UX 心理学与无障碍访问审核 | python scripts/ux_audit.py <project_path> |
停!如果用户的请求是开放式的,切勿默认使用你偏好的方案。
未指定颜色? 询问:
"您偏好哪种配色方案?(蓝色/绿色/橙色/中性/其他?)"
未指定风格? 询问:
"您追求哪种风格?(极简/大胆/复古/未来感/有机?)"
未指定布局? 询问:
"您有偏好的布局吗?(单列/网格/不对称/全宽?)"
| AI 默认倾向 | 为何不好 | 应该思考 |
|---|---|---|
| Bento 网格(现代陈词滥调) | 每个 AI 设计都在用 | 为什么这些内容需要网格? |
| 英雄区左右分割 | 可预测且乏味 | 试试巨型排版或垂直叙事如何? |
| 网格/极光渐变 | 新的"懒惰"背景 | 什么才是激进的颜色搭配? |
| 玻璃态 | AI 眼中的"高级感" | 试试实色、高对比度的扁平风格如何? |
| 深青色 / 金融科技蓝 | 避开紫色禁令的安全港 | 为什么不用红色、黑色或霓虹绿? |
| "编排 / 赋能" | AI 生成的文案 | 人类会怎么说这个? |
| 深色背景 + 霓虹发光 | 过度使用,"AI 风格" | 品牌实际需要什么? |
| 所有元素都圆角 | 通用/安全 | 哪里可以使用尖锐、粗野主义的边缘? |
🔴 "你选择的每一个‘安全’结构,都让你离通用模板更近一步。要敢于冒险。"
在任何设计工作之前,回答这些问题或询问用户:
| 约束 | 问题 | 为何重要 |
|---|---|---|
| 时间线 | 有多少时间? | 决定复杂度 |
| 内容 | 内容已就绪还是占位符? | 影响布局灵活性 |
| 品牌 | 有现有指南吗? | 可能决定颜色/字体 |
| 技术 | 使用什么技术栈? | 影响能力 |
| 受众 | 具体是谁? | 驱动所有视觉决策 |
| 受众 | 思考方向 |
|---|---|
| Z 世代 | 大胆、快速、移动优先、真实 |
| 千禧一代 | 简洁、极简、价值驱动 |
| X 世代 | 熟悉、可信、清晰 |
| 婴儿潮一代 | 可读性强、高对比度、简单 |
| B2B | 专业、数据驱动、信任 |
| 奢侈品 | 克制的优雅、留白 |
| 定律 | 原则 | 应用 |
|---|---|---|
| 希克定律 | 选择越多,决策越慢 | 限制选项,使用渐进式披露 |
| 费茨定律 | 越大 + 越近 = 越容易点击 | 适当调整 CTA 大小 |
| 米勒定律 | 工作记忆约 7 个项目 | 将内容分块分组 |
| 冯·雷斯托夫效应 | 与众不同 = 易于记忆 | 使 CTA 在视觉上与众不同 |
| 序列位置效应 | 最先和最后最容易被记住 | 关键信息放在开头/结尾 |
VISCERAL (本能) → 第一印象:颜色、图像、整体感觉
BEHAVIORAL (行为) → 使用体验:速度、反馈、效率
REFLECTIVE (反思) → 使用后:"我喜欢这代表我的形象"
用于比例和谐:
├── 内容 : 侧边栏 ≈ 62% : 38%
├── 每个标题大小 = 前一个 × 1.618 (用于戏剧性缩放)
├── 间距可遵循:sm → md → lg (每个 × 1.618)
所有间距和尺寸以 8 的倍数进行:
├── 紧密:4px (用于微调的半步)
├── 小:8px
├── 中:16px
├── 大:24px, 32px
├── 特大:48px, 64px, 80px
└── 根据内容密度调整
| 元素 | 考虑因素 |
|---|---|
| 触摸目标 | 最小舒适点击尺寸 |
| 按钮 | 基于重要性层级的高度 |
| 输入框 | 与按钮高度匹配以对齐 |
| 卡片 | 一致的内边距,呼吸感 |
| 阅读宽度 | 45-75 个字符为佳 |
60% → 主色/背景色 (平静、中性基调)
30% → 辅助色 (支持区域)
10% → 强调色 (CTA、高亮、吸引注意)
| 如果你需要... | 考虑色系 | 避免 |
|---|---|---|
| 信任、平静 | 蓝色系 | 攻击性的红色 |
| 成长、自然 | 绿色系 | 工业灰色 |
| 活力、紧迫感 | 橙色、红色 | 被动的蓝色 |
| 奢华、创意 | 深青色、金色、祖母绿 | 感觉廉价的高亮度色 |
| 简洁、极简 | 中性色 | 压倒性的色彩 |
详细颜色理论请见:color-system.md
| 内容类型 | 比例系数 | 感觉 |
|---|---|---|
| 密集 UI | 1.125-1.2 | 紧凑、高效 |
| 通用网页 | 1.25 | 平衡 (最常见) |
| 编辑类 | 1.333 | 可读性强、宽敞 |
| 英雄区/展示区 | 1.5-1.618 | 戏剧性冲击力 |
对比 + 和谐:
├── 足够**不同**以建立层级
├── 足够**相似**以保持凝聚力
└── 通常:展示字体 + 中性字体,或衬线体 + 无衬线体
详细排版请见:typography-system.md
关键属性:
├── 半透明背景
├── 背景模糊
├── 细微边框以定义边界
└── ⚠️ **警告:** 标准的蓝/白玻璃态是现代陈词滥调。要么激进地使用它,要么完全不用。
高程概念:
├── 越高的元素 = 越大的阴影
├── Y 偏移 > X 偏移 (光线来自上方)
├── 多层阴影 = 更真实
└── 深色模式:可能需要发光效果代替
和谐的渐变:
├── 色轮上相邻的颜色 (类似色)
├── 或者 相同色相,不同明度
├── 避免生硬的互补色对
├── 🚫 **禁止使用 网格/极光渐变** (漂浮的色块)
└── 在不同项目间进行**彻底的**变化
完整效果指南请见:visual-effects.md
持续时间基于:
├── 距离 (越远 = 越长)
├── 大小 (越大 = 越慢)
├── 重要性 (关键 = 清晰)
└── 上下文 (紧急 = 快,奢华 = 慢)
| 动作 | 缓动 | 原因 |
|---|---|---|
| 进入 | Ease-out | 减速,平稳进入 |
| 离开 | Ease-in | 加速,退出 |
| 强调 | Ease-in-out | 平滑,刻意 |
| 趣味性 | Bounce | 有趣,充满活力 |
动画模式请见:animation-guide.md,高级动画请见:motion-graphics.md
对于**每一个**设计任务:
1. 约束条件
└── 时间线、品牌、技术、受众是什么?
└── 如果不明确 → 询问
2. 内容
└── 存在什么内容?
└── 层级结构是什么?
3. 风格方向
└── 什么适合当前上下文?
└── 如果不明确 → 询问 (不要默认!)
4. 执行
└── 应用上述原则
└── 对照反模式检查
5. 审查
└── "这服务于用户吗?"
└── "这与我的默认做法不同吗?"
└── "我会为此感到自豪吗?"
特定领域的深入指导:
| 技能 | 何时使用 |
|---|---|
| frontend-design (本技能) | 编码前 - 学习设计原则 (颜色、排版、UX 心理学) |
| web-design-guidelines | 编码后 - 审核无障碍访问、性能和最佳实践 |
实施设计后,运行审核:
1. 设计 → 阅读前端设计原则 ← 你在这里
2. 编码 → 实现设计
3. 审核 → 运行网页设计指南审查
4. 修复 → 处理审核发现的问题
下一步: 编码后,使用
web-design-guidelines技能来审核你的实现,检查无障碍访问、焦点状态、动画和性能问题。
记住: 设计是思考,而非复制。每个项目都应根据其独特的背景和用户进行全新的考量。避免现代 SaaS 安全港!
[!IMPORTANT] 对于 Next.js 16+ 项目,在所有基于 GET 的搜索/筛选操作中,使用原生的
next/form组件,而不是标准的 HTML<form>。
<Form> 组件的优势import Form from 'next/form'
export default function SearchBar() {
return (
<Form action="/search" className="flex gap-2">
<input
name="q"
placeholder="Search products..."
className="border p-2"
/>
<button type="submit">Search</button>
</Form>
)
}
<Form> 与标准 <form>:next/form 用于:搜索、筛选、排序、分页 (GET 请求)。<form> 用于:数据变更、登录、数据录入 (通过 Server Actions 的 POST 请求)。Weekly Installs
223
Repository
GitHub Stars
6.6K
First Seen
Jan 21, 2026
Security Audits
Installed on
opencode183
gemini-cli183
codex181
cursor162
github-copilot160
amp143
Philosophy: Every pixel has purpose. Restraint is luxury. User psychology drives decisions. Core Principle: THINK, don't memorize. ASK, don't assume.
Read REQUIRED files always, OPTIONAL only when needed:
| File | Status | When to Read |
|---|---|---|
| ux-psychology.md | 🔴 REQUIRED | Always read first! |
| color-system.md | ⚪ Optional | Color/palette decisions |
| typography-system.md | ⚪ Optional | Font selection/pairing |
| visual-effects.md | ⚪ Optional | Glassmorphism, shadows, gradients |
| animation-guide.md | ⚪ Optional | Animation needed |
| motion-graphics.md | ⚪ Optional | Lottie, GSAP, 3D |
| decision-trees.md | ⚪ Optional | Context templates |
🔴 ux-psychology.md = ALWAYS READ. Others = only if relevant.
Execute these for audits (don't read, just run):
| Script | Purpose | Usage |
|---|---|---|
scripts/ux_audit.py | UX Psychology & Accessibility Audit | python scripts/ux_audit.py <project_path> |
STOP! If the user's request is open-ended, DO NOT default to your favorites.
Color not specified? Ask:
"What color palette do you prefer? (blue/green/orange/neutral/other?)"
Style not specified? Ask:
"What style are you going for? (minimal/bold/retro/futuristic/organic?)"
Layout not specified? Ask:
"Do you have a layout preference? (single column/grid/asymmetric/full-width?)"
| AI Default Tendency | Why It's Bad | Think Instead |
|---|---|---|
| Bento Grids (Modern Cliché) | Used in every AI design | Why does this content NEED a grid? |
| Hero Split (Left/Right) | Predictable & Boring | How about Massive Typography or Vertical Narrative? |
| Mesh/Aurora Gradients | The "new" lazy background | What's a radical color pairing? |
| Glassmorphism | AI's idea of "premium" | How about solid, high-contrast flat? |
| Deep Cyan / Fintech Blue | Safe harbor from purple ban | Why not Red, Black, or Neon Green? |
| "Orchestrate / Empower" | AI-generated copywriting | How would a human say this? |
| Dark background + neon glow | Overused, "AI look" | What does the BRAND actually need? |
🔴 "Every 'safe' structure you choose brings you one step closer to a generic template. TAKE RISKS."
Before any design work, ANSWER THESE or ASK USER:
| Constraint | Question | Why It Matters |
|---|---|---|
| Timeline | How much time? | Determines complexity |
| Content | Ready or placeholder? | Affects layout flexibility |
| Brand | Existing guidelines? | May dictate colors/fonts |
| Tech | What stack? | Affects capabilities |
| Audience | Who exactly? | Drives all visual decisions |
| Audience | Think About |
|---|---|
| Gen Z | Bold, fast, mobile-first, authentic |
| Millennials | Clean, minimal, value-driven |
| Gen X | Familiar, trustworthy, clear |
| Boomers | Readable, high contrast, simple |
| B2B | Professional, data-focused, trust |
| Luxury | Restrained elegance, whitespace |
| Law | Principle | Application |
|---|---|---|
| Hick's Law | More choices = slower decisions | Limit options, use progressive disclosure |
| Fitts' Law | Bigger + closer = easier to click | Size CTAs appropriately |
| Miller's Law | ~7 items in working memory | Chunk content into groups |
| Von Restorff | Different = memorable | Make CTAs visually distinct |
| Serial Position | First/last remembered most | Key info at start/end |
VISCERAL (instant) → First impression: colors, imagery, overall feel
BEHAVIORAL (use) → Using it: speed, feedback, efficiency
REFLECTIVE (memory) → After: "I like what this says about me"
Use for proportional harmony:
├── Content : Sidebar = roughly 62% : 38%
├── Each heading size = previous × 1.618 (for dramatic scale)
├── Spacing can follow: sm → md → lg (each × 1.618)
All spacing and sizing in multiples of 8:
├── Tight: 4px (half-step for micro)
├── Small: 8px
├── Medium: 16px
├── Large: 24px, 32px
├── XL: 48px, 64px, 80px
└── Adjust based on content density
| Element | Consideration |
|---|---|
| Touch targets | Minimum comfortable tap size |
| Buttons | Height based on importance hierarchy |
| Inputs | Match button height for alignment |
| Cards | Consistent padding, breathable |
| Reading width | 45-75 characters optimal |
60% → Primary/Background (calm, neutral base)
30% → Secondary (supporting areas)
10% → Accent (CTAs, highlights, attention)
| If You Need... | Consider Hues | Avoid |
|---|---|---|
| Trust, calm | Blue family | Aggressive reds |
| Growth, nature | Green family | Industrial grays |
| Energy, urgency | Orange, red | Passive blues |
| Luxury, creativity | Deep Teal, Gold, Emerald | Cheap-feeling brights |
| Clean, minimal | Neutrals | Overwhelming color |
For detailed color theory: color-system.md
| Content Type | Scale Ratio | Feel |
|---|---|---|
| Dense UI | 1.125-1.2 | Compact, efficient |
| General web | 1.25 | Balanced (most common) |
| Editorial | 1.333 | Readable, spacious |
| Hero/display | 1.5-1.618 | Dramatic impact |
Contrast + Harmony:
├── DIFFERENT enough for hierarchy
├── SIMILAR enough for cohesion
└── Usually: display + neutral, or serif + sans
For detailed typography: typography-system.md
Key properties:
├── Semi-transparent background
├── Backdrop blur
├── Subtle border for definition
└── ⚠️ **WARNING:** Standard blue/white glassmorphism is a modern cliché. Use it radically or not at all.
Elevation concept:
├── Higher elements = larger shadows
├── Y-offset > X-offset (light from above)
├── Multiple layers = more realistic
└── Dark mode: may need glow instead
Harmonious gradients:
├── Adjacent colors on wheel (analogous)
├── OR same hue, different lightness
├── Avoid harsh complementary pairs
├── 🚫 **NO Mesh/Aurora Gradients** (floating blobs)
└── VARY from project to project radically
For complete effects guide: visual-effects.md
Duration based on:
├── Distance (further = longer)
├── Size (larger = slower)
├── Importance (critical = clear)
└── Context (urgent = fast, luxury = slow)
| Action | Easing | Why |
|---|---|---|
| Entering | Ease-out | Decelerate, settle in |
| Leaving | Ease-in | Accelerate, exit |
| Emphasis | Ease-in-out | Smooth, deliberate |
| Playful | Bounce | Fun, energetic |
For animation patterns: animation-guide.md, for advanced: motion-graphics.md
For EVERY design task:
1. CONSTRAINTS
└── What's the timeline, brand, tech, audience?
└── If unclear → ASK
2. CONTENT
└── What content exists?
└── What's the hierarchy?
3. STYLE DIRECTION
└── What's appropriate for context?
└── If unclear → ASK (don't default!)
4. EXECUTION
└── Apply principles above
└── Check against anti-patterns
5. REVIEW
└── "Does this serve the user?"
└── "Is this different from my defaults?"
└── "Would I be proud of this?"
For deeper guidance on specific areas:
| Skill | When to Use |
|---|---|
| frontend-design (this) | Before coding - Learn design principles (color, typography, UX psychology) |
| web-design-guidelines | After coding - Audit for accessibility, performance, and best practices |
After implementing your design, run the audit:
1. DESIGN → Read frontend-design principles ← YOU ARE HERE
2. CODE → Implement the design
3. AUDIT → Run web-design-guidelines review
4. FIX → Address findings from audit
Next Step: After coding, use
web-design-guidelinesskill to audit your implementation for accessibility, focus states, animations, and performance issues.
Remember: Design is THINKING, not copying. Every project deserves fresh consideration based on its unique context and users. Avoid the Modern SaaS Safe Harbor!
[!IMPORTANT] For Next.js 16+ projects, use the native
next/formcomponent instead of standard HTML<form>for all GET-based search/filter operations.
<Form> Component Advantageimport Form from 'next/form'
export default function SearchBar() {
return (
<Form action="/search" className="flex gap-2">
<input
name="q"
placeholder="Search products..."
className="border p-2"
/>
<button type="submit">Search</button>
</Form>
)
}
<Form> vs. standard <form>:next/form for: Search, Filtering, Sorting, Pagination (GET requests).<form> for: Mutations, Login, Data Entry (POST requests via Server Actions).Weekly Installs
223
Repository
GitHub Stars
6.6K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode183
gemini-cli183
codex181
cursor162
github-copilot160
amp143
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
107,800 周安装
| Rounded everything | Generic/Safe | Where can I use sharp, brutalist edges? |