Agent skill

Test Metro Ide Locally

by ZacSweers in ZacSweers/metro

Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project.

Apache-2.0Auto-check passedMobile

Install Test Metro Ide Locally

skills CLI
$ npx skills add ZacSweers/metro --skill test-metro-ide-locally -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ZacSweers/metro test-metro-ide-locally --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ZacSweers/metro.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/test-metro-ide-locally .claude/skills/test-metro-ide-locally && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
test-metro-ide-locally
GitHub stars
1.4k
Token cost
~3k tokens
SKILL.md length
1,475 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project.

  • IDE behavior checks
  • SKILL.md covers Match the runs, Launch through the runner, Bind UI control and finish… and Load graph data and record a…, plus 2 more sections
  • Calls osascript
  • Refresh performance traces

What it does

Test Metro Ide Locally is an agent skill from ZacSweers/metro. Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project. Use for IDE behavior checks, refresh performance traces, or baseline/change comparisons with runLocalIde.

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Mobile. It works with Gradle. The repository describes itself as: A multiplatform, compile-time dependency injection framework for Kotlin. The licence is Apache-2.0.

When your agent uses it

  • IDE behavior checks
  • Refresh performance traces
  • Baseline/change comparisons with runLocalIde

Example prompts

  • “/test-metro-ide-locally”

What it can do on your machine

Read from SKILL.md and the folder at commit ba2f45f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • osascript

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • plugins.jetbrains.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Test Metro Ide Locally loads about 3k tokens when it runs. Until then it costs about 54 tokens; SKILL.md has 1,475 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~54
When it runs · the whole SKILL.md, loaded when a task matches
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ZacSweers/metro at commit ba2f45f, republished under its Apache-2.0 licence (© ZacSweers). 1,475 words, ~3,003 tokens.

