mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 09:30:42 +08:00
feat: skills i18n 改造(schemaVersion 1.1,零向后兼容) (#1)
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容
把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。
## 关键变更
### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
i18n.<locale>
### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)
### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)
### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude
### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落
## 验证
- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(i18n): 修复 PR #1 review 反馈的 6 项问题
- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
与 zh-CN 版本对齐
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
name: MiniMax 音乐生成
|
||||
name: minimax-music-gen
|
||||
description: >-
|
||||
Use this skill when the user wants to generate music using MiniMax's
|
||||
Music Generation API. Supports text-to-music with lyrics, instrumental
|
||||
@@ -25,6 +25,29 @@ requires:
|
||||
metadata:
|
||||
author: desirecore
|
||||
updated_at: '2026-05-03'
|
||||
i18n:
|
||||
default_locale: en-US
|
||||
source_locale: zh-CN
|
||||
locales:
|
||||
- zh-CN
|
||||
- en-US
|
||||
zh-CN:
|
||||
name: MiniMax 音乐生成
|
||||
short_desc: 基于 MiniMax Music 2.6 的文本生成音乐技能
|
||||
description: >-
|
||||
Use this skill when the user wants to generate music using MiniMax's Music Generation API. Supports text-to-music with lyrics, instrumental generation, and music cover. Use when 用户提到 生成音乐、文生音乐、 AI 作曲、创作歌曲、写一首歌、音乐生成、AI 音乐、MiniMax 音乐、 作词作曲、纯音乐、伴奏、翻唱、cover。
|
||||
body: ./SKILL.zh-CN.md
|
||||
source_hash: sha256:403153a9c1da2ad9
|
||||
translated_by: human
|
||||
en-US:
|
||||
name: MiniMax Music Generation
|
||||
short_desc: Text-to-music skill powered by MiniMax Music 2.6
|
||||
description: >-
|
||||
Use this skill when the user wants to generate music using MiniMax's Music Generation API. Supports text-to-music with lyrics, instrumental generation, and music cover. Use when the user mentions generating music, text-to-music, AI composing, creating songs, writing a song, music generation, AI music, MiniMax music, songwriting, instrumental music, accompaniment, cover, or remake.
|
||||
body: ./SKILL.md
|
||||
source_hash: sha256:403153a9c1da2ad9
|
||||
translated_by: ai:claude-opus-4-7
|
||||
translated_at: '2026-05-04'
|
||||
market:
|
||||
icon: >-
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
|
||||
@@ -35,7 +58,6 @@ market:
|
||||
stroke-linejoin="round"/><circle cx="6.5" cy="18" r="2.5" fill="#AF52DE"
|
||||
fill-opacity="0.6"/><circle cx="16.5" cy="16" r="2.5" fill="#AF52DE"
|
||||
fill-opacity="0.6"/></svg>
|
||||
short_desc: 基于 MiniMax Music 2.6 的文本生成音乐技能
|
||||
category: media
|
||||
maintainer:
|
||||
name: DesireCore Official
|
||||
@@ -43,45 +65,45 @@ market:
|
||||
channel: latest
|
||||
---
|
||||
|
||||
# minimax-music-gen 技能
|
||||
# minimax-music-gen Skill
|
||||
|
||||
## 强制规则(违反将导致功能失败)
|
||||
## Mandatory Rules (violations will cause functionality to fail)
|
||||
|
||||
1. **必须用 HTTPS 访问 agent-service** — `https://127.0.0.1:${PORT}` 加 `-k` 跳过证书验证
|
||||
2. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
|
||||
3. **禁止使用 `output_format: "url"`** — URL 下载在 Token Plan 等场景下会因 CDN 鉴权失败返回空文件。必须使用默认的 hex 格式,音频数据直接在 API 响应中返回
|
||||
1. **Must access agent-service over HTTPS** — `https://127.0.0.1:${PORT}` with `-k` to skip certificate verification
|
||||
2. **Use Bash curl throughout** — do not use the HttpRequest tool or Python
|
||||
3. **Do not use `output_format: "url"`** — URL downloads will return empty files in scenarios such as Token Plan due to CDN authentication failures. Always use the default hex format; audio data is returned directly in the API response
|
||||
|
||||
## 完整执行流程
|
||||
## Full Execution Flow
|
||||
|
||||
### 前置条件
|
||||
### Prerequisites
|
||||
|
||||
- 用户已在资源管理器-算力中配置 MiniMax Provider(常规 API 或 Token Plan)并填写 API Key
|
||||
- agent-service 正在运行
|
||||
- The user has configured the MiniMax Provider (regular API or Token Plan) in Resource Manager → Compute and filled in the API Key
|
||||
- agent-service is running
|
||||
|
||||
### 核心概念
|
||||
### Core Concepts
|
||||
|
||||
MiniMax Music Generation 是**同步 API**(非异步任务模式),调用后直接返回音频数据。支持三种模式:
|
||||
MiniMax Music Generation is a **synchronous API** (not an asynchronous task model); it returns audio data directly when called. Three modes are supported:
|
||||
|
||||
| 模式 | model | 说明 |
|
||||
|------|-------|------|
|
||||
| 歌曲生成 | `music-2.6` | 提供 prompt + lyrics,生成带人声的歌曲 |
|
||||
| 纯器乐 | `music-2.6` | 设置 `is_instrumental: true`,仅需 prompt |
|
||||
| 翻唱/Cover | `music-cover` | 提供参考音频 + prompt,基于旋律骨架重新编曲 |
|
||||
| Mode | model | Description |
|
||||
|------|-------|-------------|
|
||||
| Song generation | `music-2.6` | Provide prompt + lyrics to generate a song with vocals |
|
||||
| Pure instrumental | `music-2.6` | Set `is_instrumental: true`; only a prompt is needed |
|
||||
| Cover | `music-cover` | Provide a reference audio + prompt; rearrange based on the melodic skeleton |
|
||||
|
||||
### 歌词结构标签
|
||||
### Lyrics Structure Tags
|
||||
|
||||
lyrics 字段支持以下结构标签来组织歌曲段落:
|
||||
The lyrics field supports the following structure tags to organize song sections:
|
||||
|
||||
| 标签 | 含义 |
|
||||
|------|------|
|
||||
| `[verse]` | 主歌 |
|
||||
| `[chorus]` | 副歌 |
|
||||
| `[bridge]` | 桥段 |
|
||||
| `[intro]` | 前奏 |
|
||||
| `[outro]` | 尾声 |
|
||||
| `[interlude]` | 间奏 |
|
||||
| Tag | Meaning |
|
||||
|-----|---------|
|
||||
| `[verse]` | Verse |
|
||||
| `[chorus]` | Chorus |
|
||||
| `[bridge]` | Bridge |
|
||||
| `[intro]` | Intro |
|
||||
| `[outro]` | Outro |
|
||||
| `[interlude]` | Interlude |
|
||||
|
||||
示例歌词格式:
|
||||
Example lyrics format:
|
||||
```
|
||||
[verse]
|
||||
夜晚的城市灯火阑珊
|
||||
@@ -92,9 +114,9 @@ lyrics 字段支持以下结构标签来组织歌曲段落:
|
||||
所有的喧嚣都已远去
|
||||
```
|
||||
|
||||
### 生成歌曲(带人声)
|
||||
### Generate a Song (with Vocals)
|
||||
|
||||
**注意:不要传 `output_format` 参数,使用默认的 hex 格式。**
|
||||
**Note: Do not pass the `output_format` parameter; use the default hex format.**
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
@@ -117,7 +139,7 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}'
|
||||
```
|
||||
|
||||
### 生成纯器乐
|
||||
### Generate Pure Instrumental
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
@@ -140,11 +162,11 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}'
|
||||
```
|
||||
|
||||
### 响应处理与保存
|
||||
### Response Handling and Saving
|
||||
|
||||
API 返回 JSON,音频数据以 hex 编码存放在 `data.data.audio.data` 字段中。
|
||||
The API returns JSON; audio data is hex-encoded and stored in the `data.data.audio.data` field.
|
||||
|
||||
**响应结构**:
|
||||
**Response structure**:
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
@@ -168,69 +190,69 @@ API 返回 JSON,音频数据以 hex 编码存放在 `data.data.audio.data` 字
|
||||
}
|
||||
```
|
||||
|
||||
**注意**:`status` 字段含义为 1=合成中(流式场景)、2=合成完成。非流式模式下返回时 status 为 2。
|
||||
**Note**: The `status` field means 1 = synthesizing (streaming scenario), 2 = synthesis complete. In non-streaming mode, the returned status is 2.
|
||||
|
||||
### 将 hex 音频数据保存到 media-store
|
||||
### Save the hex Audio Data to media-store
|
||||
|
||||
从响应 JSON 中提取 `data.data.audio.data` 字段的 hex 字符串,转为二进制后上传:
|
||||
Extract the hex string from the `data.data.audio.data` field of the response JSON, convert it to binary, and upload:
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
# 将 API 响应保存到临时文件(避免 hex 数据过大撑爆 shell 变量)
|
||||
# 假设上一步的 curl 输出已保存到 /tmp/minimax-music-resp.json
|
||||
# Save the API response to a temporary file (avoid letting large hex data overflow shell variables)
|
||||
# Assume the curl output of the previous step has been saved to /tmp/minimax-music-resp.json
|
||||
|
||||
# 提取 hex 数据并转为二进制(纯 Bash,不依赖 Python)
|
||||
# Extract hex data and convert to binary (pure Bash, no Python dependency)
|
||||
jq -r '.data.data.audio.data' /tmp/minimax-music-resp.json | xxd -r -p > /tmp/minimax-music.mp3
|
||||
|
||||
# 验证文件有效(大于 1KB 且为音频格式)
|
||||
# Verify the file is valid (greater than 1KB and in audio format)
|
||||
FILE_SIZE=$(stat -f%z /tmp/minimax-music.mp3 2>/dev/null || stat -c%s /tmp/minimax-music.mp3 2>/dev/null)
|
||||
if [ "$FILE_SIZE" -lt 1024 ]; then
|
||||
echo "ERROR: 音频文件异常(${FILE_SIZE} 字节),可能生成失败"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 上传到 media-store
|
||||
# Upload to media-store
|
||||
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
|
||||
-F "file=@/tmp/minimax-music.mp3;type=audio/mpeg"
|
||||
```
|
||||
|
||||
从上传响应 JSON 中提取 `mediaId` 字段。
|
||||
Extract the `mediaId` field from the upload response JSON.
|
||||
|
||||
### 展示结果
|
||||
### Display the Result
|
||||
|
||||
在回复中使用 dc-media 协议引用(前端会自动识别音频扩展名并渲染播放器):
|
||||
In the reply, use a dc-media protocol reference (the frontend will automatically detect the audio extension and render a player):
|
||||
|
||||
```
|
||||

|
||||
```
|
||||
|
||||
### 参数说明
|
||||
### Parameter Descriptions
|
||||
|
||||
| 参数 | 说明 | 必填 | 默认值 |
|
||||
|------|------|------|--------|
|
||||
| model | 模型名称 | 是 | "music-2.6" |
|
||||
| prompt | 音乐风格/情绪描述 | 有歌词时可选,纯器乐/cover 必填 | — |
|
||||
| lyrics | 歌词(支持结构标签) | 非纯器乐模式必填 | — |
|
||||
| is_instrumental | 是否生成纯器乐 | 否 | false |
|
||||
| lyrics_optimizer | 根据 prompt 自动生成歌词 | 否 | false |
|
||||
| audio_setting.format | 音频格式:mp3/wav/pcm | 否 | "mp3" |
|
||||
| audio_setting.sample_rate | 采样率:16000/24000/32000/44100 | 否 | 32000 |
|
||||
| audio_setting.bitrate | 比特率:32000/64000/128000/256000 | 否 | 128000 |
|
||||
| Parameter | Description | Required | Default |
|
||||
|-----------|-------------|----------|---------|
|
||||
| model | Model name | Yes | "music-2.6" |
|
||||
| prompt | Music style/mood description | Optional when lyrics are present; required for pure instrumental/cover | — |
|
||||
| lyrics | Lyrics (structure tags supported) | Required when not in pure instrumental mode | — |
|
||||
| is_instrumental | Whether to generate pure instrumental | No | false |
|
||||
| lyrics_optimizer | Auto-generate lyrics from the prompt | No | false |
|
||||
| audio_setting.format | Audio format: mp3/wav/pcm | No | "mp3" |
|
||||
| audio_setting.sample_rate | Sample rate: 16000/24000/32000/44100 | No | 32000 |
|
||||
| audio_setting.bitrate | Bitrate: 32000/64000/128000/256000 | No | 128000 |
|
||||
|
||||
### prompt 写法建议
|
||||
### Tips for Writing Prompts
|
||||
|
||||
prompt 用于描述音乐的风格、情绪和乐器编排,建议用逗号分隔关键词:
|
||||
The prompt is used to describe the music's style, mood, and instrumentation; commas are recommended to separate keywords:
|
||||
|
||||
- 风格:`独立民谣`、`电子舞曲`、`古典钢琴`、`摇滚`、`R&B`、`爵士`、`嘻哈`
|
||||
- 情绪:`温暖`、`忧郁`、`欢快`、`史诗感`、`空灵`、`治愈`
|
||||
- 乐器:`吉他伴奏`、`钢琴独奏`、`弦乐铺底`、`合成器`、`鼓点强劲`
|
||||
- 结构:`渐进式编曲`、`开场留白渐入高潮`、`轻柔开头爆发副歌`
|
||||
- Style: `独立民谣`, `电子舞曲`, `古典钢琴`, `摇滚`, `R&B`, `爵士`, `嘻哈`
|
||||
- Mood: `温暖`, `忧郁`, `欢快`, `史诗感`, `空灵`, `治愈`
|
||||
- Instruments: `吉他伴奏`, `钢琴独奏`, `弦乐铺底`, `合成器`, `鼓点强劲`
|
||||
- Structure: `渐进式编曲`, `开场留白渐入高潮`, `轻柔开头爆发副歌`
|
||||
|
||||
示例:`"独立民谣,温暖治愈,木吉他为主,轻柔的鼓点,渐进式编曲"`
|
||||
Example: `"独立民谣,温暖治愈,木吉他为主,轻柔的鼓点,渐进式编曲"`
|
||||
|
||||
### 自动生成歌词模式
|
||||
### Auto-generated Lyrics Mode
|
||||
|
||||
如果用户只描述了想要的音乐风格但没有提供歌词,可以设置 `lyrics_optimizer: true`,模型会根据 prompt 自动生成歌词:
|
||||
If the user only describes the desired music style without providing lyrics, set `lyrics_optimizer: true` and the model will auto-generate lyrics from the prompt:
|
||||
|
||||
```bash
|
||||
PORT=$(cat ~/.desirecore/agent-service.port)
|
||||
@@ -253,21 +275,21 @@ curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
|
||||
}'
|
||||
```
|
||||
|
||||
### 错误处理
|
||||
### Error Handling
|
||||
|
||||
- `base_resp.status_code: 1002`:频率限制,稍后重试
|
||||
- `base_resp.status_code: 1004`:API Key 认证失败
|
||||
- `base_resp.status_code: 1008`:余额不足
|
||||
- `base_resp.status_code: 1026`:内容敏感,修改歌词或 prompt 后重试
|
||||
- `base_resp.status_code: 2013`:参数错误,检查必填字段
|
||||
- `success: false` + `error: "未找到匹配的供应商"`:未配置 MiniMax Provider
|
||||
- `base_resp.status_code: 1002`: rate limit reached, retry later
|
||||
- `base_resp.status_code: 1004`: API Key authentication failed
|
||||
- `base_resp.status_code: 1008`: insufficient balance
|
||||
- `base_resp.status_code: 1026`: content sensitive, modify the lyrics or prompt and retry
|
||||
- `base_resp.status_code: 2013`: parameter error, check required fields
|
||||
- `success: false` + `error: "未找到匹配的供应商"`: MiniMax Provider not configured
|
||||
|
||||
### 注意事项
|
||||
### Notes
|
||||
|
||||
- prompt 长度限制 1-2000 字符,lyrics 长度限制 1-3500 字符
|
||||
- Token Plan 用户:所有套餐免费使用 music-2.6(100 首/天,每首 ≤5 分钟)
|
||||
- 如果用户未明确要求,默认使用 `music-2.6` + `mp3` 格式 + 44100 采样率
|
||||
- 如果用户只给了主题没给歌词,使用 `lyrics_optimizer: true` 自动生成歌词
|
||||
- 如果用户要求纯音乐/伴奏,设置 `is_instrumental: true`
|
||||
- 音乐生成耗时较长(通常 30-90 秒),请耐心等待
|
||||
- hex 数据量较大(几 MB),务必用临时文件中转,不要用 shell 变量存储
|
||||
- The prompt length limit is 1-2000 characters; the lyrics length limit is 1-3500 characters
|
||||
- Token Plan users: all plans use music-2.6 for free (100 tracks/day, each track ≤5 minutes)
|
||||
- Unless the user specifies otherwise, default to `music-2.6` + `mp3` format + 44100 sample rate
|
||||
- If the user only gives a theme without lyrics, use `lyrics_optimizer: true` to auto-generate lyrics
|
||||
- If the user requests pure music/accompaniment, set `is_instrumental: true`
|
||||
- Music generation takes a relatively long time (typically 30-90 seconds); please be patient
|
||||
- The hex data volume is large (several MB); always use a temporary file as intermediary, do not store it in shell variables
|
||||
|
||||
Reference in New Issue
Block a user