# photokit

A skill that gives the agent working patterns for photo picking, camera capture and media permissions in iOS apps written in Swift.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3200 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/photokit/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/photokit

## What it does

Inside are recipes for PhotoKit and AVFoundation: a single or multi-photo picker built on `PhotosPicker`, media type filters, and async loading through `Transferable`. A separate section covers the camera side of `AVCaptureSession`. Permissions get their own chapter — library access levels, the Info.plist keys, and the request calls on `PHPhotoLibrary` and `AVCaptureDevice`.

The snippets target iOS 26 with Swift 6.3, though most stay compatible down to iOS 16 unless a note says otherwise. Two reference files come along: `references/photokit-patterns.md` for picker recipes and `references/camera-capture.md` for capture session examples.

One point the skill keeps making: `PhotosPicker` runs out-of-process, so browsing needs no library permission and the app only sees what the user picked. Ask for access explicitly when you read the whole library or write into it. For the camera, the access prompt never appears without `NSCameraUsageDescription` in Info.plist, so add the key before the session starts.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill photokit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/photokit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/photokit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill photokit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/photokit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill photokit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/photokit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills photokit
```

2. **Manually: put the files in place**
- File: `.github/skills/photokit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill photokit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/photokit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/photokit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill photokit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/photokit/SKILL.md

## When to use it
- let the user pick several photos with a selection cap
- restrict the picker to videos or Live Photos only
- load a picked item asynchronously without freezing the main thread
- request camera access and handle a denial cleanly
- decide between read-write and add-only library permission

## Example prompts
- Add a single-photo `PhotosPicker` to this screen, filtered to `.images`
- Set up an `AVCaptureSession` for video and check camera permission before starting it
- Review my photo picking code for anything that could block the main thread

## Similar
- [vercel-react-native-skills](https://affpapa.org/en/nevibecode/skills/vercel-react-native-skills.md) — skill · 255200 installs
- [animate-expo](https://affpapa.org/en/nevibecode/skills/animate-expo.md) — skill · 137900 installs
- [mobile-native](https://affpapa.org/en/nevibecode/skills/mobile-native.md) — skill · 86600 installs
- [aso](https://affpapa.org/en/nevibecode/skills/aso.md) — skill · 75400 installs
- [swiftui-pro](https://affpapa.org/en/nevibecode/skills/swiftui-pro.md) — skill · 35200 installs
- [orca-emulator](https://affpapa.org/en/nevibecode/skills/orca-emulator.md) — skill · 5800 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
