
Avkit
Audit or implement iOS AVKit playback with correct AVAudioSession, Background Modes, PiP, and AirPlay behavior.
Install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill avkitWhat is this skill?
- Covers AVAudioSession `.playback` with `.moviePlayback` and when to call `setActive(true)`
- Background Modes guidance for Audio, AirPlay, and Picture in Picture
- Custom AVPlayerLayer PiP snippets with support and possibility checks
- Eval-driven expectations: avoid claiming silent PiP failure or nonstandard entitlements
- Swift-focused review and implementation patterns, not full app scaffolding
Adoption & trust: 1.2k installs on skills.sh; 713 GitHub stars; 2/3 security scanners passed (skills.sh audits).
Recommended Skills
Vercel React Native Skillsvercel-labs/agent-skills
Firebase Basicsfirebase/agent-skills
Building Native Uiexpo/skills
Firebase Ai Logic Basicsfirebase/agent-skills
Native Data Fetchingexpo/skills
Firebase Firestorefirebase/agent-skills
Journey fit
Common Questions / FAQ
Is Avkit safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Avkit
{ "skill_name": "avkit", "evals": [ { "id": 1, "prompt": "Audit this proposed iOS video player setup: it calls AVAudioSession.setCategory(.playback, mode: .moviePlayback) and setActive(true) in app launch, adds no background modes, and expects Picture in Picture and AirPlay to work automatically. Write a concise review with corrected Swift and Info.plist guidance.", "expected_output": "A review that corrects the audio session and background mode setup for an iOS AVKit playback app, recommends deferring setActive until playback begins, and avoids unsupported claims.", "files": [], "assertions": [ "Identifies that Background Modes > Audio, AirPlay, and Picture in Picture must be enabled for background audio, AirPlay streaming, and PiP support.", "Recommends setting AVAudioSession category to .playback with .moviePlayback for movie playback.", "Recommends deferring AVAudioSession.setActive(true) until playback begins rather than activating at app launch.", "Does not claim PiP failure is silent or require a PiP entitlement for standard playback." ] }, { "id": 2, "prompt": "Implement a custom iOS AVPlayerLayer view that offers a Picture in Picture button. Include the important checks and delegate handling, but keep it as snippets rather than a full app.", "expected_output": "Swift snippets for custom AVPlayerLayer-based PiP that check device support and current PiP possibility, start PiP only from user interaction, configure the delegate, and restore UI correctly.", "files": [], "assertions": [ "Uses AVPictureInPictureController with an AVPlayerLayer or ContentSource instead of subclassing AVPlayerViewController.", "Checks AVPictureInPictureController.isPictureInPictureSupported() before exposing or configuring PiP UI.", "Checks the controller's isPictureInPicturePossible before calling startPictureInPicture().", "Starts custom Picture in Picture only from an explicit user interaction such as a PiP button action.", "Implements restoreUserInterfaceForPictureInPictureStopWithCompletionHandler and calls its completion handler." ] }, { "id": 3, "prompt": "Review an iOS AVKit implementation that uses playerVC.isSkipForwardEnabled, playerVC.isSkipBackwardEnabled, playerVC.skippingBehavior = .skipItem, playerVC.allowedSubtitleOptionLanguages, playerVC.requiresFullSubtitles, and playerItem.interstitialTimeRanges = [...] to support skip buttons, subtitle restrictions, and ad breaks. Explain what should change for iOS 26.", "expected_output": "A review that flags tvOS-only skipping and subtitle-restriction APIs, recommends iOS-safe seeking or standard controls, and uses stream-defined interstitial ranges or AVPlayerInterstitialEventController instead of direct interstitialTimeRanges assignment as the iOS recipe.", "files": [], "assertions": [ "Flags isSkipForwardEnabled, isSkipBackwardEnabled, and skippingBehavior as tvOS-focused APIs that should not be used for iOS transport controls.", "Flags allowedSubtitleOptionLanguages and requiresFullSubtitles as tvOS-only subtitle controls and recommends AVAsset/AVPlayerItem media selection for iOS defaults.", "Recommends AVPlayer.seek(...) or standard AVPlayerViewController transport controls for iOS seeking behavior.", "States that iOS interstitial ranges must be stream-defined or scheduled with AVPlayerInterstitialEventController.", "Does not present playerItem.interstitialTimeRanges assignment as the primary iOS scheduling solution." ] }, { "id": 4, "prompt": "Review this SwiftUI AVKit snippet for iOS: VideoPlayer(player: player) { Button(\"Buy\") { purchase() } } plus player.usesExternalPlaybackWhileExternalScreenIsActive = true. Explain whether the overlay can be interactive and when to set the external playback properties.", "ex