← Back to Skills Marketplace
kylinr

Feishu Mood Music

by Rong · GitHub ↗ · v1.5.0 · MIT-0
cross-platform ⚠ suspicious
89
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install feishu-mood-music
Description
飞书音乐心情伴侣。识别用户的情绪状态,生成匹配的治愈/陪伴音乐并发送到飞书群。 三级触发机制: (1) 显式触发(直接要歌):"来首歌"、"想听歌"、"来首应景的"、"音乐治愈"、"解压音乐"、"放首歌" (2) 半隐式触发(情绪词 + @机器人):"心情不好"、"有点累"、"好烦"、"需要放松"、"emo了"、...
README (SKILL.md)

飞书音乐心情伴侣 — Mood Music Companion

感知用户情绪,生成治愈音乐,通过飞书消息即时送达。不是冷冰冰的点歌台,是一个懂你情绪的音乐搭档。

依赖:MiniMax CLI(mmx-cli)+ Token Plan


快速配置(首次使用)

1. 安装 MiniMax CLI

npm install -g mmx-cli

需要 Node.js 18+。完整文档:https://github.com/MiniMax-AI/cli

2. 订阅 Token Plan

前往 MiniMax 平台订阅 Token Plan(音乐生成需要额度):

  • 🇨🇳 国内:https://platform.minimaxi.com/subscribe/token-plan
  • 🌍 海外:https://platform.minimax.io/subscribe/token-plan

3. 登录认证

# 方式一:API Key 登录(推荐,从平台「接口密钥」页获取)
mmx auth login --api-key sk-xxxxx

# 方式二:浏览器 OAuth 登录
mmx auth login

4. 验证

mmx auth status    # 检查登录
mmx quota          # 检查额度
mmx music generate --prompt "gentle piano, healing" --out /tmp/test_mood.mp3  # 测试生成

全部通过即可使用本 Skill。


情绪-音乐映射表

负面情绪(治愈方向)

情绪信号 识别关键词 音乐策略 风格 情绪曲线
😞 低落/难过 难过、伤心、emo、低落、郁闷 先共鸣后治愈 Lo-fi R&B → Acoustic Warm 从忧伤缓缓上升到温暖
😤 烦躁/愤怒 烦、气死了、崩溃、炸了 释放型 Post-Rock, Alt Rock 先给爆发出口,再收归平静
😰 焦虑/压力 焦虑、压力大、紧张、慌 镇静型 Ambient, New Age 持续安定,缓慢呼吸节奏
😴 疲惫/倦怠 好累、不想动、倦了、乏 温柔托底 Bossa Nova, Soft Jazz 不强求振作,给温柔的休息感
😢 孤独/思念 孤独、想念、一个人、寂寞 陪伴型 Indie Folk, Singer-songwriter 像朋友在身边轻声哼唱

正面情绪(助燃方向)

情绪信号 识别关键词 音乐策略 风格
😊 开心/满足 开心、不错、满足、幸福 锦上添花 City Pop, Funk, Disco
🔥 兴奋/庆祝 太棒了、赢了、发布、上线 推向高潮 EDM, Dance Pop, Hyperpop
🌟 期待/憧憬 期待、马上就、等不及 氛围渲染 Synth Pop, Dream Pop
💪 战斗/冲刺 冲、干就完了、拼了 热血增幅 Rock, Trap, Epic Electronic

工作流

Step 1: 触发判断(三级触发机制)

本 Skill 采用三级触发,根据信号强度决定行为:

🟢 Level 1:显式触发(直接要歌)

用户明确要求音乐,无论是否 @机器人,立即生成

触发词 动作
来首歌、想听歌、放首歌 直接生成,不问
来首应景的、音乐治愈、解压音乐 直接生成,不问
来首 [风格] 的歌 按指定风格生成

🟡 Level 2:半隐式触发(情绪词 + @机器人)

用户表达了情绪且 @了机器人,视为求助信号,直接生成。 如果只有情绪词但没有 @,不触发(避免群聊噪音)。

触发词(需要 @) 动作
心情不好、有点累、好烦、好丧 匹配情绪 → 生成
emo了、压力好大、需要放松、陪我 匹配情绪 → 生成
开心、兴奋、太棒了 匹配情绪 → 生成

🔴 Level 3:全隐式触发(极端情绪,自动送歌)

用户情绪到了极端值,无需 @,自动生成并送歌。 这些词本身就是强烈信号,沉默反而像冷漠。

负面极端(先共鸣后治愈):

