design-lab by 0xdesign/design-plugin
npx skills add https://github.com/0xdesign/design-plugin --skill design-lab此技能实现了一个完整的设计探索工作流程:访谈、生成变体、收集反馈、优化、预览和最终确定。
当流程结束时,所有临时文件必须被删除,无论是因为:
切勿留下 .claude-design/ 或 __design_lab 路由。 如果用户在任何时候说“取消”、“中止”、“停止”或“算了”,请确认并删除所有临时工件。
在开始访谈之前,自动检测:
检查项目根目录中的锁文件:
pnpm-lock.yaml → 使用 pnpmyarn.lock → 使用 yarn广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
package-lock.jsonnpmbun.lockb → 使用 bun检查配置文件:
next.config.js 或 next.config.mjs 或 next.config.ts → Next.js
app/ 目录 → App Routerpages/ 目录 → Pages Routervite.config.js 或 vite.config.ts → Viteremix.config.js → Remixnuxt.config.js 或 nuxt.config.ts → Nuxtastro.config.mjs → Astro检查 package.json 依赖项和配置文件:
tailwind.config.js 或 tailwind.config.ts → Tailwind CSS@mui/material 在依赖项中 → Material UI@chakra-ui/react 在依赖项中 → Chakra UIantd 在依赖项中 → Ant Designstyled-components 在依赖项中 → styled-components@emotion/react 在依赖项中 → Emotion.css 或 .module.css 文件 → CSS Modules查找现有的设计记忆文件:
docs/design-memory.mdDESIGN_MEMORY.md.claude-design/design-memory.md如果找到,请读取它并用于预填充默认值并跳过冗余问题。
请勿使用通用/预定义的样式。从项目中提取视觉语言:
如果检测到 Tailwind ,读取 tailwind.config.js 或 tailwind.config.ts:
// 提取并使用:
theme.colors // 调色板
theme.spacing // 间距比例
theme.borderRadius // 圆角值
theme.fontFamily // 排版
theme.boxShadow // 高程系统
如果存在 CSS 变量 ,读取 globals.css、variables.css 或 :root 定义:
:root {
--color-* /* 颜色标记 */
--spacing-* /* 间距标记 */
--font-* /* 排版标记 */
--radius-* /* 边框圆角标记 */
}
如果检测到 UI 库 (MUI, Chakra, Ant),读取主题配置:
theme.ts 或 createTheme() 调用theme/index.ts 或 extendTheme() 调用ConfigProvider 主题属性始终扫描现有组件 以理解模式:
将推断出的样式存储在 Design Brief 中,以便在所有变体中一致使用。
对所有访谈步骤使用 AskUserQuestion 工具。如果存在设计记忆,请根据它调整问题。
询问这些问题(可以合并到包含多个问题的单个 AskUserQuestion 中):
问题 1:范围
问题 2:新建还是重新设计
如果选择了"重新设计",询问:问题 3:现有路径
如果目标不明确,请根据仓库模式建议一个名称并确认。
问题 1:痛点
问题 2:视觉灵感
问题 3:功能灵感
问题 1:品牌形容词
问题 2:密度
问题 3:深色模式
问题 1:主要用户
问题 2:使用场景
问题 3:关键任务
问题 1:必须保留的元素
问题 2:技术约束
访谈结束后,创建一个结构化的设计简报作为 JSON 并保存到 .claude-design/design-brief.json:
{
"scope": "component|page",
"isRedesign": true|false,
"targetPath": "src/components/Example.tsx",
"targetName": "Example",
"painPoints": ["Too dense", "Primary action unclear"],
"inspiration": {
"visual": ["Stripe", "Linear"],
"functional": ["Inline validation"]
},
"brand": {
"adjectives": ["minimal", "trustworthy"],
"density": "comfortable",
"darkMode": true
},
"persona": {
"primary": "Developer",
"context": "desktop-first",
"keyTasks": ["Complete checkout", "Review order", "Apply discount"]
},
"constraints": {
"mustKeep": ["existing fields"],
"technical": ["no new dependencies", "WCAG accessible"]
},
"framework": "nextjs-app",
"packageManager": "pnpm",
"stylingSystem": "tailwind"
}
在继续之前向用户显示摘要。
在 .claude-design/ 下创建所有文件:
.claude-design/
├── lab/
│ ├── page.tsx # 主实验室页面(框架特定)
│ ├── variants/
│ │ ├── VariantA.tsx
│ │ ├── VariantB.tsx
│ │ ├── VariantC.tsx
│ │ ├── VariantD.tsx
│ │ └── VariantE.tsx
│ ├── components/
│ │ └── LabShell.tsx # 实验室布局包装器
│ ├── feedback/ # 交互式反馈系统
│ │ ├── types.ts # TypeScript 接口
│ │ ├── selector-utils.ts # 元素标识
│ │ ├── format-utils.ts # 反馈格式化
│ │ ├── FeedbackOverlay.tsx # 主覆盖组件
│ │ └── index.ts # 模块导出
│ └── data/
│ └── fixtures.ts # 共享模拟数据
├── design-brief.json
└── run-log.md
FeedbackOverlay 是设计实验室的主要功能。 没有它,用户无法提供交互式反馈。切勿在没有 FeedbackOverlay 的情况下生成设计实验室。
可靠性策略: 为避免不同项目配置中的导入路径问题,请将 FeedbackOverlay 直接创建在路由目录中(例如 app/design-lab/FeedbackOverlay.tsx),而不是在 .claude-design/ 中。这确保了简单的相对导入 (./FeedbackOverlay) 始终有效。
路由目录中必需的文件:
app/design-lab/ # 或者如果下划线有效,使用 app/__design_lab/
├── page.tsx # 包含变体的主实验室页面
└── FeedbackOverlay.tsx # 自包含的覆盖组件(从模板复制)
模板来源: design-and-refine/templates/feedback/FeedbackOverlay.tsx
为什么采用这种方法:
.claude-design/ 路径可能因打包器配置而失败Next.js App Router: 创建 app/__design_lab/page.tsx,从 .claude-design/lab/ 导入
Next.js Pages Router: 创建 pages/__design_lab.tsx,从 .claude-design/lab/ 导入
Vite React:
/__design_labApp.tsx 中基于 ?design_lab=true 查询参数创建条件渲染其他框架: 为检测到的框架创建最合适的临时路由。
重要: 阅读 DESIGN_PRINCIPLES.md 以了解 UX、交互和动效的最佳实践。但请勿使用预定义的视觉样式——从项目中推断它们。
应用通用原则(来自 DESIGN_PRINCIPLES.md):
从项目中推断视觉样式:
每个变体必须探索不同的设计维度。不要创建微小的变体——让它们在意义上截然不同。对所有变体使用项目现有的视觉语言。
变体 A:信息层次结构焦点
变体 B:布局模型探索
变体 C:密度变体
变体 D:交互模型
变体 E:表达性方向
设计实验室页面必须包括:
页眉,包含:
变体网格,包含:
data-variant="X" 属性(其中 X 是 A, B, C, D, E 或 F)。这是反馈系统识别评论属于哪个变体所必需的。响应式行为:
共享数据:
data/fixtures.ts 的相同模拟数据反馈覆盖层(关键 - 切勿省略):
⚠️ 这是最重要的要求 ⚠️
FeedbackOverlay 使用户能够点击元素并留下评论。没有它,设计实验室只是一个无法收集结构化反馈的静态页面。
* 在与 `page.tsx` 相同的目录中创建 `FeedbackOverlay.tsx`
* 使用相对路径导入:`import { FeedbackOverlay } from './FeedbackOverlay'`
* 在所有变体之后,在页面末尾渲染
* 传递包含组件/页面名称的 `targetName` 属性
示例集成:
import { FeedbackOverlay } from './FeedbackOverlay'; // 相对导入 - 始终有效
export default function DesignLabPage() {
return (
<div className="min-h-screen bg-background">
<header>...</header>
<main>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<div data-variant="A">
<VariantA />
</div>
<div data-variant="B">
<VariantB />
</div>
{/* ... 更多变体 */}
</div>
</main>
{/* 关键:必须包含 FeedbackOverlay */}
<FeedbackOverlay targetName="ComponentName" />
</div>
);
}
如果您忘记了 FeedbackOverlay,用户将无法提供反馈。 这违背了设计实验室的整个目的。
约定:
可访问性(来自 DESIGN_PRINCIPLES):
<button> 而不是 <div onclick>,使用 <nav>、<main>、<section>:focus-visible,带有 2px 圆环和偏移状态(每个组件都需要):
动效:
prefers-reduced-motion生成实验室文件后,立即向用户展示实验室。请勿尝试:
输出实验室位置和 URL:
✅ 设计实验室已创建!
我已在 `.claude-design/lab/` 中生成了 5 个设计变体
查看方法:
1. 确保您的开发服务器正在运行(如果没有,运行 `pnpm dev`)
2. 打开:http://localhost:3000/__design_lab
请花时间并排查看变体,然后回来告诉我:
- 哪个变体胜出(A-E)
- 您喜欢它的哪些方面
- 应该更改什么
立即进入阶段 5 - 请求反馈。不要等待用户说他们已经打开了浏览器。直接提出反馈问题,以便用户返回时准备好。
运行 pnpm dev 或 npm run dev 会启动一个永不退出的长时间运行进程。如果您运行它,您将永远等待。用户可能已经运行了他们的开发服务器,或者可以在另一个终端中自己启动它。
展示实验室 URL 后,用户可以通过两种方式提供反馈:
设计实验室包含一个类似 Figma 的反馈覆盖层。展示实验室时,请包含以下说明:
✅ 设计实验室已创建!
我已在 `.claude-design/lab/` 中生成了 5 个设计变体
查看和提供反馈的方法:
1. 确保您的开发服务器正在运行(如果没有,运行 `pnpm dev`)
2. 打开:http://localhost:3000/__design_lab
**添加反馈:**
1. 点击"添加反馈"按钮(右下角)
2. 点击您想评论的任何元素
3. 输入您的反馈并点击"保存"
4. 对所有您想评论的元素重复此操作
5. 填写"总体方向"字段(必需)
6. 点击"提交所有反馈"
7. 将复制的文本粘贴到此处终端中
或者直接在下面手动描述您的反馈!
当用户粘贴反馈时,格式如下:
## Design Lab Feedback
**Target:** ComponentName
**Comments:** 3
### Variant A
1. **Button** (`[data-testid='submit']`, button with "Submit")
"Make this more prominent"
### Variant B
1. **Card** (`.product-card`, div with "Product Name")
"Love this layout"
### Overall Direction
Go with Variant B's structure. Apply Variant A's button styling.
如何解析并据此行动:
[data-testid='submit'])如果用户不想使用交互式覆盖层(或粘贴了手动反馈),请使用下面的 AskUserQuestion 流程:
问题 1:准备好选择了吗?
如果用户说"是",询问:
问题 2a:哪一个?
问题 3a:需要调整吗?
如果"需要微调",请让用户通过文本输入描述更改。
然后进入阶段 7:最终预览。
如果用户说"否 - 我喜欢不同变体的某些部分",询问:
问题 2b:您喜欢每个变体的哪些方面?
示例响应格式以指导用户:
- A: 喜欢卡片布局和间距
- B: 配色方案感觉合适
- C: 悬停交互很棒
- D: 没什么突出的
- E: 排版层次最清晰
然后进入阶段 6:综合新变体。
基于用户关于他们喜欢每个变体哪些方面的反馈:
创建一个新的混合变体(变体 F),结合:
替换设计实验室为比较视图:
更新 /__design_lab 路由以显示新布局
再次请求反馈:
问题:新变体怎么样?
如果"更接近了"或"方向错了",收集更具体的反馈并进行迭代。支持多次综合过程,直到用户满意为止。
然后进入阶段 7:最终预览。
一旦用户满意:
创建 .claude-design/preview/ 目录:
.claude-design/preview/
├── page.tsx # 预览页面
└── FinalDesign.tsx # 胜出设计
在 /__design_preview 创建路由
对于重新设计,包括前后对比:
请求最终确认:
问题:确认最终设计?
如果"否,需要更改":收集反馈并进行迭代。如果"中止":进入下面的中止处理。
如果用户在此过程的任何阶段(不仅仅是最终确认)想要取消/中止,他们可能会说:
当中止被检测到时:
确认中止:
如果确认,立即清理:
.claude-design/ 目录app/__design_lab/ 等)确认:
当用户确认时(选择了"是,最终确定"):
删除所有临时文件:
.claude-design/ 目录app/__design_lab/ (Next.js App Router)pages/__design_lab.tsx (Next.js Pages Router)app/__design_preview/pages/__design_preview.tsxApp.tsx 修改(Vite)安全规则:
.claude-design/ 内的文件在项目根目录创建 DESIGN_PLAN.md:
# 设计实施计划:[TargetName]
## 摘要
- **范围:** [组件/页面]
- **目标:** [文件路径]
- **胜出变体:** [A-E]
- **关键改进:** [来自反馈]
## 需要更改的文件
- [ ] `src/components/Example.tsx` - 主组件重构
- [ ] `src/styles/example.css` - 样式更新
- [ ] ...(列出所有受影响文件)
## 实施步骤
1. [带有代码指导的具体步骤]
2. [下一步]
3. ...
## 组件 API
- **属性:**
- `prop1: type` - 描述
- ...
- **状态:**
- 内部状态要求
- **事件:**
- 回调和处理程序
## 必需的 UI 状态
- **加载:** [描述]
- **空:** [描述]
- **错误:** [描述]
- **禁用:** [描述]
- **验证:** [描述]
## 可访问性检查清单
- [ ] 键盘导航有效
- [ ] 焦点状态可见
- [ ] 标签和 aria-* 属性正确
- [ ] 颜色对比度符合 WCAG AA
- [ ] 屏幕阅读器已测试
## 测试检查清单
- [ ] 逻辑单元测试
- [ ] 渲染组件测试
- [ ] 视觉回归测试(如果适用)
- [ ] E2E 冒烟测试(如果适用)
## 设计标记
- [任何要添加的新标记]
- [要使用的现有标记]
---
*由 Design Variations 插件生成*
创建或更新 DESIGN_MEMORY.md:
如果是新文件:
# 设计记忆
## 品牌调性
- **形容词:** [来自访谈]
- **避免:** [发现的反模式]
## 布局与间距
- **密度:** [偏好]
- **网格:** [如果已建立]
- **圆角:** [如果一致]
- **阴影:** [如果一致]
## 排版
- **标题:** [使用的字体、字重]
- **正文:** [字体、大小]
- **强调:** [模式]
## 颜色
- **主色:** [颜色标记]
- **辅色:** [颜色标记]
- **中性策略:** [方法]
- **语义颜色:** [错误、成功、警告]
## 交互模式
- **表单:** [验证方法、布局]
- **模态框/抽屉:** [何时使用哪个]
- **表格/列表:** [首选模式]
- **反馈:** [通知、内联等]
## 可访问性规则
- **焦点:** [可见焦点方法]
- **标签:** [标签约定]
- **动效:** [减少动效支持]
## 仓库约定
- **组件结构:** [文件组织]
- **样式方法:** [Tailwind 类、CSS 模块等]
- **现有原语:** [Button、Input、Card 等]
---
*由 Design Variations 插件更新*
如果更新现有文件:
如果无法确定框架:
如果开发服务器无法启动:
如果无法创建临时路由:
如果清理被中断:
该插件支持以下可选配置(通过环境或项目配置):
DESIGN_AUTO_IMPLEMENT:如果为 true,确认后立即实施计划DESIGN_KEEP_LAB:如果为 true,在明确清理命令之前不删除实验室DESIGN_MEMORY_PATH:设计记忆文件的自定义路径/design-variations:design CheckoutSummary.claude-design/lab/app/__design_lab/page.tsxpnpm dev/__design_preview 的最终预览DESIGN_PLAN.mdDESIGN_MEMORY.mdThis skill implements a complete design exploration workflow: interview, generate variations, collect feedback, refine, preview, and finalize.
All temporary files MUST be deleted when the process ends, whether by:
Never leave.claude-design/ or __design_lab routes behind. If the user says "cancel", "abort", "stop", or "nevermind" at any point, confirm and then delete all temporary artifacts.
Before starting the interview, automatically detect:
Check for lock files in the project root:
pnpm-lock.yaml → use pnpmyarn.lock → use yarnpackage-lock.json → use npmbun.lockb → use bunCheck for config files:
next.config.js or next.config.mjs or next.config.ts → Next.js
app/ directory → App Routerpages/ directory → Pages Routervite.config.js or vite.config.ts → Viteremix.config.js → Remixnuxt.config.js or nuxt.config.ts → Check package.json dependencies and config files:
tailwind.config.js or tailwind.config.ts → Tailwind CSS@mui/material in dependencies → Material UI@chakra-ui/react in dependencies → Chakra UIantd in dependencies → Ant Designstyled-components in dependencies → styled-components@emotion/react in dependencies → Emotion.css or .module.css files → Look for existing Design Memory file:
docs/design-memory.mdDESIGN_MEMORY.md.claude-design/design-memory.mdIf found, read it and use to prefill defaults and skip redundant questions.
DO NOT use generic/predefined styles. Extract visual language from the project:
If Tailwind detected , read tailwind.config.js or tailwind.config.ts:
// Extract and use:
theme.colors // Color palette
theme.spacing // Spacing scale
theme.borderRadius // Radius values
theme.fontFamily // Typography
theme.boxShadow // Elevation system
If CSS Variables exist , read globals.css, variables.css, or :root definitions:
:root {
--color-* /* Color tokens */
--spacing-* /* Spacing tokens */
--font-* /* Typography tokens */
--radius-* /* Border radius tokens */
}
If UI library detected (MUI, Chakra, Ant), read the theme configuration:
theme.ts or createTheme() calltheme/index.ts or extendTheme() callConfigProvider theme propAlways scan existing components to understand patterns:
Store inferred styles in the Design Brief for consistent use across all variants.
Use the AskUserQuestion tool for all interview steps. Adapt questions based on Design Memory if it exists.
Ask these questions (can combine into single AskUserQuestion with multiple questions):
Question 1: Scope
Question 2: New or Redesign
If "Redesign" selected, ask: Question 3: Existing Path
If target is unclear, propose a name based on repo patterns and confirm.
Question 1: Pain Points
Question 2: Visual Inspiration
Question 3: Functional Inspiration
Question 1: Brand Adjectives
Question 2: Density
Question 3: Dark Mode
Question 1: Primary User
Question 2: Context
Question 3: Key Tasks
Question 1: Must-Keep Elements
Question 2: Technical Constraints
After the interview, create a structured Design Brief as JSON and save to .claude-design/design-brief.json:
{
"scope": "component|page",
"isRedesign": true|false,
"targetPath": "src/components/Example.tsx",
"targetName": "Example",
"painPoints": ["Too dense", "Primary action unclear"],
"inspiration": {
"visual": ["Stripe", "Linear"],
"functional": ["Inline validation"]
},
"brand": {
"adjectives": ["minimal", "trustworthy"],
"density": "comfortable",
"darkMode": true
},
"persona": {
"primary": "Developer",
"context": "desktop-first",
"keyTasks": ["Complete checkout", "Review order", "Apply discount"]
},
"constraints": {
"mustKeep": ["existing fields"],
"technical": ["no new dependencies", "WCAG accessible"]
},
"framework": "nextjs-app",
"packageManager": "pnpm",
"stylingSystem": "tailwind"
}
Display a summary to the user before proceeding.
Create all files under .claude-design/:
.claude-design/
├── lab/
│ ├── page.tsx # Main lab page (framework-specific)
│ ├── variants/
│ │ ├── VariantA.tsx
│ │ ├── VariantB.tsx
│ │ ├── VariantC.tsx
│ │ ├── VariantD.tsx
│ │ └── VariantE.tsx
│ ├── components/
│ │ └── LabShell.tsx # Lab layout wrapper
│ ├── feedback/ # Interactive feedback system
│ │ ├── types.ts # TypeScript interfaces
│ │ ├── selector-utils.ts # Element identification
│ │ ├── format-utils.ts # Feedback formatting
│ │ ├── FeedbackOverlay.tsx # Main overlay component
│ │ └── index.ts # Module exports
│ └── data/
│ └── fixtures.ts # Shared mock data
├── design-brief.json
└── run-log.md
The FeedbackOverlay is the PRIMARY feature of the Design Lab. Without it, users cannot provide interactive feedback. NEVER generate a Design Lab without the FeedbackOverlay.
Reliability Strategy: To avoid import path issues across different project configurations, create the FeedbackOverlay directly in the route directory (e.g., app/design-lab/FeedbackOverlay.tsx), NOT in .claude-design/. This ensures a simple relative import (./FeedbackOverlay) always works.
Required Files in Route Directory:
app/design-lab/ # or app/__design_lab/ if underscores work
├── page.tsx # Main lab page with variants
└── FeedbackOverlay.tsx # Self-contained overlay component (copy from templates)
Template Source: design-and-refine/templates/feedback/FeedbackOverlay.tsx
Why this approach:
.claude-design/ paths can fail due to bundler configurationsNext.js App Router: Create app/__design_lab/page.tsx that imports from .claude-design/lab/
Next.js Pages Router: Create pages/__design_lab.tsx that imports from .claude-design/lab/
Vite React:
/__design_labApp.tsx based on ?design_lab=true query paramOther frameworks: Create the most appropriate temporary route for the detected framework.
IMPORTANT: Read DESIGN_PRINCIPLES.md for UX, interaction, and motion best practices. But DO NOT use predefined visual styles —infer them from the project.
Apply universal principles (from DESIGN_PRINCIPLES.md):
Infer visual styles from the project:
Each variant MUST explore a different design axis. Do not create minor variations—make them meaningfully distinct. Use the project's existing visual language for all variants.
Variant A: Information Hierarchy Focus
Variant B: Layout Model Exploration
Variant C: Density Variation
Variant D: Interaction Model
Variant E: Expressive Direction
The Design Lab page must include:
Header with:
Variant Grid with:
data-variant="X" attribute (where X is A, B, C, D, E, or F). This is required for the feedback system to identify which variant comments belong to.Responsive behavior :
Shared Data :
data/fixtures.tsFeedback Overlay (CRITICAL - NEVER OMIT):
⚠️ THIS IS THE MOST IMPORTANT REQUIREMENT ⚠️
The FeedbackOverlay enables users to click on elements and leave comments. Without it, the Design Lab is just a static page with no way to collect structured feedback.
* Create `FeedbackOverlay.tsx` in the SAME directory as `page.tsx`
* Import with relative path: `import { FeedbackOverlay } from './FeedbackOverlay'`
* Render at the END of the page, after all variants
* Pass `targetName` prop with the component/page name
Example integration:
import { FeedbackOverlay } from './FeedbackOverlay'; // Relative import - always works
export default function DesignLabPage() {
return (
<div className="min-h-screen bg-background">
<header>...</header>
<main>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<div data-variant="A">
<VariantA />
</div>
<div data-variant="B">
<VariantB />
</div>
{/* ... more variants */}
</div>
</main>
{/* CRITICAL: FeedbackOverlay must be included */}
<FeedbackOverlay targetName="ComponentName" />
</div>
);
}
If you forget the FeedbackOverlay, the user CANNOT provide feedback. This defeats the entire purpose of the Design Lab.
Conventions:
Accessibility (from DESIGN_PRINCIPLES):
<button> not <div onclick>, <nav>, <main>, <section>:focus-visible with 2px ring and offsetStates (every component needs):
Motion:
prefers-reduced-motionAfter generating the lab files, immediately present the lab to the user. Do NOT attempt to:
Output the lab location and URL:
✅ Design Lab created!
I've generated 5 design variants in `.claude-design/lab/`
To view them:
1. Make sure your dev server is running (run `pnpm dev` if not)
2. Open: http://localhost:3000/__design_lab
Take your time reviewing the variants side-by-side, then come back and tell me:
- Which variant wins (A-E)
- What you like about it
- What should change
Immediately proceed to Phase 5 - ask for feedback. Do NOT wait for the user to say they've opened the browser. Just present the feedback questions right away so they're ready when the user returns.
Running pnpm dev or npm run dev starts a long-running process that never exits. If you run it, you'll wait forever. The user likely already has their dev server running, or can start it themselves in another terminal.
After presenting the lab URL, the user can provide feedback in two ways:
The Design Lab includes a Figma-like feedback overlay. When presenting the lab, include these instructions:
✅ Design Lab created!
I've generated 5 design variants in `.claude-design/lab/`
To view and provide feedback:
1. Make sure your dev server is running (run `pnpm dev` if not)
2. Open: http://localhost:3000/__design_lab
**To add feedback:**
1. Click the "Add Feedback" button (bottom-right corner)
2. Click any element you want to comment on
3. Type your feedback and click "Save"
4. Repeat for all elements you want to comment on
5. Fill in the "Overall Direction" field (required)
6. Click "Submit All Feedback"
7. Paste the copied text here in the terminal
Or just describe your feedback manually below!
When the user pastes feedback , it will be in this format:
## Design Lab Feedback
**Target:** ComponentName
**Comments:** 3
### Variant A
1. **Button** (`[data-testid='submit']`, button with "Submit")
"Make this more prominent"
### Variant B
1. **Card** (`.product-card`, div with "Product Name")
"Love this layout"
### Overall Direction
Go with Variant B's structure. Apply Variant A's button styling.
How to parse and act on this feedback:
[data-testid='submit'])If the user prefers not to use the interactive overlay (or pastes manual feedback), use the AskUserQuestion flow below:
Question 1: Ready to pick?
If user said "Yes", ask:
Question 2a: Which one?
Question 3a: Any tweaks?
If "Minor tweaks needed", ask user to describe changes via text input.
Then proceed to Phase 7: Final Preview.
If user said "No - I like parts of different ones", ask:
Question 2b: What do you like about each?
Example response format to guide user:
- A: Love the card layout and spacing
- B: The color scheme feels right
- C: The interaction on hover is great
- D: Nothing stands out
- E: The typography hierarchy is clearest
Then proceed to Phase 6: Synthesize New Variant.
Based on the user's feedback about what they liked from each variant:
Create a new hybrid variant (Variant F) that combines:
Replace the Design Lab with a comparison view:
Update the/__design_lab route to show the new arrangement
Ask for feedback again:
Question: How's the new variant?
If "Getting closer" or "Went the wrong direction", gather more specific feedback and iterate. Support multiple synthesis passes until user is satisfied.
Then proceed to Phase 7: Final Preview.
Once user is satisfied:
Create .claude-design/preview/ directory:
.claude-design/preview/
├── page.tsx # Preview page
└── FinalDesign.tsx # The winning design
Create route at /__design_preview
For redesigns, include before/after comparison:
Ask for final confirmation:
Question: Confirm final design?
If "No, needs changes": gather feedback and iterate. If "Abort": proceed to Abort Handling below.
If the user wants to cancel/abort at ANY point during the process (not just final confirmation), they may say things like:
When abort is detected:
Confirm the abort:
If confirmed, clean up immediately:
.claude-design/ directory entirelyapp/__design_lab/, etc.)Acknowledge:
When user confirms (selected "Yes, finalize it"):
Delete all temporary files:
.claude-design/ directory entirelyapp/__design_lab/ (Next.js App Router)pages/__design_lab.tsx (Next.js Pages Router)app/__design_preview/pages/__design_preview.tsxApp.tsx modifications (Vite)Safety rules:
.claude-design/Create DESIGN_PLAN.md in the project root:
# Design Implementation Plan: [TargetName]
## Summary
- **Scope:** [component/page]
- **Target:** [file path]
- **Winner variant:** [A-E]
- **Key improvements:** [from feedback]
## Files to Change
- [ ] `src/components/Example.tsx` - Main component refactor
- [ ] `src/styles/example.css` - Style updates
- [ ] ... (list all affected files)
## Implementation Steps
1. [Specific step with code guidance]
2. [Next step]
3. ...
## Component API
- **Props:**
- `prop1: type` - description
- ...
- **State:**
- Internal state requirements
- **Events:**
- Callbacks and handlers
## Required UI States
- **Loading:** [description]
- **Empty:** [description]
- **Error:** [description]
- **Disabled:** [description]
- **Validation:** [description]
## Accessibility Checklist
- [ ] Keyboard navigation works
- [ ] Focus states visible
- [ ] Labels and aria-* attributes correct
- [ ] Color contrast meets WCAG AA
- [ ] Screen reader tested
## Testing Checklist
- [ ] Unit tests for logic
- [ ] Component tests for rendering
- [ ] Visual regression tests (if applicable)
- [ ] E2E smoke test (if applicable)
## Design Tokens
- [Any new tokens to add]
- [Existing tokens to use]
---
*Generated by Design Variations plugin*
Create or update DESIGN_MEMORY.md:
If new file:
# Design Memory
## Brand Tone
- **Adjectives:** [from interview]
- **Avoid:** [anti-patterns discovered]
## Layout & Spacing
- **Density:** [preference]
- **Grid:** [if established]
- **Corner radius:** [if consistent]
- **Shadows:** [if consistent]
## Typography
- **Headings:** [font, weights used]
- **Body:** [font, size]
- **Emphasis:** [patterns]
## Color
- **Primary:** [color tokens]
- **Secondary:** [color tokens]
- **Neutral strategy:** [approach]
- **Semantic colors:** [error, success, warning]
## Interaction Patterns
- **Forms:** [validation approach, layout]
- **Modals/Drawers:** [when to use which]
- **Tables/Lists:** [preferred patterns]
- **Feedback:** [toast, inline, etc.]
## Accessibility Rules
- **Focus:** [visible focus approach]
- **Labels:** [labeling conventions]
- **Motion:** [reduced motion support]
## Repo Conventions
- **Component structure:** [file organization]
- **Styling approach:** [Tailwind classes, CSS modules, etc.]
- **Existing primitives:** [Button, Input, Card, etc.]
---
*Updated by Design Variations plugin*
If updating existing file:
If framework cannot be determined:
If dev server won't start:
If can't create temporary route:
If cleanup is interrupted:
The plugin supports these optional configurations (via environment or project config):
DESIGN_AUTO_IMPLEMENT: If true, implement the plan immediately after confirmationDESIGN_KEEP_LAB: If true, don't delete lab until explicit cleanup commandDESIGN_MEMORY_PATH: Custom path for Design Memory file/design-variations:design CheckoutSummary.claude-design/lab/ with 5 variantsapp/__design_lab/page.tsxpnpm dev/__design_previewDESIGN_PLAN.mdWeekly Installs
70
Repository
GitHub Stars
583
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode60
codex60
gemini-cli59
github-copilot51
claude-code50
cursor49
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
159,700 周安装
Proxychains 网络代理工具:自动解决GitHub/PyPI/npm访问失败和连接超时问题
111 周安装
Skill Creator - AI Agent技能创建工具,扩展Claude能力,构建模块化技能包
131 周安装
Cloudflare 开发平台完整指南:API、Workers、存储、AI与安全产品决策树
132 周安装
Google Sheets自动化指南:通过Rube MCP与Composio实现数据读写与管理
132 周安装
UX文案撰写指南:清晰、简洁、人性化的界面文案写作原则与模式
132 周安装
Nansen Profiler 钱包画像分析器 - 区块链地址余额、交易、盈亏与关联分析工具
133 周安装
astro.config.mjs → AstroDESIGN_MEMORY.md