- Home
- Skills
- Alinaqi
- Claude Bootstrap
- Android Kotlin
android-kotlin_skill
- Shell
450
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill alinaqi/claude-bootstrap --skill android-kotlin- SKILL.md11.9 KB
Overview
This skill provides an opinionated Android Kotlin starter focused on Coroutines, Jetpack Compose, Hilt dependency injection, Room, and testable architecture. It favors security-first, spec-driven patterns and includes Gradle Kotlin DSL, CI, linting, and testing setup to bootstrap robust apps quickly. The layout and examples show how to structure layers, state management, and common utilities.
How this skill works
The skill outlines a project structure with clear data, domain, DI, and UI layers, plus an Application entry. It demonstrates StateFlow-based ViewModel patterns, repository implementations using Flow, Compose screens wired to ViewModels, and sealed result wrappers. It also provides Gradle dependency setup, detekt/ktlint linting rules, GitHub Actions for CI, and example unit tests using MockK and Turbine.
When to use it
- Starting a new Android app that uses Compose, Coroutines, Hilt, and Room
- When you need a testable architecture with injected dispatchers and unit testing patterns
- Bootstrapping apps that must pass CI and static analysis (detekt/ktlint)
- Adopting Flow/StateFlow for predictable UI state and reactive data layers
- Creating apps that prioritize security and spec-driven design from day one
Best practices
- Use StateFlow + collectAsStateWithLifecycle in Composables to observe ViewModel state
- Inject CoroutineDispatcher for repository and use flowOn/withContext for threading
- Expose immutable StateFlow to consumers and keep MutableStateFlow private
- Handle Flow errors with catch and surface user-friendly messages in UI
- Avoid GlobalScope and blocking calls on main; use structured concurrency (viewModelScope)
- Write unit tests with MockK, Turbine, and a MainDispatcherRule to control coroutines
Example use cases
- User profile screen that loads cached data first then refreshes from network
- Feature module wired with Hilt modules, Room DAO, and Retrofit/Ktor API client
- CI pipeline that runs detekt, ktlint, unit tests, and assembles a debug APK
- Sealed Result wrapper to standardize success/loading/error across layers
- Compose screen showing loading, content, and Snackbar-based error handling
FAQ
Use a TestDispatcher (via a MainDispatcherRule), MockK to stub use cases, and Turbine to assert StateFlow emissions deterministically.
How do I avoid blocking the main thread?
Inject dispatchers and perform IO on Dispatchers.IO or a TestDispatcher; never call runBlocking on the main thread and prefer viewModelScope.launch for async work.