with one click
dom-inspector
// Advanced DOM inspection and interaction capabilities. Allows analyzing page layout, extracting compact DOM snapshots, manipulating elements, and debugging browser logs.
// Advanced DOM inspection and interaction capabilities. Allows analyzing page layout, extracting compact DOM snapshots, manipulating elements, and debugging browser logs.
| name | dom-inspector |
| description | Advanced DOM inspection and interaction capabilities. Allows analyzing page layout, extracting compact DOM snapshots, manipulating elements, and debugging browser logs. |
| allowed-tools | ["get_page_snapshot","get_visual_hierarchy","get_element_details","click_element","input_text","get_console_logs","scroll_to_element","capture_screenshot"] |
Core Principle: Minimize token cost. Always choose the cheapest tool that gets the job done.
| Cost | Tools | Use For |
|---|---|---|
| Low | get_visual_hierarchy, click_element, input_text, scroll_to_element | Layout overview, trigger interactions |
| Mid | get_page_snapshot, get_element_details, get_console_logs | DOM with @eID, element deep dive, logs |
| High | capture_screenshot | Visual comparison with design mockups only |
capture_screenshot ā compare with design ā edit styles ā capture_screenshot ā verify
Screenshot is justified here ā pixel-level visual comparison requires images.
get_page_snapshot ā find @eID ā click_element/input_text ā get_page_snapshot ā verify DOM changes
Example: snapshot ā @e42 [button] "Settings" ā click_element(e42) ā snapshot ā confirm dialog appeared
get_console_logs(level="error") ā add console.info("[BUG]",...) to code
ā click_element to reproduce ā get_console_logs(keyword="[BUG]")
ā fix code ā re-trigger ā get_console_logs ā confirm fix
Important: console.log is NOT captured. Use console.info or higher (warn/error) for debugging.
Use prefixes ([BUG], [PERF]) + keyword/level filter to avoid log noise.
get_visual_hierarchy ā understand layout (cheap)
ā get_page_snapshot(startNodeId="eX") ā targeted DOM of area of interest
ā get_element_details("eY") ā deep dive if needed
Always start with get_visual_hierarchy ā cheapest way to understand the page.
Add console.time/PerformanceObserver ā click_element to trigger
ā get_console_logs(keyword="[PERF]") ā fix ā re-trigger ā verify
get_visual_hierarchy firstget_page_snapshot (use startNodeId to narrow scope)click_element / input_text with @eIDcapture_screenshotget_console_logs with keyword / levelscroll_to_element before snapshotget_element_detailscapture_screenshot to discover structure (use get_visual_hierarchy)startNodeId)get_console_logs without keyword/level filter (token waste)get_visual_hierarchy and jumping straight to detailed snapshot[HINT] Download the complete skill directory including SKILL.md and all related files