---
name: android-engineering
description: >
  Android engineering guidance covering security auditing, performance and
  UI rendering investigation, Kotlin/Compose/Views architecture, Gradle
  build and CI practices, and end-to-end feature implementation. Use when
  working in an Android, Kotlin, or Gradle project: auditing app security
  against OWASP MASVS, investigating jank, dropped frames, ANRs, or slow
  startup, reviewing an Android pull request, optimizing a Gradle build,
  or implementing a new feature. Works with Jetpack Compose or XML Views,
  any architecture (MVVM, MVI, or whatever the project already uses), and
  any build/CI setup. Does not activate for non-Android or non-Gradle tasks.
license: Apache-2.0
compatibility: Designed for Claude Code or any Agent Skills-compatible client; some body features (shell injection, dynamic variables) are Claude Code-specific.
metadata:
  version: "0.2.0"
---

# Android Engineering

Consolidated, evidence-based Android engineering guidance: security, performance/rendering, architecture/Kotlin/UI, Gradle/testing/CI, and feature development. This skill **integrates** existing Android, Kotlin, Gradle, and OWASP guidance into repeatable workflows — it does not replace official documentation, static analysis tools, runtime testing, or a professional security review. See `docs/SOURCE_MAPPING.md` in this repository for what informed each reference file.

## Important

- **Evidence over assumption.** State what you verified (file read, command run, profiler trace) vs. what you're inferring. Flag anything that needs external/runtime confirmation.
- **Measure before claiming a performance win.** No optimization is "done" without a before/after measurement and the conditions it was measured under (device, build type, repetitions).
- **Don't force architecture or libraries the project doesn't already use.** No introducing Compose, Hilt, MVI, or any other pattern/dependency into a codebase that doesn't already have it, unless the user explicitly asks for that migration.
- **Never report a test as passing unless it actually ran** and you saw the output. Report real failures and risks, not optimistic summaries.
- A security or performance checklist here is a **structured review aid**, not a penetration test, certification, or substitute for a human security/performance expert.

## Which reference to read

Read only the reference file(s) that match the current task. Do not load every reference for every request — each is self-contained and cites its own sources.

| Task looks like... | Read |
|---|---|
| Manifest/permissions review, exported components, deep links, WebView, network security config, secrets/crypto, storage/logging/backup privacy, dependency/supply-chain risk, release signing, "security audit", "OWASP" | `references/security.md` |
| Jank, dropped frames, slow scrolling, ANRs, slow cold/warm startup, Compose recomposition cost, RecyclerView/LazyColumn tuning, memory/allocations, "why is the UI slow", profiling | `references/performance-rendering.md` |
| Kotlin idioms, coroutines/Flow, architecture pattern questions (MVVM/MVI/UDF), Compose vs. XML Views, state management, accessibility, general code review of UI/domain/data layers | `references/architecture-kotlin-ui.md` |
| Gradle build times, AGP/Kotlin/version-catalog upgrades, build/config cache, multi-module/convention plugins, unit/instrumented tests, Lint/Detekt/coverage, CI pipeline, signing/artifacts | `references/gradle-testing-ci.md` |
| "Implement feature X", "add a screen/endpoint/flow", scoping a new change end to end | `references/feature-development.md` |

Several references may apply (e.g., a PR review often touches architecture and performance) — read each relevant file once, not the whole set by default.

## Feature development workflow

For "implement X" requests, follow this loop (full detail, worked example, and edge cases — XML-only projects, multi-module, no-DI — are in `references/feature-development.md`):

1. **Inspect** the relevant existing files before writing anything.
2. **Understand** the project's actual conventions and architecture — don't assume a blueprint it doesn't use.
3. **Identify** requirements and edge cases from the request and the surrounding code.
4. **Propose a minimal plan** scoped to what was asked.
5. **Implement only the requested scope** — no incidental refactors or unrequested abstractions.
6. **Add tests** that match the project's existing test conventions.
7. **Run the relevant validation commands** (build, lint, tests) and capture real output.
8. **Report**: changed files, actual test results, risks, and what's left undone.

## Standard vs. client-specific skill features

This file's frontmatter is written to satisfy the open [Agent Skills specification](https://agentskills.io/specification) (`name`, `description`, `license`, `compatibility`, `metadata`) so the skill is portable across any compliant client. [Claude Code's skill documentation](https://code.claude.com/docs/en/skills) adds client-specific fields and body features (e.g. `when_to_use`, `allowed-tools`, shell injection via `` !`cmd` ``, `${CLAUDE_*}` variables) that this skill does not rely on — do not assume another client supports them.
