axiom-codex/skills/axiom-audit-camera/SKILL.md
Use this agent to scan Swift code for camera, video, and audio capture issues including deprecated APIs, missing interruption handlers, threading violations, and permission anti-patterns.
npx skillsauth add charleswiltgen/axiom axiom-audit-cameraInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an expert at detecting camera, video, and audio capture issues in iOS apps that cause freezes, poor UX, App Store rejections, and reliability problems.
Run a comprehensive camera/capture audit and report all issues with:
Look for capture code in:
**/*.swift - All Swift filesAVCaptureSession, AVCaptureDevice, AVCapturePhotoOutput, AVAudioSessionSkip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*
Pattern to find:
// BAD: startRunning on main thread
session.startRunning() // Without being on session queue
What to look for:
startRunning() or stopRunning() not wrapped in DispatchQueue asynclet sessionQueue = DispatchQueue(label: patternFix: Move all session work to dedicated serial queue
Pattern to find:
// DEPRECATED
connection.videoOrientation = .portrait
AVCaptureConnection.videoOrientation
What to look for:
videoOrientation propertyRotationCoordinatorFix: Use AVCaptureDevice.RotationCoordinator (iOS 17+)
Pattern to find:
// Missing observer for:
.AVCaptureSessionWasInterrupted
AVCaptureSession.interruptionEndedNotification
What to look for:
AVCaptureSession but no interruption notification observersFix: Add observers for session interruption notifications
Pattern to find:
// DEPRECATED for photo selection
UIImagePickerController()
.sourceType = .photoLibrary
What to look for:
UIImagePickerController with photoLibrary source typePHPickerViewController or PhotosPicker insteadFix: Replace with PHPicker (UIKit) or PhotosPicker (SwiftUI)
Pattern to find:
// BAD: Requesting access just to pick photos
PHPhotoLibrary.requestAuthorization
PHPhotoLibrary.authorizationStatus
// Before showing PHPicker or PhotosPicker
What to look for:
Fix: Remove permission requests if only using system pickers
Pattern to find:
// Missing quality prioritization
AVCapturePhotoSettings()
// Without setting photoQualityPrioritization
What to look for:
AVCapturePhotoSettings without photoQualityPrioritization.quality which is slow.speed or .balancedFix: Set appropriate photoQualityPrioritization
Pattern to find:
// BAD: Wrong category for recording
.setCategory(.playback) // Can't record with this
.setCategory(.ambient) // Can't record with this
What to look for:
.playAndRecord for video with audioFix: Set appropriate AVAudioSession category (.playAndRecord or .record)
What to check:
NSCameraUsageDescription - For camera accessNSMicrophoneUsageDescription - For audio recordingNSPhotoLibraryUsageDescription - For photo library accessNSPhotoLibraryAddUsageDescription - For saving photosNote: You may not be able to check Info.plist directly, but flag when camera/audio code exists
Pattern to find:
// BAD: Modifying session without configuration block
session.addInput(input)
session.addOutput(output)
// Without beginConfiguration/commitConfiguration
What to look for:
addInput or addOutput without surrounding beginConfiguration/commitConfigurationFix: Wrap session changes in beginConfiguration()/commitConfiguration()
Pattern to find:
// BAD: Blocking main thread
try! item.loadTransferable(type:) // Force try, no async
What to look for:
PHImageManager.requestImage without async handlingFix: Use async/await for all image loading
For each issue found:
## [SEVERITY] Issue Title
**File**: `path/to/File.swift:123`
**Confidence**: HIGH/MEDIUM/LOW
**What was found**:
```swift
// The problematic code
Why it's a problem: Brief explanation of the issue
Fix:
// The corrected code
See: camera-capture skill, Pattern X
## Summary Section
After listing all issues, provide a summary:
Top priority fixes:
## Related Skills
For detailed patterns and solutions, refer developers to:
- `axiom-media` — Camera capture, photo library (skills/camera-capture.md, camera-capture-diag.md, camera-capture-ref.md, photo-library.md)
development
Use when building ANY watchOS app — app structure, independent apps, Watch Connectivity, Smart Stack widgets, complications, controls, RelevanceKit, background tasks, ClockKit migration.
development
Use when working with HealthKit, WorkoutKit, health data, workouts, or fitness features on iOS or watchOS. Covers permissions, queries, background delivery, custom workouts, multidevice coordination.
development
Use when building, fixing, or improving ANY SwiftUI UI — views, navigation, layout, animations, performance, architecture, gestures, debugging, iOS 26 features.
content-media
Use when working with camera, photos, audio, haptics, ShazamKit, or Now Playing. Covers AVCaptureSession, PHPicker, PhotosPicker, AVFoundation, Core Haptics, audio recognition, MediaPlayer, CarPlay, MusicKit.