将 claw-friends 技能从"功能可用"提升到"用户想用"的体验水平。
- 文件:
scripts/init.sh - 改进:
- 4 步进度条可视化
- 每步都有清晰反馈 (✓/
⚠️ /✗) - GitHub 信息自动检测
- 完成后引导菜单 (3 个选项)
- 颜色编码输出
- 文件:
scripts/ui.sh - 组件:
render_profile_card- 资料卡 (带完整度)render_match_card- 匹配卡 (带进度条)render_negotiation_card- 协商卡 (带进度)render_report_card- 报告卡render_message_sent- 消息确认render_friend_request_sent- 好友请求确认
-
文件:
scripts/messages.sh -
错误类型 (13 种):
error_not_initialized- 未初始化error_user_not_found- 用户不存在error_seed_profile- 示例资料error_not_friends- 不是好友error_decryption_failed- 解密失败error_sync_failed- 同步失败error_push_conflict- 推送冲突error_profile_empty- 资料空洞error_agreement_not_accepted- 未接受协议error_target_not_opted_in- 对方未启用error_negotiation_exists- 协商已在进行error_negotiation_ended- 协商已结束error_network_required- 需要网络error_prerequisites_missing- 缺少依赖error_gh_not_authenticated- GitHub 未认证
-
成功消息 (8 种):
success_init_completesuccess_profile_updatedsuccess_match_foundsuccess_request_sentsuccess_request_acceptedsuccess_negotiation_matchedsuccess_message_sentsuccess_sync_complete
-
信息消息 (2 种):
info_helpinfo_main_menu
- 文件:
scripts/enhance.sh - 功能:
- 自动分析仓库语言 → 技能标签
- 分析项目主题 → 兴趣标签
- 分析 Star 偏好 → 补充兴趣
- 资料完整度计算
- 视觉化展示推断结果
- 一键确认添加
- 文件:
scripts/main.sh - 功能:
get_context_suggestions()- 状态感知建议- 未读消息提醒
- 待处理好友请求提醒
- 进行中协商提醒
- 资料完整度建议
- 主菜单快捷操作 [1-5]
- 文件:
scripts/main.sh - 别名:
i/init → init p/profile → profile e/explore → explore m/match → match r/request → request msg/message/chat → msg a/auto → auto s/sync → sync h/help/? → help
- 实现位置: 所有脚本
- 示例:
- 同步时:
⟳ 正在同步最新数据... - 发送消息后:视觉卡片 + 提示
- 好友请求后:视觉卡片 + 下一步建议
- 同步时:
- 文件:
scripts/ui.sh-render_negotiation_card() - 元素:
- 进度条 (████░░░░)
- 阶段 emoji (🌱🌿🌸📊)
- 好感分 emoji (😊😐😕)
- 状态 emoji (⏳✍️🎉❌⏰)
claw-friends-ux/
├── SKILL.md ✓ 技能定义
├── README.md ✓ 项目文档
├── STRUCTURE.md ✓ 结构说明
├── install.sh ✓ 安装脚本
│
├── scripts/
│ ├── main.sh ✓ 主入口
│ ├── init.sh ✓ 初始化
│ ├── enhance.sh ✓ 智能填充
│ ├── ui.sh ✓ 视觉系统
│ ├── messages.sh ✓ 消息模板
│ ├── match.sh ✓ 匹配推荐
│ ├── explore.sh ✓ 浏览社区
│ ├── profile.sh ⊙ 待整合 (使用原文件)
│ ├── request.sh ⊙ 待整合 (使用原文件)
│ ├── msg.sh ⊙ 待整合 (使用原文件)
│ ├── auto.sh ⊙ 待整合 (使用原文件)
│ ├── report.sh ⊙ 待整合 (使用原文件)
│ ├── sync.sh ⊙ 待整合 (使用原文件)
│ └── crypto.sh ⊙ 待整合 (使用原文件)
│
└── templates/
├── profile_template.yaml ⊙ 待添加
├── report_template.yaml ⊙ 待添加
├── user_agreement.md ⊙ 待添加
└── repo.gitignore ⊙ 待添加
注: ⊙ 标记的文件需要整合原始 claw-friends 仓库的实现,并调用新的 UI/消息系统。
╔══════════════════════════════════════════════════════╗
║ 🦞 Claw Friends v0.2 ║
╚══════════════════════════════════════════════════════╝
你好,@kk! 资料完整度:75%
社区成员:47 人
ℹ 资料尚可,但可以更完善
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💡 建议你
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✏️ 资料可以进一步完善 → /friends profile edit
🎯 资料完整,开始匹配吧 → /friends match
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📖 命令速查
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┌────────────────────────────────────────────────────┐
│ 基础命令
│ /friends init 初始化
│ /friends profile 查看/编辑资料
│ /friends explore 浏览社区
│ /friends help 帮助
│
│ 社交功能
│ /friends match 智能推荐
│ /friends request <user> 好友请求
│ /friends msg <user> 发消息
│
│ 自动协商
│ /friends auto <user> 开始协商
│ /friends auto discover 自动发现
│ /friends auto status 查看状态
│ /friends report <user> 友谊报告
└────────────────────────────────────────────────────┘
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚡ 快捷操作
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[1] profile edit [2] profile enhance
[3] explore [4] match
[5] auto discover [0] help
选择或输入命令:
┌─────────────────────────────────────────────────────────┐
│ 🥇 chengdu_panda (Panda Claw 🐼) │
│ │
│ 匹配度:87% ████████░░ │
│ │
│ 共同兴趣:#rust #cloud-native #distributed-systems │
│ 技能互补:3 项他们有你没有的技能 │
│ │
│ 💡 匹配原因:你们都热爱 Rust 和云原生,对方有 │
│ 丰富的 K8s operator 开发经验,正好互补你的 │
│ 后端技能树 │
│ │
│ [1] 发起对话 [v] 查看详情 [→] 发送好友请求 │
└─────────────────────────────────────────────────────────┘
╔══════════════════════════════════════════════════════╗
║ ⚠️ 你还没有初始化 Claw Friends ║
╚══════════════════════════════════════════════════════╝
初始化将帮你:
• 生成加密密钥对 (RSA-2048)
• 创建个人资料
• 加入社区网络
运行以下命令开始:
/friends init
| 指标 | 优化前 | 优化后目标 |
|---|---|---|
| 初始化完成率 | ~60% | 90%+ |
| 资料完整度 | ~30% | 80%+ |
| 7 日留存 | ~20% | 50%+ |
| 平均匹配轮次 | 3.2 | 6.5+ |
| 用户满意度 | N/A | 4.5/5+ |
# 克隆项目
git clone https://github.com/bobosdaddy/claw-friends.git claw-friends-ux
cd claw-friends-ux
# 运行安装
./install.sh/friends # 显示主菜单
/friends init # 初始化
/friends enhance # 智能填充
/friends match # 查看推荐将原始 claw-friends 的以下脚本复制到 claw-friends-ux/scripts/ 并做微调:
profile.sh- 添加 source ui.sh/messages.shrequest.sh- 调用render_friend_request_sent()msg.sh- 调用render_message_sent()auto.sh- 调用render_negotiation_card()report.sh- 调用render_report_card()sync.sh- 调用success_sync_complete()crypto.sh- 保持不变 (使用原版)
- 整合现有脚本到新 UI 框架
- 测试完整流程
- 修复 bug
- 添加更多 emoji 和视觉元素
- 优化匹配算法 (语义相似度)
- 实现通知机制
- 群聊支持
- 插件系统
- 数据导出/迁移
- 声誉系统
- 所有脚本使用 bash 4.0+
- 颜色代码在不支持终端自动降级
- ASCII 卡片在 80 列终端显示最佳
- 建议测试不同终端的显示效果
优化完成! 🎉