← 返回 Skills 市场
tomtrije

Music Creator

作者 顾雪阳 · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ⚠ suspicious
65
总下载
0
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install music-creator
功能描述
AI 音乐创作全流程技能。根据主题和风格创作歌词,通过 MiniMax AI 生成音乐和封面图,ASR 精准对齐歌词时序,生成带歌词同步的播放页面并部署。触发词:创作歌曲、写首歌、生成音乐、AI 音乐、music creator、帮我写首歌、创作音乐、做个音乐。
使用说明 (SKILL.md)

Music Creator — AI 音乐创作技能

从主题到成品播放页面的一站式 AI 音乐创作流程。

初始化配置

首次使用前必须完成以下配置。 Agent(即你)在首次接到音乐创作任务时,应主动引导用户完成配置。


🤖 Agent Prompt — 首次使用时对用户说的话

在你第一次使用音乐创作功能前,需要完成以下初始化配置:

1. MiniMax API 密钥 我需要一个 MiniMax API Key 来生成歌词、音乐和封面图。请提供你的 API Key。 获取地址:https://platform.minimaxi.com

2. 创作人信息 请告诉我以下信息,用于封面图署名和播放页展示:

  • 艺术家名 / 歌手名
  • 作词人(默认同上)
  • 作曲人(默认同上)
  • 演唱者(默认同上)
  • 制作人(默认同上)

其他依赖(whisper、ffmpeg、Pillow)我会自行检查并安装,不需要你操作。

用户提供 API Key 后,Agent 执行以下命令完成初始化:

# 安装 mmx CLI
npm install -g mmx-cli
# 登录 API Key
mmx auth login --api-key \x3C用户提供的API_KEY>
# 验证
mmx text chat --model MiniMax-M2.7 --message "test" --output json

用户提供创作人信息后,Agent 在技能目录创建 config.json

{
  "artist": "\x3C艺术家名>",
  "credits": {
    "lyrics": "\x3C作词人>",
    "compose": "\x3C作曲人>",
    "sing": "\x3C演唱者>",
    "produce": "\x3C制作人>"
  }
}

如果某个角色与艺术家不同,单独设置对应字段;相同则默认填艺术家名。


🔧 技术依赖(Agent 自行检查)

以下依赖 Agent 首次运行时自行检测,缺失则自动安装,无需用户参与:

依赖 检查命令 安装命令
mmx CLI mmx text chat --help npm install -g mmx-cli
whisper whisper --help pip install openai-whisper
ffprobe ffprobe -version apt install ffmpeg
Pillow + 中文字体 python3 -c "from PIL import Image" pip install Pillow

中文字体检查:ls /usr/share/fonts/google-noto-cjk/NotoSansCJK-Black.ttc

依赖

工具 用途 检查命令
mmx CLI 歌词创作、音乐生成、封面图生成 mmx text chat --help
whisper ASR 歌词时序识别 whisper --help
ffprobe 获取音频时长 ffprobe -version
Pillow (PIL) 封面图文字合成 python3 -c "from PIL import Image"
report-expert 播放页面模板 + 部署 技能目录 music_player_builder.py

文件目录结构

每首歌创建独立目录,所有相关文件放在一起:

