Better Layout is an agent skill for page and component structure. It groups content with space first, aligns it to shared edges, orders it by importance and keeps the DOM order matching the visual order, then checks that the result survives a resize, a long translation and a right-to-left mirror.
Every fix is written in the project’s own styling system and spacing scale. A finding needs a failure that can be shown, such as a clip, an overlap, a broken mirror or a misread group.
What You Get
- Grouping and alignment fixes that use space before lines, with shared alignment edges and one spacing step per nesting level
- Logical-property rewrites such as margin-inline-start and inset-inline-start, so a layout mirrors correctly for RTL
- Responsive guidance using container queries, minmax(0, 1fr) tracks, 100dvh and scroll-padding for sticky headers
- Room for growth, with max-width and min-height containers that survive long translated strings
- A detection table of CSS patterns such as width 100vw or float left, each with its fix
Common Use Cases
- Checking a card grid whose long text overflows its track at narrow widths
- Converting a stylesheet from left and right properties to logical ones before adding an RTL locale
- Fixing anchored links and focused fields that land beneath a sticky header
- Reviewing a toolbar of borderless controls for clearance and hidden overflow cues
What Makes It Unique
The numbers it gives are starting points that apply only where the project has no spacing scale, so existing tokens always win. It tests structure under three stresses, resizing, translation and mirroring, and it names a one-word button label as the riskiest element for growth because short strings grow proportionally more.
Under The Hood
The skill is a SKILL.md with three reference files for grouping and alignment, spacing and adaptivity, and reporting. It has no scripts. The agent reads your markup and styles, compares logical against physical properties, container and media queries against your supported viewports, and DOM order against visual order. With a browser it checks each supported width, 320px, 200 percent zoom and the RTL mirror. A review leaves files untouched, and edits happen when you ask for fixes.