spotify-patterns

Implement Spotify Web API patterns for token refresh, relinking, and playlist creation.

3|Updated Mar 1, 2010
One-click install
npx skills add https://github.com/harleypig/dotfiles --skill spotify-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spotify-patterns
Source: https://github.com/harleypig/dotfiles/tree/main/config/claude/skills/spotify-patterns
Command: npx skills add https://github.com/harleypig/dotfiles --skill spotify-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Spotify integration projects struggle with token expiry, library state inconsistencies due to relinking, and scalable playlist management under rate limits.

Core Features & Use Cases

  • Proactive token refresh to outlive short-lived access tokens and handle refresh token rotation.
  • Relinking-aware library operations that use the original id for saved- state and handle saved/unsaved transitions via linked_from.
  • Pagination and set-based dedup for building large playlists without duplicates.
  • 429/Retry-After handling with exponential backoff to gracefully recover from rate limits.
  • Playlist-creation strategies (by artist, by theme, from song list) to assemble curated playlists.
  • Cover-art generation pipeline (SVG→PNG) with accessibility considerations and support for ugc-image-upload.

Quick Start

Apply the proactive token refresh, relinking-aware library operations, and playlist-creation patterns to your Spotify integration to ensure reliability and correct track handling.

Frequently Asked Questions about spotify-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle Spotify API token expiry and refresh token rotation?

Implement proactive token refresh patterns to outlive short-lived Spotify access tokens and handle refresh token rotation. This ensures your app maintains continuous authentication without manual intervention during active sessions.

What is track relinking and how does it affect saved library state in the Spotify Web API?

Track relinking causes library state inconsistencies across markets. Relinking-aware operations use the original track ID for saved-state and manage saved or unsaved transitions via the linked_from property to maintain accurate library state.

How do I build large Spotify playlists without duplicates using pagination?

Build large Spotify playlists without duplicates by implementing pagination with set-based deduplication. This pattern ensures tracks are fetched and assembled efficiently while preventing repeated songs in the final playlist.

What is the best way to handle Spotify API rate limits and 429 Retry-After errors?

Handle Spotify API rate limits by implementing 429 Retry-After handling with exponential backoff. This approach gracefully recovers from rate limit errors by progressively increasing wait times between subsequent retry attempts.

Can I generate and upload custom cover art for Spotify playlists?

Generate custom cover art for Spotify playlists using an SVG to PNG conversion pipeline with accessibility considerations. The pipeline supports the ugc-image-upload endpoint to programmatically set custom playlist images.