触发词 情绪 动作
烦死了、烦得要死 😤 暴怒 释放型音乐 + 「🎵 先听会儿」
无语死了、服了 😤 无奈 释放型音乐
崩溃了、要疯了、受不了了 😰 崩溃 镇静型音乐 + 「🎵 深呼吸」
累死了、不想干了 😴 极度疲惫 温柔托底音乐 + 「🎵 歇会儿吧」
想哭、难受死了 😢 极度悲伤 陪伴型带歌词 + 「🎵 这首给你」

正面极端(助燃放大):

触发词 情绪 动作
爽死了、太爽了 🔥 极度兴奋 高能舞曲 + 「🎵 燥起来!」
太开心了、幸福死了 😊 极度开心 欢快 Funk + 「🎵 快乐加倍!」
牛逼炸了、赢麻了 🔥 庆祝 EDM/Hyperpop + 「🎵 这首给你庆祝!」
冲冲冲、干就完了 💪 战斗 热血摇滚 + 「🎵 冲!」

全隐式安全规则

  • 仅在群聊中对已知用户触发(非陌生人)
  • 同一用户 30 分钟内最多触发 1 次(防刷屏)
  • 私聊场景下,Level 2 和 Level 3 均可无需 @ 触发

Step 2: 情绪识别

从用户消息中分析:

  1. 情绪类别:匹配上方映射表(可多维度叠加)
  2. 情绪强度:轻微 / 中等 / 强烈(影响音乐激烈程度和歌词策略)
  3. 场景线索:工作中 / 下班后 / 深夜(影响风格选择)

Step 3: 构建 Prompt

根据情绪映射选择音乐策略,构建 prompt。

负面情绪使用"情绪曲线"策略——不直接跳到快乐,而是先共鸣再引导:

prompt 模板(负面情绪):
\x3Cstyle>, \x3Cmood 起始: 共鸣词>, gradually shifting to \x3Cmood 目标: 治愈词>, 
\x3Cinstruments>, \x3CBPM> BPM, \x3Cvocal/instrumental>, 
a song that understands how you feel and gently lifts you up

正面情绪使用"助燃"策略——放大当前感受:

prompt 模板(正面情绪):
\x3Cstyle>, \x3Cmood: 正面高能词>, \x3Cinstruments>, \x3CBPM> BPM, 
\x3Cvocal/instrumental>, energetic and feel-good

Step 4: 歌词策略

情绪类型 歌词策略
负面轻微 纯音乐(is_instrumental: true),不加歌词避免矫情感
负面强烈 带歌词(lyrics_optimizer: true),让 AI 写共鸣歌词,有"被懂了"的感觉
正面情绪 带歌词,节奏明快有感染力
用户指定 按用户要求

Step 5: 生成音乐

优先使用 CLI,回退到 Python 脚本:

# 方式一:MiniMax CLI(推荐)
# 纯音乐(负面轻微)
mmx music generate \
  --prompt "\x3Cconstructed prompt>" \
  --instrumental \
  --out /tmp/openclaw/mood_\x3Cemotion>.mp3

# 带歌词(负面强烈/正面)— 自动生成歌词
mmx music generate \
  --prompt "\x3Cconstructed prompt>" \
  --lyrics "[verse]\
[chorus]" \
  --out /tmp/openclaw/mood_\x3Cemotion>.mp3

# 方式二:Python 脚本(需要 MINIMAX_API_KEY 环境变量)
python3 scripts/generate_mood_music.py \
  --prompt "\x3Cconstructed prompt>" \
  --instrumental \
  --output /tmp/openclaw/mood_\x3Cemotion>.mp3

Step 6: 播放与送达

生成完成后,必须完成送达,不能只输出文件路径。根据环境自动选择最佳方式。

环境探测

# 检测本地音乐播放器(macOS)
osascript -e 'id of application "Music"' 2>/dev/null && echo "HAS_MUSIC_APP"
# 或检测命令行播放器
which mpv afplay ffplay 2>/dev/null

送达策略

条件 行为
检测到本地播放器(Music.app / mpv / afplay) 自动吊起播放 + 飞书发送备份
未检测到本地播放器 发送飞书音频消息

路径 A:本地播放器可用

# macOS 用系统命令打开默认播放器
open /tmp/openclaw/mood_\x3Cemotion>.mp3

# 或 afplay 后台播放
afplay /tmp/openclaw/mood_\x3Cemotion>.mp3 &

# 或 mpv
mpv --no-video /tmp/openclaw/mood_\x3Cemotion>.mp3 &

同时发一份到飞书群(见路径 B)。

路径 B:飞书音频消息送达

⚠️ 关键步骤,不可跳过。 飞书语音气泡需要特殊的上传+发送流程。

方式 1:使用内置脚本(推荐,一行搞定)

