camera-auditor
Scans Swift code for camera, video, and audio capture issues — both known anti-patterns like main-thread session work, deprecated videoOrientation, missing interruption observers, and UIImagePickerController for photos, and architectural gaps like missing sessionRuntimeError recovery, concurrent session queues, missing audio session deactivation, and stuck permission-denied UI when the user returns from Settings.
What It Does
- Detects 10 known anti-patterns (main-thread
startRunning, deprecatedvideoOrientation, missingsessionWasInterrupted/sessionInterruptionEndedobservers,UIImagePickerControllerwith.photoLibrary, over-requestingPHPhotoLibrary.requestAuthorization, missingphotoQualityPrioritization, wrongAVAudioSessioncategory for recording, missing purpose strings, configuration outsidebeginConfigurationblock, synchronous photo loading) - Identifies architectural gaps (missing
sessionRuntimeErrorobserver + restart logic, concurrent session queue letting reconfiguration race, no Open-Settings guidance after permission denial and nodidBecomeActiveNotificationre-check on return, hot session left running in background, missingAVAudioSession.setActive(false)on end, missing audio interruption handling, stale rotation tracking on iOS 17+ withoutRotationCoordinator, deprecatedAVCaptureDevice.devices()enumeration vsDiscoverySession, non-atomic reconfiguration,AVCaptureMultiCamSessionwithoutisMultiCamSupportedcheck,try!onloadTransferable) - Correlates findings that compound into higher severity (main-thread + heavy initial config, missing interruption + audio capture, missing purpose strings + capture session, deprecated
videoOrientation+ iOS 17+ deployment, AVAudioSession.playback+ video recording produces silent files) - Produces a Capture Reliability Health Score (RELIABLE / FRAGILE / BROKEN)
How to Use
Natural language:
- "Can you check my camera code for issues?"
- "Audit my capture implementation"
- "Is my camera code following best practices?"
- "Check for deprecated camera APIs"
- "Review my AVFoundation capture code"
Explicit command:
bash
/axiom:audit cameraRelated
- camera-capture skill — session setup, rotation handling, interruption recovery patterns
- camera-capture-ref skill — full AVCaptureSession/AVCaptureDevice/RotationCoordinator API reference
- camera-capture-diag skill — decision trees for camera freezes, black preview, rotation bugs
- photo-library skill — PHPicker/PhotosPicker patterns
- avfoundation-ref skill — AVAudioSession category and activation rules
- concurrency-auditor agent — overlaps on main-thread session work and sample-buffer processing
- security-privacy-scanner agent — overlaps on
NSCameraUsageDescription,NSMicrophoneUsageDescription, photo library purpose strings - energy-auditor agent — overlaps on hot session left running in background and HEVC encoding pressure
- swift-performance-analyzer agent — overlaps on ARC overhead in
AVCaptureVideoDataOutputsample-buffer paths - storage-auditor agent — overlaps on saved photo/video file location and
isExcludedFromBackup - health-check agent — includes camera-auditor in project-wide scans