Skip to content

anbeime/skill / projects/companion-skill

companion-skill

Verified

软件开发工程师与综合办公文员在长时间独自执行后台任务或处理繁琐工作时,当需要情绪陪伴与互动反馈,请使用此技能。小跃虚拟伴侣会在任务期间主动陪聊,智能生成专属生活照片并通过飞书发送温暖消息,为你提供全天候的情绪价值与贴心陪伴。

FileKindSize
.env.exampleother403 B
CHANGELOG.mdmarkdown3.0 KB
INSTALL.mdmarkdown2.4 KB
QUICKSTART.mdmarkdown4.6 KB
README-LITE.mdmarkdown4.3 KB
README.mdmarkdown4.5 KB
RETHINK.mdmarkdown2.3 KB
SKILL.mdskill md4.6 KB
package.jsonmanifest876 B
src/companion.tsscript5.4 KB
src/image-generator.tsscript8.0 KB
src/index.tsscript2.5 KB
src/prompts/personality.tsscript3.3 KB
src/scene-detector.tsscript4.0 KB
src/test.tsscript6.9 KB
tsconfig.jsonconfig486 B

CHANGELOG.md

View on GitHub
# 更新说明 v0.2.0

## ✅ 已修正

### 1. 模型名称全部改为小写
- ✅ `GLM-4.7-Flash` → `glm-4-flash`
- ✅ `CogView-3-Flash` → `cogview-3-flash`
- ✅ 新增 `glm-4v-flash` 多模态视觉能力

### 2. 新增功能

#### 多模态视觉理解 (glm-4v-flash)
小跃现在可以"看懂"图片了!

**新增方法:**
```typescript
// 分析图片内容
await companion.analyzeImage(imageUrl, '描述这张图片');
```

**应用场景:**
- 用户发送图片时,小跃可以理解图片内容并回应
- 分析参考图片,生成更一致的场景图片
- 识别用户的工作环境,提供更贴心的建议

**测试示例:**
```typescript
// 测试参考图片 D:\tool\StepFun\resources\chat.png
const analysis = await companion.analyzeImage(
  'data:image/png;base64,...',
  '请描述这张图片的内容,包括人物、场景和氛围'
);
```

### 3. 更新的文件

- ✅ `src/companion.ts` - 添加 `analyzeImage()` 方法
- ✅ `src/image-generator.ts` - 修正模型名称
- ✅ `src/test.ts` - 添加多模态测试
- ✅ `README.md` - 更新技术栈说明

## 🚀 如何使用

### 测试多模态能力

```bash
npm test
```

测试将自动:
1. 读取 `D:\tool\StepFun\resources\chat.png`
2. 转换为 base64
3. 调用 glm-4v-flash 分析图片
4. 输出分析结果

### 在代码中使用

```typescript
import { CompanionService } from './companion';

const companion = new CompanionService(apiKey);

// 分析用户发送的图片
const result = await companion.analyzeImage(
  imageUrl,
  '这张图片是什么场景?'
);

console.log(result);
// 输出:这是一张在咖啡馆工作的照片,桌上有笔记本电脑和咖啡...
```

## 📊 智谱 AI 模型对比

| 模型 | 用途 | 特点 | 成本 |
|------|------|------|------|
| **glm-4-flash** | 对话生成 | 快速响应,自然对话 | ¥0.001/千tokens |
| **glm-4v-flash** | 视觉理解 | 图片分析,多模态 | ¥0.005/千tokens |
| **cogview-3-flash** | 图片生成 | 快速生图,质量高 | ¥0.05/张 |

## 🎯 下一步

现在你可以:

1. **运行测试**:验证所有功能是否正常
   ```bash
   cd D:\tool\xiaoyue-companion-skill
   npm install
   npm test
   ```

2. **生成图片库**:预先生成一套场景图片
   ```bash
   npm run test:generate
   ```

3. **集成到 OpenClaw**:参考 `INSTALL.md`

## 💡 创新应用场景

### 场景1:智能识别用户环境
```
用户:[发送工作照片]
小跃:[分析图片] 看起来你在咖啡馆工作呀~
     环境不错!需要我帮你整理一下今天的任务吗?
```

### 场景2:生成一致风格的图片
```
1. 用 glm-4v-flash 分析参考图片
2. 提取人物特征和风格
3. 用 cogview-3-flash 生成新场景图片
4. 保持人物形象一致
```

### 场景3:理解用户分享的内容
```
用户:[发送代码截图]
小跃:[分析图片] 看到你在调试 Python 代码~
     这个错误是因为...需要我帮你搜索解决方案吗?
```

---

**版本**: v0.2.0  
**更新日期**: 2026-02-11  
**兼容性**: 完全向后兼容 v0.1.0
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall