You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
3
+
This file provides guidance for AI agents working with code in this repository.
4
4
5
5
## Project Overview
6
6
7
-
SummaryExpressive is an AI/LLM summarizer FOSS Android app that summarizes YouTube videos, web articles, images, and documents. It follows [MAD](https://developer.android.com/courses/pathways/android-architecture) principles using pure Kotlin + Jetpack Compose + Material 3 Expressive. The app is BYOK (Bring Your Own Key), allowing users to configure their own LLM API keys.
7
+
SummaryExpressive is an AI/LLM summarizer FOSS Android app that summarizes YouTube/BiliBili videos, web articles, images, and documents. It follows [MAD (Modern Android Development)](https://developer.android.com/courses/pathways/android-architecture) principles using pure Kotlin + Jetpack Compose + Material 3 Expressive. The app is BYOK (Bring Your Own Key), allowing users to configure their own LLM API keys.
- Use `./gradlew clean assembleDebug` to verify the build
51
-
- Use `./gradlew clean test` to run tests
52
-
- Configure SDK paths in `local.properties`
53
-
- Set up signing keys in `keystore.properties` for release builds
54
-
55
-
## Architecture & Code Structure
56
-
57
-
### Technology Stack
58
-
-**Language**: Kotlin
59
-
-**UI Framework**: Jetpack Compose with Material 3 Expressive (alpha version for expressive features)
60
-
-**DI**: Dagger/Hilt
61
-
-**Database**: Room (SQLite)
62
-
-**Networking**: Ktor 3.x
44
+
> [!TIP]
45
+
> Coding agents should use the `android-cli` skill for CLI workflows, SDK management, running/debugging apps on emulators/devices, UI inspection, and taking screenshots.
46
+
47
+
---
48
+
49
+
## Development Guidelines
50
+
51
+
### Code Style
52
+
-**Simple structure**: Keep the code structure as simple and readable as possible.
53
+
-**Imports**: Never use fully-qualified class names inline; always use import statements.
54
+
-**Style guide**: Follow the [Kotlin Android Style Guide](https://developer.android.com/kotlin/style-guide).
55
+
56
+
### Material 3 Expressive UI
57
+
-**Expressive Compliance**: Use the `material-3` skill to check and ensure that any newly added or updated UI complies with Material Design 3 Expressive guidelines (expressive shapes, spring motion physics, tonal elevation, dynamic color, and tokens).
58
+
-**Material 3 Version**: The app targets Compose Material 3 Expressive features using `1.5.0-alpha26`.
59
+
60
+
---
61
+
62
+
## Architecture
63
+
64
+
### Architectural Patterns
65
+
-**Layered Architecture & UDF**:
66
+
-**UI Layer**: Compose + ViewModels exposing reactive `StateFlow`, adhering to Unidirectional Data Flow (UDF).
67
+
-**Domain / Model Layer (`model/`, `exception/`)**: Pure domain models and centralized exceptions decoupled from UI and Data layers.
68
+
-**Data Layer (`data/`)**: Repositories act as the Single Source of Truth (SSOT). ViewModels never interact directly with DAOs, DataStores, or raw network clients.
69
+
-**Component Placement Conventions**:
70
+
-**Global Reusable Components**: Place in `ui/component/` (e.g. `SummaryCard`, `LlmSwitcher`, `LlmIndicator`, `LogoIcon`, `ClickablePasteIcon`).
71
+
-**Page-Specific Components**: Place alongside the screen in `ui/page/` (or `ui/page/<feature>/`) scoped to that specific screen/feature (e.g. `BilibiliLoginScreen.kt` sheet).
72
+
-**Dependency Injection (Hilt)**:
73
+
- All major dependencies are Hilt-injectable using `@Singleton` for app-wide dependencies or `@ActivityScoped` for activity-level dependencies.
74
+
-**Database (Room)**:
75
+
- Database name: `summary_expressive_db`.
76
+
- Main entity: `HistorySummary` with `HistoryDao`.
77
+
- Custom type converters reside in `data/converters/`.
78
+
-**Custom Exceptions**:
79
+
- Centralized in `exception/SummaryException.kt` with string resource localization support.
80
+
81
+
### Technology Stack & Key Dependencies
82
+
-**Language**: Kotlin 2.4.x
83
+
-**UI Framework**: Jetpack Compose with Material 3 Expressive (`1.5.0-alpha26` for expressive features)
-**ML Kit**: For text recognition from images (build flavor dependent)
65
-
-**LLM Integration**: Koog library
91
+
-**ML Kit**: Text recognition from images (Google Play Services / standalone bundled)
92
+
93
+
---
66
94
67
-
### Build Flavors
68
-
The app uses two product flavors:
69
-
-**gms**: Uses Google Play Services ML Kit (smaller APK size, requires Google Play Services)
70
-
-**standalone**: Bundles ML model in APK (larger package size, works without Google Play Services)
95
+
## Code Structure
71
96
72
-
Configure in `app/build.gradle.kts:58-68`.
97
+
### Build Flavors & Distribution
98
+
The app defines two product flavors under the `distribution` dimension (`app/build.gradle.kts`):
99
+
-**`gms`**: Uses Google Play Services ML Kit (`com.google.android.gms:play-services-mlkit-text-recognition`). Smaller APK size, requires Google Play Services. Used for Google Play Store releases (signed with Google-managed key).
100
+
-**`standalone`**: Bundles ML model in the APK (`com.google.mlkit:text-recognition`). Larger package size, functions offline without Google Play Services.
-**Page-Specific Components**: Place alongside the screen in `ui/page/` (or `ui/page/<feature>/`) scoped specifically to that screen/feature (e.g. `BilibiliLoginScreen.kt` sheet).
204
212
-**Custom Exceptions**: Centralized in `exception/SummaryException.kt` with string resource localization support.
205
213
206
-
### Dependency Injection
207
-
- All major components are Hilt-injectable
208
-
- Use `@Singleton` for app-wide dependencies
209
-
- Use `@ActivityScoped` for activity-level dependencies (when needed)
210
-
211
-
### Room Database
212
-
- Database: `summary_expressive_db`
213
-
- Main entity: `HistorySummary` with DAO operations
214
-
- Type converters in `converters/` package
215
-
216
-
### Material 3 Expressive
217
-
The app uses Material 3 Expressive alpha features for enhanced UI. Material version: `1.5.0-alpha26`
218
-
219
-
## Testing
220
-
- Unit tests in `src/test/kotlin/`
221
-
- Instrumented tests in `src/androidTest/kotlin/`
222
-
- Use `./gradlew test` for unit tests
223
-
- Use `./gradlew connectedAndroidTest` for instrumented tests
224
-
225
-
## Build & Release
226
-
227
-
### Development
228
-
- Debug builds are debuggable with application ID suffix `.debug`
229
-
- Use `assembleDebug` for development builds
230
-
231
-
### Release
232
-
- Release builds are minified and shrunk
233
-
- Requires `keystore.properties` for signing
234
-
- Two distribution channels:
235
-
1.**GitHub Releases**: Both gms and standalone variants
236
-
2.**Google Play Store**: GMS variant with Google-managed signing
237
-
238
-
### Version Info
239
-
Current version: 1.3.2 (versionCode 49)
240
-
- Update version in `app/build.gradle.kts:21-22`
241
-
242
-
## Permissions & Security
243
-
The app likely requires:
244
-
- Internet access (for LLM calls and content extraction)
0 commit comments