- Home
- Skills
- Frontend & Web Apps
- UI Geometry Audit (CDP)
Works with the AI Agents you already use
UI Geometry Audit (CDP)
Measure centering, glass-layer depth, and clipped controls on a live page over CDP — stop trusting a green test.
Free
UI Geometry Audit (CDP)
Example session with this skill installed
The labels in my primary buttons look slightly off-center. Can you audit the layout on http://localhost:3000/buttons?
- Read your context and instructions
- Compiled the ui geometry audit
- Generated the design tokens stylesheet
I have audited the button centering on the provided URL using the audit-control-centering.mjs script. I connected to the local Chrome instance on port 9222 and measured the line-box offsets for all matched button elements.
UI Geometry Audit Results: Button Centering
| Selector | Measured Offset | Status | Detected Issue |
|---|---|---|---|
button.btn-primary | 1.2px (Vertical) | FAIL | Blockified-inline-block offset |
button.btn-secondary | 0.2px (Vertical) | PASS | Within tolerance (< 0.6px) |
button.btn-outline | 0.8px (Vertical) | FAIL | Line-height / Padding mismatch |
a.btn-link | 0.1px (Vertical) | PASS | Within tolerance (< 0.6px) |
The audit detected a consistent 1.2px vertical offset in your primary buttons. This usually happens when a button is rendered as a blockified inline-block. To fix this, you should update your CSS to use a flexbox centering pattern.
/* Recommended Fix for .btn-primary */
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
/* Ensure min-height matches expectations */
}
Next steps
- Apply the
display: inline-flexfix to the.btn-primaryclass instyles/buttons.css. - Re-run the audit script to verify the offset falls below the 0.6px threshold.
- Check the
.btn-outlinepadding-to-line-height ratio to resolve the 0.8px drift.
buttons.css
CSS · design tokens
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Visual bugs often pass CI because traditional tests only check for the presence of CSS rules, not their rendered result. This skill provides a set of diagnostic scripts that connect to a live Chrome instance via DevTools Protocol to measure actual element geometry and stacking. It replaces "it looks right to me" with pixel-accurate proof.
What it does
- Verify Centering measures the line-box offset of controls to detect micro-misalignments larger than 0.6px.
- Audit Navigation validates sidebar highlights across multiple routes and ensures inner-pane scroll positions persist during filter events.
- Measure Stacking Depth counts active
backdrop-filterlayers to identify nested glass effects that degrade performance or legibility. - Diagnose Layout Bugs detects overflowing, clipped, or "squeezed" elements by reporting actual bounding box dimensions from the browser runtime.
How it works
- Start Chrome or Edge with the
--remote-debugging-port=9222flag enabled. - Target a specific script based on the visual symptom (centering, navigation, or glass stacking).
- Execute the script via Node.js providing the target URL and optional CSS selectors.
- Analyze the exit codes and numeric offsets to identify specific CSS fixes like
inline-flexcentering or scroll-pane resets.
Frameworks & tools
The scripts are built for Node.js 18+ and 21+. They utilize the Chrome DevTools Protocol (CDP) and the ws library to interact with Chromium-based browsers.
Why this beats prompting it yourself
Standard LLM prompting cannot "see" the actual rendered pixels or calculate real-time offsets in a browser runtime. This skill provides the specific CDP logic required to extract ground-truth geometry that an AI otherwise has to guess from source code.
Use cases
- Confirming that a "vertical centering" fix actually works across different viewport sizes.
- Ensuring a sidebar highlight correctly follows the active route during navigation.
- Preventing "double-glass" blur performance issues in complex UI dashboards.
- Validating that form submissions do not snap a user's scroll position back to the top.
Known limitations
Requires a Chromium browser running with remote debugging enabled. It does not bundle a browser or provide visual screenshots, only numeric geometry data.
Requires Node.js 18+ and a Chromium browser running with --remote-debugging-port. Does not support automated POST form testing. Limited to geometry measurements, not aesthetic "feel".
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 13 days ago
- Free with an Agensi account
Requires