Ensures clean-state testing by restarting browsers after code changes and monitoring for runtime errors.
Install
mkdir -p .claude/skills/debugging-skill && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10448" && unzip -o skill.zip -d .claude/skills/debugging-skill && rm skill.zipInstalls to .claude/skills/debugging-skill
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Always start a fresh browser session after any file change, walk through the full user flow, and monitor for errors before proceeding with further work.Key capabilities
- →Restart browser sessions
- →Verify full user flows
- →Monitor runtime console errors
- →Interact with shadow DOM elements
How it works
It mandates a clean state by restarting the browser after every change and using specific evaluation scripts to interact with shadow DOM elements.
Inputs & outputs
When to use debugging-skill
- →Verifying UI changes after code updates
- →Debugging runtime console errors
- →Performing manual user flow testing
About this skill
Debugging Skill: Error-Free UI Verification
Purpose
Ensure that after any code change, the app is fully reloaded, the user flow is tested from the beginning, and no runtime errors or warnings are present before continuing with feature work or test automation.
Workflow
-
Restart Browser Session
- After any file change or hot-reload, always start a new browser session (do not reuse previous state).
- This ensures no stale state or session issues.
-
Start with the Test App (http://localhost:5173)
- Always verify behavior on the standalone test app first, before testing in Storybook or other environments.
- The test app runs directly in the page (no iframes), making it easier to inspect shadow DOM elements, debug overlay state, and interact with the bottom toolbar.
- Only move to Storybook (SB8/SB10) or other environments after confirming the feature works in the test app.
-
Walk Through Full User Flow
- Navigate to the target page.
- Interact with the UI as a real user would.
-
Monitor for Errors and Warnings
- Capture all browser console logs, errors, and exceptions during navigation and interaction.
- Do not proceed if any runtime errors or warnings are present.
- Only continue with feature work or test automation when the UI is confirmed error-free.
Clicking the Toggle Button (Playwright MCP)
The Convey toggle button (aria-label="Open Convey inspector") lives inside a shadow DOM (#tw-visual-editor-host). Playwright MCP's click_element and snapshot tools cannot reach shadow DOM elements directly.
Always use page.evaluate() to click it:
await page.waitForFunction(() => {
const host = document.querySelector('#tw-visual-editor-host') as HTMLElement;
return !!(host?.shadowRoot?.querySelector('.toggle-btn'));
}, { timeout: 5000 });
await page.evaluate(() => {
const host = document.querySelector('#tw-visual-editor-host') as HTMLElement;
const btn = host.shadowRoot!.querySelector('.toggle-btn') as HTMLButtonElement;
btn.click();
});
Or with Playwright MCP's mcp_playwright_browser_evaluate:
// Step 1: wait for button
await page.waitForFunction(() =>
!!(document.querySelector('#tw-visual-editor-host') as HTMLElement)?.shadowRoot?.querySelector('.toggle-btn')
);
// Step 2: click it
await page.evaluate(() => {
const host = document.querySelector('#tw-visual-editor-host') as HTMLElement;
(host.shadowRoot!.querySelector('.toggle-btn') as HTMLButtonElement).click();
});
Do NOT try
getByRole('button', { name: 'Open Convey inspector' })or snapshot-based clicks — they will not find the shadow DOM element.
Best Practices
- Always verify the UI is in a clean state before testing features.
- Use Playwright or similar tools to automate the flow and error monitoring.
- Document any errors found and fix them before proceeding.
This skill should be followed for all feature implementation, E2E test writing, and UI debugging.
When not to use it
- →Initial feature development
- →Unit testing
Prerequisites
Limitations
- →Requires manual or automated flow execution
- →Shadow DOM interaction requires page.evaluate
How it compares
It prevents stale state issues by forcing a full reload and providing specific patterns for shadow DOM interaction that standard selectors miss.
Compared to similar skills
debugging-skill side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| debugging-skill (this skill) | 0 | 2mo | No flags | Beginner |
| expect | 0 | 4mo | No flags | Intermediate |
| frontend-testing | 11 | 3mo | Review | Intermediate |
| feature-flags | 6 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
expect
zakad00e2
Use when editing .tsx/.jsx/.css/.html, React components, pages, routes, forms, styles, or layouts. Also when asked to test, verify, validate, QA, find bugs, check for issues, or fix expect-cli failures.
frontend-testing
langgenius
Generate Vitest + React Testing Library tests for Dify frontend components, hooks, and utilities. Triggers on testing, spec files, coverage, Vitest, RTL, unit tests, integration tests, or write/review test requests.
feature-flags
Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.
vue-testing-best-practices
vuejs-ai
Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.
playwright-pro
alirezarezvani
Production-grade Playwright testing toolkit. Use when the user mentions Playwright tests, end-to-end testing, browser automation, fixing flaky tests, test migration, CI/CD testing, or test suites. Generate tests, fix flaky failures, migrate from Cypress/Selenium, sync with TestRail, run on BrowserStack. 55 templates, 3 agents, smart reporting.
vue-debug-guides
vuejs-ai
Vue 3 debugging and error handling for runtime errors, warnings, async failures, and SSR/hydration issues. Use when diagnosing or fixing Vue issues.