Skill library

Agent skill UI design

Better Layout

Improve grouping, alignment and reading order across breakpoints, long translations and right-to-left layouts.

  • Responsive layout
  • Alignment
  • Visual hierarchy

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add jakubkrehel/skills --skill better-layout --agent claude-code --yes

Check this file in your project.claude/skills/better-layout/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add jakubkrehel/skills --skill better-layout

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Bring the current spacing tokens, a representative long label, and the supported viewport and locale ranges.

View operation manual

What this skill helps with

  • Group related elements with spacing and align them to common edges.
  • Preserve the visual and reading order when a layout stacks.
  • Leave room for translated labels and mirrored layouts.

Good for

  • Responsive feature sections
  • Multilingual page layouts
Skill name
better-layout
Workflow
Make a list row fit long translations
Deliverable
A row that grows or reflows while keeping the primary control reachable.
Skill name
better-layout

Keep the request tied to one real task

A broad request

Set fixed widths on the text and action to stop them moving.

The fixed allocation can clip an actual translation or move a required action outside the visible viewport.

A checkable workflow

  1. Find the content width where the row breaks
  2. Give the text room without displacing controls
  3. Repeat the narrow and translated states

Better Layout operation manual

Fix one real overflow and verify the same content in wide, narrow, and mirrored layouts.

Replace the bracketed details with the component, route, or source you want to use.

  1. Find the content width where the row breaks

    Reproduce the bug with the actual label and action.

    Prompt · Step 1
    Use better-layout to inspect [list row and preview route]. Load a real long label and action at the widest and narrowest supported sizes. Find the width where text, metadata, or controls first clip or overlap. Inspect the row’s source order, grid or flex tracks, spacing tokens, and direction-aware properties. Report a reproducible viewport and exact code location.
  2. Give the text room without displacing controls

    Address the verified failure using the current spacing scale and reading order.

    Prompt · Step 2
    Use better-layout to fix [approved row overflow] in [component path]. Reuse existing spacing tokens and preserve the DOM reading order. If an inflexible track is the cause, use the applicable minmax(0, 1fr) or min-width: 0 pattern and choose when the content should wrap or the layout collapse based on actual fit. Use logical properties for anything that mirrors. Keep full text reachable where it is truncated.
  3. Repeat the narrow and translated states

    Check the same label and action around the failing width.

    • The original label fits or wraps at the verified width.
    • The primary action stays visible and logically ordered.
    Prompt · Step 3
    Use better-layout to verify [changed row and original break width]. Test the same long label on both sides of the breakpoint and with one long-string locale or a pseudo-localized fixture. Inspect RTL where supported and confirm visual and DOM order agree. Verify the primary action remains reachable and record exactly which layouts, widths and locales were tested.

Find the relevant rule

Provide the actual target and point to the installed reference.

Rows break only when translatedReference
Command or reference
spacing-and-adaptivity.md
Examples
Test realistic long strings and identify the first width that fails.
Leading and trailing positions fail in RTLReference
Command or reference
grouping-and-alignment.md
Examples
Use logical properties and compare visual order with DOM order.

Better Layout troubleshooting

Should I choose breakpoints by device name?

Find where the actual content stops fitting. Reusable components can adapt to their container when the project supports it.