iphone-duo-camera
Skill4 starsChanged 2 months agoMITView on GitHub
Adapt an AVFoundation or AVKit camera app for iPhone Duo, where opening or closing the device moves the app between displays and a camera can start facing the other way. Use when choosing between the virtual front camera and the inner and outer ultra-wide cameras, adopting AVCaptureDeviceDirectionCoordinator, fixing preview mirroring or rotation after a display change, switching capture inputs safely, or verifying saved photos and video on the device.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- mirzaaghazadeh/iphone-duo-skillstheir own version, first seen Oct 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- mirzaaghazadeh/iphone-duo-skills★ 302same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- iphone-duo-designSkill
- iphone-duo-developmentSkill
- iphone-duo-layoutSkill
- iphone-duo-readinessSkill
- iphone-duo-scenesSkill
- iphone-duo-testingSkill
- iphone-duo-toolbarsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 9
Read camera evidence. The direction coordinator and the inner and outer camera types need the iOS 27.1 SDK.
- Distinctive: line 15
Document the session owner, serialization mechanism, preview owner, and actor boundaries.
- Distinctive: line 29
Test permission denial, unavailable cameras, rapid open and close, background and foreground transitions, and capture interruption.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
iPhone Duo camera
Read camera evidence. The direction coordinator and the inner and outer camera types need the iOS 27.1 SDK. Do not infer an API from a camera's marketing name.
Choose the capture strategy
Establish the product requirement: ordinary front-camera continuity, a specific physical camera's capabilities, or a display-relative capture experience. The virtual front camera follows the active display with no extra work but exposes only what both front cameras share. Selecting the physical cameras gives their full capabilities and makes following their direction the app's job. Inspect available device formats rather than assuming a model guarantees a resolution or frame rate in the current configuration.
Document the session owner, serialization mechanism, preview owner, and actor boundaries. Keep capture logic out of presentation models where the project already has a reusable capture layer; do not undertake an unrelated architectural rewrite.
Handle transitions deliberately
Ask a direction coordinator which cameras face the same way as the preview view instead of reading a camera's position. Create it on the main actor, keep it alive as long as its view is on screen, and use one per preview view. Pass the sendable descriptors it reports to the actor that owns the session; never call AVFoundation from its handler. Resolve a descriptor there, handle a camera that no longer exists, and replace a single input rather than running both cameras unless the product needs it.
Serialize session reconfiguration and prevent stale direction callbacks from replacing a newer selection. Check input compatibility, retain enough state to restore the previous input when replacement fails, and present a clear interruption state if recording cannot continue. Do not promise seamless recording across a device switch without measured evidence.
Keep preview mirroring, saved-media orientation, and camera selection as separate decisions. Mask stale frames while the new camera starts. Derive mirroring from direction, reapply it after every input change, and create a new rotation coordinator for each camera. Verify output with text and an asymmetric subject: a plausible preview does not prove the saved file is correctly oriented.
Preserve authorization handling, interruption recovery, and resource cleanup. Avoid synchronous camera startup or expensive session work on the main thread. Use the project's established capture actor or serial executor and satisfy actual Swift concurrency constraints rather than adding unchecked sendability.
Verify
Test permission denial, unavailable cameras, rapid open and close, background and foreground transitions, and capture interruption. Inspect saved photos and videos, not only screenshots. Exercise reduced-capability paths and confirm the UI stays responsive. Content for the outer display during capture belongs to the scenes skill.
Return the strategy tradeoff, session and state boundary, compatibility evidence, and observed failures or untested hardware cases. Simulator has no camera, so it cannot establish camera behavior.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

