/skip-app-design:skip-fusefrom skip-app-design
Guides building Skip apps in Fuse mode, where Swift compiles natively for Android via the Swift Android SDK with auto-generated JNI bridging. Covers mode selection, project init, configuration, and debugging.
Ships in skip-app-design. 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.
None: SKILL.md is the whole skill.
Fuse is Skip's "native Swift on Android" mode. Instead of transpiling Swift to Kotlin (Lite), Fuse compiles the same Swift source with the official Swift SDK for Android and generates JNI bridges so the Swift code can call into Kotlin/Java and vice versa. The SwiftUI surface still goes through SkipUI → Compose; only the Swift-language code is compiled rather than transpiled.
This skill covers the Fuse-specific workflow. For the rest of the Skip workflow (UI components, icons, localization, tests, deployment) the Lite skills apply unchanged.
| Choose Fuse when… | Choose Lite when… |
|---|---|
You depend on Swift language features that transpile poorly: variadic generics, complex macros, reflection, key-paths-as-values, Mirror. | You're targeting the broadest base of Swift libraries and want the smallest APK. |
You need C interop without SkipFFI boilerplate (Fuse can call C directly via the Swift Android SDK). | You're shipping a small, focused app where 60 MB of Swift runtime is the wrong trade-off. |
| You're consuming Swift packages that weren't written for Skip and want them to "just work". | You want maximum agent / tooling support — most Skip skills, examples, and sample apps target Lite. |
| You need bidirectional Swift↔Kotlin interop in the same project (a Swift Package that also calls Android SDK APIs). | You don't need to call Kotlin or Java APIs directly; SkipFoundation / SkipUI cover what you use. |
Default to Lite unless one of the left-column reasons applies. Fuse is more capable but more nascent — fewer skills, sample apps, and CI templates document it.
Before writing any code, determine the project mode. The Swift you can safely write depends on it.
# Check each module's skip.yml
grep -l "mode: 'native'" Sources/*/Skip/skip.yml
mode: 'native' → Fuse (this skill applies).mode: 'transpiled' or no mode set → Lite (skip-lite-transpilation applies).mode: 'automatic' → depends on the resolved dependency graph. If SkipFuse/SkipFuseUI is pulled in (typically via SKIP_MODE=fuse at build time), it's Fuse; otherwise Lite.Before starting a Fuse project, install the Swift SDK for Android and run the Fuse-specific environment checkup:
skip android sdk install # one-time: download the Swift SDK for Android
skip checkup --native # verify the native toolchain (above and beyond plain `skip checkup`)
skip checkup --native runs everything in skip checkup plus the additional checks needed for Fuse compilation. If you skip these, the first skip app launch will fail with a confusing toolchain error.
skip init --native-app --appid=com.example.someapp some-app SomeApp
The flags that matter:
--native-app — selects Fuse mode (vs. --transpiled-app for Lite).SomeAppModel. The bridge generator works better with one module per app.skip init flags from skip-project-creation (--appid, --version, --no-build, --git-repo, --icon) apply unchanged.The generated Sources/SomeApp/Skip/skip.yml will contain:
skip:
mode: 'native'
bridging: true
bridging: true is shorthand for the auto-bridging form (bridging.auto: true) — see Bridging options below for the full schema and when you'd want to customise it.
@Observable requires import SkipFuse (warning, not error)Any Swift file that declares an @Observable type in a Fuse module needs import SkipFuse (or import SkipFuseUI, which re-exports it). Without it, the state-tracking glue that synchronises Swift observables with Jetpack Compose's recomposition is not installed, and the Android UI silently stops updating when the model changes.
import Foundation
import SkipFuse // installs the @Observable bridge for Compose
import Observation
@Observable final class ViewModel {
var items: [Item] = []
var isLoading = false
}
This is enforced as a warning, not a compile error. The build emits:
This file contains @Observables, but they will not be able to power your Android UI unless you 'import SkipFuse' or 'import SkipFuseUI'
The code compiles, the iOS build runs correctly, and the Android build runs without crashing — the bug only shows up at runtime as a UI that never updates when the model mutates. Treat the warning as a blocker during code review.
Views and their SwiftUI properties must use default (internal) or public visibility. private views and private @State / @Binding properties are not visible to the bridge generator and will not render on Android.
// BAD on Android — bridge generator can't see private members
private struct DetailRow: View {
@State private var expanded = false
var body: some View { ... }
}
// GOOD — default internal visibility
struct DetailRow: View {
@State var expanded = false
var body: some View { ... }
}
This applies in both Fuse and Lite, but it bites harder in Fuse because the bridge generator runs against the public API surface; in Lite the transpiler reaches private members through its own AST traversal.
#if os(Android) vs. #if SKIP in FuseIn Lite, #if os(Android) and #if SKIP are equivalent (everything is transpiled to Kotlin). In Fuse they're different:
| Conditional | Fuse behaviour |
|---|---|
#if os(Android) | Compiled as native Swift for Android. Cannot call Kotlin/Java APIs directly. |
#if SKIP | Transpiled to Kotlin. Can call Kotlin/Java API directly. |
#if !SKIP | Native Swift on both iOS and Android. The right place for shared logic that should not be transpiled. |
#if !os(Android) | iOS only. |
Rules of thumb:
android.content.Context, java.util.UUID, a Kotlin coroutine? Use #if SKIP.#if os(Android) is fine and stays native.#if !SKIP is what you want.bridging: true in skip.yml is shorthand for the auto-bridging form. The full schema:
skip:
mode: 'native'
bridging:
auto: true
options: 'kotlincompat' # optional
| Form | Effect |
|---|---|
bridging: true | Shorthand for bridging.auto: true. Auto-generates JNI bridges for every public API in the module. The default for skip init --native-app. |
bridging.auto: true | Same as above, expanded. |
bridging.options: 'kotlincompat' | Generated Kotlin wrappers use kotlin.collections.List / kotlin.collections.Map / java.net.URI instead of skip.lib.Array / skip.foundation.URL. Use this when the bridged API is consumed from native Kotlin / Compose code rather than from another transpiled Swift module. |
Without kotlincompat, the bridged surface is shaped for Skip Lite consumers (uses the Skip wrapper types). With kotlincompat, it's shaped for raw Kotlin consumers (uses standard Kotlin collections). For an app that mixes Lite and Fuse modules, leave it off. For a Fuse library you want to ship to Kotlin-side consumers, turn it on.
Per-declaration control via SKIP comment directives:
| Directive | Effect |
|---|---|
// SKIP @bridge | Bridge this specific declaration even if auto-bridging is off. |
// SKIP @bridgeMembers | Bridge all members of this type matching its visibility (all public if the type is public). |
// SKIP @nobridge | Exclude this member from auto-bridging. |
Use @nobridge to selectively trim what crosses the JNI boundary — for example, a public method that returns a non-bridgeable type, where you only want it visible to native Swift callers.
When a Fuse module needs to use a Kotlin or Java type from the Android SDK or a Kotlin library and there's no transpiled Swift wrapper for it, the documented escape hatch is AnyDynamicObject. It's a SkipFuse type that wraps any JVM object and lets native Swift call its methods and properties via Swift's dynamic dispatch features.
Raw form (no dynamicroot):
import SkipFuse
#if os(Android)
let date = try AnyDynamicObject(className: "java.util.Date", 999)
// Call instance methods. Return types and `throws` are mandatory.
let time: Int64 = try date.getTime()!
// Property syntax works for getters and setters.
let t = date.time!
date.time = 1001
// Chain calls freely.
let s = try date.instant?.toString()
#endif
Important characteristics:
throws and ?-prefixed. Kotlin methods can throw, and Swift can't know whether they return null.#if os(Android).dynamicroot for cleaner syntaxRepeatedly typing className: "java.util.Date" is tedious. The dynamicroot option in skip.yml creates a magic namespace prefix for fully-qualified types:
skip:
mode: 'native'
dynamicroot: 'D' # any single uppercase letter or short identifier
With dynamicroot: 'D':
import SkipFuse
#if os(Android)
let date = try D.java.util.Date(999) // no string class name
typealias JDate = D.java.util.Date // typealias for repeated use
let time: Int64 = try date.getTime()!
// Static methods use Companion()
let parsed = try D.java.util.Date.Companion().parse(dateString)!
// Convert a base AnyDynamicObject to a typed one
let dateAsTyped = baseAnyDynamicObject.as(D.java.util.Date.self)
#endif
dynamicroot is purely syntactic sugar over AnyDynamicObject. There's no runtime difference; the build plugin rewrites D.foo.bar.Baz(args) into the equivalent AnyDynamicObject(className: "foo.bar.Baz", args).
| Use AnyDynamicObject when… | Write a transpiled wrapper when… |
|---|---|
| You need one or two Kotlin types in a Fuse app. | You're consuming a whole Kotlin library across many call sites. |
| The API surface is small enough to live with unchecked calls. | You want Swift-side type checking. |
| You don't want to maintain a parallel Swift declaration file. | You want IDE autocomplete and refactoring. |
For the deeper story (including how dynamicroot reaches into reflection, performance characteristics, and what it does for class hierarchies), see the modes documentation.
SKIP_BRIDGE — the bridge-mode preprocessor symbolWhen a transpiled module is built as a bridge target for native Swift consumption, the build plugin defines a SKIP_BRIDGE preprocessor symbol. Use #if !SKIP_BRIDGE to guard Swift code that would produce duplicate-symbol errors when the module is built in bridge mode:
#if !SKIP_BRIDGE
#if os(Android)
import android.content.Context
let context = ProcessInfo.processInfo.androidContext // Lite-style call
#endif
#endif
The skipstone plugin emits a warning when it detects Android-specific code in a transpiled module that lacks the #if !SKIP_BRIDGE guard. Treat the warning as a blocker — without the guard, the module won't link in mixed Lite/Fuse projects.
Setting SKIP_BRIDGE=1 as an environment variable when running swift build forces every library product in the resolved graph to be dynamic (.dynamic rather than .automatic / .static). This is occasionally needed when a Fuse module consumes a peer Fuse package across the JNI boundary:
SKIP_BRIDGE=1 swift build
SKIP_BRIDGE=1 swift test
SKIP_BRIDGE=1 skip app launch
Use it for the build of a Fuse-library-plus-Fuse-app project; you don't need it for a single-module Fuse app or for pure Lite projects.
Fuse apps add approximately 60 MB to the Android APK for the Swift runtime, Foundation, and internationalisation libraries. This is a fixed cost that does not grow with app complexity. It will decrease as the Swift Android SDK matures, but plan for it today:
apkanalyzer (Android Studio) — confirm the 60 MB lives in lib/ (the Swift stdlib .so files) and not in app code.Two limitations to plan around:
LLDB-on-Android for the Swift Android SDK is in development but not generally available. Today:
OSLog.Logger (not print()) for runtime tracing. OSLog is bridged to Logcat in Fuse, so logger.info(...) lands in adb logcat -s <tag>. print() goes to stdout, which Android does not route to Logcat.swift demangle on the mangled Swift symbols in the crash dump — they look like $s9SomeApp11ViewModelC4loadyyYaKF and demangle to SomeApp.ViewModel.load() async throws -> ().import OSLog
let logger = Logger(subsystem: "com.example.someapp", category: "ViewModel")
func loadItems() async {
logger.info("starting load") // visible in adb logcat
// print("starting load") // NOT visible in Logcat, even though it works on iOS
}
Some Android SDK and Kotlin-library APIs (common in Compose, LiveKit, AndroidX) expose properties whose types are Kotlin inline classes (@JvmInline value class Dp(...), Color, TextUnit, etc.). The JVM-level getter for an inline-class property has a mangled name (getColor-impl rather than getColor), and Fuse's bridge generator can't resolve .stringValue or direct casts against these.
The reliable workaround is string interpolation:
#if SKIP
import androidx.compose.ui.unit.Dp
let height: Dp = ...
// BAD — fails to resolve the mangled getter
let s = height.stringValue
// GOOD — string interpolation forces a toString() call
let s = "\(height)"
#endif
This trades type safety for compile-time guarantee and is documented in the Skip codebase as the recommended pattern.
swift test runs the Swift-side tests as usual. For the Android side, Fuse has its own runner:
skip android test # Fuse CLI mode — fast, no Android APIs available
skip android test --apk # Fuse APK mode — full Android APIs, slower
| Mode | What runs | When to use |
|---|---|---|
swift test | Swift tests on the host (macOS/Linux). | All pure-Swift logic. |
skip android test | Fuse tests in a CLI environment on the emulator/device. No Android Context, no UI. | Fast iteration on cross-platform logic. |
skip android test --apk | Tests run inside the packaged APK on the emulator/device with full Android APIs. | Anything that touches ProcessInfo.processInfo.dynamicAndroidContext(), system services, or asset bundles. |
The --android-serial flag scopes to a specific device when multiple are connected:
skip android test --android-serial emulator-5554
skip android test --android-serial auto # auto-detect, prefer emulators
For the broader test-suite story (parity testing across iOS and Android, XCSkipTests harness, Robolectric — all of which apply to Lite, not Fuse), see skip-testing.
In Fuse, ProcessInfo.processInfo.dynamicAndroidContext() returns the Android Context as an AnyDynamicObject — the bridge-time wrapper that lets native Swift call Kotlin / Java APIs without writing a transpiled wrapper. Use it whenever you need a system service, shared preferences, an asset, or any Android API that requires a context.
import SkipFuse
#if os(Android)
let context = ProcessInfo.processInfo.dynamicAndroidContext()
if let packageName: String = try? context.getPackageName() {
// ...
}
#endif
The androidContext (no parentheses) form is the Lite spelling; in Fuse, calling that on ProcessInfo won't compile. Use the dynamicAndroidContext() method in Fuse and reach the same API surface through AnyDynamicObject's dynamic-dispatch syntax. For the Activity, the parallel is UIApplication.shared.dynamicAndroidActivity().
For more on AnyDynamicObject and the dynamicroot machinery that backs these accessors, see the Skip Fuse / Bridging Modes docs.
The Fuse mode depends on a small set of foundational packages (you usually don't pin these yourself — they come in via SkipFuseUI):
| Package | Purpose |
|---|---|
swift-jni | C headers and Swift wrappers for the JNI surface. |
swift-android-native | Wrappers for Android NDK APIs (Logging, Context, AssetManager, Choreographer, Looper). |
skip-android-bridge | Android-specific bridging glue between Swift and Kotlin. |
skip-fuse | Umbrella for OSLog, @Observable, AnyDynamicObject — the Swift side of bridging. |
skip-fuse-ui | Native Swift UI types for Android (the Fuse equivalent of SkipUI for Lite). |
You'll see them appear in Package.resolved and the SwiftPM build graph but rarely need to touch them.
skip init flags, project layout decisions, when to use one vs. two modules.Double == Int issue, etc.), but apply unchanged to any #if SKIP block within a Fuse module.private views/properties) is enforced more strictly in Fuse.swift test on the Swift side; skip android test for the Fuse-on-Android side.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub skiptools/skills --plugin skip-app-design8 skills in this plugin
/building-skip-uiBuilding SwiftUI views in Skip projects that work on both iOS and Android. Covers supported components, navigation, state management, Jetpack Compose customization, Material 3 theming, the hard rule against `Image(systemName:)` / `Label(_, systemImage:)` (use `.symbolset` resources via `Image("name", bundle: .module)` instead), and the localization-correct `Label { Text } icon: { Image }` shape./skip-app-walkthroughStart-to-finish orchestrator for building a new cross-platform Skip app. Sequences the other Skip skills in the order you actually need them — scaffold with `skip init`, write SwiftUI, add Material Symbols icons, validate Kotlin transpilation with `swift test`, drive the running app with `skip app launch` + Maestro, localise via `Localizable.xcstrings`, and ship via `skip export` with fastlane metadata. Use this skill at the start of a new project, or when picking up an existing Skip app and trying to decide which skill applies to which phase. Each phase links to the dedicated skill for the deep dive. Also points at the `skipapp-todo` working example at https://github.com/skiptools/skills as a reference build./skip-frameworksIntegrating optional Skip frameworks into a project. Covers Firebase, SQLite, Keychain, WebView, audio/video, device sensors, Lottie animations, FFI, and other frameworks. Includes Package.swift dependencies, skip.yml configuration, and usage examples./skip-iconsIcons in Skip projects. The hard rule: never use `Image(systemName:)` or `Label(_, systemImage:)`. SF Symbols are an Apple-only catalogue with no Android equivalent; the names you pass to `systemName:` / `systemImage:` will not resolve on Android and most will render as a blank or generic-placeholder glyph. The canonical replacement is to download Material Symbols from `fonts.google.com/icons` in **Apple symbolset format**, drop the `.symbolset/` bundle under `Sources/<Module>/Resources/Icons.xcassets/`, and render with `Image("name", bundle: .module)` inside the localisation-correct `Label { Text(…, bundle: .module) } icon: { Image(…) }` form. The same SVG ships to both platforms and looks identical. Also covers app launcher icons via `skip icon` and how to verify in-app icons render on both platforms. The full `.symbolset` format spec (download URLs per variant, `Contents.json` schemas, verification checks) is in references/symbolset-anatomy.md. references/sf-symbol-map.md explains what SkipUI does with `systemName:` internally — it is **not** a "safe-to-use" list. Use this skill whenever adding, replacing, or auditing icons in a Skip app or library./skip-lite-transpilationSwift-to-Kotlin transpilation rules and pitfalls for Skip Lite mode. Covers the high-impact bugs (silent integer overflow, `Double == Int` compile errors, `Foundation.sqrt`, `String.append(Character)`, `Array.remove(atOffsets:)` SwiftUI-only gotcha, variadic init issues, `String(describing:)` and Kotlin map iteration), the `MutableStruct`/`.sref()` value-semantics machinery and the `@nocopy` escape, generics limits and the `@inline(__always)` reified-generics escape, garbage-collection effects (`weak`/`unowned` ignored, `deinit` becomes Kotlin `finalize`), the Kotlish dialect for `#if SKIP` blocks, and the SKIP comment directives (INSERT/REPLACE/DECLARE/NOWARN/SYMBOLFILE/EXTERN/@nocopy/@nodispatch/@bridge). The full long-form rules are in references/swift-kotlin-rules.md. Use when writing or reviewing Swift code in a transpiled Skip project, or when a Kotlin compile error in `XCSkipTests.testSkipModule` points at one of the above patterns./skip-localizationTranslating Skip apps and libraries into other languages. Covers in-app strings via `Localizable.xcstrings` String Catalogs in each module's `Resources/` directory, iOS `Info.plist` usage descriptions via `Darwin/InfoPlist.xcstrings`, and App Store / Google Play metadata under `Darwin/fastlane/metadata/` and `Android/fastlane/metadata/android/`. Includes the `Text("…", bundle: .module, comment: "…")` extraction convention, the `state: needs_review` discipline for agent-produced translations, conservative idiomatic translation guidance, and the catalog-rewrite-from-scratch path for template-to-app conversions. The full xcstrings JSON schema is in references/xcstrings-schema.md; fastlane directory layout, byte budgets, and validation commands in references/fastlane-metadata.md; the BCP-47 ↔ App Store ↔ Play language-code mapping in references/language-codes.md. Use this skill whenever adding or updating translations, expanding the supported-language set, validating xcstrings JSON, or preparing store metadata for a release.Other plugins' skills for the same job