agentleFS
geevarghesekthomas84-sysgeevarghesekthomas84-sys/android-ai-engineering-system/skills/android-cli/SKILL.md

android-cli

Skill4 starsChanged 39 days agoMITView on GitHub

Expert-level Android development skill for Claude Code. Autonomously plans, develops, builds, tests, debugs, optimizes, and maintains Android applications using Kotlin, Jetpack Compose, and Material Design 3. Before any Android task, detect the available tools. Run the environment check script if uncertain: If ANDROID_HOME or JAVA_HOME are not set, use full paths or set them in the current session: If the android command is not in PATH, install or reinstall: After installation, restart the shell or add the install directory to…

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use navigation-3 and edge-to-edge.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • drewid74Skill

    navigation-3

    Learn how to install and migrate to Jetpack Navigation 3, and how to

    Also in 3 projects that use this

  • kid1412621Skill

    edge-to-edge

    Use this skill to migrate your Jetpack Compose app to add adaptive edge-to-edge

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 10 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 10

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before any Android task, detect the available tools.

    line 40
  2. Very specific:

    If ANDROID_HOME or JAVA_HOME are not set, use full paths or set them in the current session:

    line 62
  3. Very specific:

    If the android command is not in PATH, install or reinstall:

    line 73
  4. Distinctive:

    After installation, restart the shell or add the install directory to PATH.

    line 79
  5. Distinctive:

    When asked to build an Android application, follow this workflow:

    line 129
  6. Distinctive:

    Document the plan before writing code.

    line 142
  7. Very specific:

    Use android create for template-based projects:

    line 145
  8. Distinctive:

    Write Kotlin code following the architecture plan.

    line 153
  9. Distinctive:

    Follow the coding standards in the reference docs.

    line 156
  10. Distinctive:

    Read Gradle output carefully.

    line 169
  11. Distinctive:

    Check for hardcoded secrets, insecure storage, missing network security config.

    line 191
  12. Distinctive:

    Never claim success without execution results: Always show actual build output, test results, or error messages.

    line 203
  13. Very specific:

    Never invent Android CLI commands: Only use commands documented in the android --help output.

    line 205
  14. Distinctive:

    Never weaken security for convenience: Do not disable TLS validation, export components unnecessarily, or store secrets in plaintext.

    line 208
  15. Very specific:

    Inspect before modifying: Read existing project files, build.gradle.kts, and AndroidManifest.xml before making changes.

    line 212

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “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

Android Development Specialist

Expert-level Android development skill for Claude Code. Autonomously plans, develops, builds, tests, debugs, optimizes, and maintains Android applications using Kotlin, Jetpack Compose, and Material Design 3.

Environment Detection

Before any Android task, detect the available tools. Run the environment check script if uncertain:

& "$HOME/.claude/skills/android-cli\scripts\check-environment.ps1"

Known Environment Paths (Windows)

ToolPath
Android CLI${ANDROID_CLI_HOME}/android.exe
Android SDK${ANDROID_HOME}
Android CLI data$HOME/.android/cli
ADBSDK platform-tools\adb.exe
sdkmanagerSDK cmdline-tools\latest\bin\sdkmanager.bat
avdmanagerSDK cmdline-tools\latest\bin\avdmanager.bat
EmulatorSDK emulator\emulator.exe
Build toolsSDK build-tools\{version}\
Android StudioC:\Program Files\Android\Android Studio
JDK 21C:\Program Files\Java\jdk-21.0.12

If ANDROID_HOME or JAVA_HOME are not set, use full paths or set them in the current session:

$env:ANDROID_HOME = "${ANDROID_HOME}"
$env:JAVA_HOME = "C:\Program Files\Java\jdk-21.0.12"
$env:PATH = "${ANDROID_CLI_HOME};$env:ANDROID_HOME\platform-tools;$env:ANDROID_HOME\emulator;$env:ANDROID_HOME\cmdline-tools\latest\bin;$env:PATH"

Android CLI Installation

If the android command is not in PATH, install or reinstall:

curl -fsSL https://dl.google.com/android/cli/latest/windows_x86_64/install.cmd -o "%TEMP%\i.cmd" && "%TEMP%\i.cmd"

