Guidance for AI coding agents (Copilot, Cursor, Aider, Claude, etc.) working in Stream’s Android Feeds repo.
Delivers the Stream Feeds Android SDK, network layer, and sample app. Guard API stability, network resilience, and low-regression releases.
- Kotlin targeting JVM 11; Gradle Kotlin DSL with shared logic in
buildSrc/ - Retrofit, OkHttp, Moshi (KSP) for networking and serialization
- Spotless (ktfmt), Detekt, explicit API, Kover for static analysis and coverage
- Tests rely on JUnit4, MockK, Turbine, coroutines-test, MockWebServer
stream-feeds-android-client/– public SDK sources and testsstream-feeds-android-network/– shared HTTP + serialization layerstream-feeds-android-sample/– demo app for manual verificationbuildSrc/,config/,metrics/– Gradle helpers, lint configs, coverage
./gradlew assemblebuilds release artifacts;./gradlew checkruns tests + static analysis./gradlew :stream-feeds-android-client:testis the fast loop;./gradlew :stream-feeds-android-sample:installDebugdeploys the demo- Run
./gradlew spotlessApplythen./gradlew detektbefore committing
- Keep coroutines structured and thread safe around token refresh, pagination, realtime updates
- Reuse shared retry/backoff helpers instead of bespoke networking logic
- Log via
StreamLoggerwith actionable context and no secrets
- Spotless enforces Kotlin style (4 spaces, ktfmt, no wildcard imports)
- Public APIs need KDoc + explicit visibility; coordinate breaking changes
- PascalCase types, camelCase members, expressive builder verbs; backticked test names when helpful
- Place tests under each module’s
src/test/kotlin, mirroring package names - Cover success, retry, and failure paths for feed mutations, token refresh, and connectivity loss
- Use MockWebServer/fakes plus Turbine + coroutines-test for deterministic assertions
- Never hardcode API keys or tokens; rely on
local.properties/env vars in the sample app - Scrub sensitive data from logs and configs; coordinate edits in
scripts/andgradle/libs.versions.toml
- Use imperative commit subjects, optional scope or
[skip ci], and(#123)for linked work - Squash related commits, attach command output/screenshots for sample changes, and run
./gradlew checkpre-PR - Flag breaking API or publishing-impacting work early and update docs when behaviour shifts
- Run module-level tests (
:module:test) - Apply Spotless + Detekt and fix findings
- Document and cover new or changed APIs