spotify-hub
Skill584 starsChanged 59 days agoMITView on GitHub
A skill that uses Python and spotipy to control Spotify playback. It supports play/pause, skipping tracks, volume, shuffle, searching for and playing songs, generating mixed playlists from keywords (for example, TikTok hits, a specific genre, or a specific artist), and viewing the current playback status and device list. This skill must be triggered whenever the user mentions "Spotify," "play music," "skip a track," "pause," "search for a song," "switch playlists," "spotify-hub," or any scenario that requires controlling Spotify playback.
- Installs packages
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use the spotipy library to call the Spotify Web API, control playback, and search for music.
- Distinctive: line 44
After authorization is complete, the browser displays "✅ Spotify authorization successful!".
- Very specific: line 48
All operations are executed through /var/minis/skills/spotify-hub/scripts/spotify.py:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spotify Hub
Use the spotipy library to call the Spotify Web API, control playback, and search for music.
Dependencies
Both scripts declare dependencies (spotipy>=2.26.0) using uv inline script. When executed with uv run, they are installed automatically, so no manual pip install is required.
Environment Requirements
The following environment variables must be set. If they are not set, guide the user to create them:
SPOTIPY_CLIENT_ID— SettingsSPOTIPY_CLIENT_SECRET— SettingsSPOTIPY_REDIRECT_URI— Settings
Apply for credentials at https://developer.spotify.com/dashboard → Create App → set Redirect URI to http://127.0.0.1:8888/callback
Authorization Flow (First Time or When the Token Expires)
The token is stored in ~/.config/spotify/cache and includes a refresh_token. Under normal circumstances, it remains valid indefinitely and does not require repeated authorization.
When authorization is required, start the authorization server in the background, get the URL, and give it directly to the user to click:
# Start the authorization server in the background
import subprocess, time
subprocess.Popen(["uv", "run", "--script", "--cache-dir", "/root/.cache/uv",
"/var/minis/skills/spotify-hub/scripts/spotify_auth.py"],
stdout=open("/tmp/spotify_auth.log", "w"), stderr=subprocess.STDOUT)
time.sleep(2)
url = open("/tmp/spotify_auth_url.txt").read().strip()
print(url)Then provide the user with a clickable authorization link in the reply:
[👉 Click to authorize Spotify](<url>)
After authorization is complete, the browser displays "✅ Spotify authorization successful!". Once the user informs you, you can continue.
Core Script
All operations are executed through /var/minis/skills/spotify-hub/scripts/spotify.py:
uv run --script --cache-dir /root/.cache/uv /var/minis/skills/spotify-hub/scripts/spotify.py <cmd> [args]| Command | Description |
status | Current playback status + device list |
play / pause | Play / pause |
next / prev | Next track / previous track |
volume <0-100> | Set volume |
shuffle on/off | Toggle shuffle |
repeat off/track/context | Repeat mode |
seek <seconds or mm:ss> | Seek playback position |
search <keyword> | Search and play |
play-track <id/uri> | Play a specified track |
play-playlist <id/uri> | Play a specified playlist |
save / unsave | Save / unsave the current track |
liked [count] | View saved tracks |
recent [count] | Recently played history |
top [tracks/artists] [count] | Most-listened tracks / artists |
playlists | View my playlist list |
create-playlist <name> | Create a playlist |
add-to-playlist <id> | Add the current track to a playlist |
follow <artist name> | Follow an artist |
following | View followed artists |
Popular Playlist Scenarios (for example, "TikTok Hits" or "a Specific Genre")
Third-party public playlists will return 403. Do not attempt to read playlists. Instead, use multi-keyword search to mix and play tracks:
from scripts.spotify import get_sp, search_multi_and_play
sp = get_sp()
keywords = ["TikTok trending", "douyin trending", "tiktok viral 2024", "TikTok hit songs"]
search_multi_and_play(sp, keywords, count_each=10, market="HK")Or call spotify.py search directly with shell_execute:
uv run --script --cache-dir /root/.cache/uv /var/minis/skills/spotify-hub/scripts/spotify.py search "TikTok trending"Notes
- Playback control requires an active device (Spotify is open on a phone or computer and has played before)
market="HK"can find more Chinese songs- spotipy is preinstalled (
pip show spotipycan verify this) - In Development Mode, 403 for third-party public playlists is a normal restriction. Use search instead.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- lsongdev/skills★ 094% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository56 other files it gives its agents.
- android-devSkill
- android-ui-automationSkill
- apple-remindersSkill
- appstoreprice-hubSkill
- asc-cliSkill
- bilibili-hubSkill
- Clash 控制器Skill
- cloudflare-dnsSkill
- codex-imageSkill
- codex-on-ishSkill
- contact-vcard-extractorSkill
- coredevice-toolkitSkill
- deepseek-usageSkill
- doubao-ttsSkill
- douyin-downloaderSkill
- evidence-chain-builderSkill
- exa-searchSkill
- free-ttsSkill
- fucai3d-latestSkill
- generative-ui-minisSkill
- github-sync-helperSkill
- health-sleep-analysisSkill
- health-training-checkinSkill
- hyperframes-cliSkill
- hyperframesSkill
- ios-devSkill
- korea-stockSkill
- maimai-hubSkill
- memos-apiSkill
- nano-bananaSkill
- notion-hubSkill
- openstreetmap-markerSkill
- pdf-converterSkill
- production-agent-publicSkill
- qbt-hubSkill
- quark-hubSkill
- reverse-dcfSkill
- self-improving-agentSkill
- shortcuts-builderSkill
- shortcut-share-fileSkill
- stock-fund-flowSkill
- stock-priceSkill
- tavily-searchSkill
- tg-hubSkill
- todoocardSkill
- twitter-downloaderSkill
- twitter-x-hubSkill
- us-stockSkill
- web-content-extractorSkill
- web-searchSkill
- weibo-hubSkill
- whenpeakSkill
- xianyu-hubSkill
- xiaohongshu-hubSkill
- youtube-downloaderSkill
- ytmusic-hubSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

