Logotipo de Skills Ui Debug Agent

Skills Ui Debug Agent

Comunidad
anhtester
skills-ui-debug-agent

Skill inspect web/mobile applications bằng browser tools, phân tích DOM elements, xác định locators ổn định, debug UI automation failures, và hỗ trợ sinh Page Object classes.

Descripción general

Editoranhtester
Repositorioclaude-testing-kit
Nombre de la habilidadskills-ui-debug-agent
Estrellas
61
Forks
31
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por anhtester en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Skills Ui Debug Agent en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/anhtester/claude-testing-kit/tree/main/.claude/skills/skills-ui-debug-agent
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/anhtester/claude-testing-kit.git /tmp/claude-testing-kit
mkdir -p .claude/skills
cp -r /tmp/claude-testing-kit/.claude/skills/skills-ui-debug-agent .claude/skills/skills-ui-debug-agent
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Skills Ui Debug Agent en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Skills Ui Debug Agent automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Skills Ui Debug Agent no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

UI Debug Agent

Description

Skill chuyên biệt giúp agent inspect ứng dụng web/mobile trực tiếp trên browser thật, phân tích DOM, thu thập locators ổn định, và debug các vấn đề UI automation.

Agent có thể:

  • Mở browser thật, navigate đến bất kỳ URL nào
  • Inspect DOM elements — xác định attributes, hierarchy, state
  • Thu thập locators ổn định cho Playwright, Selenium, Appium
  • Debug automation failures (element not found, click intercepted, timeout)
  • Capture UI state (snapshot, screenshot) để phân tích
  • Phân tích dynamic content, iframe, shadow DOM, SPA navigation

When to Use

Sử dụng skill này khi:

  • Cần khám phá UI của một trang web/module mới
  • Cần tìm locator cho element cụ thể
  • Cần debug test automation fail do UI thay đổi
  • Cần verify locator có hoạt động trên DOM thực tế không
  • Cần phân tích DOM để hiểu cấu trúc UI (forms, tables, modals)
  • Cần capture evidence (screenshot) cho test report

Trigger keywords: "inspect UI", "tìm locator", "debug element", "mở browser xem", "kiểm tra DOM"


MCP Command Sequence (BẮT BUỘC)

Khi sử dụng Playwright MCP để debug UI, LUÔN tuân theo thứ tự:

1. browser_navigate(url)           → Mở trang
2. browser_resize(1920, 1080)      → Desktop viewport
3. browser_wait_for(text/time)     → Chờ page load
4. browser_snapshot()              → Thu thập DOM (dùng để phân tích + tìm locator)
5. browser_click/type/hover(ref)   → Tương tác (nếu cần)
6. browser_take_screenshot()       → Chụp ảnh (evidence khi fail hoặc milestone)

Quy tắc quan trọng:

Quy tắcChi tiết
KHÔNG navigate lại nếu đã ở đúng trangTránh reload ngoài ý muốn
LUÔN resize ngay sau navigatebrowser_resize(1920, 1080) — đảm bảo desktop viewport
LUÔN wait trước khi snapshotChờ page load hoàn tất
Dùng snapshot để phân tíchSnapshot trả về accessibility tree — nhanh, chính xác, có ref để tương tác
Dùng screenshot để báo cáoScreenshot là hình ảnh — dùng khi cần evidence visual

Snapshot vs Screenshot

browser_snapshotbrowser_take_screenshot
Trả vềAccessibility tree (text + ref IDs)Hình ảnh (PNG/JPEG)
Mục đíchPhân tích DOM, tìm locator, xác định elementVisual evidence, báo cáo, debug layout
Khi nào dùng⭐ Luôn dùng trước khi tương tácChỉ khi fail hoặc milestone quan trọng
Có ref để interact✅ Có — dùng ref để click/type/hover❌ Không — chỉ là hình ảnh
Tốc độNhanhChậm hơn

Quy tắc: Ưu tiên snapshot cho phân tích, dùng screenshot cho evidence.


Quy trình Inspect UI

1. Mở & Chuẩn bị trang

browser_navigate → URL target
browser_resize → 1920 × 1080
browser_wait_for → chờ indicator page đã load (text hoặc thời gian)

Nếu trang yêu cầu đăng nhập:

  • Hỏi user credentials HOẶC dùng fixture sẵn có trong project
  • KHÔNG đọc file .env trực tiếp (quy tắc bảo mật)

2. Thu thập DOM Structure

browser_snapshot → accessibility tree

Từ snapshot, xác định:

  • Các element chính: buttons, inputs, links, headings, tables
  • Attributes quan trọng: role, name, label, placeholder, testid
  • Hierarchy: parent → child relationships
  • State: visible, enabled, disabled, checked, expanded

3. Xác định Locators

Với mỗi element cần locator, áp dụng priority order theo framework:

Playwright:

PriorityLocatorVí dụKhi nào dùng
1 ⭐getByRole()getByRole('button', {name: 'Submit'})Element có role + accessible name rõ ràng
2getByLabel()getByLabel('Email')Form input có label
3getByPlaceholder()getByPlaceholder('Enter email')Input có placeholder, không có label
4getByText()getByText('Welcome back')Text content unique
5getByTestId()getByTestId('submit-btn')Element có data-testid attribute
6CSSpage.locator('.submit-button')Không có semantic option nào phù hợp
7XPathpage.locator('//div[@class="x"]')Last resort — tránh dùng

Selenium:

