agentleFS
maroffomaroffo/claude-forge/skills/android-kotlin/SKILL.md

android-kotlin

Skill17 starsChanged 50 days agoMITView on GitHub

Android development with Kotlin, Jetpack Compose, Clean Architecture, and performance. Use when working with .kt files, build.gradle.kts, AndroidManifest.xml, or Compose UI.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use cases: single responsibility, orchestration here (NOT in ViewModel).

    line 63

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ABOUTME: Android/Kotlin, Compose, Clean Architecture, testing, performance

ABOUTME: MVVM + DI conventions, state/side-effect patterns, review checklists

Android/Kotlin

Commands

./gradlew assembleDebug|assembleRelease|test|connectedAndroidTest|lint|ktlintFormat
./gradlew :feature:home:build                    # Module-specific

See: _AST_GREP.md (sg patterns) | _PATTERNS.md | source-control


Version (determine, don't assume)

See ../_LANG_COMMON.md. Fetch the truth:

./gradlew --version                                         # Gradle + JVM
grep -E 'kotlin|agp|compose' gradle/libs.versions.toml      # version catalog (preferred)
grep -E 'kotlin|android' build.gradle.kts                   # fallback
cat gradle.properties                                       # AGP / Kotlin flags
curl -s https://api.github.com/repos/JetBrains/kotlin/releases/latest | jq -r .tag_name   # latest Kotlin
curl -s https://api.github.com/repos/gradle/gradle/releases/latest | jq -r .tag_name      # latest Gradle

Pre-Commit Verification (MANDATORY)

make check && make test-e2e must pass (enforced by the pre-commit-gate hook; see ../_LANG_COMMON.md). What make check expands to for Android:

./gradlew ktlintCheck                           # formatting
./gradlew detekt                                # static analysis
./gradlew lint                                  # Android lint
./gradlew test                                  # unit tests (all variants)
./gradlew connectedAndroidTest                  # instrumented / e2e (device/emulator)

Architecture

Clean Architecture Structure

feature/
├── data/repository/, datasource/local/, datasource/remote/
├── domain/model/, repository/ (interface), usecase/
└── presentation/screen/, viewmodel/

Use Cases and ViewModels

Use cases: single responsibility, orchestration here (NOT in ViewModel). ViewModels expose immutable StateFlow UI state and one-time events via Channel/SharedFlow (never StateFlow).


Dependency Injection

AspectHiltKoin
TypeCompile-timeRuntime
Build timeSlowerFaster
Error detectionCompileRuntime
KMP supportNoYes
Best forLarge/enterpriseSmall-medium/KMP

Hilt: @HiltAndroidApp, @AndroidEntryPoint, @HiltViewModel, @Inject constructor Koin: module { }, single, factory, viewModelOf, koinViewModel()

See references/compose-patterns.md for setup examples.


Compose Essentials

Side effects: LaunchedEffect(key), DisposableEffect. Collect flows with collectAsStateWithLifecycle() (not collectAsState).

Type-safe navigation: @Serializable routes.

See references/compose-patterns.md for detailed examples.


Code Review Checklists

Architecture

  • VMs don't chain use cases (orchestration in domain)
  • VMs don't call repositories directly
  • Use cases have single responsibility
  • State immutable (use copy())
  • Side effects use Channel/SharedFlow (not StateFlow)

Compose

  • State hoisted appropriately
  • remember vs rememberSaveable correct
  • Side effects use correct APIs
  • Stable types for parameters
  • key used in LazyColumn/LazyRow

Red Flags

CriticalHigh
Network/DB on main threadUse case chaining in VM
StateFlow for one-time eventsMutable state exposed from VM
Hardcoded strings in UIMissing key in LazyColumn
Missing error handlingcollectAsState vs collectAsStateWithLifecycle
R8 disabled in release

Detailed References

  • references/kotlin-features.md - Kotlin language features and idioms
  • references/compose-patterns.md - State, side effects, navigation, image loading
  • references/data-layer.md - Retrofit, Ktor, Room, DataStore
  • references/testing-patterns.md - Compose UI tests, ViewModel tests, snapshot tests (Paparazzi), Turbine
  • references/performance.md - R8, Baseline Profiles, Compose optimization

Resources

Official: android.com/kotlin | compose | architecture | type-safe nav | baseline profiles

Libraries: Coil | Koin | Hilt | Retrofit | Ktor | Room

Testing: Compose testing | Paparazzi | Turbine

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.