iphone-duo-adapt
Skill2 starsChanged 40 days agoMITView on GitHub
Audits an existing SwiftUI or UIKit iOS app for iPhone Duo (Apple's foldable iPhone, iOS 27.1) and then fixes every problem it finds. Use when the user asks to get an app ready for iPhone Duo or the foldable iPhone, to check or audit Duo support, or to fix layouts that break when the device opens, closes, folds, or runs in split view. Also use for vertical bars, reserved regions, the fold or hinge, ArrangementView, UIArrangementViewController, onHingeChange, UIHingeInteraction, camera direction on Duo, and CameraCaptureAccessory.
In this repository28 other files it gives its agents.
- broSkill
- codebase-designSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- grill-with-docsSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- openai-docsSkill
- product-thinkingSkill
- prSkill
- researchSkill
- retroSkill
- setup-matt-pocock-skillsSkill
- swift-concurrency-expertSkill
- swift-concurrencySkill
- swiftui-expert-skillSkill
- swiftui-liquid-glassSkill
- swiftui-performance-auditSkill
- swiftui-proSkill
- swiftui-ui-patternsSkill
- swiftui-view-refactorSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- typesafe-aiSkill
- wayfinderSkill
- wwdc-knowledgeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
16 rules. About 0 are common, 5 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Read references/device.md before the audit.
- Distinctive: line 19
When the device is partially folded, a division reserved region crosses the screen.
- Distinctive: line 20
All apps join split view multitasking on the inner display.
- Very specific: line 25
Run scripts/preflight.sh <project-dir>.
- Distinctive: line 26
If no Xcode with the iOS 27.1 SDK exists, stop.
- Very specific: line 31
Run python3 scripts/audit.py <project-dir>.
- Very specific: line 34
Write DUO_AUDIT.md in the project root.
- Very specific: line 45
If the user says "use your judgment" or the session is non-interactive, apply the default from references/decisions.md and list each …
- Distinctive: line 46
If you find a new ambiguity during the fix phase, stop and ask.
- Very specific: line 62
Keep the user's deployment target.
- Very specific: line 64
Never replace a dynamic value with a literal.
- Distinctive: line 65
Prefer system containers (NavigationStack, NavigationSplitView, TabView, List, UINavigationController, UISplitViewController, …
- Very specific: line 66
Do not use hinge data (onHingeChange, UIHingeInteraction) for layout.
- Very specific: line 72
Follow references/verification.md.
- Very specific: line 74
Run python3 scripts/audit.py again.
- Very specific: line 78
Update DUO_AUDIT.md with what you verified and how.
≈ “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 Adapt
This skill takes an existing app from "unknown" to "supports iPhone Duo". It runs in five phases: preflight, audit, decisions, fix, verify. Do not skip a phase. Do not start fixing before the audit report exists.
Every API in this skill was checked against the iOS 27.1 SDK in Xcode 27.1 (build 27A9269). Every code sample in references/ compiles against that SDK. If you need an API that is not in references/api-surface.md, run scripts/find-api.sh <name> before you use it. Do not use an API from memory: most Duo APIs did not exist before September 2026.
What changes on iPhone Duo
Read references/device.md before the audit. In short:
- The app moves between an outer display (closed, iPhone-like, 386×678 pt window) and a larger inner display (open, regular × regular size classes).
- The inner display ignores
UISupportedInterfaceOrientations. Any aspect ratio can happen. - In landscape, system navigation bars, toolbars, and tab bars move to a vertical bar on the leading or trailing side. Custom bars do not move.
- When the device is partially folded, a division reserved region crosses the screen. Interactive content must not sit on it.
- All apps join split view multitasking on the inner display.
- The front camera changes direction when the device opens and closes.
Phase 1: Preflight (read only)
- Run
scripts/preflight.sh <project-dir>. It finds an Xcode with the iOS 27.1 SDK, the targets, the deployment target, the UI frameworks, the Info.plist keys, and the iPhone Duo simulator. It also finds Apple'sapp-resizabilityreference files inside Xcode 27.1. - If no Xcode with the iOS 27.1 SDK exists, stop. Tell the user that Duo layouts (full-screen inner display, vertical bars, reserved regions) need an app built with the iOS 27.1 SDK, and that Xcode 27.1 is required.
- Build the app once, unchanged, with
scripts/build.sh <project-dir>. Record whether it built. If it does not build before your changes, tell the user and ask whether to continue. You must be able to tell your own breakage apart from existing breakage.
Phase 2: Audit
- Run
python3 scripts/audit.py <project-dir>. It prints one candidate per line:CHECK-ID<TAB>file:line<TAB>code, and a count per check on stderr. It parses plists (a key set toNOis not a finding) and matches multi-line toolbar items. - Grep finds candidates. It does not prove a problem. Open every flagged line, read the context, and decide: real problem, false positive, or needs a decision.
- Some checks cannot be found with grep: custom layouts that put controls in the center of the screen, custom split layouts, and custom bars built from stacks. For these, read every top-level screen of the app (root views, view controllers that a navigation or tab container shows). The checks marked "manual" in
references/checks.mdtell you what to look for. - Write
DUO_AUDIT.mdin the project root. Use the template inreferences/report-template.md. Every finding has a check ID, a severity, a location, the evidence, and a planned fix. - Show the user a short summary: the number of findings per severity and the top 5 problems. Give the path to
DUO_AUDIT.md.
The check catalog is references/checks.md. It is the source of truth for detection, severity, and the fix for each check.
Phase 3: Decisions
Some fixes change product behavior. You must not guess them. references/decisions.md lists every decision point, when it applies, the default, and the question to ask.
- Collect all the decision points that apply to this app first. Then ask them together in one round, with your recommended option first. Use the AskUserQuestion tool when you have it. Ask at most 4 questions per round.
- For each question, say what you found in the code that raises it (file and line).
- If the user says "use your judgment" or the session is non-interactive, apply the default from
references/decisions.mdand list each default you applied inDUO_AUDIT.md. - If you find a new ambiguity during the fix phase, stop and ask. Do not pick silently.
Phase 4: Fix
Fix in this order. Each step builds on the one before it.
- Build settings and Info.plist (checks D01 to D04). →
references/checks.md - Resizability foundation (checks R01 to R05):
UIScreen.main, orientation, idiom, scene lifecycle, asymmetric safe areas. If preflight found Apple'sapp-resizabilityfiles, read the matching Apple task file and follow it. It has the most complete decision trees. Otherwise usereferences/resizability.md. - Bars (checks B01 to B07): move custom bars into system containers and prepare items for vertical bars. →
references/vertical-bars.md - Fold and layout (checks F01 to F05): reserved regions, arrangements, centered layouts. →
references/fold-and-layout.md - Scenes and multitasking (checks S01 to S03). →
references/scenes.md - Camera (checks C01 to C05), only if the app uses AVFoundation capture. →
references/camera.md - Hinge (check H01), only if a hinge feature was agreed in Phase 3. →
references/hinge.md
Rules for every fix:
- Keep the user's deployment target. If it is below iOS 27.1, wrap each new API in
if #available(iOS 27.1, *)or@available(iOS 27.1, *). Each reference shows the gated form. - Change only what a finding needs. Do not reformat or refactor nearby code.
- Never replace a dynamic value with a literal. Never replace one global (
UIScreen.main) with another (UIApplication.shared.connectedScenes.first). - Prefer system containers (NavigationStack, NavigationSplitView, TabView, List, UINavigationController, UISplitViewController, UITabBarController) over custom code. They adapt to Duo with no extra work.
- Do not use hinge data (
onHingeChange,UIHingeInteraction) for layout. Use size classes, reserved regions, and arrangements. Apple states this rule directly. - Track progress in
DUO_AUDIT.md: mark each findingfixed,skipped (reason), orneeds user. A finding with no status at the end is a failure. - Build after each step with
scripts/build.sh. If the build fails, fix it before you go to the next step.
Phase 5: Verify
Follow references/verification.md. In short:
- Run
python3 scripts/audit.pyagain. Every remaining candidate must be a documented false positive or skip. - Build with the iOS 27.1 SDK. No new warnings from your changes.
- Run
scripts/sim-capture.sh <project-dir>. It installs the app on the iPhone Duo simulator, launches it, and saves a screenshot of each display to<project-dir>/duo-captures/. Do not commit that folder: add it to.gitignoreif the project is a git repo. Look at the screenshots. Check for clipped content, content under the vertical status bar, and bars that stayed horizontal. - The simulator cannot be folded from the command line. Ask the user to change the pose in Xcode's Device Hub (open, partially open, landscape, split view), then run
scripts/sim-capture.sh --no-installagain for each pose. Check each result against the pose table inreferences/verification.md. - Update
DUO_AUDIT.mdwith what you verified and how. Say plainly what you did not verify (for example, camera behavior needs a real device).
Final report
Tell the user, in this order: what you changed (per phase), what you did not change and why, what needs their action (decisions, device testing), and the path to DUO_AUDIT.md. Do not call the app "Duo ready" unless Phase 5 passed.
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.

