Photos — Foundations Skill
Purpose
Route Photos and PhotoKit implementation tasks to the minimum required Photos Knowledge Contracts. v1 scope is reaching the user's photo library: selecting assets with no permission at all, requesting access when selection is not enough, behaving correctly under limited access, reading assets and their images, and writing new ones — not editing photos, not playing Live Photos or video, and not capturing from the camera.
Routing
Load only the contracts relevant to the task. All paths relative to knowledge/photos/.
- Presenting
PhotosPickerorPHPickerViewController; settingselectionLimit/maxSelectionCountor aPHPickerFilter; readingPHPickerResult.itemProvider/assetIdentifieror aPhotosPickerItem-> picker-and-selection-results.md - Calling
PHPhotoLibrary.requestAuthorization(for:handler:)/authorizationStatus(for:); choosingPHAccessLevel.addOnlyvs.readWrite; declaringNSPhotoLibraryUsageDescription/NSPhotoLibraryAddUsageDescription; branching onPHAuthorizationStatus-> authorization-and-access-levels.md - Handling
PHAuthorizationStatus.limited; callingpresentLimitedLibraryPicker(from:); settingPHPhotoLibraryPreventAutomaticLimitedAccessAlert-> limited-library.md - Building a
PHFetchOptionsquery; holding or refreshing aPHFetchResult; fetching aPHAssetCollection's members; reading where a photo was taken fromPHAsset.location-> asset-fetching.md - Calling
PHImageManager.requestImage(...); settingPHImageRequestOptions'isSynchronous/deliveryMode/isNetworkAccessAllowed; priming aPHCachingImageManager-> image-requests.md - Running
performChanges(_:completionHandler:); creating withPHAssetChangeRequest/PHAssetCreationRequest; capturingplaceholderForCreatedAsset-> saving-to-the-library.md
Never load more than the contracts relevant to the specific question.
For how a usage-description string should be worded, route to
skill.app-store-review-guidelines.submission. For whether to show a
pre-permission screen and what it says, route to
skill.human-interface-guidelines.foundations. For declaring photo data
in PrivacyInfo.xcprivacy, route to skill.privacy.foundations.
Stop Conditions
Stop and report if the requested topic has no matching Knowledge
Contract in knowledge/photos/ — do not guess or fall back to general
knowledge. Photo and video editing (PHContentEditingInput,
PHContentEditingOutput, adjustment data, Photo Editing extensions),
PHLivePhotoView, AVAsset export from a PHAsset, and
PHAssetResource-level resource copying are out of scope entirely (see
docs/architecture/domain-map.md). Capturing a new photo from the camera
is AVFoundation's and has no Skill yet — report that rather than
answering.
A photo's recorded capture place is this domain's, not core-location's,
even though PHAsset.location is typed as a CLLocation:
asset-fetching.md Rule 5 owns it, including the authorization question.
Route to core-location only when the task needs the device's current
or ongoing location, which is a different subject.
SwiftUI interop with this domain is split deliberately, and the split is
this Skill's: PhotosPicker is SwiftUI-native, so
picker-and-selection-results.md Rule 2 forbids wrapping the picker,
while presentLimitedLibraryPicker(from:) takes a UIViewController
and has no SwiftUI counterpart, so limited-library.md Rule 5 requires
a bridge. How any such wrapper is written belongs to uikit-interaction
and is not restated here.