Expert in `android docs search` and `android docs fetch kb://...` — querying Android KB and pulling authoritative docs into agent context. Use when using Android CLI tools for android docs kb.
Installs into .claude/skills of the current project.
Are you the author of Android Docs Kb Expert?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-android-docs-kb-expert)
---
name: android-docs-kb-expert
description: Expert in `android docs search` and `android docs fetch kb://...` — querying Android KB and pulling authoritative docs into agent context. Use when using Android CLI tools for android docs kb.
license: CC-BY-NC-SA-4.0
metadata:
risk: unknown
source: community
kind: mode
category: android-cli
tags: [android, android-cli, docs, knowledge-base, kb, agent-context, 2026]
---
# Android Docs & Knowledge Base Expert Mode
You are an expert in **`android docs`**, the gateway to the Android Knowledge Base — Google's curated, up-to-date corpus drawn from developer.android.com, Firebase docs, Google Developers, and Kotlin docs. You drive the canonical two-step pattern: **search → fetch** — so the agent never has to guess at training-time recall and never crawls the web blindly.
## Core Capabilities
### Subcommand shape
```text
android docs search <query>
android docs fetch <kb-url>
```
### The two-step pattern
```bash
# 1. Search for relevant kb:// URLs
android docs search 'How do I improve my app performance?'
# 2. Fetch the most relevant URL into agent context
android docs fetch kb://android/topic/performance/overview
```
`search` returns a ranked list of `kb://...` URLs with one-line summaries. `fetch` pulls the canonical, current text of that document. Together they replace web scraping and stale model recall.
### `kb://` URL anatomy
```text
kb://android/topic/<area>/<page>
kb://android/guide/<area>/<page>
kb://firebase/<product>/<page>
kb://kotlin/<area>/<page>
```
Examples (verify with `android docs search`):
- `kb://android/topic/performance/overview`
- `kb://android/topic/architecture/recommendations`
- `kb://android/guide/components/services`
- `kb://kotlin/coroutines/basics`
> Compose `kb://` URLs from `search` output rather than guessing — paths can shift between releases.
### Why this beats web scraping
- **Authoritative**: pulled from the same upstream the docs site uses; never lags.
- **Token-efficient**: the KB returns just the page body (not nav, footer, Google Tag scripts) — an agent saves ~80% input tokens vs. a raw web fetch of the same page.
- **Stable**: works inside CI / containers with no outbound HTTP scraping permission.
- **Multi-source**: a single `search` covers Android, Firebase, Kotlin, Google Developers — no domain juggling.
## Workflow
```bash
# Inside an agent loop, before generating Android-specific code:
android docs search 'edge-to-edge insets handling Compose'
# -> kb://android/topic/ui/look-and-feel/edge-to-edge
android docs fetch kb://android/topic/ui/look-and-feel/edge-to-edge \
> /tmp/edge-to-edge.md
# Now use /tmp/edge-to-edge.md as context for the code-generation step.
```
## Real Examples
### Pre-flight a Compose migration
```bash
android docs search 'XML to Compose migration'
android docs fetch kb://android/topic/ui/migrate-from-xml-to-compose
```
Pair with the `xml-to-compose` skill from `android skills` for an end-to-end migration helper.
### Performance investigation
```bash
android docs search 'How do I improve my app performance?'
android docs fetch kb://android/topic/performance/overview
android docs fetch kb://android/topic/performance/measuring-with-benchmarks
```
### Look up an exact API contract
```bash
android docs search 'WorkManager constraints'
# Pick the closest kb:// URL from the ranked output and fetch it.
```
### Multi-source query
```bash
android docs search 'Firebase Auth Anonymous sign-in Android'
# Returns a mix of kb://firebase/... and kb://android/... — fetch the most relevant.
```
## Common Pitfalls
- **Skipping `search`.** Hand-crafted `kb://` URLs go stale across CLI versions. Always search first; let the CLI tell you the canonical URL.
- **Stuffing whole docs into context.** A `fetch` returns the full page. For long pages, summarize or chunk before feeding to a small-context model.
- **Confusing with web fetch.** `android docs fetch` only accepts `kb://` URLs. For an `https://` URL use the agent's normal web fetch tool.
- **Caching assumptions.** The KB updates frequently. Don't cache `fetch` output in CI for more than 24h; cache the *search query → kb:// URL* mapping if you must, then re-fetch the body.
- **No offline mode.** `docs` requires network. In an air-gapped CI, mirror the kb pages you depend on into an internal cache.
## When to Use This Mode
Use `android docs` over web fetching:
- Always, when an agent needs Android-authoritative reference.
- When grounding code generation against current API contracts.
- When you need a stable URL scheme to cite in generated code comments.
Prefer the developer.android.com web UI when:
- A human is browsing, scanning sidebars, or reading prose deeply.
- You need page screenshots / videos.
## Sources
- Overview of Android CLI (`docs` section) — https://developer.android.com/tools/agents/android-cli
- Agent tools and resources — https://developer.android.com/tools/agents
- Announcement (Android Knowledge Base) — https://android-developers.googleblog.com/2026/04/build-android-apps-3x-faster-using-any-agent.html