/swift-android-skills:swift-android-architecturefrom swift-android-skills
Use this skill when Swift code from an iOS app should also run on Android: choosing the route (Skip Fuse with SwiftUI on both platforms, a shared Swift core under native Kotlin/Compose UI via skip export, Skip Lite, or the bare Swift SDK), auditing a Swift package for what blocks Android (UIKit, SwiftUI or MapKit in shared targets, Combine at the Kotlin boundary, URLSession without FoundationNetworking, the Objective-C runtime), and designing the shared core: platform services as Swift protocols implemented in Kotlin, @Observable view models with an input enum, AsyncStream instead of publishers, closures Skip can bridge, stale state and zombie subscriptions when Compose keeps a Swift view model alive, Android tests on every pull request. Not for scaffolding a Skip project, skip.yml options, SwiftUI views on Android, icons, localization or store release (skip-project-creation, skip-fuse, building-skip-ui, skip-icons, skip-localization, skip-deployment), or toolchain and packaging problems (swift-android-sdk).
Ships in swift-android-skills. 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.
Decide what to share, and which compiler runs it on Android, before any code moves.
Share everything that is not UI or a platform SDK.
Make each platform capability a Swift protocol that each app implements natively.
Keep view models plain @Observable state machines,
and let the Android side own their lifetime explicitly.
A production app built this way —
about 170,000 lines of shared Swift under a native Compose UI —
is described in the Polymarket report (references/sources.md).
Skip's official skills cover the Skip project itself;
this skill covers the decision, the shared core and the boundary,
and says where those skills disagree with skip.dev (references/official-skip-skills.md).
references/routes.mdreferences/boundary.mdreferences/view-models.mdreferences/compose-lifetime.mdreferences/aar-workflow.mdreferences/bridge-surface.mdreferences/ci.mdreferences/versions.mdreferences/measured-behavior.mdreferences/official-skip-skills.mdreferences/recommendation-format.mdreferences/sources.mdsamples/SharedCore in this skill's repositoryreferences/recommendation-format.md).
"Make it work on Android" before a plan exists is a request for the plan.python3 scripts/toolchain_report.py first.
Without an Android Swift SDK and an NDK nothing about Android is verified here;
installing them, or running skip checkup, changes the machine and needs approval.measured-behavior.md.
Versions and sizes come from references/versions.md, with its date.
One team's experience is a report, not a rule.
Anything else is labelled inference.| Route | Shared | Android UI | How Swift reaches Android | Who owns it |
|---|---|---|---|---|
| Skip Fuse app | models, logic and SwiftUI | SwiftUI rendered as Compose by Skip | natively compiled Swift, bridged by Skip | Skip's skills (skip-fuse, building-skip-ui) |
| Shared core, native UI | models, networking, view models | Kotlin and Compose written by the Android team | Skip native modules exported as Android libraries | this skill |
| Skip Lite | as Fuse | as Fuse | Swift transpiled to Kotlin source | Skip's skip-lite-transpilation |
| Bare SDK | a Swift library | anything | Swift SDK for Android, swift-java or JNI | swift-android-sdk |
references/routes.md; references/official-skip-skills.md).python3 scripts/toolchain_report.py --format markdown
python3 scripts/android_scan.py <project-root> --route shared-core --format markdown
python3 scripts/android_scan.py <project-root> --route shared-core --format json > "$TMPDIR/android-scan.json"
--route is one of fuse-app, shared-core, lite, bare-sdk;
severities change with it (Combine is a blocker without Skip and information in a Fuse app).
--shared <target> names targets to treat as shared when no skip.yml says so;
with none, the scan is a survey of what could be shared.#if guards: code under #if os(iOS) or #if canImport(UIKit) is not flagged.
Its matches are heuristics; read the code before a finding becomes an item.
Rules and sources: CHECKS.md in this skill's repository.NSObject is not a blocker —
Foundation on other platforms provides it without an Objective-C runtime.
@objc, #selector, key-value observing and swizzling are (rule AND008).references/sources.md).references/boundary.md).references/bridge-surface.md, not memory.@Observable class:
an Input enum in, observable state out, navigation through injected callbacks,
no UIKit or SwiftUI (references/view-models.md).
The same instance can drive SwiftUI, UIKit and Compose.ObservableObject and @Published one screen at a time.async functions and AsyncStream instead (rule AND011).samples/SharedCore holds a tested version of this pattern;
its tests pass on an Android emulator (Measured M4).async functions, streams, and closures within the bridge's limits
(references/bridge-surface.md; rules AND011, AND012).#if !SKIP code is compiled for Android too;
use #if !os(Android) for iOS-only code (rule AND010).@Observable must import SkipFuse,
or Compose is not told about changes (rule AND009; Skip's skip-fuse owns the details).skip.yml options belong to Skip's skip-fuse skill.deinit as a teardown hook on Android (references/compose-lifetime.md).references/aar-workflow.md).
Re-export after every Swift change; transitive Android dependencies go into the app's Gradle file.references/ci.md).
A scan with --fail-on high catches a UIKit import before the build does.references/versions.md are reports, dated — measure your own.references/versions.md).async and streams.python3 scripts/toolchain_report.py; the project's own agent instructions
(AGENTS.md, CLAUDE.md); every Package.swift and Skip/skip.yml.
Report what this machine can verify in the plan's header.references/recommendation-format.md:
route and blockers first, then what stops compiling on Android,
then the boundary and view models,
then crossing to Kotlin and lifetimes,
then the export loop, CI and size.
Name the owner of each item: this skill, swift-android-sdk, or one of Skip's skills.swift build, or the project's own command).
Where a sandbox blocks swift build, typecheck the changed files with swiftc -typecheck
and say which check ran.android_scan.py; the resolved findings should be gone.toolchain_report.py says it can, or say which CI job will;
behavior is verified only by tests that ran on an emulator or a device.deinit or garbage collection for teardown on Android.skip init, skip checkup, skip android sdk install, swiftly install
or any download in Phase 1.evals/evals.json (opens in a new tab)evals/files/Ledger/Android/app/src/main/kotlin/com/example/ledger/LedgerNavHost.kt (opens in a new tab)evals/files/Ledger/README.md (opens in a new tab)evals/files/Ledger/Shared/Package.swift (opens in a new tab)evals/files/Ledger/Shared/Sources/LedgerCore/BalanceSocket.swift (opens in a new tab)evals/files/Ledger/Shared/Sources/LedgerCore/LedgerViewModel.swift (opens in a new tab)evals/files/Ledger/Shared/Sources/LedgerCore/Skip/skip.yml (opens in a new tab)evals/files/Notes/Package.swift (opens in a new tab)evals/files/Notes/Sources/Notes/NoteListView.swift (opens in a new tab)evals/files/Notes/Sources/NotesShared/Analytics.swift (opens in a new tab)evals/files/Notes/Sources/NotesShared/Note.swift (opens in a new tab)evals/files/Notes/Sources/NotesShared/NoteListViewModel.swift (opens in a new tab)evals/files/PricingKit/Android/app/src/main/kotlin/com/example/pricing/WatchlistScreen.kt (opens in a new tab)evals/files/PricingKit/Package.swift (opens in a new tab)evals/files/PricingKit/Sources/PricingKit/Price.swift (opens in a new tab)evals/files/PricingKit/Sources/PricingKit/PriceBoard.swift (opens in a new tab)evals/files/PricingKit/Sources/PricingKit/Skip/skip.yml (opens in a new tab)evals/files/TripNotes/Package.swift (opens in a new tab)evals/files/TripNotes/Sources/TripNotesKit/APIClient.swift (opens in a new tab)evals/files/TripNotes/Sources/TripNotesKit/Analytics.swift (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub alexey1312/swift-android-agent-skill --plugin swift-android-skills2 skills in this plugin