Prototype Designer by daffy0208/ai-dev-standards
npx skills add https://github.com/daffy0208/ai-dev-standards --skill 'Prototype Designer'在编写代码之前,通过交互式原型验证想法。
先测试,后构建。
原型让你能够:
| 工具 | 最适合 | 学习曲线 | 保真度 |
|---|---|---|---|
| Figma | 完整设计、协作 | 中等 | 高 |
| Framer | 基于代码、高级交互 | 高 | 非常高 |
| ProtoPie | 复杂交互、传感器 | 中等 | 非常高 |
| Adobe XD |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| Adobe 生态系统用户 |
| 低 |
| 高 |
| InVision | 设计交接、简单点击 | 低 | 中等 |
| Axure | 复杂逻辑、文档 | 高 | 高 |
初学者: 从 Figma 开始
进阶者: 升级到 Framer 或 ProtoPie
用户流程展示了用户在你的应用中完成任务所经过的路径。
示例:用户注册流程
开始
↓
着陆页
↓
点击"注册"
↓
输入邮箱 → 验证
↓ [有效]
输入密码 → 验证
↓ [有效]
成功页面
↓
新手引导流程
1. 创建流程框架:
所需框架:
├── 01-着陆页
├── 02-注册表单
├── 03-邮箱验证
├── 04-成功
└── 05-新手引导步骤-1
2. 添加交互:
点击"注册"按钮 → 导航到 02-注册表单
点击"提交" → 导航到 03-邮箱验证
点击"继续" → 导航到 04-成功
3. 添加叠加层:
错误状态:
- 显示"错误:无效邮箱"叠加层
- 显示"错误:密码太弱"叠加层
// user-flows.ts
interface UserFlow {
id: string
name: string
description: string
steps: FlowStep[]
alternativePaths: AlternativePath[]
}
interface FlowStep {
id: string
screen: string
action: string
nextStep: string
conditions?: string[]
}
interface AlternativePath {
trigger: string
steps: FlowStep[]
destination: string
}
export const signupFlow: UserFlow = {
id: 'signup',
name: '用户注册',
description: '用户注册账户',
steps: [
{
id: '1',
screen: '着陆页',
action: '点击"注册"',
nextStep: '2'
},
{
id: '2',
screen: '注册表单',
action: '输入邮箱和密码',
nextStep: '3',
conditions: ['邮箱有效', '密码强度足够']
},
{
id: '3',
screen: '邮箱验证',
action: '输入验证码',
nextStep: '4',
conditions: ['验证码有效']
},
{
id: '4',
screen: '成功',
action: '点击"开始使用"',
nextStep: '5'
}
],
alternativePaths: [
{
trigger: '无效邮箱',
steps: [
{
id: 'error-1',
screen: '注册表单',
action: '显示错误信息',
nextStep: '2'
}
],
destination: '步骤 2'
}
]
}
1. 基本点击导航:
选择元素 → 原型面板 → 添加交互
- 触发器:点击时
- 动作:导航到
- 目标:屏幕名称
- 动画:即时 / 溶解 / 滑动 / 推入
2. 悬停状态:
按钮 → 原型面板
- 触发器:悬停时
- 动作:更改为
- 目标:按钮-悬停变体
3. 滚动行为:
框架 → 原型面板
- 溢出行为:垂直滚动
- 设置滚动位置(可选)
4. 智能动画:
两个具有匹配图层名称的框架
- 动画:智能动画
- 缓动:缓出
- 持续时间:300毫秒
条件逻辑(变量):
// Figma 变量(测试版)
变量:
- isLoggedIn: 布尔值
- userType: 字符串
- itemCount: 数字
条件:
如果 isLoggedIn = true
则 导航到 仪表板
否则
则 导航到 登录
多步骤表单:
步骤 1(姓名) → 验证
↓ [有效]
步骤 2(邮箱) → 验证
↓ [有效]
步骤 3(密码) → 验证
↓ [有效]
成功页面
状态管理:
组件:按钮
状态:
- 默认
- 悬停
- 按下
- 禁用
- 加载中
原型:
点击时 → 更改为"加载中"
延迟后 → 导航到下一个屏幕
在以下情况使用 Framer:
// components/Counter.tsx
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 16
}}
>
<h1 style={{ fontSize: 48 }}>{count}</h1>
<div style={{ display: 'flex', gap: 8 }}>
<button
onClick={() => setCount(count - 1)}
style={{
padding: '12px 24px',
fontSize: 16,
borderRadius: 8,
border: 'none',
cursor: 'pointer',
background: '#0066cc',
color: 'white'
}}
>
-
</button>
<button
onClick={() => setCount(count + 1)}
style={{
padding: '12px 24px',
fontSize: 16,
borderRadius: 8,
border: 'none',
cursor: 'pointer',
background: '#0066cc',
color: 'white'
}}
>
+
</button>
</div>
</div>
)
}
// components/AnimatedCard.tsx
import { motion } from 'framer-motion'
export function AnimatedCard() {
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3 }}
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
style={{
width: 300,
height: 200,
background: 'white',
borderRadius: 16,
padding: 24,
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
cursor: 'pointer'
}}
>
<h2>卡片标题</h2>
<p>悬停或点击我!</p>
</motion.div>
)
}
1. 定义目标:
2. 招募参与者:
3. 创建测试脚本:
# 原型可用性测试脚本
## 介绍(2 分钟)
"感谢您帮助我们测试这个原型。没有错误答案——我们测试的是设计,而不是您。请在完成任务时大声说出您的想法。"
## 任务(20 分钟)
### 任务 1:注册
"假设您想创建一个账户。请向我展示您会如何操作。"
成功标准:
- [ ] 找到注册按钮
- [ ] 输入邮箱
- [ ] 输入密码
- [ ] 完成验证
- [ ] 到达仪表板
### 任务 2:查找设置
"您想更改通知偏好设置。请向我展示您会如何操作。"
成功标准:
- [ ] 导航到设置
- [ ] 找到通知部分
- [ ] 更改设置
- [ ] 保存更改
## 问题(5 分钟)
1. 哪个部分最容易?
2. 哪个部分最难?
3. 您会改变什么?
4. 您会使用这个产品吗?为什么/为什么不?
4. 执行测试:
5. 分析结果:
// test-results.ts
interface TestResult {
participant: string
task: string
completed: boolean
timeSeconds: number
errors: string[]
feedback: string
}
const results: TestResult[] = [
{
participant: '用户 1',
task: '注册',
completed: true,
timeSeconds: 45,
errors: ['错过了验证步骤'],
feedback: '表单很清晰,但验证部分令人困惑'
}
// ...
]
// 计算指标
function analyzeResults(results: TestResult[]) {
const completionRate = results.filter(r => r.completed).length / results.length
const avgTime = results.reduce((sum, r) => sum + r.timeSeconds, 0) / results.length
const commonErrors = findCommonErrors(results)
return {
completionRate: `${(completionRate * 100).toFixed(0)}%`,
avgTime: `${avgTime.toFixed(0)}s`,
commonErrors
}
}
非主持式:
主持式:
1. 文档:
# 原型文档
## 用户流程
- [注册流程](figma-link)
- [购买流程](figma-link)
## 交互
- 按钮悬停:缩放 1.05,200ms 缓出
- 页面过渡:向右滑动,300ms 缓入缓出
- 错误抖动:X 轴平移 ±10px,3 次,100ms
## 状态
- 默认
- 悬停
- 激活
- 禁用
- 加载中
- 错误
## 动画
- 淡入:不透明度 0→1,300ms
- 向上滑动:translateY 20px→0,400ms 缓出
## 断点
- 移动端:375px - 767px
- 平板:768px - 1023px
- 桌面端:1024px+
2. 注释原型:
在 Figma 中:
3. 导出规范:
// specs/interactions.ts
export const interactions = {
button: {
hover: {
scale: 1.05,
duration: 200,
easing: 'ease-out'
},
click: {
scale: 0.95,
duration: 100,
easing: 'ease-in'
}
},
page: {
transition: {
type: 'slide',
direction: 'right',
duration: 300,
easing: 'ease-in-out'
}
},
modal: {
open: {
backdrop: { opacity: 0.5 },
content: { scale: 0.9, opacity: 0 },
to: { scale: 1, opacity: 1 },
duration: 200
},
close: {
backdrop: { opacity: 0 },
content: { scale: 0.9, opacity: 0 },
duration: 200
}
}
}
4. 创建实施指南:
# 实施指南
## 技术栈推荐
### 动画
- **Framer Motion** - React 动画
- **GSAP** - 高级动画
- **CSS 过渡** - 简单效果
### 状态管理
- **useState** - 本地组件状态
- **Zustand** - 全局状态
- **React Query** - 服务器状态
### 表单
- **React Hook Form** - 表单验证
- **Zod** - 模式验证
## 代码示例
### 带悬停效果的按钮
\`\`\`tsx
import { motion } from 'framer-motion'
export function Button({ children, onClick }) {
return (
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
transition={{ duration: 0.2 }}
onClick={onClick}
style={{
padding: '12px 24px',
borderRadius: 8,
border: 'none',
background: '#0066cc',
color: 'white',
fontSize: 16,
fontWeight: 600,
cursor: 'pointer'
}} >
{children}
</motion.button>
)
}
\`\`\`
在高保真原型之前,先从草图/线框图开始。
进展过程:
首先对最重要的用户流程进行原型设计:
跳过:
避免使用"Lorem ipsum"——使用真实的:
随着以下情况更新原型:
// 加载状态进展
1. 按钮:"提交"(可点击)
2. 按钮:"加载中..."(禁用,旋转器)
3. 按钮:"成功!"(绿色,勾选标记)
4. 2秒后:返回"提交"
// 实时验证
1. 用户在字段中输入
2. 失去焦点时:验证
3. 如果无效则显示错误
4. 在所有字段有效前禁用提交
5. 提交后显示成功
// 模态框交互
1. 点击触发器 → 打开模态框(背景 + 动画)
2. 用户与模态框内容交互
3. 点击外部 / X 按钮 → 关闭模态框
4. 打开时阻止主体滚动
原型设计:
测试:
动画:
相关技能:
ux-designer - 用户体验设计frontend-builder - 实施原型user-researcher - 测试与验证快速原型,尽早验证,正确构建。 🚀
每周安装
0
代码仓库
GitHub 星标
18
首次出现
1970年1月1日
安全审计
Validate ideas through interactive prototypes before writing code.
Test before you build.
Prototypes let you:
| Tool | Best For | Learning Curve | Fidelity |
|---|---|---|---|
| Figma | Full designs, collaboration | Medium | High |
| Framer | Code-based, advanced interactions | High | Very High |
| ProtoPie | Complex interactions, sensors | Medium | Very High |
| Adobe XD | Adobe ecosystem users | Low | High |
| InVision | Design handoff, simple clicks | Low | Medium |
| Axure | Complex logic, documentation | High | High |
Beginner: Start with Figma
Advanced: Graduate to Framer or ProtoPie
A user flow shows the path users take through your app to complete a task.
Example: User Registration Flow
Start
↓
Landing Page
↓
Click "Sign Up"
↓
Email Entry → Validation
↓ [Valid]
Password Entry → Validation
↓ [Valid]
Success Screen
↓
Onboarding Flow
1. Create Flow Frames:
Frames needed:
├── 01-landing
├── 02-signup-form
├── 03-email-verification
├── 04-success
└── 05-onboarding-step-1
2. Add Interactions:
Click "Sign Up" button → Navigate to 02-signup-form
Click "Submit" → Navigate to 03-email-verification
Click "Continue" → Navigate to 04-success
3. Add Overlays:
Error states:
- Show "Error: Invalid email" overlay
- Show "Error: Password too weak" overlay
// user-flows.ts
interface UserFlow {
id: string
name: string
description: string
steps: FlowStep[]
alternativePaths: AlternativePath[]
}
interface FlowStep {
id: string
screen: string
action: string
nextStep: string
conditions?: string[]
}
interface AlternativePath {
trigger: string
steps: FlowStep[]
destination: string
}
export const signupFlow: UserFlow = {
id: 'signup',
name: 'User Registration',
description: 'User signs up for an account',
steps: [
{
id: '1',
screen: 'Landing Page',
action: 'Click "Sign Up"',
nextStep: '2'
},
{
id: '2',
screen: 'Sign Up Form',
action: 'Enter email and password',
nextStep: '3',
conditions: ['Email valid', 'Password strong']
},
{
id: '3',
screen: 'Email Verification',
action: 'Enter verification code',
nextStep: '4',
conditions: ['Code valid']
},
{
id: '4',
screen: 'Success',
action: 'Click "Get Started"',
nextStep: '5'
}
],
alternativePaths: [
{
trigger: 'Invalid email',
steps: [
{
id: 'error-1',
screen: 'Sign Up Form',
action: 'Show error message',
nextStep: '2'
}
],
destination: 'Step 2'
}
]
}
1. Basic Click Navigation:
Select element → Prototype panel → Add interaction
- Trigger: On click
- Action: Navigate to
- Destination: Screen name
- Animation: Instant / Dissolve / Slide / Push
2. Hover States:
Button → Prototype panel
- Trigger: While hovering
- Action: Change to
- Destination: Button-hover variant
3. Scroll Behavior:
Frame → Prototype panel
- Overflow behavior: Vertical scrolling
- Set scroll position (optional)
4. Smart Animate:
Two frames with matching layer names
- Animation: Smart animate
- Easing: Ease out
- Duration: 300ms
Conditional Logic (Variables):
// Figma Variables (Beta)
Variables:
- isLoggedIn: Boolean
- userType: String
- itemCount: Number
Conditional:
IF isLoggedIn = true
THEN Navigate to Dashboard
ELSE
THEN Navigate to Login
Multi-Step Forms:
Step 1 (Name) → Validation
↓ [Valid]
Step 2 (Email) → Validation
↓ [Valid]
Step 3 (Password) → Validation
↓ [Valid]
Success Screen
State Management:
Component: Button
States:
- Default
- Hover
- Pressed
- Disabled
- Loading
Prototype:
On click → Change to "Loading"
After delay → Navigate to next screen
Use Framer for:
// components/Counter.tsx
import { useState } from 'react'
export function Counter() {
const [count, setCount] = useState(0)
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: 16
}}
>
<h1 style={{ fontSize: 48 }}>{count}</h1>
<div style={{ display: 'flex', gap: 8 }}>
<button
onClick={() => setCount(count - 1)}
style={{
padding: '12px 24px',
fontSize: 16,
borderRadius: 8,
border: 'none',
cursor: 'pointer',
background: '#0066cc',
color: 'white'
}}
>
-
</button>
<button
onClick={() => setCount(count + 1)}
style={{
padding: '12px 24px',
fontSize: 16,
borderRadius: 8,
border: 'none',
cursor: 'pointer',
background: '#0066cc',
color: 'white'
}}
>
+
</button>
</div>
</div>
)
}
// components/AnimatedCard.tsx
import { motion } from 'framer-motion'
export function AnimatedCard() {
return (
<motion.div
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.3 }}
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
style={{
width: 300,
height: 200,
background: 'white',
borderRadius: 16,
padding: 24,
boxShadow: '0 4px 12px rgba(0,0,0,0.1)',
cursor: 'pointer'
}}
>
<h2>Card Title</h2>
<p>Hover or click me!</p>
</motion.div>
)
}
1. Define Goals:
2. Recruit Participants:
3. Create Test Script:
# Prototype Usability Test Script
## Introduction (2 min)
"Thank you for helping us test this prototype. There are no wrong answers - we're testing the design, not you. Please think aloud as you complete tasks."
## Tasks (20 min)
### Task 1: Sign Up
"Imagine you want to create an account. Show me how you would do that."
Success criteria:
- [ ] Found sign up button
- [ ] Entered email
- [ ] Entered password
- [ ] Completed verification
- [ ] Reached dashboard
### Task 2: Find Settings
"You want to change your notification preferences. Show me how you would do that."
Success criteria:
- [ ] Navigated to settings
- [ ] Found notifications section
- [ ] Changed setting
- [ ] Saved changes
## Questions (5 min)
1. What was the easiest part?
2. What was the hardest part?
3. What would you change?
4. Would you use this? Why/why not?
4. Conduct Tests:
5. Analyze Results:
// test-results.ts
interface TestResult {
participant: string
task: string
completed: boolean
timeSeconds: number
errors: string[]
feedback: string
}
const results: TestResult[] = [
{
participant: 'User 1',
task: 'Sign up',
completed: true,
timeSeconds: 45,
errors: ['Missed verification step'],
feedback: 'Form was clear but verification was confusing'
}
// ...
]
// Calculate metrics
function analyzeResults(results: TestResult[]) {
const completionRate = results.filter(r => r.completed).length / results.length
const avgTime = results.reduce((sum, r) => sum + r.timeSeconds, 0) / results.length
const commonErrors = findCommonErrors(results)
return {
completionRate: `${(completionRate * 100).toFixed(0)}%`,
avgTime: `${avgTime.toFixed(0)}s`,
commonErrors
}
}
Unmoderated:
Moderated:
1. Documentation:
# Prototype Documentation
## User Flows
- [Sign Up Flow](figma-link)
- [Purchase Flow](figma-link)
## Interactions
- Button hover: Scale 1.05, 200ms ease-out
- Page transition: Slide right, 300ms ease-in-out
- Error shake: Translate X ±10px, 3 times, 100ms
## States
- Default
- Hover
- Active
- Disabled
- Loading
- Error
## Animations
- Fade in: opacity 0→1, 300ms
- Slide up: translateY 20px→0, 400ms ease-out
## Breakpoints
- Mobile: 375px - 767px
- Tablet: 768px - 1023px
- Desktop: 1024px+
2. Annotate Prototype:
In Figma:
3. Export Specifications:
// specs/interactions.ts
export const interactions = {
button: {
hover: {
scale: 1.05,
duration: 200,
easing: 'ease-out'
},
click: {
scale: 0.95,
duration: 100,
easing: 'ease-in'
}
},
page: {
transition: {
type: 'slide',
direction: 'right',
duration: 300,
easing: 'ease-in-out'
}
},
modal: {
open: {
backdrop: { opacity: 0.5 },
content: { scale: 0.9, opacity: 0 },
to: { scale: 1, opacity: 1 },
duration: 200
},
close: {
backdrop: { opacity: 0 },
content: { scale: 0.9, opacity: 0 },
duration: 200
}
}
}
4. Create Implementation Guide:
# Implementation Guide
## Tech Stack Recommendations
### Animations
- **Framer Motion** - React animations
- **GSAP** - Advanced animations
- **CSS Transitions** - Simple effects
### State Management
- **useState** - Local component state
- **Zustand** - Global state
- **React Query** - Server state
### Forms
- **React Hook Form** - Form validation
- **Zod** - Schema validation
## Code Examples
### Button with Hover Effect
\`\`\`tsx
import { motion } from 'framer-motion'
export function Button({ children, onClick }) {
return (
<motion.button
whileHover={{ scale: 1.05 }}
whileTap={{ scale: 0.95 }}
transition={{ duration: 0.2 }}
onClick={onClick}
style={{
padding: '12px 24px',
borderRadius: 8,
border: 'none',
background: '#0066cc',
color: 'white',
fontSize: 16,
fontWeight: 600,
cursor: 'pointer'
}} >
{children}
</motion.button>
)
}
\`\`\`
Begin with sketches/wireframes before high-fidelity prototypes.
Progression:
Prototype the most important user flows first:
Skip:
Avoid "Lorem ipsum" - use realistic:
Keep prototype updated as:
// Loading state progression
1. Button: "Submit" (clickable)
2. Button: "Loading..." (disabled, spinner)
3. Button: "Success!" (green, checkmark)
4. After 2s: Back to "Submit"
// Real-time validation
1. User types in field
2. On blur: Validate
3. Show error if invalid
4. Disable submit until all valid
5. Show success after submit
// Modal interaction
1. Click trigger → Open modal (backdrop + animation)
2. User interacts with modal content
3. Click outside / X button → Close modal
4. Prevent scroll on body when open
Prototyping:
Testing:
Animation:
Related Skills:
ux-designer - User experience designfrontend-builder - Implementing prototypesuser-researcher - Testing & validationPrototype fast, validate early, build right. 🚀
Weekly Installs
0
Repository
GitHub Stars
18
First Seen
Jan 1, 1970
Security Audits
前端设计技能指南:避免AI垃圾美学,打造独特生产级界面
39,800 周安装