agentleFS
garfiecgarfiec/Librechat-Mobile/shared/CLAUDE.md

Librechat-Mobile / shared

CLAUDE.md149 starsChanged 7 days agoApache-2.0View on GitHub

KMP umbrella module that exports all core and feature modules as a single Shared.framework for iOS. On Android, this module is a dependency of :app but the framework export is iOS-only. shared/build.gradle.kts configures iOS targets (iosArm64, iosSimulatorArm64) and exports: - core:common, core:model, core:network, core:data — exported via api() so iOS sees all public types - core:ui + all feature:* modules — included via implementation() for Compose Multiplatform screen sharing The framework is static (isStatic = true) and named Shared. The…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No explicit SKIE configuration is needed unless disabling a specific feature.

    line 38

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Shared Module

KMP umbrella module that exports all core and feature modules as a single Shared.framework for iOS. On Android, this module is a dependency of :app but the framework export is iOS-only.

Framework Export

shared/build.gradle.kts configures iOS targets (iosArm64, iosSimulatorArm64) and exports:

  • core:common, core:model, core:network, core:data — exported via api() so iOS sees all public types
  • core:ui + all feature:* modules — included via implementation() for Compose Multiplatform screen sharing

The framework is static (isStatic = true) and named Shared.

iOS Platform Files (src/iosMain/)

FilePurpose
IosKoinHelper.ktstartIosKoin() — called from Swift iOSApp.init(). Sets up Kermit logging via NSLog, installs crash reporting, starts Koin with iOS modules.
IosSharedModule.ktiOS Koin graph: includes(sharedKoinModules) (which brings in networkModule → Darwin engine + iOS SseHttpTransport via networkPlatformModule.ios, HTTP clients, all API services, SSE client) and adds only the one iOS-only binding, LibreChatSDK.
IosKoinAccessor.ktSwift-accessible Koin resolver. KoinHelper.swift calls these to get SDK, repos, etc.
IosCrashReporting.ktUnhandled exception hook — logs via Kermit + raises NSException for readable iOS crash logs.
NsLog.ktnsLogVerbatim(text) — the only way to call NSLog from Kotlin. Direct calls crash: Kotlin text in the format string has its % read as specifiers, and a Kotlin String vararg isn't converted to NSString.
MainViewController.ktMainViewController() — the Compose Multiplatform entry point wrapped by ComposeView.swift.

Common Files (src/commonMain/)

  • LibreChatSDK.kt — Facade class aggregating all API services, token manager, and SSE client
  • di/SharedKoinModules.kt — sharedKoinModules, the single Koin module list both platforms start from (Android loads it directly; iOS includes it). Add a feature module here, not in the per-platform entry points. Verified against Android actuals by :app KoinGraphVerificationTest and against iOS actuals by iosTest/IosKoinGraphTest (:shared:iosSimulatorArm64Test).
  • navigation/ — Nav 3 route definitions and entry providers shared across platforms
  • app/ — Shared app-level composables (root navigation host)

SKIE

The SKIE Gradle plugin is applied here. All features are enabled by default:

  • Sealed classes → Swift exhaustive enums (onEnum(of:))
  • Flow<T> → AsyncSequence
  • suspend fun → async throws

No explicit SKIE configuration is needed unless disabling a specific feature.

Adding Platform-Specific Code

  • iOS implementations go in src/iosMain/ with actual declarations matching expect in commonMain
  • For feature-level platform code, prefer adding iosMain source sets in the feature module itself rather than here
  • This module should only contain app-level iOS wiring (DI bootstrap, framework entry point)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.