Agent Skill for Android development with Kotlin and Jetpack Compose, covering modular architecture, Navigation3, Gradle conventions, dependency management, and testing best practices.
git clone https://github.com/Drjacky/claude-android-ninja.gitclaude-android-ninja is an Agent Skill package that provides structured instructions, templates, and references for building production-quality Android apps with Kotlin and Jetpack Compose. It covers modular architecture patterns, domain/data/UI layering, Navigation3 guidance, Material 3 theming, accessibility support, internationalization, background media playback, testing practices, and Play Store CI/CD workflows. The skill includes comprehensive references for Gradle conventions, performance benchmarking, security implementation (biometrics, certificate pinning, Play Integrity), and migrations from legacy Android patterns. Developers using Claude Code, Cursor, and similar AI agents benefit from consistent guidance on adaptive UI for phones, tablets, and foldables, alongside debugging techniques and code quality checks.
[{"step":"Define the feature requirements and scope","action":"Create a ticket in Sortd (ai-assistant) with details: '[FEATURE_NAME] - Modular implementation for [PROJECT_NAME]'. Include acceptance criteria, dependencies, and any design mockups.","tip":"Use Sortd's kanban board to track progress from 'Backlog' to 'In Review'. Add labels like 'android-dev' and 'modular-architecture'."},{"step":"Set up the modular structure","action":"Run the prompt template to generate the Gradle configuration, module structure, and initial navigation setup. Replace [PLACEHOLDERS] with your project and feature names.","tip":"Verify the module is correctly included in the root `settings.gradle.kts` file. Use `include(\":feature-user-profile\")` for the module path."},{"step":"Implement the feature logic","action":"Develop the ViewModel, UseCases, and Composable UI following the project's architecture guidelines. Write unit tests for business logic and UI tests for Compose components.","tip":"Use Android Studio's 'Run Tests' button to execute unit tests. For UI tests, use the 'Record Espresso Test' feature to generate initial test cases."},{"step":"Integrate with Navigation3","action":"Update the Navigation graph to include the new feature route. Test navigation flow using the app's debug build.","tip":"Use Android Studio's 'Layout Inspector' to verify Compose UI rendering during navigation transitions."},{"step":"Document changes and review","action":"Update the project README.md and create a pull request. Use Sortd to assign reviewers and track feedback.","tip":"In Sortd, add a comment with the PR link and tag reviewers directly in the task. Use '@reviewer-name' to notify them."}]
Building modular Android apps with feature-first architecture and strict dependency management
Implementing Jetpack Compose UI with Material 3 theming and adaptive layouts for multiple screen sizes
Setting up Navigation3 with deep linking, saved state, and large-screen navigation patterns
Hardening background media playback with Media3 and Android 37+ compliance
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/Drjacky/claude-android-ninjaCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Act as a senior Android developer specializing in Kotlin and Jetpack Compose. Using the project structure and best practices from [PROJECT_NAME], implement a modular feature module for [FEATURE_NAME] following the team's architecture guidelines. Write the necessary Gradle configuration for the new module, update dependency versions in the root build.gradle, and ensure the module integrates with the Navigation3 graph. Include unit tests for the ViewModel and UI tests for the Composable. Document any changes in the project's README.md under 'Module Additions'.
### Implementation of Modular Feature Module for 'User Profile' in 'MyApp'
**1. Project Structure Updates:**
- Created new module `feature-user-profile` under `modules/` with the following structure:
- `src/main/java/com/myapp/feature/userprofile/` (Kotlin sources)
- `src/main/res/` (Compose resources)
- `src/test/java/com/myapp/feature/userprofile/` (Unit tests)
- `src/androidTest/java/com/myapp/feature/userprofile/` (UI tests)
**2. Gradle Configuration:**
- Added `feature-user-profile/build.gradle.kts`:
```kotlin
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
android {
namespace = "com.myapp.feature.userprofile"
compileSdk = 34
defaultConfig {
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
}
}
dependencies {
implementation(project(":core:ui"))
implementation(project(":core:domain"))
implementation("androidx.navigation:navigation-compose:2.7.4")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:5.3.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.0")
}
```
- Updated `build.gradle.kts` in root project to bump dependency versions:
```kotlin
val navigationVersion by extra("2.7.4")
val composeVersion by extra("1.5.3")
```
**3. Navigation Integration:**
- Added route `user-profile/{userId}` to `app/src/main/java/com/myapp/navigation/AppNavGraph.kt`:
```kotlin
composable("user-profile/{userId}") { backStackEntry ->
val userId = backStackEntry.arguments?.getString("userId")
UserProfileScreen(userId = userId, onBackClick = { navController.popBackStack() })
}
```
**4. Feature Implementation:**
- Created `UserProfileViewModel.kt` in `feature-user-profile`:
```kotlin
class UserProfileViewModel(
private val getUserProfileUseCase: GetUserProfileUseCase,
savedStateHandle: SavedStateHandle
) : ViewModel() {
private val userId: String = savedStateHandle.get<String>("userId") ?: ""
val uiState = mutableStateOf<UserProfileUiState>(UserProfileUiState.Loading)
init {
viewModelScope.launch {
uiState.value = try {
UserProfileUiState.Success(getUserProfileUseCase(userId))
} catch (e: Exception) {
UserProfileUiState.Error(e.message ?: "Unknown error")
}
}
}
}
```
- Implemented `UserProfileScreen.kt` with Compose:
```kotlin
@Composable
fun UserProfileScreen(
userId: String,
onBackClick: () -> Unit,
viewModel: UserProfileViewModel = viewModel()
) {
val uiState by viewModel.uiState.collectAsState()
when (val state = uiState) {
is UserProfileUiState.Loading -> LoadingIndicator()
is UserProfileUiState.Success -> UserProfileContent(user = state.user, onBackClick)
is UserProfileUiState.Error -> ErrorMessage(state.message)
}
}
```
**5. Testing:**
- Unit test for `UserProfileViewModel`:
```kotlin
@Test
fun `ViewModel emits Success state when use case succeeds`() {
val useCase = mockk<GetUserProfileUseCase>()
val user = User("1", "John Doe", "[email protected]")
every { useCase(any()) } returns user
val viewModel = UserProfileViewModel(useCase, SavedStateHandle(mapOf("userId" to "1")))
assert(viewModel.uiState.value is UserProfileUiState.Success)
}
```
- UI test for `UserProfileScreen`:
```kotlin
@HiltAndroidTest
class UserProfileScreenTest {
@get:Rule
val composeTestRule = createComposeRule()
@Test
fun screen_displays_user_data() {
composeTestRule.setContent {
MyAppTheme {
UserProfileScreen("1", {})
}
}
composeTestRule.onNodeWithText("John Doe").assertExists()
composeTestRule.onNodeWithText("[email protected]").assertExists()
}
}
```
**6. Documentation:**
- Updated `README.md` under 'Module Additions':
```markdown
### User Profile Module
- **Purpose**: Display and manage user profile data
- **Dependencies**: Core UI, Core Domain, Navigation3
- **Testing**: Unit tests cover ViewModel logic; UI tests verify Compose rendering
- **Navigation**: Accessible via `user-profile/{userId}` route
```
**7. Next Steps:**
- Merge PR and run `./gradlew assembleDebug` to verify build
- Add feature to CI pipeline for automated testing
- Review with team for feedback on implementationAI assistant built for thoughtful, nuanced conversation
Get more done every day with Microsoft Teams – powered by AI
Automate security compliance and monitor real-time security posture seamlessly.
Automate your spreadsheet tasks with AI power
Agentic AI Workflow platform
Connected workspace for docs, wikis, and projects
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan