mcpField
I
import-art

import-art

github.com/bitwize-music-studioクリエイティブ・メディア603222 回インストール2 週間前に更新
リポジトリ

import-art について

import-artは、音楽アルバムのアートワークを整理するスキルです。アルバム情報と解決したパスに基づき、画像をオーディオ用とコンテンツ用の両方のディレクトリにコピーします。

主な機能

  1. 01アルバム検索とパス解決
  2. 02アートワークを2か所にコピー
  3. 03オーディオ用は album.png
  4. 04コンテンツ用は拡張子を維持

活用シーン

  1. 01リリース用のアートワーク準備
  2. 02アルバム資料への画像追加

MCP 対応

MCPのfind_albumでアルバムを検索し、resolve_pathでオーディオ用とコンテンツ用のディレクトリを特定します。

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/bitwize-music-studio/claude-ai-music-skills --skill import-art

インストール後、Claude Code で/import-artを入力して読み込まれたか確認します。

詳細

あなたのタスク

入力: $ARGUMENTS

設定に基づいて、オーディオフォルダーとアルバムのコンテンツフォルダーの両方にアルバムアートをインポートします。


アートのインポートスキル

設定に基づいて、アルバムアートを必要な2つの場所にコピーします。

ステップ 1: 引数を解析する

想定される形式: <file-path> <album-name>

例:

  • ~/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

ステップ 2: MCP 経由でアルバムを検索し、パスを解決する

  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>

ステップ 3: コピー先のパスを作成する

コピー先は2か所必要です(MCP の resolve_path 呼び出しから取得したパス):

  1. オーディオフォルダー(プラットフォーム/マスタリング用): {audio_path}/album.png
  2. コンテンツフォルダー(ドキュメント用): {content_path}/album-art.{ext}

重要: resolve_path はアーティストフォルダーを自動的に含みます。

ステップ 4: ディレクトリを作成してファイルをコピーする

# Create audio directory (includes artist folder!)
mkdir -p {audio_root}/artists/{artist}/albums/{genre}/{album}

# Copy to audio folder as 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}"

ステップ 5: 確認する

次の内容を報告します:

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: 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)

例

/import-art ~/Downloads/sample-album-cover.jpg sample-album

設定の内容:

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)

よくある間違い

❌ やってはいけないこと: 設定を手動で読み込み、パスを作成する

誤り:

cat ~/.bitwize-music/config.yaml
cp art.png ~/music-projects/audio/sample-album/

正しい方法:

# Use MCP to find album and resolve both paths
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

理由: resolve_path は設定の読み込み、アーティストフォルダー、ジャンルの解決を自動的に処理します。

❌ やってはいけないこと: アートを1か所にしか配置しない

誤り:

# Only copying to audio folder
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
# Missing: content folder copy

正しい方法:

# Copy to BOTH locations
# 1. Audio location (for streaming platforms)
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
# 2. Content location (for documentation)
cp art.jpg {album_path}/album-art.jpg

理由: アルバムアートは両方の場所に必要です。リリース用のオーディオフォルダーと、ドキュメント用のコンテンツフォルダーに配置します。

❌ やってはいけないこと: ファイル名を取り違える

誤り:

# 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

正しい命名方法:

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

理由: 混乱を避けるため、場所ごとに異なる命名規則を使用します。

❌ やってはいけないこと: アルバムを手動で検索する

誤り:

find . -name "README.md" -path "*albums/$album_name*"

正しい方法:

find_album(album_name) → returns album data including path and genre
❌ やってはいけないこと: ディレクトリの作成を忘れる

誤り:

# Copying without ensuring directory exists
cp art.png {audio_root}/artists/{artist}/albums/{genre}/{album}/album.png
# Fails if directory doesn't exist

正しい方法:

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

理由: 特に新しいアルバムの場合、オーディオディレクトリがまだ存在しないことがあります。

コメント