After installation, restart the shell or add the install directory to PATH.

Core Capabilities

1. Android CLI Commands

See references/android-cli-commands.md for the complete command reference including create, run, install, layout, screen, sdk, emulator, docs, studio, input, and more.

2. Kotlin & Jetpack Compose Development

See references/kotlin-development.md and references/jetpack-compose.md for patterns, architecture, and Material 3 implementation.

3. Architecture & Dependency Injection

See references/android-architecture.md for MVVM, Clean Architecture, Hilt, Navigation Compose, Room, Retrofit, and state management patterns.

4. Gradle Build System

See references/gradle-builds.md for build configuration, variants, signing, dependency management, and AGP setup.

5. Device & Emulator Management

See references/adb-device-management.md and references/emulator-management.md.

6. Debugging

See references/debugging.md for logcat, crash analysis, layout inspection, and network debugging.

7. Security Engineering

See references/android-security.md for OWASP MASVS compliance, secure storage, network security, and authorized security testing.

8. Testing & QA

See references/testing.md for JUnit, Compose UI testing, Espresso, and CI/CD integration.

9. Performance

See references/performance.md for profiling, memory optimization, and startup performance.

10. Troubleshooting

See references/troubleshooting.md for common errors and their solutions.

Autonomous Development Workflow

When asked to build an Android application, follow this workflow:

Step 1 — Understand Requirements

  • Clarify app purpose, target API levels, and required features.
  • Identify UI complexity (single screen vs multi-screen navigation).
  • Determine data sources (local DB, REST API, both).
  • Note any security or compliance requirements.

Step 2 — Plan Architecture

  • Choose architecture pattern (default: MVVM with Clean Architecture layers).
  • Identify modules: app, data, domain for larger apps.
  • Plan navigation graph.
  • Select dependencies (Hilt, Room, Retrofit as needed).
  • Document the plan before writing code.

Step 3 — Create Project

Use android create for template-based projects:

android create empty-activity --name="App Name" --namespace=com.example.app --output=./app-name

Or create manually with proper Gradle structure when templates don't fit.

Step 4 — Implement

  • Write Kotlin code following the architecture plan.
  • Build Compose UI with Material 3 theming.
  • Implement navigation, state management, data layers.
  • Follow the coding standards in the reference docs.

Step 5 — Build

# From project root
.\gradlew assembleDebug

Or use the build script:

& "$HOME/.claude/skills/android-cli\scripts\build-debug.ps1" -ProjectPath ".\app-name"

Step 6 — Diagnose Errors

  • Read Gradle output carefully. Do not claim success without clean output.
  • For common errors, consult references/troubleshooting.md.
  • Fix dependency conflicts, API incompatibilities, and Kotlin errors iteratively.

Step 7 — Deploy & Test

# Install and run on connected device/emulator
android run --apks=app/build/outputs/apk/debug/app-debug.apk
# Or via ADB
adb install -r app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n com.example.app/.MainActivity

Step 8 — Automated Testing

.\gradlew test              # Unit tests
.\gradlew connectedCheck    # Instrumentation tests (requires device)

Or use: & "$HOME/.claude/skills/android-cli\scripts\run-tests.ps1" -ProjectPath ".\app-name"

Step 9 — Security Review

  • Review AndroidManifest.xml for exported components and permissions.
  • Check for hardcoded secrets, insecure storage, missing network security config.
  • Run lint: .\gradlew lint

Step 10 — Release Build

.\gradlew assembleRelease   # APK
.\gradlew bundleRelease     # AAB for Play Store

Signing configuration must be set up in build.gradle.kts first.

Critical Rules

  1. Never claim success without execution results. Always show actual build output, test results, or error messages.
  2. Never invent Android CLI commands. Only use commands documented in the android --help output. When the CLI lacks a feature, use Gradle, ADB, or SDK tools instead.
  3. Never weaken security for convenience. Do not disable TLS validation, export components unnecessarily, or store secrets in plaintext.
  4. Never delete projects, reset devices, overwrite signing keys, or publish apps without explicit user approval.
  5. Inspect before modifying. Read existing project files, build.gradle.kts, and AndroidManifest.xml before making changes.
  6. Use actual installed tools. Detect what's available and use full paths when tools aren't in PATH.
  7. Prefer Gradle wrapper (gradlew/gradlew.bat) over system Gradle.
  8. Use android docs search to look up current Android API documentation when uncertain about API usage.

