AGENTS.md
AGENTS.mdAGENTS.mdroot
Quality
97/100
Scores the file, not the repository.Length
843 words
19 headings · 2 code blocksRepository
17k
— · pushed 5 days agoLast changed
3 days ago
First indexed 3 days ago.1# AGENTS.md23This file provides guidance to WARP (warp.dev) when working with code in this repository.45## Project Overview67Komi Store is a cross-platform app store for GitHub releases built with **Kotlin Multiplatform (KMP)** and **Compose Multiplatform**. It targets **Android** (min API 26, target 36) and **Desktop** (Windows, macOS, Linux via JVM).89Package: `zed.rainxch.githubstore`1011## Build & Run Commands1213```bash14# Android debug build15./gradlew :composeApp:assembleDebug1617# Desktop (run in dev mode)18./gradlew :composeApp:run1920# Full build check (both platforms)21./gradlew build2223# Lint (ktlint auto-formats on preBuild/compileKotlin* tasks automatically)24./gradlew ktlintFormat # manual format all modules25./gradlew ktlintCheck # check without fixing2627# Desktop installers28./gradlew :composeApp:packageDmg # macOS29./gradlew :composeApp:packageExe # Windows30./gradlew :composeApp:packageDeb # Linux31```3233**Requirements:** JDK 21+ (Temurin recommended), Android SDK for Android builds.3435**Setup:** Create a GitHub OAuth App and put `GITHUB_CLIENT_ID=<your_id>` in `local.properties` (root). Callback URL: `githubstore://callback`.3637## Architecture3839**Clean Architecture + MVVM** with strict layer separation:4041- **Domain** — Repository interfaces, models, use cases. No framework dependencies.42- **Data** — Repository implementations, Ktor API clients, Room DAOs, DTOs, mappers. Each feature's DI module lives in `data/di/SharedModule.kt`.43- **Presentation** — ViewModels with `StateFlow`/`Channel`, Compose screens.4445### State Management Pattern (every screen)4647Every ViewModel follows the same State/Action/Event pattern:4849- `State` — data class holding all UI state, exposed via `StateFlow`50- `Action` — sealed interface for user input (clicks, refreshes)51- `Event` — sealed interface for one-off effects (navigation, toasts), sent via `Channel.receiveAsFlow()`5253### Module Layout5455```text56composeApp/ # App entry points, navigation, DI wiring57 src/commonMain/ # Shared UI & wiring58 src/androidMain/ # Android entry (MainActivity)59 src/jvmMain/ # Desktop entry (DesktopApp.kt)60core/61 domain/ # Shared interfaces, models, use cases62 data/ # Networking (Ktor), database (Room), DI, platform impls63 presentation/ # Material 3 theming, reusable UI components, localized strings (13 languages)64feature/<name>/65 domain/ # Feature-specific interfaces & models66 data/ # Feature-specific implementations & Koin DI module67 presentation/ # Feature ViewModel + Compose screens68build-logic/convention/ # Custom Gradle convention plugins69```7071Some features (favourites, starred, recently-viewed, tweaks) are **presentation-only** — they use core repositories directly and register ViewModels in `composeApp/.../di/ViewModelsModule.kt` instead of having a `data/di/` layer.7273### Convention Plugins (build-logic)7475| Plugin ID | Use For |76| :--- | :--- |77| `convention.kmp.library` | KMP shared library modules (domain, data) |78| `convention.cmp.library` | Compose Multiplatform library modules |79| `convention.cmp.feature` | Feature presentation modules (auto-adds Compose + Koin + core:presentation) |80| `convention.cmp.application` | Main app module |81| `convention.room` | Room database modules |82| `convention.buildkonfig` | Build-time config (reads from local.properties) |8384### Navigation8586Type-safe navigation using `@Serializable` sealed interface `GithubStoreGraph` in `composeApp/.../navigation/GithubStoreGraph.kt`. Routes are wired in `AppNavigation.kt`. Parameterized routes: `DetailsScreen(repositoryId, owner, repo, isComingFromUpdate)`, `DeveloperProfileScreen(username)`.8788### Dependency Injection8990**Koin** — each feature's data layer defines a module in `data/di/SharedModule.kt`. All modules are registered in `composeApp/.../di/initKoin.kt`. ViewModels injected via `koinViewModel()`. `DetailsViewModel` and `MirrorPickerViewModel` use manual Koin `viewModel { }` with `parametersOf()` for constructor args; all others use `viewModelOf(::ClassName)`.9192### Key Cross-Cutting Concerns9394- **Auth flow:** GitHub device-flow OAuth. Primary path goes through backend proxy (`/v1/auth/device/start`, `/v1/auth/device/poll`); falls back to direct GitHub only on infrastructure errors (5xx, timeouts). HTTP 4xx and GitHub's negative 200-bodies never trigger fallback. Backend rate limits (10 starts/hr, 200 polls/hr per IP) are hard — do not add retry loops.95- **`X-GitHub-Token` header:** Forwarded on every backend passthrough route — `/v1/search`, `/v1/search/explore`, `/v1/repo/{owner}/{name}`, `/v1/releases/{owner}/{name}`, `/v1/readme/{owner}/{name}`, `/v1/user/{username}`. Backend re-sends as `Authorization: token $token` so upstream GitHub calls run under the user's 5000/hr OAuth quota; without it the request falls back to the shared 60/hr anonymous bucket and a single 4xx can poison the backend's 15-min negative cache for everyone. DB-only routes (`/v1/categories`, `/v1/topics`, `/v1/events`, `/v1/auth/device/*`, `/v1/badge/*`) never get the header. Sourced via `BackendApiClient.currentUserGithubToken()` (`private`), never logged. 401 from passthrough routes ≠ session expired — `AuthenticationStateImpl` debounces consecutive 401s under the same token before clearing the session.96- **Platform branching:** Source sets are `commonMain` (shared), `androidMain` (Android), `jvmMain` (Desktop). Some features (apps, installation, Shizuku) are Android-only.97- **Shizuku (Android):** Optional silent install via AIDL service. Falls back to standard installer on failure.9899## Coding Conventions100101- Packages: `zed.rainxch.{module}.{layer}` (e.g. `zed.rainxch.home.data.repository`)102- Private state: underscore prefix `_state`, `_events`103- Sealed classes/interfaces for type-safe routes, actions, events104- Repository pattern: interface in `domain/`, implementation in `data/`105- Ktlint auto-runs on `preBuild`/`compileKotlin*` tasks; `ignoreFailures = true`106- Ktlint rules: wildcard imports allowed, filename rule disabled, `@Composable` functions exempt from function naming rule (see `.editorconfig`)107108## Adding a New Feature1091101. Create `feature/<name>/domain/`, `feature/<name>/data/`, `feature/<name>/presentation/`1112. Add `build.gradle.kts` in each using the appropriate convention plugin1123. Add `include` entries in `settings.gradle.kts`1134. Define domain interfaces/models in `domain/`1145. Implement repository + Koin DI module in `data/di/SharedModule.kt`1156. Create ViewModel (State/Action/Event pattern) and Screen in `presentation/`1167. Add navigation route to `GithubStoreGraph.kt` and wire in `AppNavigation.kt`1178. Register the Koin module in `initKoin.kt`118119## Feature-Level Documentation120121Each `feature/` directory contains its own `CLAUDE.md` with module structure, key interfaces, navigation routes, and implementation notes. Read those for feature-specific guidance.122123## Versions124125All library versions managed in `gradle/libs.versions.toml`. Key versions: Kotlin 2.3.10, Compose Multiplatform 1.10.3, Ktor 3.4.0, Room 2.8.4, Koin 4.1.1.126
Also in kurikomi-labs/komi-store
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| kurikomi-labs/komi-storefeature/dev-profile/CLAUDE.md · 17k | CLAUDE.md | arch | 40/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/favourites/CLAUDE.md · 17k | CLAUDE.md | arch | 40/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/home/CLAUDE.md · 17k | CLAUDE.md | arch | 54/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/profile/CLAUDE.md · 17k | CLAUDE.md | arch | 54/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/tweaks/CLAUDE.md · 17k | CLAUDE.md | archmonorepo | 54/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/recently-viewed/CLAUDE.md · 17k | CLAUDE.md | arch | 35/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/search/CLAUDE.md · 17k | CLAUDE.md | arch | 54/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/starred/CLAUDE.md · 17k | CLAUDE.md | arch | 54/100 | 3 days ago | |
| kurikomi-labs/komi-storeCLAUDE.md · 17k | CLAUDE.md | buildstylearchgit | 78/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/apps/CLAUDE.md · 17k | CLAUDE.md | arch | 58/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/auth/CLAUDE.md · 17k | CLAUDE.md | archsecurity | 58/100 | 3 days ago | |
| kurikomi-labs/komi-storefeature/details/CLAUDE.md · 17k | CLAUDE.md | arch | 53/100 | 3 days ago |
Diff against feature/dev-profile/CLAUDE.md Diff against feature/favourites/CLAUDE.md Diff against feature/home/CLAUDE.md Diff against feature/profile/CLAUDE.md Diff against feature/tweaks/CLAUDE.md Diff against feature/recently-viewed/CLAUDE.md Diff against feature/search/CLAUDE.md Diff against feature/starred/CLAUDE.md Diff against CLAUDE.md Diff against feature/apps/CLAUDE.md Diff against feature/auth/CLAUDE.md Diff against feature/details/CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| OnlyTerp/prompt-cache-skillsAGENTS.md · 112 | AGENTS.md | setupbuildtestlint-format+5 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| wpscanteam/wpscanAGENTS.md · 9.7k | AGENTS.md | setupbuildteststyle+6 | 100/100 | 2 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago |
