jayvinz-tools
Claude Code plugins for Android UI inspection, layout debugging, and UI-to-code navigation.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/jayvinz--layout-inspector-android)HTML
<a href="/listings/jayvinz--layout-inspector-android"><img src="/api/listings/jayvinz--layout-inspector-android/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
Prerequisites
- Node.js ≥ 20 (required by the plugin / MCP / CLI) - Android platform-tools: `adb` on `PATH`, or set `DLI_ADB` / `ADB_PATH` - A device or emulator with USB debugging enabled; the target app running in the foreground - The `view` / `compose` sources require a debuggable build (`android:debuggable=true`); `semantics` has no such requirement - For the Claude Code plugin, Claude Code must be able to invoke `node` / `npm` from `PATH`
1. Install the Claude Code plugin (recommended)
/plugin marketplace add Jayvinz/layout-inspector-android /plugin install layout-inspector-android@jayvinz-tools
After installation you get:
| Component | Content | |---|---| | MCP server `layout-inspector-android` | `dump_ui`, `find_elements`, `locate_code`, `hit_test`, `analyze_ui`, `screenshot`, `diff_ui`, `tap`, and more | | Slash commands | `/layout-inspector-android:locate` (UI→source location), `:screen` (current screen summary), `:verify` (verify UI changes on device) | | Skills | `locate-ui-code`, `verify-ui-change` | | Read-only subagent | `ui-code-locator` |
Use `/mcp` to confirm the server is loaded; `/help` lists the commands above.
**Local development/debugging**: run `npm install && npm run build` in the repository root first, then point the marketplace at your local path:
/plugin marketplace add E:/repo/layout-inspector-android /plugin install layout-inspector-android@jayvinz-tools
See [docs/plugin.md](docs/plugin.md) for the component list, publishing, and versioning.
2. Connect the MCP server (other clients)
node dist/cli.js mcp --print-config
Put the printed config into your client's MCP configuration (for example `.mcp.json` at the Claude Code project root):
{
"mcpServers": {
"layout-inspector-android": {
"command": "node",
"args": ["E:/repo/layout-inspector-android/dist/mcp.js"]
}
}
}See [docs/mcp.md](docs/mcp.md) for the tool list, parameters, and the recommended call order.
3. Use the CLI
npm install && npm run build npm link # provides the global layout-inspector command layout-inspector devices # connected devices layout-inspector state # screen, foreground app, pid layout-inspector dump # capture the current UI (auto source) layout-inspector find "开拍" # search by text
See [docs/cli.md](docs/cli.md) for the full command table, analysis rules, screenshots, and coordinate mapping.
4. Run your first task
Put the target app on the page you care about, then just say in Claude Code:
> Locate the **Me** button on the current screen and trace it to its related code logic.
Or run the command:
/layout-inspector-android:locate Me
The tools will: confirm the foreground app → capture the UI tree → lock onto the target node → scan the repository for `file:line` candidates → read the code and report the location. After a UI change, use `/layout-inspector-android:verify` to compare before/after.
What you can do
| Task | Entry point | |---|---| | Locate the Compose/XML source and business chain of a control | `/layout-inspector-android:locate` / `locate_code` | | Understand the current screen (foreground app, Activity, visible entries) | `/layout-inspector-android:screen` / `get_state` + `dump_ui` | | Verify a UI change on a real device (diff + rules + screenshot) | `/layout-inspector-android:verify` / `diff_ui` + `analyze_ui` | | Find elements / hit-test / tap, swipe, input | `find_elements` / `hit_test` / `tap`, `swipe`, `input_text` | | Screenshots (SVG node overlay, image→device coordinates) | `screenshot` / `layout-inspector shot` | | Layout and accessibility checks | `analyze_ui` / `layout-inspector analyze` | | Before/after layout diff around a code change | `diff_ui` / `layout-inspector diff` |
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 26 lines
- {
- "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
- "name": "jayvinz-tools",
- "description": "Claude Code plugins for Android UI inspection, layout debugging, and UI-to-code navigation.",
- "owner": {
- "name": "Jayvinz",
- "url": "https://github.com/Jayvinz"
- },
- "plugins": [
- {
- "name": "layout-inspector-android",
- "source": "./",
- "description": "Locate controls on a live Android screen and trace them to Compose/XML source files, event handlers, state and business logic.",
- "license": "MIT",
- "category": "development",
- "keywords": [
- "android",
- "compose",
- "layout-inspector",
- "ui-testing",
- "code-navigation",
- "mcp"
- ]
- }
- ]
- }
README.md · README · 148 lines
- # layout-inspector-android
- [English](README.md) | [简体中文](README.zh.md)
- Android layout inspection for coding agents: read the live UI of a real device or emulator over ADB (XML View tree / Compose semantics tree / Compose JVMTI tree), search and hit-test elements, take screenshots, run layout/accessibility checks, diff before/after layouts, and trace visible controls back to their Compose/XML source and business logic.
- Inspired by [LayoutInspectorV2-Pro](https://plugins.jetbrains.com/plugin/21047-layoutinspectorv2-pro).
- ```
- CLI (layout-inspector) ──┐
- ├── core ──┬── JDWP + DDM → ViewDebug v2 view tree
- MCP Server ──────────────┘ ├── adb uiautomator → semantics tree
- └── Android Studio transport/JVMTI → Compose tree
- ```
- ## Quick start
- ### Prerequisites
- - Node.js ≥ 20 (required by the plugin / MCP / CLI)
- - Android platform-tools: `adb` on `PATH`, or set `DLI_ADB` / `ADB_PATH`
- - A device or emulator with USB debugging enabled; the target app running in the foreground
- - The `view` / `compose` sources require a debuggable build (`android:debuggable=true`); `semantics` has no such requirement
- - For the Claude Code plugin, Claude Code must be able to invoke `node` / `npm` from `PATH`
- ### 1. Install the Claude Code plugin (recommended)
- ```text
- /plugin marketplace add Jayvinz/layout-inspector-android
- /plugin install layout-inspector-android@jayvinz-tools
- ```
- After installation you get:
- | Component | Content |
- |---|---|
- | MCP server `layout-inspector-android` | `dump_ui`, `find_elements`, `locate_code`, `hit_test`, `analyze_ui`, `screenshot`, `diff_ui`, `tap`, and more |
- | Slash commands | `/layout-inspector-android:locate` (UI→source location), `:screen` (current screen summary), `:verify` (verify UI changes on device) |
- | Skills | `locate-ui-code`, `verify-ui-change` |
- | Read-only subagent | `ui-code-locator` |
- Use `/mcp` to confirm the server is loaded; `/help` lists the commands above.
- **Local development/debugging**: run `npm install && npm run build` in the repository root first, then point the marketplace at your local path:
- ```text
- /plugin marketplace add E:/repo/layout-inspector-android
- /plugin install layout-inspector-android@jayvinz-tools
- ```
- See [docs/plugin.md](docs/plugin.md) for the component list, publishing, and versioning.
- ### 2. Connect the MCP server (other clients)
- ```bash
- node dist/cli.js mcp --print-config
- ```
- Put the printed config into your client's MCP configuration (for example `.mcp.json` at the Claude Code project root):
- ```json
- {
- "mcpServers": {
- "layout-inspector-android": {
- "command": "node",
- "args": ["E:/repo/layout-inspector-android/dist/mcp.js"]
- }
- }
- }
- ```
- See [docs/mcp.md](docs/mcp.md) for the tool list, parameters, and the recommended call order.
- ### 3. Use the CLI
- ```bash
- npm install && npm run build
- npm link # provides the global layout-inspector command
- layout-inspector devices # connected devices
- layout-inspector state # screen, foreground app, pid
- layout-inspector dump # capture the current UI (auto source)
- layout-inspector find "开拍" # search by text
- ```
- See [docs/cli.md](docs/cli.md) for the full command table, analysis rules, screenshots, and coordinate mapping.
- ### 4. Run your first task
- Put the target app on the page you care about, then just say in Claude Code:
- > Locate the **Me** button on the current screen and trace it to its related code logic.
- Or run the command:
- ```text
- /layout-inspector-android:locate Me
- ```
- The tools will: confirm the foreground app → capture the UI tree → lock onto the target node → scan the repository for `file:line` candidates → read the code and report the location. After a UI change, use `/layout-inspector-android:verify` to compare before/after.
- ### What you can do
- | Task | Entry point |
- |---|---|
- | Locate the Compose/XML source and business chain of a control | `/layout-inspector-android:locate` / `locate_code` |
- | Understand the current screen (foreground app, Activity, visible entries) | `/layout-inspector-android:screen` / `get_state` + `dump_ui` |
- | Verify a UI change on a real device (diff + rules + screenshot) | `/layout-inspector-android:verify` / `diff_ui` + `analyze_ui` |
- | Find elements / hit-test / tap, swipe, input | `find_elements` / `hit_test` / `tap`, `swipe`, `input_text` |
- | Screenshots (SVG node overlay, image→device coordinates) | `screenshot` / `layout-inspector shot` |
- | Layout and accessibility checks | `analyze_ui` / `layout-inspector analyze` |
- | Before/after layout diff around a code change | `diff_ui` / `layout-inspector diff` |
- ## Documentation
- | Document | Content |
- |---|---|
- | [docs/data-sources.md](docs/data-sources.md) | The three data sources (view / semantics / compose), auto selection policy, Compose JVMTI details |
- | [docs/cli.md](docs/cli.md) | CLI installation, command table, analysis rules, screenshots & coordinate mapping, environment variables |
- | [docs/mcp.md](docs/mcp.md) | MCP server configuration, tool table, recommended call order |
- | [docs/plugin.md](docs/plugin.md) | Claude Code plugin components, installation, typical workflow, release & versioning |
- | [docs/development.md](docs/development.md) | Development, testing, and implementation notes |
- ## Limitations
- - `view` / `compose` require `android:debuggable=true`; release builds can only use `semantics`.
- - JDWP usually allows one debugger at a time; attach may fail while Android Studio is debugging.
- - `compose` additionally needs a local Android Studio and Java 17+; each capture takes about 8–12s.
- - `input text` reliably supports ASCII only; every command captures a fresh snapshot — there is no live monitoring.
- See [docs/data-sources.md](docs/data-sources.md) for the full boundaries of each source.
- ## Development
- ```bash
- npm test # fixture-based unit tests, no device required
- npm run typecheck
- npm run build # regenerates dist/ (committed with source changes)
- ```
- See [docs/development.md](docs/development.md).
- ## Attribution
- - Protocol and hit-testing algorithm follow [CoXier/LayoutInspectorV2-Pro](https://github.com/CoXier/LayoutInspectorV2-Pro) (Apache-2.0).
- - The ViewDebug / DDM protocol comes from AOSP `android.view.ViewDebug`, `DdmHandleViewDebug`, and ddmlib.
- - The Compose tree reuses the transport/JVMTI agent and `androidx.compose.ui:ui-inspection` from a locally installed Android Studio; the protocol comes from AOSP `tools/base` (`transport` / `app-inspection` / `dynamic-layout-inspector`) and AndroidX `compose/ui/ui-inspection` (all Apache-2.0). This project does not redistribute these binaries; they are read at runtime from the user's Android Studio installation.
- - The code in this project is an independent implementation released under the MIT License; see `NOTICE`.
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.