Skill 自带 scripts/send_feishu_audio.sh,支持 --file 模式直接发送已有音频:

# 发送已生成的音乐到飞书群(语音气泡,非文件附件)
bash scripts/send_feishu_audio.sh --file /tmp/openclaw/mood_\x3Cemotion>.mp3 "\x3Cchat_id>"

凭证自动从环境变量 FEISHU_APP_ID / FEISHU_APP_SECRET 读取, 或回退到 $HOME/.openclaw/openclaw.json

方式 2:OpenClaw message 工具(OpenClaw 环境)

message(action="send", filePath="/tmp/openclaw/mood_\x3Cemotion>.mp3",
        message="\x3C共情文案>")

方式 3:手动 curl 两步流程(理解原理用)

# ⚠️ 关键坑:file_type 必须填 opus(不是 mp3),否则报 234001
# ⚠️ 关键坑:msg_type 必须是 audio(不是 file),否则显示为附件

# Step 1: 上传文件(file_type=opus)
FILE_KEY=$(curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/files" \
  -H "Authorization: Bearer $TOKEN" \
  -F "file_type=opus" \
  -F "file_name=voice.opus" \
  -F "file=@/tmp/openclaw/mood_\x3Cemotion>.mp3" \
  | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['file_key'])")

# Step 2: 发送音频消息(msg_type=audio)
curl -s -X POST "https://open.feishu.cn/open-apis/im/v1/messages?receive_id_type=chat_id" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d "{\"receive_id\":\"$CHAT_ID\",\"msg_type\":\"audio\",\"content\":\"{\\\"file_key\\\":\\\"$FILE_KEY\\\"}\"}"

❌ 错误行为(严禁)

  • 只输出文件路径如 📎 /workspace/.../output/xxx.mp3用户无法访问服务器路径
  • 只发文字说"已生成" → 用户听不到音乐
  • 把 base64 音频贴在聊天里 → 不可读

原则:用户必须能在 2 次点击内听到音乐。

播放器优先级:open(macOS 默认)> mpv > afplay > 飞书音频消息 > 飞书文件消息

共情文案模板(简短、不说教):

情绪 文案示例
低落 🎵 这首给你,不用急着开心
烦躁 🎵 先听会儿,让脑子放空一下
焦虑 🎵 深呼吸,跟着节奏慢下来
疲惫 🎵 歇会儿吧,没什么比你重要
开心 🎵 快乐加倍!这首配你的好心情
兴奋 🎵 燥起来!这首给你庆祝

进阶:情绪追踪(可选)

如果用户频繁使用,可以在 memory/mood-music-log.json 中记录:

{
  "history": [
    {"date": "2026-04-10", "emotion": "tired", "style": "bossa nova", "rating": "👍"},
    {"date": "2026-04-09", "emotion": "anxious", "style": "ambient", "rating": null}
  ]
}

用于:

  • 避免连续推荐相同风格
  • 发现用户偏好("你之前喜欢 Bossa Nova 治愈系,这次也来一首?")
  • 如果连续多天负面情绪,温和提醒(不是心理医生,只是朋友式的关心)

边界与安全

  • 不是心理咨询:不诊断、不处方、不说"你应该怎样"
  • 不过度解读:用户说"有点累"就是累,别上升到心理问题
  • 不强制正能量:允许用户沉浸在情绪里,音乐是陪伴不是说教
  • 隐私:情绪记录仅存本地,不外传

生成方式

方式一:MiniMax CLI(推荐,零代码)

CLI 自动管理认证和 region,无需手动传 API Key:

# 纯音乐
mmx music generate --prompt "\x3Cprompt>" --instrumental --out /tmp/openclaw/mood.mp3

# 带自动歌词
mmx music generate --prompt "\x3Cprompt>" --lyrics "[verse]\
[chorus]" --out /tmp/openclaw/mood.mp3

方式二:Python 脚本(需要 API Key)

scripts/generate_mood_music.py 直接调用 MiniMax Music API:

  • 读取 API Key:从环境变量 MINIMAX_API_KEY 获取
  • 模型:music-2.5+
  • 支持 --instrumental 切换纯音乐/带歌词
  • 带歌词模式:lyrics_optimizer: true(API 自动写词)
  • 输出:MP3,44100Hz,256kbps
