Skip to content
Back to search

jayvinz-tools

MarketplaceWorks with Claude CodeGitHub

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jayvinz--layout-inspector-android/badge.svg)](/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
  1. {
  2. "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
  3. "name": "jayvinz-tools",
  4. "description": "Claude Code plugins for Android UI inspection, layout debugging, and UI-to-code navigation.",
  5. "owner": {
  6. "name": "Jayvinz",
  7. "url": "https://github.com/Jayvinz"
  8. },
  9. "plugins": [
  10. {
  11. "name": "layout-inspector-android",
  12. "source": "./",
  13. "description": "Locate controls on a live Android screen and trace them to Compose/XML source files, event handlers, state and business logic.",
  14. "license": "MIT",
  15. "category": "development",
  16. "keywords": [
  17. "android",
  18. "compose",
  19. "layout-inspector",
  20. "ui-testing",
  21. "code-navigation",
  22. "mcp"
  23. ]
  24. }
  25. ]
  26. }
README.md · README · 148 lines
  1. # layout-inspector-android
  2. [English](README.md) | [简体中文](README.zh.md)
  3. 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.
  4. Inspired by [LayoutInspectorV2-Pro](https://plugins.jetbrains.com/plugin/21047-layoutinspectorv2-pro).
  5. ```
  6. CLI (layout-inspector) ──┐
  7. ├── core ──┬── JDWP + DDM → ViewDebug v2 view tree
  8. MCP Server ──────────────┘ ├── adb uiautomator → semantics tree
  9. └── Android Studio transport/JVMTI → Compose tree
  10. ```
  11. ## Quick start
  12. ### Prerequisites
  13. - Node.js ≥ 20 (required by the plugin / MCP / CLI)
  14. - Android platform-tools: `adb` on `PATH`, or set `DLI_ADB` / `ADB_PATH`
  15. - A device or emulator with USB debugging enabled; the target app running in the foreground
  16. - The `view` / `compose` sources require a debuggable build (`android:debuggable=true`); `semantics` has no such requirement
  17. - For the Claude Code plugin, Claude Code must be able to invoke `node` / `npm` from `PATH`
  18. ### 1. Install the Claude Code plugin (recommended)
  19. ```text
  20. /plugin marketplace add Jayvinz/layout-inspector-android
  21. /plugin install layout-inspector-android@jayvinz-tools
  22. ```
  23. After installation you get:
  24. | Component | Content |
  25. |---|---|
  26. | MCP server `layout-inspector-android` | `dump_ui`, `find_elements`, `locate_code`, `hit_test`, `analyze_ui`, `screenshot`, `diff_ui`, `tap`, and more |
  27. | Slash commands | `/layout-inspector-android:locate` (UI→source location), `:screen` (current screen summary), `:verify` (verify UI changes on device) |
  28. | Skills | `locate-ui-code`, `verify-ui-change` |
  29. | Read-only subagent | `ui-code-locator` |
  30. Use `/mcp` to confirm the server is loaded; `/help` lists the commands above.
  31. **Local development/debugging**: run `npm install && npm run build` in the repository root first, then point the marketplace at your local path:
  32. ```text
  33. /plugin marketplace add E:/repo/layout-inspector-android
  34. /plugin install layout-inspector-android@jayvinz-tools
  35. ```
  36. See [docs/plugin.md](docs/plugin.md) for the component list, publishing, and versioning.
  37. ### 2. Connect the MCP server (other clients)
  38. ```bash
  39. node dist/cli.js mcp --print-config
  40. ```
  41. Put the printed config into your client's MCP configuration (for example `.mcp.json` at the Claude Code project root):
  42. ```json
  43. {
  44. "mcpServers": {
  45. "layout-inspector-android": {
  46. "command": "node",
  47. "args": ["E:/repo/layout-inspector-android/dist/mcp.js"]
  48. }
  49. }
  50. }
  51. ```
  52. See [docs/mcp.md](docs/mcp.md) for the tool list, parameters, and the recommended call order.
  53. ### 3. Use the CLI
  54. ```bash
  55. npm install && npm run build
  56. npm link # provides the global layout-inspector command
  57. layout-inspector devices # connected devices
  58. layout-inspector state # screen, foreground app, pid
  59. layout-inspector dump # capture the current UI (auto source)
  60. layout-inspector find "开拍" # search by text
  61. ```
  62. See [docs/cli.md](docs/cli.md) for the full command table, analysis rules, screenshots, and coordinate mapping.
  63. ### 4. Run your first task
  64. Put the target app on the page you care about, then just say in Claude Code:
  65. > Locate the **Me** button on the current screen and trace it to its related code logic.
  66. Or run the command:
  67. ```text
  68. /layout-inspector-android:locate Me
  69. ```
  70. 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.
  71. ### What you can do
  72. | Task | Entry point |
  73. |---|---|
  74. | Locate the Compose/XML source and business chain of a control | `/layout-inspector-android:locate` / `locate_code` |
  75. | Understand the current screen (foreground app, Activity, visible entries) | `/layout-inspector-android:screen` / `get_state` + `dump_ui` |
  76. | Verify a UI change on a real device (diff + rules + screenshot) | `/layout-inspector-android:verify` / `diff_ui` + `analyze_ui` |
  77. | Find elements / hit-test / tap, swipe, input | `find_elements` / `hit_test` / `tap`, `swipe`, `input_text` |
  78. | Screenshots (SVG node overlay, image→device coordinates) | `screenshot` / `layout-inspector shot` |
  79. | Layout and accessibility checks | `analyze_ui` / `layout-inspector analyze` |
  80. | Before/after layout diff around a code change | `diff_ui` / `layout-inspector diff` |
  81. ## Documentation
  82. | Document | Content |
  83. |---|---|
  84. | [docs/data-sources.md](docs/data-sources.md) | The three data sources (view / semantics / compose), auto selection policy, Compose JVMTI details |
  85. | [docs/cli.md](docs/cli.md) | CLI installation, command table, analysis rules, screenshots & coordinate mapping, environment variables |
  86. | [docs/mcp.md](docs/mcp.md) | MCP server configuration, tool table, recommended call order |
  87. | [docs/plugin.md](docs/plugin.md) | Claude Code plugin components, installation, typical workflow, release & versioning |
  88. | [docs/development.md](docs/development.md) | Development, testing, and implementation notes |
  89. ## Limitations
  90. - `view` / `compose` require `android:debuggable=true`; release builds can only use `semantics`.
  91. - JDWP usually allows one debugger at a time; attach may fail while Android Studio is debugging.
  92. - `compose` additionally needs a local Android Studio and Java 17+; each capture takes about 8–12s.
  93. - `input text` reliably supports ASCII only; every command captures a fresh snapshot — there is no live monitoring.
  94. See [docs/data-sources.md](docs/data-sources.md) for the full boundaries of each source.
  95. ## Development
  96. ```bash
  97. npm test # fixture-based unit tests, no device required
  98. npm run typecheck
  99. npm run build # regenerates dist/ (committed with source changes)
  100. ```
  101. See [docs/development.md](docs/development.md).
  102. ## Attribution
  103. - Protocol and hit-testing algorithm follow [CoXier/LayoutInspectorV2-Pro](https://github.com/CoXier/LayoutInspectorV2-Pro) (Apache-2.0).
  104. - The ViewDebug / DDM protocol comes from AOSP `android.view.ViewDebug`, `DdmHandleViewDebug`, and ddmlib.
  105. - 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.
  106. - 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 in

Free to use. If it’s helped, pass it on.