Download SKILL.mdSave it as .claude/skills/test-metro-ide-locally/SKILL.md (or your agent's skills folder).
name
test-metro-ide-locally
description
Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project. Use for IDE behavior checks, refresh performance traces, or baseline/change comparisons with runLocalIde.

Test Metro IDE Locally

Use the repository's runLocalIde runner for every IDE session in this workflow. It installs the plugin built from the chosen Metro checkout into a sandbox. Keep the runner session alive while using that IDE. The runner pre-installs the checkout's plugin. No Marketplace or disk installation is needed.

Match the runs

Record the Metro commit and dirty worktree state, consumer checkout, graph declaration, IDE build, Java runtime, heap, and Metro settings. Use the same consumer source and installed IDE runtime for baseline and comparison runs. Keep their sandbox directories separate.

Decide whether the measurement covers initial import/indexing, the first graph refresh after startup, or repeated warm refreshes. Compare the same state on both sides. Record any previous refreshes and source edits. Preserve existing caches unless the user requested a fresh sandbox. A restarted IDE can still have warm persistent indexes.

For a large Android project, allocate an 8g IDE heap before its first import. Match the heap on both runs. IDE heap and Gradle daemon heap are separate settings.

Launch through the runner

From the Metro repository root:

bash
scripts/run-local-ide.sh \
  --ide-path "/Applications/Android Studio.app" \
  --project /path/to/consumer \
  --heap 8g

The runner script defaults to an 8g IDE heap. Use --repo /path/to/baseline/metro to run another Metro checkout with the same helper. --ide-path selects the runner's installed IDE runtime. The script passes the project to runLocalIde and prints the effective heap and sandbox locations. Read its --help for optional Gradle arguments.

Verify the launched process's heap and log path. Use the runner's reported paths; sandbox layouts vary by IDE and Gradle plugin version. An observed layout is idea-plugin/.intellijPlatform/sandbox/metro-idea-plugin/<IDE-build>/log_runLocalIde.

Never launch the installed IDE directly during this workflow. This includes open -a, app bundle executables, and using CUA getApp with an Android Studio name, bundle ID, or path to launch it. Those routes can open the user's normal IDE profile without the sandbox plugin.

Bind UI control and finish import

Inspect the available running surfaces before binding UI automation. Confirm that the selected window belongs to the runner process and contains the intended project. getApp can launch an app, so an installed IDE name or path alone does not establish the sandbox window's identity.

If native inventory reports a locked Mac, ask the user to unlock it and keep the existing runner. A locked session can return zero accessibility windows for a live IDE.

If CUA cannot bind the runner, use process-targeted AppleScript when authorized. First identify the live runner PID and verify its command line with ps -p "$runner_pid" -o pid=,command=. Confirm the expected IDE Java executable and this run's sandbox arguments. Recheck after every runner restart. A process name such as java or MainWrapper is insufficient to identify the sandbox.

Pass that verified PID to System Events. This reads the existing process and its windows:

bash
osascript - "$runner_pid" <<'APPLESCRIPT'
on run argv
  set runnerPid to (item 1 of argv) as integer
  tell application "System Events"
    set runnerProcess to first application process whose unix id is runnerPid
    return {name of runnerProcess, name of every window of runnerProcess}
  end tell
end run
APPLESCRIPT

Wait for the expected onboarding or project window before acting. Scope direct accessibility button clicks, value changes, and row selection to that same process selector. Avoid name-only getApp("Android Studio"); it can launch the normal installed app. If the process exits, identify and verify the new runner PID. If authorization or accessibility access is unavailable, report the blocker and continue read-only log inspection.

Never use System Events keystroke or key code, even inside a process-targeted tell block. These commands use global keyboard focus and can act on another app. Never use global CGEventPost or any other focus-based keyboard fallback.

For a popup that needs Return, read the verified PID's current accessibility popup and set selected of the observed target row to true. Recheck the runner PID and send Return directly to it with this helper. Use key code 53 for Escape when dismissing an observed runner popup.

bash
runner_keycode=36 # Return; use 53 for Escape.
osascript -l JavaScript - "$runner_pid" "$runner_keycode" <<'JXA'
ObjC.import('CoreGraphics');
function run(argv) {
  const runnerPid = Number(argv[0]);
  const keyCode = Number(argv[1]);
  if (!Number.isInteger(runnerPid) || runnerPid <= 0 || ![36, 53].includes(keyCode)) {
    throw new Error('Pass a verified runner PID and Return or Escape key code.');
  }
  const source = $.CGEventSourceCreate($.kCGEventSourceStatePrivate);
  for (const isDown of [true, false]) {
    const event = $.CGEventCreateKeyboardEvent(source, keyCode, isDown);
    $.CGEventSetFlags(event, 0);
    $.CGEventPostToPid(runnerPid, event);
  }
}
JXA

Keep the private event source and zero flags. Null-source events had no effect in this runner. Verify the expected popup result through the same PID's accessibility state. If delivery fails, stop keyboard attempts and inspect the runner. Do not switch to global keyboard delivery.

Complete first-run onboarding in the sandbox, open the supplied project, and let Gradle sync finish. Check the sync result and IDE indexing status. An open editor does not prove that project import succeeded. Resolve or report sync errors before collecting performance results. Wait for smart mode and idle indexing before measuring a graph refresh. Keep first-import timing separate.

Show full SKILL.md (771 more words)Show less

Load graph data and record a refresh

Read Performance Tracing for the current capture behavior. In Settings > Tools > Metro, open Debugging/Experimental and enable Enable debugging options. Match these settings between runs:

  • Analysis pool size; use 1 unless the comparison calls for another value.
  • Include thread activity; leave it off for the basic timing comparison.
  • Resolve bindings from compiled dependencies.
  • Automatically refresh graphs and bindings after code changes.
  • Automatically validate the pinned graph after code changes.

Automatic refresh and validation can add overlapping work. Set them consistently and record the chosen values. Debugging must stay enabled for the configured analysis pool size to apply.

Open View > Tool Windows > Metro. Refresh loads graph contexts across the project. The graph selector filters the displayed context and its extensions. Record the chosen context for validation and navigation checks. For a first-refresh measurement, start with Refresh with tracing before any untraced load. For a warm measurement, let the initial refresh finish before starting a capture.

For refresh timing, use More > Refresh with tracing in the Metro tool window. This menu provides the preferred accessible route. The same action is available by right-clicking Refresh and choosing Refresh with tracing. It starts recording, submits the refresh, awaits completion, saves the trace, and opens the result. Let that flow finish. It needs no manual Start/Stop actions or Refresh-button polling.

The capture creates an empty metro-ide-*.perfetto-trace in the runner's IDE log directory at startup. File existence alone does not establish completion. Wait for the automatically opened trace or a saved nonempty capture with the completion metadata below. If UI automation cannot invoke the action, resolve that interaction before continuing the timing experiment. Preserve the intended capture mode.

Run one capture at a time. Verify the previous capture's completion metadata before invoking the next refresh. Java accessibility can report popup rows as enabled while their actions are disabled, so an AX enabled value does not establish readiness. Re-read the current popup labels and confirm Refresh with tracing before selecting its row.

Require the refresh operation's outcome to be published and capture.finish to have stop_reason=completed and partial=false for a successful measured refresh. A failed refresh can finish recording normally. The 10-minute capture deadline can produce a partial trace; report it as partial. Check dropped_events too. The detail timeline holds 20,000 events. Current builds retain up to 1,024 additional enclosing/completion records separately. Earlier builds can lose those records when the detail budget fills, even when partial=false. Missing completion metadata leaves publication and elapsed time unverified. capture.overview measures retained events and cannot fill that gap.

Use Start Metro Performance Trace for operations outside an explicit refresh, such as editor navigation. Begin recording before triggering the operation. Its recording status is Tracing enabled…. It automatically ends admission after 60 seconds and saves once admitted work drains; Stop Metro Performance Trace can end admission sooner. Account for graph work that happened before recording and use the same capture mode on both sides. These captures require their own completeness checks.

Refresh being enabled only establishes that no explicit refresh remains pending. Hidden status panels retain their old text, so accessibility output can include stale progress messages. Check visible graph and binding rows as UI evidence. Confirm publication through the trace outcome.

Read refresh and indexing costs separately

In Perfetto, use debug.operation, debug.operation_id, and debug.parent_operation_id to follow operations. For Refresh with tracing, measure the enclosing refresh duration. Manual captures can contain index.candidate operations; check for outcome=published and report that narrower measurement boundary. Inspect source scanning, class resolution, cache counts, and cancellation/retry details to explain the change. Parent spans include their children. Concurrent worker durations can overlap; summed stage or item durations can exceed elapsed refresh time.

IDEA also writes indexing diagnostics under the runner log directory. Inspect indexing-diagnostic/<project>/diagnostic-*.json and the adjacent HTML report. For type == "DumbIndexing", inspect projectIndexingActivityHistory.totalStatsPerIndexer[] and identify each measured index by its ID.

Record totalNumberOfFiles, totalFilesSize, and partOfTotalIndexingTime.part / 1e6 in milliseconds. That duration accumulates indexer wall time across worker threads. The JSON also uses the legacy field name totalCpuTime; the HTML describes these measurements as wall time. Keep this accumulated work separate from times.totalWallTimeWithoutPauses and user-visible refresh latency. Shared file loading and index application overhead are separate totals. An absent entry in a warm session does not establish zero maintenance cost.

Report evidence

Provide the matched runtime/settings, source revisions and dirty state, graph, cache state, completed or partial outcome, trace paths, and indexing-report paths. Compare elapsed refresh time and relevant work counts. Verify that the expected graph and representative binding navigation still work. Describe any uncompleted import, UI-binding, or capture step explicitly. Keep accumulated indexer work and elapsed indexing duration separate when explaining a speedup.

© ZacSweers, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/test-metro-ide-locally of ZacSweers/metro.

Open the folder on GitHubat commit ba2f45f

Compare with similar skills

Test Metro Ide Locally next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Test Metro Ide Locally compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Test Metro Ide Locally this skillZacSweers/metro1.4k—~3kAutomated safety check: PassApache-2.0
Gradle Runchrisbanes/skills1.1k—~1.2kAutomated safety check: PassApache-2.0
Gradle Buildchampionswimmer/TwoFac130—~1.2kAutomated safety check: PassNone
Kuikly Multi Module ConfigTencent-TDS/KuiklyUI-AI130—~1.2kAutomated safety check: PassCustom licence
Configuring Test Dependenciesskydoves/android-testing-skills334—~4.1kAutomated safety check: PassApache-2.0
Android API Diffgkd-kit/gkd43k—~796Automated safety check: PassGPL-3.0

Similar skills

  • Gradle Run

    chrisbanes/skills

    A skill your agent uses when planning to execute Gradle through gradle, ./gradlew, or a custom gradlew wrapper script, or diagnosing a Gradle build, compact workflow ledger, repeated failure…

    1.1k GitHub stars~1.2k tokensUpdated today
    MobileAuto-check passed
  • Gradle Build

    championswimmer/TwoFac

    Use Gradle commands to build and run the app by platform. An agent skill from championswimmer/TwoFac.

    130 GitHub stars~1.2k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Kuikly Multi Module Config

    Tencent-TDS/KuiklyUI-AI

    Kuikly 多模块工程配置助手。指导如何创建 Kuikly 子模块、配置多模块。当用户需要创建新 Kuikly 子模块、配置多模块参数、解决 KuiklyCoreEntry 入口类冲突时使用。

    130 GitHub stars~1.2k tokensUpdated 2 mo ago
    MobileAuto-check passed
  • Configuring Test Dependencies

    skydoves/android-testing-skills

    A skill your agent uses to wire the correct Gradle dependency matrix for Jetpack Compose UI tests.

    334 GitHub stars~4.1k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Android API Diff

    gkd-kit/gkd

    Looks up Android framework Java and AIDL APIs across versions with the android-api-diff CLI: signatures, availability, source files and hidden-API access code.

    43k GitHub stars~796 tokensUpdated today
    MobileAuto-check passed
  • Android Development

    dpconde/claude-android-skill

    Create production-quality Android applications following Google's official architecture guidance and NowInAndroid best practices.

    336 GitHub stars~1.7k tokensUpdated 10 mo ago
    MobileAuto-check passed

More from ZacSweers/metro

  • Analyze Perfetto Trace

    ZacSweers/metro

    Query and analyze Metro's perfetto compiler traces to find real hot spots and untraced time.

    1.4k GitHub stars~2.7k tokensUpdated today
    Auto-check passed
  • Test Metro Locally

    ZacSweers/metro

    Publish the current Metro checkout to Maven Local and verify it in an external consumer or reproducer.

    1.4k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Add Compiler Option

    ZacSweers/metro

    Adds a new compiler option to Metro.

    1.4k GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Test Metro Ide Locally

What does Test Metro Ide Locally do?

Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project. Test Metro Ide Locally is an agent skill from ZacSweers/metro. Run Metro's IDE plugin from source in a sandboxed local IDE against a consumer project.

When should I use Test Metro Ide Locally?

Test Metro Ide Locally fits situations like: IDE behavior checks; refresh performance traces; baseline/change comparisons with runLocalIde.

How do I install Test Metro Ide Locally in Claude Code?

Run `npx skills add ZacSweers/metro --skill test-metro-ide-locally -a claude-code`. Or copy the skill folder (.agents/skills/test-metro-ide-locally in ZacSweers/metro) into .claude/skills/test-metro-ide-locally in your project. Claude Code loads it when a task matches its description.

How do I install Test Metro Ide Locally in Codex?

Run `npx skills add ZacSweers/metro --skill test-metro-ide-locally -a codex`. Or copy the skill folder (.agents/skills/test-metro-ide-locally in ZacSweers/metro) into .agents/skills/test-metro-ide-locally in your project. Codex loads it when a task matches its description.

Can I use Test Metro Ide Locally in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ZacSweers/metro --skill test-metro-ide-locally -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/test-metro-ide-locally, .gemini/skills/test-metro-ide-locally, .github/skills/test-metro-ide-locally and .opencode/skills/test-metro-ide-locally in your project.

What does Test Metro Ide Locally need to run?

Going by SKILL.md and its folder, Test Metro Ide Locally needs the command-line tools its instructions call (osascript).

Does Test Metro Ide Locally access the network?

SKILL.md names 1 domain. As links in the text: plugins.jetbrains.com. This is read from the text; nothing was executed.

Is Test Metro Ide Locally safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Test Metro Ide Locally use?

Test Metro Ide Locally is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Test Metro Ide Locally use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Test Metro Ide Locally?

Skills that share tags, products or a category with Test Metro Ide Locally: Gradle Run (chrisbanes/skills, 1.1k stars), Gradle Build (championswimmer/TwoFac, 130 stars), Kuikly Multi Module Config (Tencent-TDS/KuiklyUI-AI, 130 stars) and Configuring Test Dependencies (skydoves/android-testing-skills, 334 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Test Metro Ide Locally?

ZacSweers (a GitHub user) maintains it in ZacSweers/metro, which has 1,408 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 11, 2026.

Source: ZacSweers/metro on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.