avkit — Claude Code skill: what it does, how to install
Guides AI agents through building iOS media playback UI, configuring AVPlayerViewController, SwiftUI VideoPlayer, and Picture-in-Picture.
npx skills add dpearson2699/swift-ios-skills --skill avkit -a claude-codeWhat avkit does
This skill provides code patterns for AVKit and AVFoundation playback UI on iOS. It gives coding assistants guidance for presenting AVPlayerViewController, embedding it inside existing UIKit view hierarchies, or rendering SwiftUI VideoPlayer views. It explicitly tells the agent never to subclass AVPlayerViewController.
Setting up background audio and Picture-in-Picture requires specific steps. You must add the audio value to UIBackgroundModes, set the audio session category to .playback, and defer calling setActive(true) until playback starts. PiP fails when an item contains only audio or uses an unsupported container, so the skill highlights checks for playable media before activation.
To prevent a black flash before playback starts, the guide shows how to observe isReadyForDisplay. For advanced SwiftUI controls like custom delegate callbacks or speed adjustments, it details wrapping the UIKit player in UIViewControllerRepresentable.
What it helps with
- embed AVPlayerViewController inside a UIKit container view
- configure AVAudioSession and background modes for Picture-in-Picture
- overlay custom branding onto a SwiftUI VideoPlayer
- prevent black flashes before media playback begins
Example prompts for the agent
- Show how to embed AVPlayerViewController as a child view controller
- Configure AVAudioSession for video playback and Picture-in-Picture
- Create a SwiftUI VideoPlayer with an interactive overlay
How to install avkit
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill avkit -a claude-code2Manually: put the files in place
~/.claude/skills/avkit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/avkit/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill avkit -a codex2Manually: put the files in place
.agents/skills/avkit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill avkit -a cursor2Manually: put the files in place
.cursor/skills/avkit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills avkit2Manually: put the files in place
.github/skills/avkit/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill avkit -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/avkitManually: put the files in place
.devin/skills/avkit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill avkit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about avkit
How to install avkit in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill avkit -a claude-code in your terminal. This imports the skill directly into your environment.
What does the avkit skill do?
It teaches coding agents how to implement media playback across UIKit and SwiftUI using AVKit. It covers player presentation, background audio configuration, and Picture-in-Picture handling.
Why does Picture-in-Picture fail on certain media items?
PiP requires a ready AVPlayerItem with video tracks and supported codecs. It will not activate for audio-only items or when UIBackgroundModes lacks the audio category.