dpearson2699/swift-ios-skills / skills/vision-framework
vision-framework
VerifiedImplement computer vision features including text recognition (OCR), face detection, barcode scanning, image segmentation, object tracking, and document scanning in iOS apps. Covers both the modern Swift-native Vision API (iOS 18+) and legacy VNRequest patterns, VisionKit DataScannerViewController for live camera scanning, and CoreMLRequest/VNCoreMLRequest for custom model inference. Use when adding OCR, barcode scanning, face detection, or custom Core ML model inference with Vision.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 18.3 KB |
| evals/evals.json | config | 3.7 KB |
| references/vision-requests.md | markdown | 21.6 KB |
| references/visionkit-scanner.md | markdown | 23.5 KB |
evals/evals.json
View on GitHub{
"skill_name": "vision-framework",
"evals": [
{
"id": 1,
"prompt": "Review this iOS 26 Vision helper: it uses `DetectBarcodesRequest` with `[VNBarcodeSymbology]`, stores modern Vision bounding boxes as `CGRect`, converts them with `VNImageRectForNormalizedRect`, starts object tracking with `TrackObjectRequest(observation:)`, sets `trackingLevel`, and calls `generateMask(forInstances:)` on `InstanceMaskObservation`. Provide corrected Swift snippets and explain the API generation boundary.",
"expected_output": "A concise correction that uses modern Swift Vision APIs for iOS 18+ while preserving legacy VNRequest guidance only where needed.",
"files": [],
"assertions": [
"Uses `BarcodeSymbology` with `DetectBarcodesRequest` and does not use `VNBarcodeSymbology` for modern barcode detection.",
"Treats modern observation bounds as `NormalizedRect` and uses `toImageCoordinates(_:origin:)` or `.cgRect` only when conversion is needed.",
"Uses `TrackObjectRequest(detectedObject:)` with `DetectedObjectObservation(boundingBox:)` and does not set `trackingLevel` on modern `TrackObjectRequest`.",
"Calls `InstanceMaskObservation.generateMask(for:)` for modern person-instance masks.",
"Keeps legacy `VNImageRectForNormalizedRect`, `VNBarcodeSymbology`, and `VNTrackObjectRequest.trackingLevel` scoped to legacy VN APIs or VisionKit where applicable."
]
},
{
"id": 2,
"prompt": "Build a SwiftUI live scanner for text and QR codes using VisionKit. Include permission and availability handling, the wrapper shape, barcode symbology types, and when scanning should start.",
"expected_output": "A SwiftUI DataScannerViewController integration that is safe to present and uses VisionKit-specific types correctly.",
"files": [],
"assertions": [
"Includes `NSCameraUsageDescription` and checks camera authorization before or around presentation.",
"Checks both `DataScannerViewController.isSupported` and `DataScannerViewController.isAvailable` before presenting.",
"Uses `DataScannerViewController.RecognizedDataType.barcode(symbologies:)` with VisionKit-supported `VNBarcodeSymbology` values, not modern Vision `BarcodeSymbology`.",
"Wraps `DataScannerViewController` in `UIViewControllerRepresentable` and starts scanning after presentation or on the main actor.",
"Mentions A12 Bionic or later support and a fallback for unavailable devices or visionOS."
]
},
{
"id": 3,
"prompt": "Implement an image-analysis feature that reads text, detects barcodes, estimates horizon angle, finds saliency regions, and optionally runs a custom Core ML classifier through Vision. Keep Core ML conversion and deployment out of scope.",
"expected_output": "A Vision-focused design that uses the correct result shapes for modern requests, treats any Core ML classifier as already prepared, and keeps Core ML conversion and deployment outside the Vision implementation.",
"files": [],
"assertions": [
"Uses `RecognizeTextRequest`, `DetectBarcodesRequest`, `DetectHorizonRequest`, and saliency requests with `perform(on:)` and async/await.",
"Handles `DetectHorizonRequest` as returning one `HorizonObservation` with `angle: Measurement<UnitAngle>`.",
"Handles attention/objectness saliency requests as returning one `SaliencyImageObservation`, not an array of observations.",
"Uses `CoreMLRequest` only for an already-prepared classifier model and handles classifier output as `ClassificationObservation`.",
"Keeps Core ML conversion and deployment out of scope instead of expanding model lifecycle guidance in the Vision answer."
]
}
]
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |