Flexbox centres boxes, but the eye centres ink. These skills help your agent find the places where an icon, glyph or label looks off even though its box is perfectly aligned. They measure each one in the browser and fix it by a fraction of a pixel. Then they measure again to prove the fix held.
Free and open source under the MIT license, on GitHub.
Install
Installs all four skills for the agents you pick. Keep them together: the three steps read their rules from optical-alignment.
Align your first component
- Start the project's dev server, so the agent can open the component in its browser.
- Ask for the whole loop, and name the component or route:
Prompt - Read the ledger at .optical/filter-menu.md. Each finding has its measurement before and after, the fix applied and its status.
Or run one step at a time: “/optical-audit the settings page,” then “/optical-fix,” then “/optical-verify.”
The skills
- optical-alignment runs the three steps in order, for up to three rounds of fixes. It holds the shared rules and the in-page measuring script.
- optical-audit measures the component in the browser and writes every finding to a ledger file. It changes no code.
- optical-fix turns the open findings into a plan and applies it, with a comment on each value giving the measurement it came from.
- optical-verify measures every finding again and checks that the layout didn't move. Anything unfinished or still off goes back to optical-fix.
What it checks
- Icons beside labels, placed by stroke weight, not by the box
- All-caps labels, which centre on cap height
- Lopsided glyphs: tags, play triangles, arrows, carets
- Columns of icons, checkboxes and chevrons on one line
- Text inside pills, badges and keyboard keys
- Search fields, headers and rows sharing one left edge
- Icon-side padding on buttons and chips
- Side bearings on large headings
An offset of 0.15px or more is a finding, and a fix passes at 0.05px. Anything over 1.5px is treated as a layout bug, and the skill won't cover it with a transform.
First run
On a filter menu whose icons I had already nudged by hand, the audit found three things I had missed. All three were fixed and verified in one round, with no change to the layout.
- ARR icon, beside an all-caps label0.55px low → 0.00
- Avatar initials in their circles0.20px high → 0.01
- Section labels against the icon column0.74px left → 0.01
Install options
- -ginstall for your user, not one project
- -a <agent>pick agents, e.g. claude-code, cursor
- --allevery skill, every agent, no prompts
- -llist the skills, install nothing
Requirements
- An agent that reads SKILL.md skills
- A browser the agent can drive, for exact measurements
- A dev server that renders the component
Read the full rules in the README, or the idea behind them in Optical spacing.