mobile-native-platforms
Use when building or reviewing native iOS (Swift/SwiftUI) or native Android (Kotlin/Jetpack Compose) apps, or deciding native vs React Native. Triggers on Swift 6 concurrency / Sendable / actors, SwiftUI, The Composable Architecture (TCA), MVVM/MV, Swift Package Manager, Xcode Cloud; and on Kotlin Coroutines/Flow, Jetpack Compose, UDF/MVI, state hoisting, side-effect APIs (LaunchedEffect/DisposableEffect/derivedStateOf/produceState/snapshotFlow), Hilt DI, Room/DataStore/WorkManager, KSP, and Android Keystore/StrongBox. Also use when deep OS integration or the Intune App SDK mandates going native.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 5
- Forks
- 3
01 前言 Front Matter
- name
- mobile-native-platforms
- description
- Use when building or reviewing native iOS (Swift/SwiftUI) or native Android (Kotlin/Jetpack Compose) apps, or deciding native vs React Native. Triggers on Swift 6 concurrency / Sendable / actors, SwiftUI, The Composable Architecture (TCA), MVVM/MV, Swift Package Manager, Xcode Cloud; and on Kotlin Coroutines/Flow, Jetpack Compose, UDF/MVI, state hoisting, side-effect APIs (LaunchedEffect/DisposableEffect/derivedStateOf/produceState/snapshotFlow), Hilt DI, Room/DataStore/WorkManager, KSP, and Android Keystore/StrongBox. Also use when deep OS integration or the Intune App SDK mandates going native.
03 SKILL.md 正文
Native iOS & Android
Go native (for the whole app or specific modules) when you need deep OS integration (widgets, complex background work, AR, peak performance) or when the Intune App SDK is mandated — it officially supports native Android/iOS/.NET/MAUI but not React Native.
iOS — Swift / SwiftUI
- Swift 6 enables complete concurrency checking by default: strict
Sendable, actor isolation,@MainActor. Swift 6.2 (Nov 2025) added "approachable concurrency" to ease migration — practitioners still describe full UIKit migration as a major lift. - Architecture options:
- The Composable Architecture (TCA 1.0+) — Redux-style unidirectional flow with
Reducer,State,Action,@Dependency, and.runasync effects integrating Swift Concurrency. - MVVM, or Apple's lighter "MV" pattern.
- The Composable Architecture (TCA 1.0+) — Redux-style unidirectional flow with
- Swift Package Manager is the dependency/modularization standard.
- Security: Keychain accessibility classes; Secure Enclave key generation
(
SecKeyCreateRandomKey); App Attest for app/device attestation; App Transport Security. - CI/CD: Xcode Cloud (or the cross-platform options in
mobile-azure-deployment).
Android — Kotlin / Jetpack Compose
- Concurrency: Kotlin Coroutines + Flow + structured concurrency (
viewModelScope,StateFlow/SharedFlow). - Recommended Compose architecture is UDF ("state flows down, events flow up") with state
hoisting to the lowest common parent: a single immutable UI-state data class exposed as
StateFlow, collected viacollectAsStateWithLifecycle()(fromandroidx.lifecycle:lifecycle-runtime-compose). MVVM is Google's baseline; MVI adds a stricter reducer(oldState, event) -> newState+ intents + one-off effects (Channel/SharedFlow) that aligns with Compose's declarative model.
Compose side-effect APIs
| API | Purpose |
|---|---|
LaunchedEffect |
key-scoped coroutine |
rememberCoroutineScope |
launch from callbacks |
rememberUpdatedState |
fresh value without restart |
DisposableEffect |
onDispose cleanup |
SideEffect |
post-recomposition publish to non-Compose objects |
derivedStateOf |
recompute only when result changes |
produceState |
non-Compose → Compose state |
snapshotFlow |
Compose State → Flow |
DI & Jetpack libraries
- Hilt (built on Dagger, compile-time DI):
androidx.hilt 1.3.0(Sep 10, 2025;hiltViewModel()moved toandroidx.hilt:hilt-lifecycle-viewmodel-compose, targets Kotlin 2.0/KSP2).@HiltViewModel+ constructor@Inject. Scopes:@Singleton(SingletonComponent) →@ActivityRetainedScoped(survives config changes) →@ViewModelScoped. Shared dependencies across ViewModels should be@ActivityRetainedScopedor@Singleton. - Room 2.8.4 (KSP;
ksp("androidx.room:room-compiler:2.8.4")). Room 3.0 (androidx.room3, 3.0.0-alpha01, March 2026) is a KMP rewrite — KSP-only, coroutine-first (suspend DAOs), still alpha. - DataStore 1.1.7 (Preferences vs Proto) — async, Flow-based SharedPreferences replacement; no encrypted DataStore exists yet.
- WorkManager for deferrable guaranteed work (
@HiltWorker+HiltWorkerFactory). - Navigation Compose with
hiltViewModel().
Android security
- Jetpack Security Crypto (
androidx.security:security-crypto) is DEPRECATED at 1.1.0-alpha07 (April 2025) — all APIs (incl.EncryptedSharedPreferences/EncryptedFile) deprecated "in favour of … direct use of Android Keystore." Migrate to direct Android Keystore or community forks (Ackee Guardian,dev.spght:encryptedprefs). - Android Keystore TEE vs StrongBox (HSM, API 28+) with key attestation; verify
isInsideSecureHardware(). - BiometricPrompt +
CryptoObjectties crypto operations to biometric auth. - Build with Gradle + KSP. (Confirm the current
androidx.biometric:biometricversion before pinning.)
See mobile-security for the cross-platform secure-storage, comms, and MFA baseline.
04 同仓库更多 Skills
white-paper-writing
Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks "how should I structure this" for a long-form document.
prose-technical-mechanics
Use when editing or writing prose at a technical/mechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.
prose-mechanics
Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate/Jamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix "AI-sounding" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.
narrative-structure
Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or "how should I structure this story/pitch/presentation" request.
legal-brief-writing
Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic/neurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.
journal-publishability-criteria
Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs/paper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.