Communitygithub.com

ni-shiliu/neil-control

Music control skill to enhance your work session by controlling Spotify on macOS.

What is neil-control?

This AI agent skill enables proactive music control during a user's coding session, currently supporting Spotify on macOS. It uses a command-line interface to play, pause, skip tracks, search, and queue songs, all without needing an API key or OAuth setup — the search leverages the anonymous Web Player API. The skill includes mood-based recommendations (focused, relaxed, hyped, sad, debug) and proactive trigger rules that automatically suggest or play music based on conversation signals like starting a session, fixing a bug, or showing frustration. It also supports multi-song operations with a `|||` separator and persistent queue management. Built for agents like Claude Code, Cursor, or Codex, this skill enhances developer flow by reducing context-switching and adding a responsive musical atmosphere to work sessions.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add ni-shiliu/neil-control

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Limit music control to Spotify only now

music-control

Controls Spotify on macOS via CLI. Use it to enhance the user's work session with music — proactively and responsively.

Setup

Requirements: macOS, Python 3.10+, Spotify desktop app installed.

No Spotify API key or OAuth setup needed — search uses the anonymous Web Player API.

CLI

MUSIC="python3 ~/.claude/skills/music-control/scripts/music_cli.py"
$MUSIC [--provider spotify] <command>
CommandDescription
statusCurrent track info (JSON)
playToggle play/pause
nextSkip to next
prevPrevious track
play-by <title>...Search and play immediately; multi-song with |||
search <query> [--page N]Search with pagination
recommend <mood>Pick by mood and play
queue-showDisplay current queue
queue-add <title>...Add songs to queue; multi-song with |||
queue-play [index]Start playing from queue
queue-nextSkip to next in queue
queue-clearClear the queue

--provider defaults to spotify. If Spotify is not running, it will be launched automatically.

Mood Keywords

MoodWhen to use
focusedDeep work, coding in flow, reading
relaxedCasual chat, breaks, light tasks
hypedFeature shipped, bug fixed, wins
sadUser venting, stuck on a problem
debugFrustrated, chasing a tricky bug

Proactive Trigger Rules

Always act without being asked when you detect:

Signal in conversationAction
User starts a new coding sessionrecommend focused → play top result
User says they fixed a bug / shippedrecommend hyped → play top result
User is frustrated / stuckrecommend debug
User mentions needing to relaxrecommend relaxed
User mentions a specific song or artistplay-by <song> <artist>
Long silence / idle in conversationrecommend relaxed
User asks "play something" with no detailInfer from recent conversation mood

Queue & Multi-Song

Multi-song separator: |||

$MUSIC play-by 逆战 ||| 天下 ||| 这就是爱
$MUSIC queue-add 逆战 ||| 天下
$MUSIC queue-play
$MUSIC queue-next
$MUSIC search 周杰伦 --page 2

Response Format

{"ok": true, "title": "晴天", "artist": "周杰伦", "playing": true}
{"ok": true, "results": [{"title":"...", "artist":"...", "id":"..."}]}
{"ok": true, "action": "next"}
{"ok": true, "action": "queue_next", "current": 1, "has_next": true}
{"ok": false, "error": "no_player", "message": "..."}

Notes

  • Spotify: uses anonymous Web Player API for search — no login or API key needed
  • If status returns no_player, the app may still be loading — wait 3s and retry
  • Queue is persisted to ~/.config/music-cli/queue.json

Related Skills