import-art

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Your Task

你的任务

Input: $ARGUMENTS
Import album art to both the audio folder and album content folder.

输入: $ARGUMENTS
将专辑封面导入到音频文件夹和专辑内容文件夹中。

Import Art Skill

导入封面Skill

You copy album art to both required locations based on config.
你需要根据配置将专辑封面复制到两个指定位置。

Step 1: Parse Arguments

步骤1:解析参数

Expected format:
<file-path> <album-name>
Examples:
  • ~/Downloads/album-art.jpg sample-album
  • ~/Downloads/cover.png sample-album
If arguments are missing, ask:
Usage: /import-art <file-path> <album-name>

Example: /import-art ~/Downloads/album-art.jpg sample-album
预期格式:
<文件路径> <专辑名称>
示例:
  • ~/Downloads/album-art.jpg sample-album
  • ~/Downloads/cover.png sample-album
如果参数缺失,提示:
Usage: /import-art <file-path> <album-name>

Example: /import-art ~/Downloads/album-art.jpg sample-album

Step 2: Find Album and Resolve Paths via MCP

步骤2:通过MCP查找专辑并解析路径

  1. Call
    find_album(album_name)
    — fuzzy match, returns album metadata including genre
  2. Call
    resolve_path("audio", album_slug)
    — returns audio directory path
  3. Call
    resolve_path("content", album_slug)
    — returns content directory path
If album not found:
Error: Album "{album-name}" not found.
Create it first with: /new-album {album-name} <genre>
  1. 调用
    find_album(album_name)
    —— 模糊匹配,返回包含流派的专辑元数据
  2. 调用
    resolve_path("audio", album_slug)
    —— 返回音频目录路径
  3. 调用
    resolve_path("content", album_slug)
    —— 返回内容目录路径
如果未找到专辑:
Error: Album "{album-name}" not found.
Create it first with: /new-album {album-name} <genre>

Step 3: Construct Target Paths

步骤3:构建目标路径

TWO destinations required (paths from MCP
resolve_path
calls):
  1. Audio folder (for platforms/mastering):
    {audio_path}/album.png
  2. Content folder (for documentation):
    {content_path}/album-art.{ext}
CRITICAL:
resolve_path
includes the artist folder automatically.
需要两个目标位置(来自MCP
resolve_path
调用的路径):
  1. 音频文件夹(用于平台/母带处理):
    {audio_path}/album.png
  2. 内容文件夹(用于文档):
    {content_path}/album-art.{ext}
重要提示
resolve_path
会自动包含艺术家文件夹。

Step 4: Create Directories and Copy Files

步骤4:创建目录并复制文件

bash
undefined
bash
undefined

Create audio directory (includes artist folder!)

创建音频目录(包含艺术家文件夹!)

mkdir -p {audio_root}/artists/{artist}/albums/{genre}/{album}
mkdir -p {audio_root}/artists/{artist}/albums/{genre}/{album}

Copy to audio folder as album.png

复制到音频文件夹并重命名为album.png

cp "{source_file}" "{audio_root}/artists/{artist}/albums/{genre}/{album}/album.png"
cp "{source_file}" "{audio_root}/artists/{artist}/albums/{genre}/{album}/album.png"

Copy to content folder preserving extension

复制到内容文件夹并保留原扩展名

cp "{source_file}" "{content_root}/artists/{artist}/albums/{genre}/{album}/album-art.{ext}"
undefined
cp "{source_file}" "{content_root}/artists/{artist}/albums/{genre}/{album}/album-art.{ext}"
undefined

Step 5: Confirm

步骤5:确认

Report:
Album art imported for: {album-name}

