agentleFS
officialunofficialofficialunofficial/skills/skills/design/alignment/SKILL.md

alignment

Skill7 starsChanged 5 days agoApache-2.0View on GitHub

Measures a running page for edges, gaps, centres and radii that miss by a pixel or two, judges visual weight, and returns a numbered report with proof.

4 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check a running page for things that are out of line or out of balance.

    line 13
  2. Very specific:

    Read the spacing scale from the project's tokens.

    line 25
  3. Very specific:

    On scale: Every padding, gap, and margin is a step on the project's scale (alignment-on-scale).

    line 35

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Alignment

Check a running page for things that are out of line or out of balance. Measure the rendered ink, confirm each finding in a zoomed crop, and return a numbered report.

Measure lines, gaps, centres, and radii. Never estimate them. A miss of 1 to 4px is a finding, because it reads as a mistake while a 16px indent reads as intent. Visual weight has no number, so judge it from the screenshot and show the crop.

Related work belongs elsewhere: opening the running result to verify, comparing against a named reference to match, forcing hover, open, and error states to lab, moving a fix into the shared component to reuse, and rendering every width to viewports.

1. Open the shipped render

Open the page at the viewport it ships at, with a device scale factor of 2. Check each theme and each state the user named. Findings come from the running page, not from reasoning about where the CSS should put things (alignment-measure-the-render).

2. Run the measurement

Read the spacing scale from the project's tokens. Set window.__alignmentOptions = { scale }, then run measure.js in the page through the browser's evaluate call.

It returns findings, each with a rule, the element, the measured values, and a rectangle. Each one is a candidate until step 3 confirms it.

3. Check the lines

Crop each candidate from the 2x screenshot and count the pixels. Drop any finding the pixels do not show.

  • Shared edge. Text, icons, and controls that start a column share one x (alignment-shared-edge).
  • Even gaps. Repeated siblings sit at one gap. A deliberate group break is at least twice that gap (alignment-even-gaps).
  • On scale. Every padding, gap, and margin is a step on the project's scale (alignment-on-scale).

4. Check the centres

  • Ink centre. Text in a control centres on its cap height and baseline, not its line box. Fix with text-box: trim-both cap alphabetic or by balancing the padding (alignment-ink-centre).
  • Icon with label. An icon beside a label centres on the label's cap height (alignment-icon-with-label).
  • Optical glyph. Play icons, arrows, and triangles carry their weight on one side. Nudge them and name the value, such as --play-nudge: 1px (alignment-optical-glyph).
  • Concentric radius. A nested surface's radius is the outer radius minus the inset (alignment-concentric-radius).

5. Judge the weight

Look at the screenshot at 1x and name what the eye lands on first. Compare icon strokes with the text's stem weight, filled icons beside outline icons, and circles drawn the same size as squares. Circles and triangles need about 10% more size than a square to read as equal (alignment-visual-weight).

6. Report with proof

Copy report.html to .alignment/<page>/index.html. That folder is ignored by git and stays out of the source tree. Save the 2x screenshot beside it, write report.js in the shape the header comment of report.html shows, then open the page.

The report draws the numbered outlines and cuts each zoomed crop from the screenshot at runtime, so write data only. Custom markup or hand-cut crops are a finding (alignment-shipped-report). So is a finding with no measurement and no rect (alignment-annotated-proof).

7. Fix only when asked

The report is the deliverable. When the user asks for fixes, change the token or primitive behind each finding. Rerun the script and the screenshot, then report what cleared.

Rules

Each rule pairs the broken case with its replacement.

RuleBrokenReplacement
alignment-measure-the-render"The flex container centres it"Measured in the running page at 2x
alignment-shared-edgeTitle inset 2px from its descriptionBoth start on one ink line
alignment-even-gapsRows at 8, 8, and 12pxRows at 8, 8, and 8px
alignment-on-scalepadding: 6px on a 4px scalepadding: 8px
alignment-ink-centreLabel ink 2px low in its buttontext-box: trim-both cap alphabetic
alignment-icon-with-labelIcon centred on the line box, 1px lowIcon centred on the cap height
alignment-optical-glyphPlay icon centred by its box, looks shifted leftPlay icon nudged 1px right, with a named value
alignment-concentric-radius16px panel in a 16px card at 8px inset8px panel radius
alignment-visual-weight2px icon stroke beside 1.5px text stemsStroke matched to the text weight
alignment-annotated-proof"The button looks a bit off"Finding 3, 1.8px low, with the crop
alignment-shipped-reportHand-cut crops in a page written from scratchreport.html copied, only report.js written

Reporting

Severity. HIGH is a miss visible at 1x on a primary surface, such as a heading column or a primary button. MEDIUM is a 1 to 2px miss, uneven gaps, a radius mismatch, a weight imbalance, or a hand-built report. LOW is an off-scale value that still renders aligned.

Format. One finding per root cause, numbered to match the overlay:

1. file:line - [rule-id] what is wrong (measured values)

Cite the element from the script when you cannot find the source line. Follow with a Rule | Count | Severity summary. The verdict is Block while any HIGH remains and Approve otherwise. Mark canvas, image, and cross-origin content as Not verified.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.