Guidelines for AI agents (Jules, Kiro, Copilot, etc.) working in this repository.
This is a Kotlin Multiplatform (KMP) project that builds a Jules API client app targeting Android, iOS, Desktop (JVM), Web (JS + WasmJS), and Server.
| Module | Purpose |
|---|---|
shared/ |
KMP SDK — models, API client, shared business logic |
composeApp/ |
Compose Multiplatform UI (Android, iOS, Desktop, Web) |
server/ |
Ktor server application |
iosApp/ |
iOS entry point (Swift/Xcode) |
Base URL: https://jules.googleapis.com/v1alpha
Auth header: x-goog-api-key: <key>
Full reference: JULES_API.md
Core resources: Sessions, Activities, Sources
- All API models live in
shared/src/commonMain/kotlin/.../sdk/models/ - The API client lives in
shared/src/commonMain/kotlin/.../sdk/JulesApiClient.kt - Platform-specific Ktor engines are declared in
shared/build.gradle.ktssource sets — no platform source files needed for the HTTP layer - Use
kotlinx.serializationfor all JSON; annotate models with@Serializable
- Shared UI in
composeApp/src/commonMain/ - ViewModels use
androidx.lifecycle.ViewModel+viewModelScope - State is exposed as
StateFlow; screens observe viacollectAsState() - Navigation is handled with a sealed
Screeninterface in the ViewModel — no navigation library
- Minimal code: only write what directly solves the requirement; no speculative abstractions
- Immutable models: use
data classwithvalfields and sensible defaults for optional fields - Error handling: use
runCatchingat the ViewModel layer; propagateerror: String?in UI state - Coroutines: all network calls are
suspend; launch fromviewModelScope - No hardcoded secrets: API keys come from config/environment, never committed
# Android
./gradlew :composeApp:assembleDebug
# Desktop
./gradlew :composeApp:run
# Web (Wasm)
./gradlew :composeApp:wasmJsBrowserDevelopmentRun
# Web (JS)
./gradlew :composeApp:jsBrowserDevelopmentRun
# Server
./gradlew :server:run
# Shared module (JVM compile check)
./gradlew :shared:compileKotlinJvm| File | Description |
|---|---|
gradle/libs.versions.toml |
All dependency versions and library aliases |
shared/build.gradle.kts |
KMP targets + Ktor engine per platform |
build.gradle.kts |
Root — plugin declarations only |
JULES_API.md |
Full Jules REST API reference |
Always add to gradle/libs.versions.toml first, then reference via libs.* alias in the relevant build.gradle.kts. Never use string literals for dependency coordinates in build files.
- Do not add navigation libraries (Decompose, Voyager, etc.) without discussion — current nav is intentionally simple
- Do not add DI frameworks without discussion
- Do not commit API keys or secrets
- Do not modify
iosApp/Xcode project files unless the task explicitly requires it - Do not use
git push --forceorgit reset --hardwithout explicit instruction