Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

axiom-now-playing

БесплатноБез исполняемых скриптовНе проверен

Use when Now Playing metadata doesn't appear on Lock Screen/Control Center, remote commands (play/pause/skip) don't respond, artwork is…

ComeOnOliverот ComeOnOliver★ 67 звёзд на GitHub

Об этом скилле

Now Playing Integration Guide

Purpose: Prevent the 4 most common Now Playing issues on iOS 18+: info not appearing, commands not working, artwork problems, and state sync issues

Swift Version: Swift 6.0+ iOS Version: iOS 18+ Xcode: Xcode 16+

Core Philosophy

"Now Playing eligibility requires THREE things working together: AVAudioSession activation, remote command handlers, and metadata publishing. Missing ANY of these silently breaks the entire system. 90% of Now Playing issues stem from incorrect activation order or missing command handlers, not API bugs."

Key Insight from WWDC 2022/110338: Apps must meet two system heuristics:

  1. Register handlers for at least one remote command
  2. Configure AVAudioSession with a non-mixable category

When to Use This Skill

✅ Use this skill when:

  • Now Playing info doesn't appear on Lock Screen or Control Center
  • Play/pause/skip buttons are grayed out or don't respond
  • Album artwork is missing, wrong, or flickers between images
  • Control Center shows "Playing" when app is paused, or vice versa
  • Apple Music or other apps "steal" Now Playing status
  • Implementing Now Playing for the first time
  • Debugging Now Playing issues in existing implementation
  • Integrating CarPlay Now Playing (covered in Pattern 6)
  • Working with MusicKit/Apple Music content (covered in Pattern 7)

iOS 26 Note

iOS 26 introduces Liquid Glass visual design for Lock Screen and Control Center Now Playing widgets. This is automatic system behavior — no code changes required. The patterns in this skill remain valid for iOS 26.

❌ Do NOT use this skill for:

  • Background audio configuration details (see AVFoundation skill)

Related Skills

  • swift-concurrency - For @MainActor patterns, weak self in closures, async artwork loading
  • memory-debugging - For retain cycles in command handlers
  • avfoundation-ref - For AVAudioSession configuration details

Red Flags / Anti-Patterns

If you see ANY of these, suspect Now Playing misconfiguration:

  • Info appears briefly then disappears (AVAudioSession deactivated)
  • Commands work in simulator but not on device (simulator has different audio stack)
  • Artwork shows placeholder then updates (race condition, not necessarily wrong)
  • Artwork never appears (format/size issue or MPMediaItemArtwork block returning nil)
  • Play/pause state incorrect after backgrounding (not updating on playback rate changes)
  • Another app "steals" Now Playing (didn't meet eligibility requirements)
  • playbackState property doesn't update (iOS doesn't have playbackState, macOS only!)

FORBIDDEN Assumptions:

  • "Just set nowPlayingInfo and it works" - Must have AVAudioSession + command handlers
  • "playbackState controls Control Center" - iOS ignores playbackState, uses playbackRate
  • "Artwork just needs an image" - Needs proper MPMediaItemArtwork with size handler
  • "Commands enable themselves" - Must add target AND set isEnabled = true
  • "Update elapsed time every second" - System infers from rate, causes jitter

Mandatory First Steps (Pre-Diagnosis)

Run this code to understand current state before debugging:

// 1. Verify AVAudioSession configuration
let session = AVAudioSession.sharedInstance()
print("Category: \(session.category.rawValue)")
print("Mode: \(session.mode.rawValue)")
print("Options: \(session.categoryOptions)")
print("Is active: \(try? session.setActive(true))")
// Must be: .playback category, NOT .mixWithOthers option

// 2. Verify background mode
// Info.plist must have: UIBackgroundModes = ["audio"]

// 3. Check command handlers are registered
let commandCenter = MPRemoteCommandCenter.shared()
print("Play enabled: \(commandCenter.playCommand.isEnabled)")
print("Pause enabled: \(commandCenter.pauseCommand.isEnabled)")
// Must have at least one command with target AND isEnabled = true

// 4. Check nowPlayingInfo dictionary
if let info = MPNowPlayingInfoCenter.default().nowPlayingInfo {
    print("Title: \(info[MPMediaItemPropertyTitle] ?? "nil")")
    print("Artwork: \(info[MPMediaItemPropertyArtwork] != nil)")
    print("Duration: \(info[MPMediaItemPropertyPlaybackDuration] ?? "nil")")
    print("Elapsed: \(info[MPNowPlayingInfoPropertyElapsedPlaybackTime] ?? "nil")")
    print("Rate: \(info[MPNowPlayingInfoPropertyPlaybackRate] ?? "nil")")
} else {
    print("No nowPlayingInfo set!")
}

What this tells you:

Observation Diagnosis Pattern
Category is .ambient or has .mixWithOthers Won't become Now Playing app Pattern 1
No commands have targets System ignores app Pattern 2
Commands have targets but isEnabled = false UI grayed out Pattern 2
Artwork is nil MPMediaItemArtwork block returning nil Pattern 3
playbackRate is 0.0 when playing Control Center shows paused Pattern 4
Background mode "audio" not in Info.plist Info disappears on lock Pattern 1

Decision Tree

Now
Полный SKILL.md на GitHub

Установить axiom-now-playing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл axiom-now-playing?

Use when Now Playing metadata doesn't appear on Lock Screen/Control Center, remote commands (play/pause/skip) don't respond, artwork is missing/wrong/flickering, or playback state is out of sync - provides systematic diagnosis, correct patterns, and professional push-back for audio/video apps on iOS 18+

Как установить скилл axiom-now-playing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл axiom-now-playing запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить axiom-now-playing с