Jetpack

From ithinkihaveacat/dotfiles · View interactive version

Jetpack is an AI agent skill from the GitHub repository ithinkihaveacat/dotfiles. Looks up AndroidX, Jetpack, Google Maven (Play Services, Play Billing, ML Kit, Firebase), and Maven Central library facts that change between releases: current artifact versions (ALPHA, BETA, RC, STABLE, SNAPSHOT, build IDs), Maven coordinates for top-level and nested classes, direct dependencies, p

How to use this skill

Skill file

Jetpack Library Utilities

Using the Jetpack Script vs. Raw Maven Queries

Use scripts/jetpack as the primary interface for resolving AndroidX, Jetpack,

Google Maven, and Maven Central library coordinates, versions, source locations,

and published Javadoc HTML. References to scripts/... in this skill are

relative to this skill directory. The script handles complex resolution logic

that manual queries miss:

Outer.Inner and Outer$Inner classes)

fallback for coordinate-addressed commands when no REPO_URL is supplied

fallback for closed-source SDKs that do not publish -sources.jar

The cache is the script's storage, not an interface. curl and xmllint

against dl.google.com are the obvious way to bypass the script, but reaching

into $JETPACK_CACHE_DIR with jq, unzip, jar, find, or grep bypasses

it just as completely — and offline, where the script is answering from that

same cache, it looks like the shortest path. It is not: the index and the cached

responses are raw upstream data, so reading them by hand skips the version-type

filtering, the class matching, and the platform-source detection listed above,

and returns something plausible with no sign that those steps were missed. Ask

the script the question, offline or not; browse the cache only to diagnose the

script itself.

When to read the script source: If the script doesn't do exactly what you

need, or fails due to missing dependencies, read the script source. It encodes

Maven repository URL patterns, version filtering logic, and package naming

heuristics—use it as reference when building similar functionality.

If the script fails, say so. A nonzero exit means the answer has not been

verified against live Maven data. Do not silently fall back to a remembered

version number or coordinate and present it as current — Jetpack versions change

often enough that a memorized answer can be confidently wrong. Report the

failure (missing dependency, network error, unresolved package) to the user,

including the script's own error message, and consult

references/troubleshooting.md before retrying.

If you have no network, say that too. In a sandbox that denies egress, run

scripts/jetpack doctor first: it reports whether the cache can answer at all.

Then set AGENT_OFFLINE=1 so the script serves cached answers instead of

spending timeouts on calls it cannot make. Every cached answer arrives with its

age on stderr ((cached 3 days ago)) — pass that age on rather than presenting

a stale version as current. A cache miss is an error quoting the command to

re-run where there is network; it is never a reason to answer from memory.

Quick Start

Requirements: curl, xmllint (libxml2-utils), jar (JDK), jq, perl.

Highest-Value Commands

scripts/jetpack inspect androidx.wear.tiles.TileService

scripts/jetpack inspect com.google.android.gms.wearable.NodeClient.OnNodeMigratedListener

scripts/jetpack javadoc --find BillingClient com.android.billingclient:billing

scripts/jetpack version androidx.wear.tiles:tiles STABLE

scripts/jetpack resolve androidx.lifecycle.ViewModel

scripts/jetpack source androidx.compose.ui:ui SNAPSHOT

scripts/jetpack-samples androidx.compose.remote:remote-creation-compose

scripts/jetpack-samples androidx.wear.compose:compose-material3 1.7.0-rc01

Subcommand Overview

`version`

package.

`list versions`

`resolve`

Outer$Inner) whose enclosing top-level class is in the cached Google Maven

index (androidx.*, com.google.android.*, com.android.billingclient.*,

etc.); use search for packages and Kotlin top-level functions. Maven Central

libraries are not in the class index — pass their GROUP:ARTIFACT coordinate

directly to version, list, source, javadoc, or inspect.

`search`

artifacts pass GROUP:ARTIFACT directly to coordinate commands.

`source`

locate specific files.

pointing to scripts/jetpack javadoc.

`javadoc`

-javadoc.jar archives (useful for closed-source Google Maven or Maven

Central SDKs without -sources.jar).

locate matching class HTML pages (including Outer.Inner / Outer$Inner).

exit status. When --find resolves to a single .html file ≤ 64 KiB, its