Usage Guidance
Before installing, verify the following: (1) The skill will need a MiniMax API key (or mmx-cli credentials) and a Feishu app_id/app_secret — these are not listed in the registry metadata but are required by the scripts; don't provide high-privilege credentials without checking scope. (2) The send script will fall back to reading $HOME/.openclaw/openclaw.json to find Feishu credentials — review that file for unrelated secrets and consider removing or isolating it. (3) Prefer creating a Feishu app with minimal scopes (only message send/upload) and use a dedicated, revocable app secret for this skill. (4) If you run this on a shared host, note the script can detect and invoke local audio players and will write/read /tmp/openclaw files. Test in an isolated environment first. (5) Confirm mmx-cli is installed from the official source and only grant MiniMax the minimum quota needed. (6) If you need stronger safety, require manual confirmation before any auto-send (adjust triggers or rate limits) or avoid giving the skill Feishu credentials so it cannot send messages autonomously.
Capability Tags
requires-oauth-token
Capability Assessment
Purpose & Capability
The declared purpose (generate mood music and post to Feishu) matches the shipped code: the Python script calls a MiniMax API and the shell script uploads audio to Feishu. However the registry metadata claims no required environment variables or binaries while the SKILL.md and scripts clearly require MINIMAX_API_KEY or mmx-cli and FEISHU_APP_ID/FEISHU_APP_SECRET (and optionally an edge-tts binary). The missing declarations are an inconsistency that needs explanation.
Instruction Scope
Runtime instructions ask the agent to install and use mmx-cli, generate audio, detect local players and potentially play audio locally, then upload/send audio to Feishu. The send script will read FEISHU_APP_ID/FEISHU_APP_SECRET from env or fall back to reading $HOME/.openclaw/openclaw.json — i.e., it reads another OpenClaw config file. Reading that config can expose unrelated credentials. The skill also supports automatic (Level 3) deliveries in group chats, which means it can autonomously send messages when it detects extreme emotion triggers.
Install Mechanism
There is no automated install spec; this is instruction-only plus two helper scripts. No remote archive downloads or hidden install hooks are present. The only install action suggested is 'npm install -g mmx-cli' (a standard public registry operation), which is reasonable for the described music-generation dependency.
Credentials
The skill requires access to a MiniMax API key (MINIMAX_API_KEY or mmx-cli auth) and Feishu app credentials (FEISHU_APP_ID / FEISHU_APP_SECRET) to function — both are sensitive and appropriate for the purpose. However the skill metadata does not declare these required env vars, and the send script will try to read openclaw.json if env vars are missing, potentially exposing other channel credentials. That fallback to reading an on-disk OpenClaw config expands the skill's access beyond its explicit needs.
Persistence & Privilege
always:false (good) and the skill is user-invocable. But it is designed to autonomously send Feishu audio messages when 'extreme' emotion triggers occur (Level 3), and because it needs Feishu credentials this gives it the capability to send messages without manual confirmation. Combined with the credential-access and config-file fallback, this increases risk if credentials are overprivileged or misconfigured.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install feishu-mood-music
  3. After installation, invoke the skill by name or use /feishu-mood-music
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.5.0
Bundle send_feishu_audio.sh script for one-line audio bubble delivery; document Feishu audio API pitfalls (file_type=opus, msg_type=audio); 3 delivery methods with script as primary
v1.4.0
Fix delivery step: add explicit Feishu API curl examples for container/server environments; add strict anti-pattern rules (never just output file path); support 3 delivery methods (OpenClaw tool / curl upload+send / file message fallback)
v1.3.0
Auto-detect local music player: if available (Music.app/mpv/afplay) auto-play locally + send to Feishu as backup; if not, send as Feishu audio bubble directly
v1.2.0
Three-tier trigger: explicit (来首歌), semi-implicit (@bot + emotion), fully-implicit (extreme emotion auto-trigger, e.g. 烦死了/爽死了). 30min cooldown for auto-trigger.
v1.1.0
Add MiniMax CLI + Token Plan quick-start setup; CLI as primary generation method
v1.0.0
Initial release: emotion-aware music companion for Feishu chats
Metadata
Slug feishu-mood-music
Version 1.5.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is Feishu Mood Music?

飞书音乐心情伴侣。识别用户的情绪状态,生成匹配的治愈/陪伴音乐并发送到飞书群。 三级触发机制: (1) 显式触发(直接要歌):"来首歌"、"想听歌"、"来首应景的"、"音乐治愈"、"解压音乐"、"放首歌" (2) 半隐式触发(情绪词 + @机器人):"心情不好"、"有点累"、"好烦"、"需要放松"、"emo了"、... It is an AI Agent Skill for Claude Code / OpenClaw, with 89 downloads so far.

How do I install Feishu Mood Music?

Run "/install feishu-mood-music" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Feishu Mood Music free?

Yes, Feishu Mood Music is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Feishu Mood Music support?

Feishu Mood Music is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Feishu Mood Music?

It is built and maintained by Rong (@kylinr); the current version is v1.5.0.

💬 Comments