plugins/android-skills/skills/android-source-search/SKILL.md
Use when needing to fetch Android source code — AOSP platform internals (@hide APIs, framework classes, system services) or AndroidX/Jetpack library source and samples. Also use when public docs are insufficient to complete a task and implementation details must be read directly from source.
npx skillsauth add rcosteira79/android-skills android-source-searchInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Two separate source trees, two access strategies. AOSP lives on android.googlesource.com (Gitiles); AndroidX lives on GitHub. cs.android.com blocks automated fetching — it's for human browsing only.
If mcp__android-sources__* tools are available, always prefer them over WebFetch/gh. They provide local source with sub-10ms lookups:
| Goal | MCP tool |
|------|----------|
| Find a class by name/pattern | mcp__android-sources__search_classes (glob, e.g. *ViewModel*) |
| Read full class source | mcp__android-sources__lookup_class (by fully qualified name) |
| Read a specific method | mcp__android-sources__lookup_method (class + method name) |
| List members of a class | mcp__android-sources__list_class_members |
| Get class hierarchy | mcp__android-sources__get_class_hierarchy |
| Search text/regex across sources | mcp__android-sources__search_in_source |
| List AndroidX artifact versions | mcp__android-sources__list_available_versions |
| Go to definition (requires LSP) | mcp__android-sources__goto_definition |
| Find references (requires LSP) | mcp__android-sources__find_references |
| Get type info/hover (requires LSP) | mcp__android-sources__get_type_info |
If MCP tools are not available, fall back to the WebFetch/gh strategies below.
| You need... | Source | Access method |
|-------------|--------|---------------|
| Framework internals (View, Activity, system services) | AOSP | WebFetch → Gitiles |
| @hide APIs, internal constants, default attr values | AOSP | WebFetch → Gitiles |
| AndroidX/Jetpack source (androidx.*) | AndroidX GitHub | WebFetch → raw.githubusercontent.com |
| AndroidX samples (e.g. LookaheadScope, LazyColumn) | AndroidX GitHub | WebFetch → raw.githubusercontent.com |
| Directory listings (when path is unknown) | AndroidX GitHub | gh api via Bash |
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/{path}
https://android.googlesource.com/platform/frameworks/base/+/refs/heads/main/{path}?format=TEXT
| Repo | Path | Contains |
|------|------|----------|
| platform/frameworks/base | core/java/android/ | View, Activity, Context, etc. |
| platform/frameworks/base | services/core/java/ | System services (AMS, WMS, etc.) |
| platform/frameworks/base | core/res/ | Default attrs, styles, drawables |
| platform/libcore | ojluni/src/main/java/ | Java core libraries |
| platform/development | samples/ | AOSP sample apps |
android.view.ViewGroup → core/java/android/view/ViewGroup.java
https://raw.githubusercontent.com/androidx/androidx/androidx-main/{path}
gh api repos/androidx/androidx/contents/{path} --jq '.[].name'
| Library | Path prefix |
|---------|-------------|
| Compose UI | compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/ |
| Compose UI samples | compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/ |
| Compose Animation | compose/animation/animation/src/commonMain/kotlin/ |
| Compose Animation samples | compose/animation/animation/samples/src/main/java/ |
| Compose Foundation | compose/foundation/foundation/src/commonMain/kotlin/ |
| Navigation | navigation/navigation-compose/src/main/java/ |
https://raw.githubusercontent.com/androidx/androidx/androidx-main/compose/ui/ui/samples/src/main/java/androidx/compose/ui/samples/LookaheadScopeSamples.kt
cs.android.com as a human search UI to find the class/file pathraw.githubusercontent.com or list via gh api# Human search (not WebFetch — JS SPA)
https://cs.android.com/search?q=ClassName+methodName&ss=android
https://cs.android.com/search?q=ClassName&ss=androidx
| Goal | What to look for |
|------|-----------------|
| Default attribute value | mGroupFlags \|= or field initializer |
| @hide method signature | Full method with /** @hide */ Javadoc |
| Delegation to system service | getService() or IActivityManager calls |
| API level gating | Build.VERSION.SDK_INT >= Build.VERSION_CODES.X |
| AndroidX sample for an API | {ClassName}Samples.kt in the samples/ subpath |
master branch on Gitiles — prefer refs/heads/main; use a tag like android-14.0.0_r74 for specific API levels.android.googlesource.com; use GitHub raw URLs.raw.githubusercontent.com for file content, gh api for listings.development
Use when writing, fixing, or refactoring Android/KMP code in Kotlin — Android's three-tier test model, fake-first strategy, coroutine testing, and Compose UI testing, on a test-first (RED-GREEN-REFACTOR) foundation.
development
Use when debugging Android or KMP issues — Android-specific techniques covering Logcat, ADB, ANR traces, R8 stack trace decoding, memory leaks, Gradle build failures, and Compose recomposition bugs, on a root-cause-first foundation.
testing
Use when implementing paginated lists in Android or Compose with Paging 3 — PagingSource, Pager and PagingConfig setup, RemoteMediator for offline-first lists, LazyPagingItems and itemKey integration in LazyColumn, dynamic filters via flatMapLatest, and unit tests with TestPager and asSnapshot. Triggers include Paging 3, infinite list, infinite scroll, paginated list, LazyPagingItems, collectAsLazyPagingItems, and cachedIn.
development
Use when setting up or working with Koin in Android or KMP projects — module declarations with Classic DSL or KSP annotations, ViewModel injection in Compose, scopes, Nav 3 entry providers, application startup, and compile-time verification via `verify()`. Triggers on Koin, `single`, `factory`, `koinViewModel`, `koinInject`, `parametersOf`, `startKoin`, "KMP DI", "shared DI".