contents are printed to stdout; larger pages print the extracted file path to

stdout (with a size note on stderr) so callers can search or read targeted

line ranges.

`inspect`

automatic fallback to javadoc when -sources.jar is not published.

scripts/jetpack inspect [OPTIONS] CLASS_NAME|GROUP:ARTIFACT [VERSION] [REPO]

names; falls back to an index search if direct resolution fails, and falls

back to -javadoc.jar (logging an info: provenance notice on stderr) when

-sources.jar returns HTTP 404. For Maven Central libraries (which are not in

the Google Maven class index), pass GROUP:ARTIFACT directly (or use

scripts/jetpack source --find <Class> GROUP:ARTIFACT /

scripts/jetpack javadoc --find <Class> GROUP:ARTIFACT).

`list dependencies`

`doctor`

Standalone Scripts

`scripts/jetpack-samples`

VERSION (or release tier like STABLE, RC, BETA, ALPHA) is specified,

it resolves the exact Git commit SHA from AndroidX release notes to match the

released artifact. If omitted, extracts samples from androidx-main (HEAD).

Version Types

Symbolic (Floating)

Resolves to the latest matching version at runtime.

Pinned (Immutable)

Always resolve to the exact same code.

androidx.dev/snapshots/builds).

Common Workflows

Inspecting a Class Implementation

cd "$(scripts/jetpack inspect androidx.wear.tiles.TileService)"
# Browse source files...

Finding a Library

# Find libraries related to 'wear.compose'
scripts/jetpack search androidx.wear.compose

# Find which artifact contains 'RemoteImage'
scripts/jetpack search RemoteImage

Checking Available Versions

# List all versions
scripts/jetpack list versions androidx.wear.tiles:tiles

# Check specific version types
scripts/jetpack version androidx.wear.tiles:tiles ALPHA
scripts/jetpack version androidx.wear.tiles:tiles SNAPSHOT

Working with Bleeding-Edge Code

scripts/jetpack source androidx.compose.remote:remote-creation-compose SNAPSHOT

Finding Maven Coordinate

scripts/jetpack resolve androidx.core.splashscreen.SplashScreen
# Output: androidx.core:core-splashscreen

Working Without Network (CI, Sandboxed Agents)

Every online run writes what it fetched into

${JETPACK_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/jetpack}, so preparing

for an offline run means nothing more than asking the same question once where

there is network:

# Where there is network: ask, and the answers are cached as a side effect
scripts/jetpack version androidx.wear.tiles:tiles
scripts/jetpack inspect androidx.wear.tiles.TileService

# Where there is not: the same commands answer from the cache
AGENT_OFFLINE=1 scripts/jetpack doctor       # is the cache good enough?
AGENT_OFFLINE=1 scripts/jetpack version androidx.wear.tiles:tiles
AGENT_OFFLINE=1 scripts/jetpack inspect androidx.wear.tiles.TileService

A miss quotes the command to re-run, so the fix is always the invocation that

just failed.

The sandbox that denies egress usually denies writes too, so the lookups read

straight from the cache and need no writable filesystem at all: version,

list versions, list dependencies, resolve, and search all answer with

nowhere to write. source, javadoc, and inspect are the exception — they

extract a JAR, so they need somewhere to put it; pass --output DIR naming a

writable directory when the default temp location is not one.

See local HTTP caching guidelines (storing response artifacts locally under

$XDG_CACHE_HOME) for the repo-wide convention.

Safety Notes

androidx.dev — or a cache warmed by an earlier online run, plus

AGENT_OFFLINE=1.

(version, list versions, list dependencies, source, javadoc, and

inspect GROUP:ARTIFACT) query Google Maven first and automatically fall back

to Maven Central (https://repo1.maven.org/maven2) on a 404 when no explicit

REPO_URL is given (never for SNAPSHOT or numeric build IDs), logging an

info: notice on stderr. resolve and search only query the cached Google

Maven class index; pass GROUP:ARTIFACT directly for Maven Central libraries.

stderr. Report that age; do not present a stale version as the latest.

reproducibility.

platform-specific sources (e.g., -android, -desktop) if detected in the

POM.

Reference Material

subcommands. See references/command-index.md.

search failures. See

references/troubleshooting.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.