bridge-swift

bridge-swift is a skill for Claude Code from ThisIsSadeghi/KMPilot. It costs 46 tokens per session (1,087 once invoked), scanned A, original, MIT.

A bridge between Swift code in an iOS app and Kotlin Multiplatform code through shared interfaces and dependency injection, a way to provide platform-specific implementations.

In plain words
What is it for?
Use it to connect iOS SDKs and device features such as biometrics, payments, cameras, or other iOS-only APIs to KMP features.
Why use it?
It handles iOS services that Kotlin cannot access cleanly on its own, while keeping the shared Kotlin code connected to the native implementation.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to connect iOS SDKs and device features such as biometrics, payments, cameras, or other iOS-only APIs to KMP features.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/thisissadeghi/kmpilot/bridge-swift
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ThisIsSadeghi/KMPilot --skill bridge-swift
Clone the repo
git clone --depth 1 https://github.com/ThisIsSadeghi/KMPilot

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bridge-swift

README.md
[![agentmods](https://agentmods.dev/badge/skills/thisissadeghi/kmpilot/bridge-swift.svg)](https://agentmods.dev/skills/thisissadeghi/kmpilot/bridge-swift)
Your own site
<a href="https://agentmods.dev/skills/thisissadeghi/kmpilot/bridge-swift"><img src="https://agentmods.dev/badge/skills/thisissadeghi/kmpilot/bridge-swift.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,087 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01087
Opus 5 $0.00023 $0.00544
Sonnet 5 $0.00009 $0.00217
Haiku 4.5 $0.00005 $0.00109

Measured 8d ago against content hash 8c1633e1e67e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

bridge-swift scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/bridge-swift/SKILL.md · 119 lines

How it starts

The opening of the file, as written. The whole thing — 119 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bridge Swift

Kotlin interface in iosMain → Swift implements it in iosApp → Inject via Koin DI.

Architecture Reference: @../_shared/patterns.md

When you arrive here

This skill is the iOS-Swift leg of the Rule 14 platform path (@../create-feature/architecture/platform.md). Reach it when a feature's iOS actual can't be written cleanly in Kotlin/Native and needs a Swift class. /create-feature and /modify-feature finish the Kotlin side (the commonMain interface + Android/desktop actuals + expect/actual val platformModule) and then route the user here — they never call this skill directly. Android almost never needs a bridge (Kotlin calls the Android SDK directly), so this is iOS-specific. The Provider-wraps-bridge-in-Either<T> pattern below is the same DataSource contract platform.md describes.

Critical: Swift Inheritance

Swift class inherits from <ModulePrefix><InterfaceName>:

Module Kotlin Swift Inherits
core:data RecaptchaBridge DataRecaptchaBridge
feature:auth AuthBridge AuthAuthBridge

Use Xcode autocomplete (Ctrl+Space) to find exact protocol name.

Implementation Steps

1. Bridge Interface (iosMain)

// <module>/src/iosMain/kotlin/{PKG_PREFIX}/<feature>/<Feature>Bridge.kt
interface <Feature>Bridge {
    suspend fun execute(param: String): String
}

2. Provider (iosMain)

// <module>/src/iosMain/kotlin/{PKG_PREFIX}/<feature>/IOS<Feature>Provider.kt
class IOS<Feature>Provider(private val bridge: <Feature>Bridge) : <Feature>Provider {
    override suspend fun execute(): Either<String> =
        try { Either.Success(bridge.execute("param")) }
        catch (e: Exception) { Either.Failure(ErrorModel.Exception(e)) }
}

3. Swift Implementation (iosApp)

// iosApp/iosApp/<Feature>/<Feature>BridgeImpl.swift
import ComposeApp

class <Feature>BridgeImpl: <ModulePrefix><Feature>Bridge {
    func execute(param: String, completionHandler: @escaping (String?, Error?) -> Void) {
        Task {
            do { completionHandler(try await nativeOperation(param), nil) }
            catch { completionHandler(nil, error) }
        }
    }
}

Read the full file on GitHub · 119 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 119 lines · 46 tokens per session scan A 8c1633e1e67e

Subscribe to this mod's changes

bridge-swift is a skill published in the GitHub repository ThisIsSadeghi/KMPilot (57 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 1,087 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

compose-multiplatform

Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…

ericrisco/rsc-harness · 80 tokens

kotlin-android

Use when building or fixing a native Android app in Kotlin and Jetpack Compose on the UDF layered architecture — ViewModel/StateFlow, Hilt, Room, Retrofit, coroutines, type-safe Navigation, and the Gradle/AGP surface. NOT shared Android and iOS UI from one Kotlin codebase (that is compose-multiplatform).

ericrisco/rsc-harness · 78 tokens

compose-animations

Use when writing or reviewing Jetpack Compose motion: visibility enter/exit, animating one property toward a target, color or size transitions, multiple properties from one state, switching composable content, or choosing between AnimatedVisibility, animateAsState, rememberTransition, AnimatedContent, and Crossfade.

chrisbanes/skills · 64 tokens

compose-focus-navigation

Use when writing or reviewing Jetpack Compose UI for TV, keyboard, desktop, accessibility focus, D-pad navigation, FocusRequester, focusProperties, key events, or initial focus behavior.

chrisbanes/skills · 41 tokens

kmp-lsp

Kotlin/Java/Swift LSP server for code navigation in Android and iOS codebases. Use when navigating Kotlin, Java, or Swift source files: finding class definitions, listing symbols, jumping to implementations, finding all usages, checking type signatures, or switching workspace between projects. Triggers for: "find this…

Hessesian/kmp-lsp · 114 tokens

kotlin-expert

Expert-level Kotlin development, Android, coroutines, and multiplatform. Use when the user mentions Android, coroutines, multiplatform, or JVM, or when the task involves Kotlin Fundamentals, Android Development, Kotlin Multiplatform, or Kotlin Style.

personamanagmentlayer/pcl · 55 tokens