/duology-ship:duo-lintfrom duology-ship
Lints Swift/ObjC code, Info.plist, and build settings for patterns that break on Apple's iPhone Duo foldable. Reports each finding with a fix. Use before release, in CI, or when layout breaks on fold/unfold.
Ships in duology-ship. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
duo-lint scans Swift (and optionally Objective-C) code, Info.plist files and build settings for patterns that break on iPhone Duo. Each finding names the rule, the code, a fix and the Apple page behind it.
It is one Python 3 file with no dependencies. It runs locally and sends nothing anywhere.
Most rules come from Step 2 of Apple's Three steps to make your app shine on iPhone Duo. Xcode 27.1 also ships an App Resizability agent skill that looks for the same patterns (prepare page). duo-lint doesn't replace it. Use duo-lint where you need a repeatable check: CI, the lint hook, or another coding agent.
duo-lint reads code. It can't see the screen. For a full iPhone Duo audit, run /duo-audit (in the duology-ship plugin): it runs duo-lint, then the 15-point duo-design-review checklist on screenshots from the Duo simulator, and ranks everything in one list. Without Claude Code, run duo-lint, then follow the duo-design-review skill.
Related skills: duo-layout (size classes, reserved regions, arrangements), duo-continuity (state through a fold), duo-testing (tests on the Duo simulator).
The command depends on how you installed this skill:
| Installed with | Run |
|---|---|
The duology-ship plugin in Claude Code | duo-lint. The plugin puts its bin/ folder on the Bash tool's PATH. |
npx skills add, or copied by hand | <skill-folder>/scripts/duo-lint. <skill-folder> is the folder that holds this SKILL.md. |
In Claude Code, <skill-folder> is ${CLAUDE_SKILL_DIR}. If duo-lint is not found or not allowed, run ${CLAUDE_SKILL_DIR}/scripts/duo-lint instead. If scripts/duo-lint can't be executed, run python3 <skill-folder>/scripts/duo-lint.py. The examples below say duo-lint; use the script path when the plugin isn't installed.
# Whole project
duo-lint .
# One folder or file
duo-lint Sources/Feed/FeedView.swift
# With the fix and the Apple link under each finding
duo-lint -v Sources/
In folders it skips build/, DerivedData/, Pods/, Carthage/, .build/, SourcePackages/, .claude/, .agents/ and its own tests/fixtures/, wherever this skill is installed. Name a skipped folder on the command line to check it anyway.
It needs Python 3.9 or later. On a Mac with Xcode 27.1, /usr/bin/python3 is Xcode's Python 3.9, which is enough.
| Option | What it does |
|---|---|
PATH ... | Files or folders. Default: the current folder. |
-v, --verbose | Prints fix: and see: lines under each finding. |
--json | JSON output. Same as --format json. |
--format github | GitHub Actions annotations. |
--strict | Exit 1 on warnings too, not only errors. |
--objc | Also scan .m, .mm and .h files in folders. Files you name are always scanned. |
--select DUO001,DUO004 | Run only these rules. |
--ignore DUO007 | Skip these rules. |
--exclude 'Tests/*' | Skip matching paths. Repeat it for more patterns. |
--list-rules | Print the rules. Add --json for machine-readable output. |
Exit codes: 0 no errors, 1 errors (or any finding with --strict), 2 a bad option or a missing path.
Real output on the four-file sample in tests/fixtures/sample, run from that folder:
$ duo-lint Sources/
Sources/App/RootView.swift:7 DUO004 warning userInterfaceIdiom == .pad layout picked by device type; pick it by size class or space
Sources/Feed/FeedView.swift:8 DUO001 error UIScreen.main.bounds your window is not the screen on a two-display phone; size from the view or window
Sources/Player/Controls.swift:9 DUO007 warning frame(width: 390) fixed width of 320 pt or more; let the container size it
Sources/Settings/SettingsView.swift:6 DUO009 warning <= 667 GeometryReader size compared to a device size; use size class or ViewThatFits
4 findings · 1 error · 3 warnings (4 files checked)
Each line is path:line RULE severity code message. The last line counts findings and files.
--json gives each finding as an object with path, line, column, rule, name, severity, snippet, message, fix, source (an Apple URL) and code (the source line). Use it when you need to sort or group findings.
| Rule | Severity | Catches | Fix |
|---|---|---|---|
| DUO001 | error | UIScreen.main, UIScreen.screens, .main where the file shows Swift infers UIScreen | view.bounds, GeometryReader, onGeometryChange; traitCollection.displayScale; UIWindow(windowScene:) |
| DUO002 | warning | UIDevice.current.orientation, its notification, effectiveGeometry.interfaceOrientation, an interfaceOrientation whose owner it can't see | Compare width with height. Camera: AVCaptureDevice.RotationCoordinator. |
| DUO003 | error | statusBarOrientation, interfaceOrientation on a UIWindowScene or view controller | Compare width with height. |
| DUO004 | warning | userInterfaceIdiom compared with .pad or .phone | Size class, NavigationSplitView, ViewThatFits. |
| DUO005 | warning | horizontalSizeClass == .regular next to "iPad" | Treat regular as "wide", not as iPad. |
| DUO006 | warning | bounds.height == 844, lists of device sizes | Size class, ViewThatFits, width vs height. |
| DUO007 | warning | .frame(width: 390), width constraints of 320 pt or more | .frame(maxWidth:), containerRelativeFrame, readable content guide. |
| DUO008 | warning | UIRequiresFullScreen = true | Remove it, or add UIRequiresFullScreenIgnoredStartingWithVersion. |
| DUO009 | warning | proxy.size.width == 393 | Width vs height, size class, even column counts. |
Bad and good code for every rule, with the Apple source: references/rules.md.
The three fixes you will write most often:
import SwiftUI
// DUO001, DUO002, DUO003, DUO009: size from the space you have.
struct MediaScreen: View {
var body: some View {
GeometryReader { proxy in
let isWide = proxy.size.width > proxy.size.height
let layout = isWide ? AnyLayout(HStackLayout()) : AnyLayout(VStackLayout())
layout {
Color.black
Text("Up next")
}
}
}
}
// DUO004, DUO005: pick the layout by size class, and name it after the space.
struct InboxScreen: View {
@Environment(\.horizontalSizeClass) private var sizeClass
var body: some View {
let isWide = sizeClass == .regular
Text(isWide ? "List and message side by side" : "List, then message")
}
}
// DUO007: cap a width instead of fixing it.
struct PromoBanner: View {
var body: some View {
Text("Try the new editor")
.frame(maxWidth: 600)
.padding()
}
}
AnyLayout keeps view identity when the layout switches, so state survives the fold (AnyLayout).
duo-lint -v . from the project root (or the script path, see Run it). Add --objc for mixed projects..main on your own type, not UIScreen, silence it with a reason.0 errors. Aim for 0 findings.import UIKit
@MainActor
func crashReportScale() -> CGFloat {
// duo-lint:disable-next-line DUO001 -- crash reports need the device scale, not layout
UIScreen.main.scale
}
// duo-lint:disable-next-line DUO001 skips that rule on the next line.// duo-lint:disable-line DUO001 skips it on the same line.// duo-lint:disable-file DUO004 skips it in the whole file.<!-- duo-lint:disable-next-line DUO008 -->.# .github/workflows/duo-lint.yml
name: duo-lint
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: python3 tools/duo-lint/duo-lint.py --format github --strict .
Copy scripts/duo-lint.py into the repo first (the path above is an example). The linter is plain Python, so a Linux runner is fine. GitHub shows each finding as an annotation on the pull request. Drop --strict to fail only on errors.
The duology-ship plugin has an optional hook. After Claude edits or writes a .swift file, it runs duo-lint on that file and passes the findings back to Claude, with the fix for each. It never blocks an edit.
export DUOLOGY_LINT_HOOK=1 before you start Claude Code. Unset it to turn it off.hooks/hooks.json and hooks/lint-hook.sh in the plugin.When the hook reports a finding, fix it in your next edit, or silence it with a reason if the code is not layout.
duo-lint finds patterns in code. It can't see controls sitting in the fold, state lost on a fold, a UIScreen kept in a property, sizes read once at launch, or window bounds used as the screen size. The full list is at the end of references/rules.md. For what only a screenshot shows, run /duo-audit or the duo-design-review checklist.
duo-lint reads text, not types. So these are heuristics: DUO001 on a bare .main (it looks for UIScreen in the file), the split between DUO003 and DUO002, and DUO004, DUO005 and DUO006. They can flag code that is fine, and miss code that hides a device size or type behind a name. references/rules.md says how each one decides. Read each finding before you change it.
duo-lint -v on the whole project (with --objc if it has Objective-C).-- reason.0 errors in the summary.UIRequiresFullScreen: removed it, or added UIRequiresFullScreenIgnoredStartingWithVersion.references/rules.md (opens in a new tab)scripts/duo-lint (opens in a new tab)scripts/duo-lint.py (opens in a new tab)tests/fixtures/Info.plist (opens in a new tab)tests/fixtures/Legacy.xcconfig (opens in a new tab)tests/fixtures/bad.m (opens in a new tab)tests/fixtures/bad.swift (opens in a new tab)tests/fixtures/good.swift (opens in a new tab)tests/fixtures/sample/Sources/App/RootView.swift (opens in a new tab)tests/fixtures/sample/Sources/Feed/FeedView.swift (opens in a new tab)tests/fixtures/sample/Sources/Player/Controls.swift (opens in a new tab)tests/fixtures/sample/Sources/Settings/SettingsView.swift (opens in a new tab)tests/test_duo_lint.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kimeur/duology --plugin duology-ship6 skills in this plugin
/duo-app-storePrepares an app's App Store submission for iPhone Duo, Apple's foldable with a 1398 x 2034 outer display and a 2007 x 2853 inner display: App Store screenshots of both displays at the exact sizes App Store Connect lists, flattened without alpha, captured from the iPhone Duo simulator in each pose with a clean status bar; app previews (886 x 1920); uploading them in App Store Connect or with the App Store Connect API (screenshot display type APP_IPHONE_DUO, not in Apple's API reference yet); the 'optimized for iPhone Duo' product page badge; promotional text and the App Store Connect preview tool; App Review notes for the poses; the privacy manifest; and the April 2027 rules (Duo screenshots required, iOS 27 SDK or later, iOS 15 or later). Use when someone asks for Duo screenshots, store assets, a submission checklist or review notes for iPhone Duo./duo-migrateMoves an existing iOS app that already ships onto iPhone Duo, Apple's foldable, step by step: from an app built with Xcode 26 (iOS 26 SDK) or Xcode 27.0 to a build with Xcode 27.1 and the iOS 27.1 SDK. Use when an app shows up centred with empty space around it on the open iPhone Duo, when a UIKit app built with the new SDK crashes at launch because it has no scene life cycle (no UIApplicationSceneManifest, no configurationForConnecting, UIWindow(frame:) in didFinishLaunching), when replacing UIScreen.main, device orientation, userInterfaceIdiom, regular width treated as iPad, hard-coded device sizes or UIRequiresFullScreen, when toolbars and tab bars turn vertical after the rebuild, when moving CI off an older Xcode, or when planning for the April 2027 App Store rules (iOS 27 SDK or later, iOS 15 or later)./duo-performanceKeeps an iPhone Duo app smooth when the phone folds and unfolds. One fold changes the app's layout size in several steps (a full-width view went 382 → 466 → 951 → 867 pt on open), and every body that reads the size runs at each step; at 120 Hz a frame lasts 8.3 ms. Measures what each fold costs the main thread on the iPhone Duo simulator with duo-fold-cost (Instruments' Hangs and os_signpost instruments while duo-pose folds the phone, with a saved run to compare against), finds the cause, and fixes it: no sorting, formatting or decoding in body, the size read once as a small value, identity kept across poses, lazy rows, follow-up work after the fold settles. Splits hitch and hang time by pose from real users with iOS 27 MetricKit and StateReporting. Says what the simulator can't measure (frame rate, hitches, the SwiftUI instrument) and what to check on a device. Use when a Duo app freezes, stutters or drops frames on fold or unfold, before a release, or to keep a fold from getting slower./duo-pose-matrixScreenshots an iPhone Duo app in every pose (closed, open, book, tabletop) on the iPhone Duo simulator by pressing Device Hub's pose buttons through the macOS Accessibility API, then writes summary.md and summary.json to review with the duo-design-review checklist. Use when asked to check, test or screenshot an app in each pose, fold or hinge state, to capture outer and inner display frames for a design review or the App Store, to change the simulator's pose from the command line or a script (simctl and devicectl have no pose command), to run /duo-poses, or when a review is missing book or tabletop frames. Ships duo-pose (status, list, set) and duo-pose-matrix, with a manual fallback when the user has not given Accessibility permission, and checks that no UI tests share the simulator before it changes the pose./duo-testingWrites and runs tests for iPhone Duo apps, Apple's foldable with an outer display and an inner display, on the Mac and on the iPhone Duo simulator in Xcode 27.1. Use when adding logic tests (swiftc script, or Swift Testing with @Test and #expect), UI tests with XCTest and XCUIAutomation, launch arguments such as -uiTesting, -resetState and jump-to-screen switches with a TestSupport type, test markers with accessibilityIdentifier and accessibilityValue, when a tap or drag in a UI test doesn't reach a SwiftUI gesture (coordinate(withNormalizedOffset:), press(forDuration:thenDragTo:)), when XCUIDevice rotation or a fold can't be scripted, or when running xcodebuild test on the existing iPhone Duo simulator with -destination id=<UDID>, -parallel-testing-enabled NO, -only-testing, -resultBundlePath, -collect-test-diagnostics and xcresulttool.Other plugins' skills for the same job