← ClaudeAtlas

uniffi-boundarylisted

Use when you author, change, or review a UniFFI cross-language boundary crate that generates Kotlin and Swift bindings from Rust. Covers proc-macro-first scaffolding versus UDL, the Record/Object/Enum/Error derives, the Record-versus-Object decision, Send + Sync requirements on exported interfaces, Arc-based ownership and object identity across the boundary, callback interfaces and foreign traits, custom types and newtype converters, versioned payloads that cross as JSON strings, coarse-boundary and large-data rules, built-in type mapping to Kotlin and Swift, async export rules, codegen failure triage, and a review checklist. Triggers on uniffi, uniffi::export, uniffi::constructor, derive Record/Object/Enum/Error, setup_scaffolding, uniffi-bindgen, UDL, callback_interface, with_foreign, custom_newtype, foreign trait, or any question about what may cross an FFI boundary.
po4yka/rust-skills · ★ 0 · Data & Documents · score 75
Install: claude install-skill po4yka/rust-skills
# UniFFI Boundary ## Purpose Use this skill to design, author, and review a UniFFI boundary crate. A UniFFI boundary crate is a thin adapter: it declares the exported surface, and one bindings generator produces the Kotlin and the Swift side from the same Rust signatures. This skill owns the *shape* of that surface: - proc-macro scaffolding and the single-source-of-truth rule, - the Record versus Object decision, - `Send + Sync` on every exported interface, - `Arc`-based object references and ownership, - foreign callback traits, - custom-type converters and JSON-string contracts, - what is allowed to cross the boundary and what must stay in deeper crates. This skill does **not** own the error, progress, and cancellation *semantics* — the error variant taxonomy, forward-compatible catch-all variants, progress mapping to Kotlin `Flow` or Swift `AsyncThrowingStream`, and cooperative cancel. Those are `ffi-error-progress-cancel`. It does not own packaging of the generated artifacts — cdylib, staticlib, XCFramework, and version skew. That is `uniffi-packaging-versioning` and `rust-android-build`. The atomics under a cancel flag are `memory-model`. Unsafe blocks and FFI safety invariants are `rust-unsafe`. Unwind policy is `rust-panic-safety`. General API-shape discipline is `rust-discipline`. ## When to use - You add, remove, or change any `#[uniffi::export]` function, method, or trait. - You must decide whether a type is a UniFFI **Record** (by value, fields cross) or an