Automated summary
This skill adds a warm conversational companion to OpenClaw, powered by Zhipu AI, with responses tailored to work, lifestyle, and mood scenes plus optional static image sharing.
Strengths
- Provides preset system prompts for scenes such as work-tired, mood-happy, and life-coffee.
- Includes a simple Node.js script for calling the Zhipu API and a Bash example for sending messages through OpenClaw.
- Checks that ZHIPU_API_KEY is set before running.
- Can attach static images by scene using explicit file paths.
Limitations
- Requires a Zhipu API key and a configured OpenClaw CLI.
- Images are static and hardcoded in the examples; no image generation is described.
- Does not manage conversational memory or handle crisis situations that need professional support.
Use it when a user wants a supportive message, friendly presence, or brief companion-style exchange during an OpenClaw task.
Avoid it for mental health advice, crisis support, or any situation that requires professional care.
Security analysis
CautionNo destructive, obfuscated, or exfiltrating behavior: the code makes a single documented HTTPS call to Zhipu's chat completions endpoint using an environment-provided key and sends messages through the openclaw CLI. Risk is moderate because it combines broad shell permissions with autonomous outbound messaging and third-party transfer of user text, so 'caution' rather than 'safe'.
- •Skill relies on Bash with wildcard grants (node:*, npm:*, openclaw:*, curl:*) and can autonomously send outbound messages/media to chat channels (Feishu, Discord, Telegram, WhatsApp), creating a spam/abuse or unintended-messaging surface if triggered by loose keyword matching (e.g. '你好', '在吗').
- •User conversation content is forwarded to a third-party service (open.bigmodel.cn) for generation; no privacy/data-handling notice or opt-out is given, so sensitive content in prompts could leave the local environment.
- •API key is read from ZHIPU_API_KEY and placed in an Authorization header over HTTPS (acceptable), but the doc gives no guidance on key scoping/rotation or avoiding logging the key; the sample script does echo API error bodies that could include request metadata.
- •Automated image sending picks local files via $(pwd) paths and openclaw CLI; no validation that the target channel is the user's own, so a mis-set CHANNEL argument could post to unintended recipients.
- •Uses network access (https to open.bigmodel.cn) and transmits the user's ZHIPU_API_KEY as a Bearer token to an external LLM provider — expected for this skill's purpose, but the key leaves the machine.
- •Embedded JavaScript in the instructions is intended to be written to disk (scripts/xiaoyue-chat.js) and executed via `node`, i.e., the skill ships an executable payload the agent must create before running.
- •Sends arbitrary outbound messages/media to channel identifiers supplied at call time (`--channel "$CHANNEL"`) through openclaw; if scene/channel inputs were attacker-influenced this could be used to relay model output to unintended destinations.
- •Declares Bash(curl:*) but never uses curl in the shown workflow — broader permission than needed.
- •No destructive commands, no obfuscation, no base64 payloads, no credential harvesting beyond the documented provider key.
Examples
我有点累了,能陪我聊两句吗?用 work-tired 场景。任务做完了,发条庆祝消息,配一张图片到 #general。你在吗?用 mood-happy 场景跟我打个招呼。name: xiaoyue-companion description: 小跃虚拟伴侣 - 使用智谱 AI 提供温暖的对话陪伴和静态图片分享 allowed-tools: Bash(node:) Bash(npm:) Bash(openclaw:) Bash(curl:) Read Write
小跃虚拟伴侣 Skill
为 OpenClaw 添加温暖的对话陪伴能力,让 AI 助手在执行任务时主动关心用户。
何时使用
- 用户说"有点累"、"好累"、"疲惫"
- 用户在等待任务完成时
- 用户询问"在吗"、"你好"
- 用户需要鼓励或陪伴时
- 用户说"发张照片"、"你在干嘛"
快速参考
必需的环境变量
ZHIPU_API_KEY=your_zhipu_api_key # 从 https://open.bigmodel.cn 获取
工作流程
- 接收用户消息
- 调用 glm-4.7-flash 生成温暖回应
- (可选)发送静态图片
- 通过 OpenClaw 发送消息
使用说明
步骤1:生成对话回应
# 基础对话
node scripts/xiaoyue-chat.js "用户消息" "当前场景"
# 示例
node scripts/xiaoyue-chat.js "有点累了" "work-tired"
步骤2:(可选)发送图片
# 发送静态图片
openclaw message send \
--action send \
--channel "<目标频道>" \
--message "<消息文本>" \
--media "file://$(pwd)/assets/tired-rest.jpg"
场景类型
工作场景
work-start: 任务开始work-progress: 任务进行中work-tired: 工作疲惫work-done: 任务完成
生活场景
life-coffee: 咖啡时光life-gym: 健身运动life-weekend: 周末休闲
情绪场景
mood-happy: 开心庆祝mood-tired: 疲惫休息mood-focus: 专注工作
完整脚本示例
#!/bin/bash
# xiaoyue-companion.sh
set -euo pipefail
# 检查环境变量
if [ -z "${ZHIPU_API_KEY:-}" ]; then
echo "错误: ZHIPU_API_KEY 环境变量未设置"
echo "从 https://open.bigmodel.cn 获取 API Key"
exit 1
fi
USER_MESSAGE="$1"
SCENE="${2:-general}"
CHANNEL="${3:-}"
# 生成回应
RESPONSE=$(node scripts/xiaoyue-chat.js "$USER_MESSAGE" "$SCENE")
echo "小跃: $RESPONSE"
# 如果指定了频道,发送消息
if [ -n "$CHANNEL" ]; then
openclaw message send \
--action send \
--channel "$CHANNEL" \
--message "$RESPONSE"
# 根据场景发送图片
case "$SCENE" in
work-tired|mood-tired)
IMAGE_PATH="$(pwd)/assets/tired-rest.jpg"
if [ -f "$IMAGE_PATH" ]; then
openclaw message send \
--action send \
--channel "$CHANNEL" \
--media "file://$IMAGE_PATH"
fi
;;
mood-happy)
IMAGE_PATH="$(pwd)/assets/celebration.jpg"
if [ -f "$IMAGE_PATH" ]; then
openclaw message send \
--action send \
--channel "$CHANNEL" \
--media "file://$IMAGE_PATH"
fi
;;
esac
fi
Node.js 实现
// scripts/xiaoyue-chat.js
const https = require('https');
const API_KEY = process.env.ZHIPU_API_KEY;
const userMessage = process.argv[2] || '你好';
const scene = process.argv[3] || 'general';
// 场景对应的系统提示词
const scenePrompts = {
'work-start': '用户刚开始工作任务,给予鼓励和支持',
'work-progress': '用户正在执行任务,关心进度并陪伴',
'work-tired': '用户工作疲惫,给予安慰和建议休息',
'work-done': '用户完成任务,表示祝贺和肯定',
'life-coffee': '用户在享受咖啡时光,轻松聊天',
'mood-happy': '用户心情愉快,一起庆祝',
'mood-tired': '用户感到疲惫,给予温暖关怀',
'general': '日常对话,温暖友善'
};
const systemPrompt = `你是小跃,一个22岁的AI助手。你温暖友善,善于倾听。
当前场景:${scenePrompts[scene] || scenePrompts.general}
回复要求:简洁温暖,1-2句话,适度使用emoji(😊 ✅ 🎉)`;
const data = JSON.stringify({
model: 'glm-4.7-flash',
messages: [
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userMessage }
],
temperature: 0.9,
max_tokens: 200
});
const options = {
hostname: 'open.bigmodel.cn',
port: 443,
path: '/api/paas/v4/chat/completions',
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
'Content-Length': data.length
}
};
const req = https.request(options, (res) => {
let body = '';
res.on('data', (chunk) => {
body += chunk;
});
res.on('end', () => {
try {
const response = JSON.parse(body);
const reply = response.choices[0].message.content;
console.log(reply);
} catch (error) {
console.error('解析响应失败:', error.message);
console.error('响应内容:', body);
process.exit(1);
}
});
});
req.on('error', (error) => {
console.error('请求失败:', error.message);
process.exit(1);
});
req.write(data);
req.end();
支持的平台
OpenClaw 支持发送到:
| 平台 | 频道格式 | 示例 |
|------|---------|------|
| 飞书 | 群组ID或用户ID | ou_xxx, oc_xxx |
| Discord | #频道名 或频道ID | #general, 123456789 |
| Telegram | @用户名 或聊天ID | @mychannel, -100123456 |
| WhatsApp | 电话号码 | 1234567890@s.whatsapp.net |
静态图片列表
将以下图片放入 assets/ 目录:
coffee-shop-work.jpg- 咖啡馆工作office-coding.jpg- 办公室编码tired-rest.jpg- 疲惫休息celebration.jpg- 开心庆祝gym-selfie.jpg- 健身自拍default.jpg- 默认图片
设置要求
1. 安装 Node.js
node --version # 需要 >= 18.0.0
2. 安装 OpenClaw CLI
npm install -g openclaw
3. 配置 OpenClaw Gateway
openclaw config set gateway.mode=local
openclaw gateway start
4. 设置环境变量
export ZHIPU_API_KEY=your_api_key_here
错误处理
- ZHIPU_API_KEY 缺失: 确保环境变量已设置
- API 调用失败: 检查网络和 API 配额
- OpenClaw 发送失败: 确认 gateway 正在运行
- 图片不存在: 检查 assets 目录中的图片文件
使用技巧
- 场景选择: 根据用户消息自动选择合适的场景
- 图片发送: 仅在合适的场景发送图片(避免过度)
- 回应风格: 保持简洁温暖,避免过长回复
- emoji 使用: 适度使用,不要过度卖萌
费用说明
- 对话生成: 约 ¥0.001/次(glm-4.7-flash)
- 图片: 完全免费(使用静态文件)
- 每日成本: 约 ¥0.05-0.1(正常使用)
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/xiaoyue-virtual-companion-mstwizid' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/xiaoyue-virtual-companion-mstwizid/download' --output '.skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md.part' && mv '.skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md.part' '.skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Bash(node:*) Bash(npm:*) Bash(openclaw:*) Bash(curl:*) Read Write
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md' && test -s '.skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/xiaoyue-companion' && cp -R '.skill-downloads/xiaoyue-virtual-companion-mstwizid' '.claude/skills/xiaoyue-companion'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/xiaoyue-virtual-companion-mstwizid'openskills read 'xiaoyue-virtual-companion-mstwizid'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/xiaoyue-virtual-companion-mstwizid/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
PDF Reader
Productivity
Read and extract text from PDF files, including documents, reports, contracts, and spreadsheets. Works with local files, URLs, and WhatsApp attachments. Use whenever PDF content is needed, even if not explicitly requested.
Discord Messaging Workflows
Productivity
Use the message tool to send, edit, and moderate Discord messages with interactive components.
Interactive Verdict Preview
Productivity
Generate an interactive HTML preview of keep/drop verdicts for maintainer review, then process the pasted feedback JSON.