Copied to:
1. {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png (for platforms)
2. {content_root}/artists/{artist}/albums/{genre}/{album}/album-art.{ext} (for docs)
返回报告:
Album art imported for: {album-name}

Copied to:
1. {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png (for platforms)
2. {content_root}/artists/{artist}/albums/{genre}/{album}/album-art.{ext} (for docs)

Error Handling

错误处理

Source file doesn't exist:
Error: File not found: {source_file}
Config file missing:
Error: Config not found at ~/.bitwize-music/config.yaml
Run /configure to set up.
Album not found:
Error: Album "{album-name}" not found.
Create it first with: /new-album {album-name} <genre>
Not an image file:
Warning: File doesn't appear to be an image: {source_file}
Expected: .jpg, .jpeg, .png, .webp

Continue anyway? (y/n)

源文件不存在:
Error: File not found: {source_file}
配置文件缺失:
Error: Config not found at ~/.bitwize-music/config.yaml
Run /configure to set up.
专辑未找到:
Error: Album "{album-name}" not found.
Create it first with: /new-album {album-name} <genre>
非图像文件:
Warning: File doesn't appear to be an image: {source_file}
Expected: .jpg, .jpeg, .png, .webp

Continue anyway? (y/n)

Examples

示例

/import-art ~/Downloads/sample-album-cover.jpg sample-album
Config has:
yaml
paths:
  content_root: ~/bitwize-music
  audio_root: ~/bitwize-music/audio
artist:
  name: bitwize
Album found at:
~/bitwize-music/artists/bitwize/albums/electronic/sample-album/
Result:
Album art imported for: sample-album

Copied to:
1. ~/bitwize-music/audio/artists/bitwize/albums/electronic/sample-album/album.png (for platforms)
2. ~/bitwize-music/artists/bitwize/albums/electronic/sample-album/album-art.jpg (for docs)

/import-art ~/Downloads/sample-album-cover.jpg sample-album
配置内容:
yaml
paths:
  content_root: ~/bitwize-music
  audio_root: ~/bitwize-music/audio
artist:
  name: bitwize
找到的专辑路径:
~/bitwize-music/artists/bitwize/albums/electronic/sample-album/
结果:
Album art imported for: sample-album

Copied to:
1. ~/bitwize-music/audio/artists/bitwize/albums/electronic/sample-album/album.png (for platforms)
2. ~/bitwize-music/artists/bitwize/albums/electronic/sample-album/album-art.jpg (for docs)

Common Mistakes

常见错误

❌ Don't: Manually read config and construct paths

❌ 错误做法:手动读取配置并构建路径

Wrong:
bash
cat ~/.bitwize-music/config.yaml
cp art.png ~/music-projects/audio/sample-album/
Right:
undefined
错误示例:
bash
cat ~/.bitwize-music/config.yaml
cp art.png ~/music-projects/audio/sample-album/
正确做法:
undefined

Use MCP to find album and resolve both paths

使用MCP查找专辑并解析两个路径

find_album(album_name) → returns album metadata resolve_path("audio", album_slug) → audio path with artist folder resolve_path("content", album_slug) → content path with genre

**Why it matters:** `resolve_path` handles config reading, artist folder, and genre resolution automatically.
find_album(album_name) → 返回专辑元数据 resolve_path("audio", album_slug) → 包含艺术家文件夹的音频路径 resolve_path("content", album_slug) → 包含流派的内容路径

**原因:** `resolve_path`会自动处理配置读取、艺术家文件夹和流派解析。

❌ Don't: Place art in only one location

❌ 错误做法:仅将封面放置在一个位置

Wrong:
bash
undefined
错误示例:
bash
undefined

Only copying to audio folder

仅复制到音频文件夹

cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png

Missing: content folder copy

缺失:复制到内容文件夹的步骤


**Right:**
```bash

**正确做法:**
```bash

Copy to BOTH locations

复制到两个位置

1. Audio location (for streaming platforms)

1. 音频位置(用于流媒体平台)

cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png

2. Content location (for documentation)

2. 内容位置(用于文档)

cp art.jpg {album_path}/album-art.jpg

**Why it matters:** Album art needs to be in both locations - audio folder for release, content folder for documentation.
cp art.jpg {album_path}/album-art.jpg

**原因:** 专辑封面需要同时存在于两个位置 - 音频文件夹用于发布,内容文件夹用于文档记录。

❌ Don't: Mix up the filenames

❌ 错误做法:混淆文件名

Wrong:
bash
undefined
错误示例:
bash
undefined

Using same filename in both locations

两个位置使用相同的文件名

cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album-art.png cp art.png {album_path}/album.png

**Correct naming:**
Audio location: album.png (or album.jpg) Content location: album-art.jpg (or album-art.png)

**Why it matters:** Different locations use different naming conventions to avoid confusion.
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album-art.png cp art.png {album_path}/album.png

**正确命名规则:**
音频位置:album.png(或album.jpg) 内容位置:album-art.jpg(或album-art.png)

**原因:** 不同位置使用不同的命名规范以避免混淆。

❌ Don't: Search for albums manually

❌ 错误做法:手动查找专辑

Wrong:
bash
find . -name "README.md" -path "*albums/$album_name*"
Right:
find_album(album_name) → returns album data including path and genre
错误示例:
bash
find . -name "README.md" -path "*albums/$album_name*"
正确做法:
find_album(album_name) → 返回包含路径和流派的专辑数据

❌ Don't: Forget to create directories

❌ 错误做法:忘记创建目录

Wrong:
bash
undefined
错误示例:
bash
undefined

Copying without ensuring directory exists

未确保目录存在就直接复制

cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png

Fails if directory doesn't exist

如果目录不存在会失败


**Right:**
```bash

**正确做法:**
```bash

Create directory first

先创建目录

mkdir -p {audio_root}/artists/{artist}/albums/{genre}/{album}/ cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png

**Why it matters:** Audio directory might not exist yet, especially for new albums.
mkdir -p {audio_root}/artists/{artist}/albums/{genre}/{album}/ cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png

**原因:** 音频目录可能尚未存在,尤其是对于新专辑。