claw/music/{slug}/
├── index.html          # 播放页面(从模板复制,无需修改)
├── song.json            # 歌曲元信息(标题、副标题、创作人)
├── song.mp3             # 音乐文件
├── cover.jpg            # 封面图(Pillow 合成后)
├── lyrics.txt           # 纯文本歌词(无时间)
└── lyrics-timed.json    # 带时序的歌词 JSON
  • slug:歌曲名的小写英文/拼音 slug(如 nanchangcheng-love
  • 部署方式:通过 report-expert 技能的 deploy 命令部署(见 Step 7)
  • index.html 是模板的副本,不需要修改,播放页从 song.jsonlyrics-timed.json 动态加载所有信息
  • 所有资源通过相对路径引用,不使用 base64

完整工作流

按以下 7 个步骤顺序执行:

Step 1:确认主题与风格

读取 config.json 获取创作人信息。

与用户确认以下信息:

参数 必填 说明 示例
主题 歌曲主题/歌名 "我爱小微"、"春天的故事"
风格 音乐风格 "甜蜜浪漫流行"、"摇滚"、"民谣"
参考信息 参考图片或文本 用户提供的灵感素材

如果用户已提供主题和风格,直接进入下一步。如果信息不完整,询问补充。

生成 slug(用于目录名):将歌名转小写,用连字符连接。

Step 2:收集参考信息(可选)

如果用户提供了:

  • 参考图片:描述图片内容,提取可用于歌词创作的意象和情感元素
  • 参考文本:提炼关键信息、情感基调、故事线索

将参考信息整理为歌词创作的参考摘要(不直接展示给用户)。

Step 3:创作歌词

使用 MiniMax 文本模型生成歌词:

mmx text chat --model MiniMax-M2.7 --message "PROMPT" --output json

Prompt 模板:

请为一首{风格}风格的中文歌曲写歌词,主题是《{主题}》。
要求:
1. 歌曲结构标签:[Intro] [Verse 1] [Pre Chorus] [Chorus] [Verse 2] [Pre Chorus] [Chorus] [Bridge] [Chorus] [Outro]
2. 每段 4-6 行,总时长控制在 2-4 分钟
3. {如果有参考信息:参考以下素材融入歌词:{参考摘要}}
4. 歌词要有画面感和故事性,朗朗上口
5. **尽可能押韵**:同一段落内相邻句子尽量押韵(如 AABB、ABAB 或 AAAA),Chorus 部分尤须押韵工整,这是歌曲朗朗上口的关键。优先使用常见韵脚(如 ao/iao、an/ian、eng/ing、ou/iu 等),韵脚要自然不生硬
6. 只输出歌词,不要其他内容

将歌词保存到歌曲目录:{MUSIC_DIR}/lyrics.txt

Step 4:生成音乐 + 封面图(并行)

音乐生成:

mmx music generate \
  --prompt "{风格}风格的中文歌曲,主题{主题}" \
  --lyrics-file {MUSIC_DIR}/lyrics.txt \
  --out {MUSIC_DIR}/song.mp3

封面图生成(无文字纯画面):

mmx image generate \
  --prompt "A beautiful album cover art, absolutely no text no words no letters, {风格对应画面的英文描述}, artistic watercolor style, 1:1 square format" \
  --out {MUSIC_DIR}/cover-raw.jpg

两者并行执行,节省时间。

封面图文字合成:

python3 scripts/make_cover.py \
  --input {MUSIC_DIR}/cover-raw.jpg \
  --title "{主题}" \
  --artist "{config.artist}" \
  --output {MUSIC_DIR}/cover.jpg

重要:AI 图像生成对中文文字渲染会乱码,必须用 Pillow 叠加文字。

Step 5:ASR 歌词时序识别

whisper {MUSIC_DIR}/song.mp3 \
  --model tiny --language zh \
  --word_timestamps True \
  --output_format json \
  --output_dir /tmp/whisper-{slug} \
  --device cpu

对齐歌词时序:

python3 scripts/align_lyrics.py \
  --asr /tmp/whisper-{slug}/{slug}.json \
  --lyrics {MUSIC_DIR}/lyrics.txt \
  --mp3 {MUSIC_DIR}/song.mp3 \
  --output {MUSIC_DIR}/lyrics-timed.json

注意:歌曲有重复段落(Chorus 出现多次),对齐脚本只处理首次出现。需要手动修正后半段(Bridge、Chorus 2/3、Outro)的时间:

  1. ffprobe 获取歌曲总时长
  2. 根据 ASR 原始输出找到每个重复段落对应的 segment 起始时间
  3. 按比例分配该段内歌词行的时间
  4. 更新 lyrics-timed.json

Step 6:生成播放页面

使用 report-expert 技能中的 music_player_builder.py 模板(需安装 report-expert 技能):

python3 {REPORT_EXPERT_DIR}/music_player_builder.py \
  --mp3 {MUSIC_DIR}/song.mp3 \
  --cover {MUSIC_DIR}/cover.jpg \
  --title "{主题}" \
  --subtitle "{副标题}" \
  --lyrics {MUSIC_DIR}/lyrics-timed.json \
  --output {MUSIC_DIR}/index.html \
  --download-filename "{主题}.mp3"

{REPORT_EXPERT_DIR} 为 report-expert 技能的安装目录,通常是 ~/.openclaw/workspace/skills/report-expert/

文件引用方式:模板生成的 HTML 通过相对路径 song.mp3cover.jpg 引用同目录文件,不使用 base64 嵌入。

Step 7:部署(需安装 report-expert 技能)

将歌曲的所有文件(播放页 + 静态资源)复制到 report-expert 的 dist/ 工作目录,然后通过 deploy.py 注册索引并 sync_to_deploy() 统一推送。

REPORT_DIR="{REPORT_EXPERT_DIR}/dist/music/{slug}"
mkdir -p "$REPORT_DIR"

# 复制所有歌曲文件到 report-expert dist/
cp {MUSIC_DIR}/index.html "$REPORT_DIR/"
cp {MUSIC_DIR}/song.mp3 "$REPORT_DIR/"
cp {MUSIC_DIR}/cover.jpg "$REPORT_DIR/"
cp {MUSIC_DIR}/song.json "$REPORT_DIR/"
cp {MUSIC_DIR}/lyrics.txt "$REPORT_DIR/"
cp {MUSIC_DIR}/lyrics-timed.json "$REPORT_DIR/"

# 注册到索引并同步部署
cd {REPORT_EXPERT_DIR}
python3 deploy.py add "music/{slug}/index.html" \
  --title "{主题} - 原创音乐" \
  --desc "AI 创作{风格}歌曲:{主题}" \
  --category other

python3 -c "from lib.config import sync_to_deploy; sync_to_deploy()"

部署的站点地址和 URL 由 report-expert 技能的配置(TOOLS.md)决定,本技能不耦合具体站点信息。

sync_to_deploy() 会将 dist/ 下所有文件(包括 mp3、jpg 等静态资源)同步到部署目录,无需单独处理。

输出

完成后的交付物:

  1. 播放页面:由 report-expert 部署,具体 URL 取决于 report-expert 配置
  2. MP3 文件{MUSIC_DIR}/song.mp3(可单独发送)
  3. 封面图{MUSIC_DIR}/cover.jpg(可单独发送)

封面图画面风格映射

音乐风格 画面描述(英文 Prompt)
流行/甜蜜 dreamy romantic scene, pink purple gradient, cherry blossom petals, couple silhouette
摇滚 electric energy, dark stage, neon lights, guitar silhouette, dramatic lighting
民谣 peaceful countryside, sunset, acoustic guitar, warm golden light
古风 Chinese ink painting style, mountains mist, bamboo, plum blossom, moon
电子/DJ futuristic neon city, abstract light trails, geometric shapes, cyberpunk
嘻哈 urban street scene, graffiti wall, boombox, bold colors
R&B smooth jazz club, saxophone, warm candlelight, velvet curtains
儿歌/欢快 colorful playground, balloons, sunshine, cartoon animals, bright colors
安全使用建议
Install only if you are comfortable giving the agent a MiniMax API key, letting it install npm/pip/apt dependencies, and potentially publishing generated music pages. Before first use, ask the agent to show every command, confirm package versions and install locations, and require explicit approval before deployment.
功能分析
Type: OpenClaw Skill Name: music-creator Version: 1.0.4 The music-creator skill bundle provides a comprehensive and legitimate workflow for AI-driven music production, including lyric generation, music/image creation via the MiniMax API, and ASR-based lyric alignment. The included Python scripts (align_lyrics.py, make_cover.py) are well-structured, use safe subprocess execution (passing arguments as lists), and perform their stated tasks without hidden side effects. While the skill requires high-privilege actions such as installing system dependencies (ffmpeg, npm packages) and handling an API key, these requirements are transparently documented in SKILL.md and are necessary for the tool's functionality. No evidence of data exfiltration, malicious prompt injection, or intentional backdoors was found.
能力标签
cryptorequires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose, SKILL.md workflow, and included Python helpers generally align: they create lyrics, generate music/cover art, align lyrics, build metadata, and prepare a player page.
Instruction Scope
The instructions tell the agent to install dependencies automatically and run the deployment step as part of the standard workflow, without clearly requiring separate user approval before environment changes or publication.
Install Mechanism
Registry/install metadata says there is no install spec and no required binaries, but SKILL.md directs runtime installation of npm, pip, and apt packages, including global/system-level dependencies.
Credentials
MiniMax API use is purpose-aligned, but automatic package installation, CLI login, and cross-skill deployment are higher-impact than simple local song generation and should be explicitly scoped and approved.
Persistence & Privilege
The skill creates config.json and uses mmx auth login for the MiniMax API key; this is expected for the service, but users should understand where credentials and generated/deployed files will persist.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install music-creator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /music-creator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.4
Step 7 部署重构:将歌曲所有文件(mp3/jpg/json/txt)复制到 report-expert dist/ 统一 sync,移除所有硬编码路径和自检中的站点依赖
v1.0.3
解耦站点信息:移除所有 rego.vip 硬编码,部署地址由 report-expert 技能配置决定,本技能不耦合具体站点
v1.0.2
初始化配置改为 Agent Prompt 版本:首次使用时主动引导用户提供 API Key 和创作人信息,技术依赖由 Agent 自行检测安装
v1.0.1
修复 mmx CLI 初始化命令:mmx auth login --api-key 替代 mmx config set-api-key
v1.0.0
首发:AI 音乐创作全流程技能,包含歌词创作、MiniMax 音乐生成、封面图合成、ASR 时序对齐、播放页面部署
元数据
Slug music-creator
版本 1.0.4
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 5
常见问题

Music Creator 是什么?

AI 音乐创作全流程技能。根据主题和风格创作歌词,通过 MiniMax AI 生成音乐和封面图,ASR 精准对齐歌词时序,生成带歌词同步的播放页面并部署。触发词:创作歌曲、写首歌、生成音乐、AI 音乐、music creator、帮我写首歌、创作音乐、做个音乐。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 65 次。

如何安装 Music Creator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install music-creator」即可一键安装,无需额外配置。

Music Creator 是免费的吗?

是的,Music Creator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Music Creator 支持哪些平台?

Music Creator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Music Creator?

由 顾雪阳(@tomtrije)开发并维护,当前版本 v1.0.4。

💬 留言讨论