anbeime/skill / projects/companion-simple
xiaoyue-companion
Verified专为软件开发工程师与综合办公文员打造。当你在等待任务执行、工作疲惫或需要鼓励时,使用此技能通过智谱AI自动生成温暖对话回应与场景配图,一键获取专属情绪价值与虚拟陪伴,让AI助手更懂你。
SUMMARY.md
View on GitHub# 小跃虚拟伴侣 Skill - 最终版本
## ✅ 已完成
### 1. 参考 Clawra 项目结构
- ✅ 克隆并分析了 Clawra 的实际代码
- ✅ 理解了 OpenClaw Skill 的标准结构
- ✅ 采用相同的简单设计模式
### 2. 创建简化版 Skill
```
xiaoyue-companion-simple/
├── SKILL.md # Skill 定义
├── scripts/
│ ├── xiaoyue-chat.js # 对话生成脚本
│ └── xiaoyue-companion.sh # 完整脚本
├── templates/
│ └── soul-injection.md # SOUL.md 注入内容
├── assets/ # 静态图片目录
└── README.md # 使用说明
```
### 3. 核心特点
- ✅ **零依赖**:不需要 npm install
- ✅ **低成本**:仅对话费用(¥0.001/次)
- ✅ **简单**:参考 Clawra,保持极简
- ✅ **实用**:温暖陪伴 + 静态图片
## ⚠️ 当前问题
### API 调用错误
智谱 AI API 返回 JSON 解析错误:
```
JSON parse error: Unexpected end-of-input in VALUE_STRING
```
**可能原因:**
1. API Key 格式问题
2. 请求体编码问题
3. API 端暂时故障
**建议解决方案:**
1. 使用智谱 AI 官方 SDK(zhipuai-sdk-nodejs-v4)
2. 或使用 curl 命令测试 API
3. 检查 API Key 是否有效
## 📦 项目文件
```desktop-local-file
{
"localPath": "D:\\tool\\xiaoyue-companion-simple",
"fileName": "xiaoyue-companion-simple"
}
```
**包含文件:**
- ✅ SKILL.md - OpenClaw Skill 定义
- ✅ xiaoyue-chat.js - 对话生成脚本
- ✅ xiaoyue-companion.sh - 完整 Bash 脚本
- ✅ soul-injection.md - SOUL.md 注入模板
- ✅ README.md - 完整使用说明
## 🎯 下一步建议
### 选项A:使用官方 SDK
```bash
cd xiaoyue-companion-simple
npm init -y
npm install zhipuai-sdk-nodejs-v4
# 重写 xiaoyue-chat.js 使用 SDK
```
### 选项B:先用 curl 测试
```bash
curl -X POST "https://open.bigmodel.cn/api/paas/v4/chat/completions" \
-H "Authorization: Bearer $ZHIPU_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-4.7-flash",
"messages": [
{"role": "user", "content": "hello"}
]
}'
```
### 选项C:使用静态回复
暂时不调用 API,使用预设回复模板,先测试 OpenClaw 集成流程。
## 📖 参考资料
- **Clawra 项目**: `D:\tool\clawra`
- **智谱 AI 文档**: 你提供的 API 示例
- **OpenClaw 文档**: https://openclaw.ai
## 💡 经验总结
### 做对的事
- ✅ 参考现有项目(Clawra)
- ✅ 保持简单设计
- ✅ 遵循 OpenClaw Skill 标准
### 之前的问题
- ❌ 过度设计(TypeScript + 复杂模块)
- ❌ 重新发明轮子
- ❌ 忽略现有最佳实践
### 关键收获
> **"先看别人怎么做的,再动手改"** 比从零开始设计要高效得多!
---
**你说得对!** 我应该先参考 Clawra 的实际代码,而不是自己从零设计。现在项目结构已经准备好了,只需要解决 API 调用问题即可。
需要我:
A. 尝试使用官方 SDK 重写脚本
B. 先用 curl 测试 API 是否正常
C. 创建静态回复版本,先测试集成流程
D. 其他建议
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |