These instructions apply to the whole repository. Module-specific rules in docs/agents/*.md take precedence for files inside their module.
firebase-kmp is an open-source Kotlin Multiplatform wrapper around official Firebase SDKs, so Firebase features can be used from shared KMP APIs.
- Final goal: 100% Firebase API compatibility and 100% public API coverage for KMP (Android/Apple/JVM), with explicit platform caveats only when official SDK parity is impossible.
- Work should be planned and implemented toward full Firebase product-family coverage, not only currently available modules.
- Every public API expansion should move compatibility coverage forward in measurable terms.
README.md,README.en.md, andREADME.ko.mdmust include current compatibility coverage status.- Coverage is tracked at three levels:
- Product-family coverage: implemented Firebase product modules / target product families.
- Public API coverage: implemented public APIs / target public APIs (per product and per platform).
- API-depth status per implemented module:
not started,partial,near parity, orparity.
- Public API inventories must be maintained in:
docs/public-api/firebase-common.mddocs/public-api/firebase-message.mddocs/public-api/firebase-storage.md
- Any PR that changes public APIs or adds modules must update both:
- README coverage sections.
- The relevant files in
docs/public-api/.
firebase-common: core Firebase app/bootstrap abstractions.firebase-message: Firebase Cloud Messaging abstractions (Android/Apple only; JVM currently unsupported).firebase-storage: Firebase Storage abstractions.
Reference module guides:
docs/agents/firebase-common.mddocs/agents/firebase-message.mddocs/agents/firebase-storage.md
- Keep wrappers thin and predictable.
- Define shared API in
commonMainfirst (expect, data models, extension properties/functions). - Implement platform behavior in every active target for that module (
androidMain, Apple source sets, andjvmMainwhere supported). - Maintain target parity as much as possible. If parity is impossible, document the difference in KDoc and module docs.
- Do not add app-level/business logic to this library.
- Public API changes must start from
commonMainand then be implemented in all active targets. - Prefer suspend APIs for async platform calls.
- Avoid silent failures. If behavior differs by platform, make it explicit.
- Keep naming and semantics Firebase-like unless there is a strong multiplatform reason to diverge.
- Preserve backward compatibility for published artifacts when possible.
- Android code should use Firebase Android SDK with the module's BOM-based dependency setup.
- Apple-native code should use CocoaPods interop APIs declared in each module.
- For modules that support JVM, use explicit runtime configuration when backed by Admin/Cloud SDKs, and document behavior differences from mobile client SDKs.
- Avoid introducing new force unwrap patterns in Apple source sets; handle nullable results defensively.
- When adding option/config fields, update all relevant platform mappings in the same change.
- Keep versions centralized in
gradle/libs.versions.toml. - Keep Android BOM and Apple CocoaPods versions aligned to a compatible Firebase generation.
- Maintain Kotlin Multiplatform target setup already present in each module; follow documented module exceptions (for example,
firebase-messagehas no JVM target). - Keep Java/Kotlin target compatibility at JVM 17 unless the project intentionally upgrades.
Run checks for touched modules before submitting:
./gradlew :firebase-common:check./gradlew :firebase-message:check./gradlew :firebase-storage:check./gradlew :firebase-common:compileKotlinJvm./gradlew :firebase-storage:compileKotlinJvm
When API surface or platform mapping changes:
- Add or update tests in relevant source sets.
- Validate compile targets at minimum for the module's active targets (Android/Apple, plus JVM where supported).
- Artifacts are published via
com.vanniktech.maven.publish. - Keep
groupId,artifactId, and POM metadata consistent with module identity. - Bump versions intentionally when behavior or API changes.
- Use local publish for validation when needed:
./gradlew :firebase-common:publishToMavenLocal./gradlew :firebase-message:publishToMavenLocal./gradlew :firebase-storage:publishToMavenLocal
- Update
README.mdand affected files indocs/agents/whenever public APIs or setup flow changes. - Update corresponding files in
docs/public-api/whenever public API coverage changes. - Add brief KDoc to new public APIs and document platform caveats.