Add window manipulation capabilities to enable responsive testing workflows.
- Objective: Allow resizing the window via HTTP API
- Files:
src/lib.rs,src/handlers.rs - Dependencies: None
- Implementation:
- Add
POST /resizeendpoint accepting{ width, height } - Use JavaScript
window.resizeTo()or Dioxus window API - Return new window dimensions in response
- Add
- Objective: Expose resize to Claude Code
- Files:
mcp-server/src/main.rs - Dependencies: Step 1.1
- Implementation:
- Add
resizetool with width/height parameters - Call bridge
/resizeendpoint - Add preset sizes: mobile (375x667), tablet (768x1024), desktop (1280x800)
- Add
Add quick stats about the DOM for understanding page complexity.
- Objective: Return element counts and tag distribution
- Files:
src/handlers.rs,src/scripts/stats.js - Dependencies: None
- Implementation:
- Create
stats.jsscript that counts elements by tag - Add
GET /statsendpoint - Return:
{ total, by_tag: { div: N, button: N, ... }, depth: N }
- Create
- Objective: Expose stats to Claude Code
- Files:
mcp-server/src/main.rs - Dependencies: Step 2.1
- Implementation:
- Add
statstool (no parameters) - Format output as readable summary
- Add
Generate unique CSS selectors for elements to use in tests or automation.
- Objective: Generate minimal unique CSS selector for any element
- Files:
src/scripts/selector.js - Dependencies: None
- Implementation:
- Create script that builds selector from id, classes, nth-child
- Prefer:
#id>.class>tag.class>parent > child - Verify uniqueness with
querySelectorAll
- Objective: Expose selector generation via API
- Files:
src/handlers.rs,mcp-server/src/main.rs - Dependencies: Step 3.1
- Implementation:
- Add
POST /selectorendpoint accepting element identifier - Add
get_selectorMCP tool - Return shortest unique selector
- Add
Extract colors used in the UI for design consistency checks.
- Objective: Scan page for all colors in use
- Files:
src/scripts/colors.js - Dependencies: None
- Implementation:
- Walk DOM, extract computed
color,background-color,border-color - Deduplicate and normalize to hex
- Group by usage type (text, background, border)
- Walk DOM, extract computed
- Objective: Expose color extraction via API
- Files:
src/handlers.rs,mcp-server/src/main.rs - Dependencies: Step 4.1
- Implementation:
- Add
GET /colorsendpoint - Add
colorsMCP tool - Return grouped color list with usage counts
- Add
List all fonts used in the page for typography auditing.
- Objective: Extract font families and sizes in use
- Files:
src/scripts/fonts.js - Dependencies: None
- Implementation:
- Walk DOM, extract computed
font-family,font-size,font-weight - Group by font family
- List all size/weight combinations per family
- Walk DOM, extract computed
- Objective: Expose font inspection via API
- Files:
src/handlers.rs,mcp-server/src/main.rs - Dependencies: Step 5.1
- Implementation:
- Add
GET /fontsendpoint - Add
fontsMCP tool - Return font usage summary
- Add