Design alignment

From Intense-Visions/harness-engineering · View interactive version

Design alignment is an AI agent skill from the GitHub repository Intense-Visions/harness-engineering. > Visual order through edge alignment, center alignment, optical alignment, and the invisible structure that consistent alignment creates across a page

How to use this skill

Skill file

Alignment

Visual order through edge alignment, center alignment, optical alignment, and the invisible structure that consistent alignment creates across a page

When to Use

Instructions

  1. Prefer left-edge alignment as the default. Left-edge alignment (in LTR languages) creates the strongest visual structure because it establishes a single vertical line that the eye can follow down the page:
  1. Use center alignment only for short, isolated content. Center alignment creates no strong edge — the left and right sides of each line are ragged. This makes it unsuitable for body text but effective for:

Specific threshold: If the text exceeds 3 lines, switch from center to left alignment. Three centered lines are scannable; four begin to feel adrift.

  1. Minimize the number of distinct alignment axes. Every unique alignment point adds visual complexity. Fewer axes = cleaner design:

Stripe's pricing page uses exactly 3 alignment axes: left edge of card content, center of card headers, and right edge of the price amount. Three axes for an entire complex page.

  1. Understand optical vs. mathematical alignment. Mathematical alignment (pixel-perfect coordinates) does not always look aligned to the human eye. Certain shapes require optical correction:
  1. Use cross-element alignment to create cohesion. Elements in different sections that share an alignment axis feel related, even across significant vertical distance:

Implementation: In CSS, this means using consistent margin-left/padding-left values across components, not per-component values. A design token like --content-inset: 72px applied to headings, paragraphs, and list items creates automatic cross-element alignment.

  1. Align related elements across cards and containers. When displaying multiple cards, tiles, or panels side by side, their internal elements should align horizontally:

Details

Alignment Strength Hierarchy

Not all alignment types create equal visual order:

  1. Left edge (strongest in LTR) — Creates a hard vertical line. Used for body text, navigation, form layouts. The eye returns here after every line.
  2. Top edge — Creates a horizontal line across elements. Critical for card grids, inline elements, and tab bars.
  3. Baseline (text) — Aligns the invisible line that letters sit on. Stronger than bounding-box alignment for mixed-size text.
  4. Right edge — Creates a vertical line on the right. Useful for numbers (right-align for easy comparison), metadata, timestamps.
  5. Center (weakest) — Creates no edge at all. The alignment point is invisible. Use sparingly and only for isolated, short content.

Alignment Audit Procedure

To evaluate alignment in an existing design:

  1. Draw vertical lines at every left edge, right edge, and center point. In Figma, use layout grids or guide lines.
  2. Count unique x-coordinates. A well-aligned page has 2-4 distinct vertical axes. More than 6 indicates alignment chaos.
  3. Check for near-misses. Elements that are 2-4px off from a shared alignment axis look worse than elements that are intentionally offset by 24px+. Near-misses read as errors. Either snap to the axis or move far enough away to look intentional.
  4. Verify text baseline alignment. Mixed-size text on the same line (e.g., a 24px heading next to a 14px badge) should share a baseline, not a top edge.
  5. Test cross-section alignment. Scroll through the page — do section headings share a left edge? Do content blocks maintain consistent indentation?

Anti-Patterns

  1. Centered everything. Centering all text and elements because it "looks balanced." In practice, center alignment creates no strong edge, making the layout feel floating and unanchored. Center-aligned body text is particularly harmful — the ragged left edge forces the eye to search for the start of each line. Apple centers hero headlines (2-3 words) but left-aligns all body text, feature descriptions, and navigation. Follow the same rule.
  1. Approximate alignment. Elements that are 2-5px off from true alignment. This is worse than no alignment at all — the near-miss tells the viewer's subconscious that the designer was trying for alignment and failed. At 20px+ offset, it reads as an intentional design choice. At 3px offset, it reads as a bug. Snap to the grid or offset by a full grid unit (24px, 32px).
  1. Mixing alignment systems. A left-aligned heading, center-aligned body paragraph, and right-aligned caption on the same page with no structural justification. Each alignment system creates different visual lines — mixing them randomly creates visual noise. Stripe uses left-edge alignment for 95% of its interface and reserves center alignment exclusively for pricing plan names and hero text.
  1. Bounding-box text alignment. Aligning mixed-size text by the top of its CSS bounding box rather than by its baseline. A 32px heading and a 14px label aligned to their top edges will have misaligned baselines — the smaller text appears to float above the line. CSS align-items: baseline fixes this in flex containers. Verify visually with a horizontal guide line.

Real-World Examples

Apple Product Comparison Tables:

Stripe's Pricing Page:

Material Design List Items (Spec):

Vercel Dashboard Navigation:

Source

Process

  1. Choose a primary alignment axis (left-edge for most layouts) and commit to it for all main content
  2. Limit total alignment axes to 2-4 per page; audit by drawing vertical lines at every unique x-coordinate
  3. Verify optical alignment for non-rectangular shapes and mixed-size text; adjust 1-3px as needed for visual correctness

Harness Integration

This is a knowledge skill. When activated, its content is injected into the system prompt to guide element placement decisions. It does not execute code or modify files. Use alongside design-grid-systems for structural grid definition and design-consistency for system-wide alignment patterns.

Success Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.