Quick Reference — Common Tasks

TaskCommand
Create projectandroid create empty-activity --name="MyApp" --output=./my-app
List templatesandroid create --list
Build debug APK.\gradlew assembleDebug
Build release AAB.\gradlew bundleRelease
Install APKandroid install --apks=path/to/app.apk
Run appandroid run --apks=path/to/app.apk
List devicesadb devices
Screenshotandroid screen capture -o screenshot.png
UI layout dumpandroid layout -p
Search docsandroid docs search "jetpack compose"
Install SDK pkgandroid sdk install platforms/android-35
List SDK pkgsandroid sdk list --all
Create emulatorandroid emulator create
Start emulatorandroid emulator start <name>
Run unit tests.\gradlew test
Run lint.\gradlew lint
Check environmentandroid info
Logcatadb logcat -v time *:W
Describe projectandroid describe --project_dir=./my-app

PowerShell Automation Scripts

Located in scripts/:

  • check-environment.ps1 — Detects installed Android tools and reports status.
  • build-debug.ps1 — Builds a debug APK with error handling.
  • run-tests.ps1 — Runs unit and instrumentation tests.
  • inspect-device.ps1 — Reports connected device status and properties.

Cross-Skill Orchestration

This skill is the entry point for Android development. For specialized tasks, identify and load the appropriate specialized skill:

Task DomainSkillWhen to Use
UI/UX Designandroid-ui-ux-designPremium design systems, Material 3 theming, responsive layouts, motion, design-to-code
Frontend Engineeringandroid-frontend-engineerCompose architecture, Navigation3, MVVM/MVI, Hilt DI, coroutines, networking
Backend APIsbackend-api-engineerREST APIs, NestJS/FastAPI, authentication, PostgreSQL, Docker
Database & Offlinedatabase-offline-syncRoom, DataStore, migrations, offline-first, sync, conflict resolution
Securityandroid-security-engineerOWASP MASVS, threat modeling, secure storage, network security, auth security
Security Labsandroid-security-lab-builderIntentionally vulnerable apps, CTF challenges, security training
Testing & QAandroid-testing-engineerJUnit, Compose tests, Espresso, screenshot testing, CI automation
Performanceapp-performance-engineerStartup optimization, Compose perf, memory, APK size, benchmarking
DevOps & Releasedevops-release-engineerCI/CD, signing, GitHub Actions, Docker, Play Console, monitoring
AI Integrationai-integration-engineerLLM APIs, chat UI, streaming, RAG, on-device ML, AI safety
Firebase/Supabasefirebase-supabase-engineerAuth, Firestore, Realtime DB, Cloud Functions, Supabase
Web Companionfullstack-web-engineerReact/Next.js dashboards, admin panels, web APIs
Product Architectureapp-product-architectRequirements, system design, tech selection, project planning

Orchestration Workflow Example

For a complex request like "Build a premium cybersecurity Android app with login, dashboard, backend, and database":

  1. app-product-architect — Define requirements, architecture, data models
  2. android-ui-ux-design — Create design system, screen layouts, theme
  3. android-frontend-engineer — Implement Compose screens, navigation, state
  4. backend-api-engineer — Build REST API, auth endpoints, Docker setup
  5. database-offline-sync — Design schema, implement Room, sync strategy
  6. android-security-engineer — Review auth, storage, network security
  7. android-testing-engineer — Write tests, set up CI
  8. devops-release-engineer — Configure builds, signing, deployment

Load skills as needed during the workflow. This skill handles the Android CLI commands, project creation, building, and emulator management throughout.

Example Projects

Located in examples/:

  • basic-compose-app/ — Minimal Jetpack Compose + Material 3 project scaffold.
  • secure-android-app/ — Security-hardened project with network security config, encrypted storage, and proper permission handling.

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.