inspect

将自然语言对页面视觉元素的描述(例如“英雄区域中的红色按钮”“从上往下数第三张卡片”)解析为当前预览页面中的具体 DOM 元素并返回其源代码位置。使用 Chrome DevTools MCP 的 take_snapshot UID 来实现确定性定位。当用户要求更改、样式化或移除某个未指向源代码的视觉元素时使用此功能。

仓库最近推送
GitHub Stars
112
Forks
11
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "inspect":https://skillpi.com/zh/skills/deepskill-c9908b18daa51c4b6fb31df401306f23bdac6dad4792163a7aaa2be79cba739f。安装前核对上游来源和版本:https://github.com/bluzir/claude-code-design。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

将自然语言对页面视觉元素的描述(例如“英雄区域中的红色按钮”“从上往下数第三张卡片”)解析为当前预览页面中的具体 DOM 元素并返回其源代码位置。使用 Chrome DevTools MCP 的 take_snapshot UID 来实现确定性定位。当用户要求更改、样式化或移除某个未指向源代码的视觉元素时使用此功能。

0 下载

介绍来源: third_party · bluzir · 0.0.1 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
来源文档未说明。
输入和输出
来源文档未说明。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
限制与区别
来源文档未说明。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: inspect
description: Resolve a natural-language element description ("the red button in the hero", "the third card from the top") to a concrete DOM element in the current preview + source-code location. Uses Chrome DevTools MCP take_snapshot UIDs for deterministic targeting. Use when user asks to change/style/remove a specific visual element without pointing at source code.
argument-hint: <natural-language description>
allowed-tools: Read Grep Glob mcp__chrome-devtools__take_snapshot mcp__chrome-devtools__evaluate_script mcp__chrome-devtools__take_screenshot

Inspect

Replaces Claude Design's <mentioned-element> inline-comment protocol with a terminal-native alternative: user describes an element in English, Claude resolves to a specific DOM node + source location for surgical edits.

Prerequisites

  • Chrome DevTools MCP has a page loaded (via /preview or /done)
  • .claude/last-snapshot.json exists (produced by /done) — or we snapshot fresh

Pipeline

  1. Get snapshot:

    • Prefer Read .claude/last-snapshot.json if recent (< 5 min, same URL)
    • Otherwise mcp__chrome-devtools__take_snapshot to get fresh tree
  2. Match the description against snapshot nodes. Use vision + text heuristics:

    • Role/tag match ("button" → role=button, tag=button)
    • Text content match ("the CTA that says 'Get started'")
    • Positional hints ("hero", "top", "third from left", "right sidebar")
    • Color hints ("the red button") — if ambiguous, take screenshot and visually match
    • Size hints ("the big heading")
    • Hierarchy ("inside the first card")
  3. Pick the best UID. If multiple candidates, show the top 3 to the user with a one-line summary each:

    Candidates for "red button in hero":
      [uid=3_12] <button> "Get started" — background #d83
      [uid=3_28] <a class="btn"> "Try free" — background #c55
      [uid=3_07] <div role=button> "Sign up" — background #d80
    Which one (or describe differently)?
  4. Resolve to source location. Once UID is confirmed:

    • mcp__chrome-devtools__evaluate_script — select by UID and return useful identifiers:
      // (Pass the picked uid as an arg to the evaluate function)
      (el) => ({
        tag: el.tagName.toLowerCase(),
        id: el.id || null,
        classList: Array.from(el.classList),
        textContent: el.textContent.trim().slice(0, 80),
        dataAttrs: Object.fromEntries(
          Array.from(el.attributes)
            .filter(a => a.name.startsWith('data-'))
            .map(a => [a.name, a.value])
        ),
        outerHTML: el.outerHTML.slice(0, 300),
      })
    • With these signals, Grep the source HTML (current artifacts/<name>.html) for the matching element — preferring id > data-* > unique class combination > text snippet > outerHTML substring.
    • Return: source file path + approximate line number.
  5. Report:

    Element: <button> "Get started" (uid 3_12)
    Source: artifacts/landing.html:142-148
    Selector: #cta-primary
  6. Optional next step: if user requested an edit alongside inspection ("make it bigger") — perform the Edit directly with the located line range. Otherwise just report and wait.

Heuristic priorities for "the red button" style references

When user phrase maps to multiple candidates:

  1. Explicit labels win — if <button aria-label="Subscribe"> and user says "the subscribe button", pick that regardless of visual cues
  2. Visible-first — prefer elements currently in viewport over below-fold
  3. Unique before common — a unique hero button beats the third of eight grid buttons
  4. Large before small — for "the big title" prefer larger font-size
  5. Top-first for ambiguous position — "the button" → closest to top-of-page in reading order

When to fall back to asking

If >3 candidates and vision can't disambiguate — ask the user: "you mean X, Y, or Z?"

Limits

  • Only resolves elements that rendered successfully (not in-error components)
  • React components with generated class names (CSS modules): selector might not round-trip — use outerHTML substring for source grep
  • Elements inside shadow DOM are visible to take_snapshot but Grep on source HTML won't find them — warn the user if this path fails

当前收录版本

0.0.1

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 解决用户在预览页面中定位视觉元素的痛点,显著提升开发效率
  • 适用于设计稿调整、样式修改等高频场景
触发精准88/100

亮点

  • 触发词精准完整,覆盖多种变体,边界清晰
  • description 明确说明了使用场景和参数格式
结构规范85/100

亮点

  • Phase/步骤清晰,有出口条件,含端到端示例
  • frontmatter完整,单文件≤500行
执行可靠82/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常
  • 不可逆操作有确认机制
证据可验 (前四项均值)87/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。