Overview
This skill focuses on closed-loop verification of all changes involving the UI (user interface). By driving a real browser environment, it ensures that code-level modifications render correctly across different theme modes, screen sizes, and interaction states.
Core Responsibilities
1. Dev Server Pre-check
Before performing any page access, you must ensure the development server (localhost:3000) is active.
- Port Check: Run
Test-NetConnection -ComputerName localhost -Port 3000(Windows) orlsof -i:3000(POSIX) to check the port. - Auto-start: If the port is not started, asynchronously run
pnpm dev(setisBackground: true) and wait about 5-10 seconds until ready. - Avoid Duplication: If the port is already occupied, it is strictly forbidden to start the server again.
2. Browser Automation Verification
Use browser tools (such as Chrome MCP) for multi-dimensional checks.
- Page Access: Navigate to the route path where the affected component is located.
- Dark Mode Toggle: Toggle dark mode by executing a script to modify the
htmlof theclasselement (add/removedark). - State Capture:
- Visual Capture: Capture a page screenshot (
browser_take_screenshot)。 - Logical Analysis: Capture an a11y tree snapshot (
take_snapshot) or execute JavaScript to get the computed styles (evaluate_script, checkgetComputedStyle)。
- Visual Capture: Capture a page screenshot (
- Interaction Verification: Simulate user actions such as hover and click to verify interaction feedback.
3. Comparison & Remediation
- Visual Comparison: Confirm whether the change fixes the original problem, or whether the new feature is visually appealing and conforms to BEM conventions and style variables.
- Regression Remediation: If style conflicts, ineffective overrides, or insufficient contrast are observed in the browser, you must fall back to the code editing stage for targeted fixes.
Instructions
- Start First, Access Later: Always verify port 3000 first; do not assume the server is always running.
- Multi-mode Check: For all UI modifications, you must check in both
lightanddarkmodes. - Key Data Orientation: Rather than a vague "looks good", prioritize providing
getComputedStylespecific color values, size information, or screenshots as evidence. - Evidence Closed Loop: In the task summary, include a brief description of the actual UI performance, and cite screenshot paths when necessary.
Usage Example
Input: "Modified the article card's border radius and darkened the background in dark mode." Actions:
- Run
Test-NetConnectionto confirm the server. - Call
browser_navigateto access the demo page. - Execute a script to add the
.darkclass. - Via
evaluate_scriptCheck the card'sborder-radiusandbackground-color。 - Take a screenshot and feed it back to the user.