PriorityLocatorVí dụ
1 ⭐By.id()By.id("email")
2By.cssSelector("[data-testid]")By.cssSelector("[data-testid='submit']")
3By.name()By.name("username")
4By.cssSelector()By.cssSelector(".login-form button")
5By.xpath()By.xpath("//button[text()='Login']")

Appium (Mobile):

PriorityLocatorVí dụ
1 ⭐Accessibility IDMobileBy.accessibilityId("loginButton")
2ID (resource-id)MobileBy.id("com.app:id/login_btn")
3NameMobileBy.name("Login")
4XPath (relative)MobileBy.xpath("//android.widget.Button[@text='Login']")

4. Verify Locator

Sau khi xác định locator, bắt buộc verify trên DOM thực tế:

browser_snapshot → tìm element bằng ref
browser_click/type(ref) → thử tương tác
browser_snapshot → xác nhận kết quả

Locator được chấp nhận khi:

  • Unique trên page (chỉ match 1 element)
  • Ổn định qua nhiều lần reload
  • Không chứa dynamic class (css-xxx, sc-xxx, MuiXxx-root)
  • Không chứa positional xpath (//div[3]/button[2])
  • Không phụ thuộc auto-generated attribute

Xử lý tình huống đặc biệt

Trang yêu cầu đăng nhập

  • Dùng fixture login sẵn có trong project hoặc hỏi user credentials
  • KHÔNG đọc .env trực tiếp
  • Sau khi login, navigate đến trang cần inspect

Modal / Dialog / Popup

  • Modal thường là overlay trên page chính
  • browser_snapshot sẽ thấy modal content trong accessibility tree
  • Tương tác với modal elements bằng ref từ snapshot
  • Chờ modal animation hoàn thành trước khi interact

Iframe

  • browser_snapshot có thể không thấy content trong iframe
  • Dùng browser_evaluate để switch vào iframe:
    javascript
    () => document.querySelector('iframe').contentDocument.body.innerHTML
  • Hoặc dùng Playwright frame locator: page.frameLocator('#iframe-id')

Shadow DOM

  • Playwright locator() tự động pierce shadow DOM
  • Selenium cần shadowRoot.findElement()
  • browser_snapshot có thể thấy shadow DOM content tùy MCP version

Dynamic Content (SPA / AJAX)

  • Chờ content load bằng browser_wait_for(text) trước khi snapshot
  • Nếu content load lazy → scroll xuống trước, rồi snapshot
  • Nếu content thay đổi theo thời gian → chụp snapshot nhiều lần

Tables / Lists (nhiều elements lặp)

  • Xác định pattern locator cho row/cell
  • Dùng nth() hoặc filter() để target element cụ thể
  • Ví dụ Playwright: page.getByRole('row').filter({hasText: 'John'}).getByRole('button', {name: 'Edit'})

Element bị che (Overlay / Toast)

  • Kiểm tra z-index, opacity, visibility trong DOM
  • Chờ overlay biến mất: browser_wait_for(textGone: 'Loading...')
  • Nếu toast notification che button → chờ toast timeout

Anti-Patterns (FORBIDDEN)

❌ Sai✅ ĐúngLý do
Đoán locator từ tên tính năngInspect DOM thực tế rồi mới lấy locatorLocator chính xác 100%
Dùng screenshot để chọn locatorDùng snapshot (accessibility tree)Snapshot có ref, screenshot thì không
Copy locator từ code cũ không verifyLuôn verify locator trên browser hiện tạiDOM có thể đã thay đổi
Dùng dynamic class .css-1abcDùng role/label/testidDynamic class thay đổi mỗi build
Dùng positional xpath //div[3]Dùng relative xpath hoặc CSSPositional xpath dễ vỡ
Chụp screenshot liên tụcChỉ screenshot khi fail hoặc milestoneTốn resource, chậm
Navigate lại khi đã ở đúng trangChỉ navigate khi cần đổi URLTránh reload không cần thiết

Output

Skill này có thể trả về:

  • Locator recommendations — bảng primary + fallback cho mỗi element
  • DOM analysis — cấu trúc element, attributes, state, hierarchy
  • Page Object suggestions — class structure phù hợp cho trang đã inspect
  • Screenshots — evidence visual tại các milestone
  • Debug findings — nguyên nhân element not found / click fail + cách fix

Rules References

Agent PHẢI tuân thủ các rules chi tiết:

  • .claude/rules/locator_strategy.md — Master locator priority map
  • .claude/rules/playwright_rules.md — Playwright browser setup and locator rules
  • .claude/rules/selenium_rules.md — Selenium locator and wait rules
  • .claude/rules/appium_rules.md — Appium mobile locator rules
  • .claude/rules/automation_rules.md — General automation best practices

Preguntas frecuentes

¿Qué hace la habilidad de IA Skills Ui Debug Agent?

Skill inspect web/mobile applications bằng browser tools, phân tích DOM elements, xác định locators ổn định, debug UI automation failures, và hỗ trợ sinh Page Object classes.

¿Por qué usar Skills Ui Debug Agent en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Skills Ui Debug Agent está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Skills Ui Debug Agent en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/anhtester/claude-testing-kit/tree/main/.claude/skills/skills-ui-debug-agent. TypingMind lee su archivo SKILL.md y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Skills Ui Debug Agent?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Skills Ui Debug Agent?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Skills Ui Debug Agent con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Skills Ui Debug Agent?

Sí. anhtester la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