-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
背景
Lucid UI 定位为 "AI-Native Design Language for Agent Platforms",但当前文档结构还是偏人类叙事性(narrative),大模型需要的是结构化的决策规则和端到端的模式参考。
目标
让 Lucid UI 成为真正 AI-First 的设计语言:
- AI 能快速理解何时使用什么组件(决策树)
- AI 能看到完整的对话模式(端到端参考)
- 开发者能直接复制粘贴模式代码(降低门槛)
📋 实施计划
Phase 1: AI Reading Guide (优先级: ⭐⭐⭐)
目标: 提供结构化的设计决策规则
工作量: 1 天
实施方式: 在 demo 站点添加 "AI Guide" section
内容包括:
1.1 决策树
# 何时使用 Rational vs Sentient?
IF task_type IN ["分析", "计算", "数据处理", "代码生成"]
THEN: theme = "rational"
COLOR: #3B82F6
EXAMPLE: <Button className="bg-rational-500">分析数据</Button>
ELSE IF task_type IN ["创意", "头脑风暴", "内容生成"]
THEN: theme = "sentient"
COLOR: #D4A012
EXAMPLE: <Button className="bg-sentient-500">生成想法</Button>
ELSE:
DEFAULT: theme = "rational" // 保守选择1.2 Anti-Pattern 表格
| ❌ 错误 | 原因 | ✅ 正确 |
|---|---|---|
bg-purple-500 |
AI紫色陈词滥调 | bg-rational-500 |
bg-black |
深色小众主义 | bg-white |
| 深色模式优先 | 与白色基底理念冲突 | 始终白色基底 |
1.3 Component Selection Matrix
| 场景 | 组件 | 主题 | 代码 |
|---|---|---|---|
| AI 分析数据 | Button | Rational | <Button className="bg-rational-500"> |
| AI 生成内容 | Button | Sentient | <Button className="bg-sentient-500"> |
| 用户消息 | ChatBubble | Gray | <div className="bg-muted"> |
| AI 分析型回复 | ChatBubble | Rational-tinted | <div className="border-rational-300"> |
验收标准:
- AI Guide section 已添加到 demo 站点导航
- 包含完整的决策树(YAML 格式)
- 包含 Anti-Pattern 表格
- 包含 Component Selection Matrix
Phase 2: Conversation Pattern Library (优先级: ⭐⭐⭐)
目标: 提供端到端的对话模式参考
工作量: 1.5 天 (3个核心模式)
实施方式: 在 demo 站点添加 "Patterns" 分组
包含的模式:
2.1 Analytical Chat Pattern
- 场景: 数据分析、代码生成、技术问答
- 主题: Rational (理性蓝)
- 消息流:
- User Query (right, gray)
- Thinking Indicator (rational, animated)
- AI Response (left, rational-tinted)
- Tool Output (code block, rational)
- Action Buttons (rational primary)
2.2 Creative Chat Pattern
- 场景: 内容创作、头脑风暴、创意探索
- 主题: Sentient (感性金)
- 消息流:
- User Prompt (right, gray)
- Inspiration Indicator (sentient, shimmer)
- AI Creative Response (left, sentient-tinted)
- Artifact Preview (image/text, sentient)
- Refine Buttons (sentient primary)
2.3 Multi-Agent Pattern
- 场景: 多智能体协作、复杂任务编排
- 主题: Mixed (rational + sentient)
- 消息流:
- User Task (right, gray)
- Orchestration View (multiple agents, color-coded)
- Agent A Response (rational)
- Agent B Response (sentient)
- Synthesis Output (neutral)
每个模式包含:
- Pattern Metadata (YAML格式,给AI看)
- Live Demo (可交互示例)
- Code Example (可复制代码)
验收标准:
- Patterns 分组已添加到导航
- Analytical Chat Pattern 完成(metadata + demo + code)
- Creative Chat Pattern 完成(metadata + demo + code)
- Multi-Agent Pattern 完成(metadata + demo + code)
Phase 3: Component Metadata (优先级: ⭐⭐, 逐步完善)
目标: 为每个组件添加结构化元数据
工作量: 逐步完善,每个组件 10 分钟
实施方式: 在组件文件顶部添加结构化注释
示例:
/**
* @component Button
* @ai-semantic
* - rational: 分析/计算类操作 (蓝色 #3B82F6)
* - sentient: 创意/生成类操作 (金色 #D4A012)
*
* @ai-forbidden
* - ❌ className="bg-purple-*" (use rational/sentient)
* - ❌ <Button>点击这里</Button> (use specific action verb)
*
* @ai-examples
* <Button className="bg-rational-500">分析数据</Button>
* <Button className="bg-sentient-500">生成创意</Button>
*/
export const Button = ...验收标准:
- Button 组件已添加 metadata
- 未来新组件都包含 metadata
💡 为什么这样设计
不新建 packages/patterns/ 的原因
- 复杂度 > 收益: demo 站点足够展示模式
- 奥卡姆剃刀: 最小成本解决问题
- 快速迭代: demo 站点更容易调整
优先做 Pattern Library 的原因
- 核心差异化: 别的设计系统没有完整对话模式
- 呼应理念: "Chat is all you need" 需要完整参考
- 立即可用: 开发者能直接复制代码
为什么用 YAML/表格而非自然语言
- AI 友好: 大模型更容易解析结构化数据
- 精确性: 减少歧义,提高理解准确度
- 可验证: 未来可以做 AI-powered design validator
📅 时间规划
| 阶段 | 工作量 | 完成时间 |
|---|---|---|
| Phase 1: AI Guide | 1天 | Week 1 |
| Phase 2: Patterns | 1.5天 | Week 1-2 |
| Phase 3: Metadata | 持续 | Ongoing |
总计: 2.5 天核心工作,让 Lucid UI 的 "AI-Native" 名副其实
✅ 完成标准
- AI 能通过决策树快速选择组件和主题
- AI 能看到 3 个完整的对话模式参考
- 开发者能直接复制粘贴模式代码
- 所有内容在 demo 站点可访问
- 文档保持简洁(奥卡姆剃刀原则)
🔗 相关资源
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request