jackson2w/claude-code-skills / cdp-layout-verification
cdp-layout-verification
FlaggedThis skill should be used when the user asks to "verify this looks right", "check the spacing/alignment/margin", "is this centered", "double check the CSS", "confirm the layout matches", or after any CSS/layout change on a web project where a screenshot alone would only be an eyeball check. It should also be used proactively whenever reporting a CSS fix as "verified" or "confirmed" — a headless screenshot is not sufficient verification for precise spacing, alignment, or color claims; only direct DOM measurement is.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.9 KB |
| scripts/cdp-eval.mjs | script | 1.4 KB |
| scripts/cdp-screenshot.mjs | script | 1.4 KB |
scripts/cdp-eval.mjs
View on GitHub// Evaluate a JS expression in a live page via Chrome DevTools Protocol and
// print the result. Requires Node 22+ (uses the built-in global WebSocket).
//
// Usage: node cdp-eval.mjs <webSocketDebuggerUrl> "<js expression>"
//
// Get the webSocketDebuggerUrl by curling the DevTools JSON endpoint of a
// headless Chrome instance launched with --remote-debugging-port=<port>:
// curl -s http://localhost:<port>/json | python3 -c \
// "import json,sys; print([t['webSocketDebuggerUrl'] for t in json.load(sys.stdin) if t['type']=='page'][0])"
const wsUrl = process.argv[2];
const expr = process.argv[3];
if (!wsUrl || !expr) {
console.error("Usage: node cdp-eval.mjs <webSocketDebuggerUrl> \"<js expression>\"");
process.exit(1);
}
const ws = new WebSocket(wsUrl);
await new Promise((resolve, reject) => {
ws.addEventListener("open", resolve);
ws.addEventListener("error", reject);
});
const id = 1;
ws.send(JSON.stringify({ id, method: "Runtime.evaluate", params: { expression: expr, returnByValue: true } }));
const result = await new Promise((resolve) => {
ws.addEventListener("message", (ev) => {
const msg = JSON.parse(ev.data);
if (msg.id === id) resolve(msg);
});
});
if (result.result?.exceptionDetails) {
console.error(JSON.stringify(result.result.exceptionDetails, null, 2));
process.exit(1);
}
console.log(JSON.stringify(result.result?.result?.value ?? result, null, 2));
ws.close();
process.exit(0);
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |