better-layout
Skill1 starsChanged 4 months agoMITView on GitHub
Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.
30 other projects use a version of this, 24 of them edited.
Adopted by
Most recently taken up by
- anis-dr/skillsedited, first seen Nov 29, 2026
- TudorAndrei/skillsedited, first seen Nov 29, 2026
- compozy/compozyedited, first seen Nov 28, 2026
- jjfantini/humblSKILLStheir own version, first seen Nov 22, 2026
- iricardofernandes/skillsedited, first seen Nov 22, 2026
- vaferkhanom/Website-skillsedited, first seen Nov 16, 2026
Used with
Projects with it also use build-design, improve-ui and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
stritarSkillbuild-design
Builds UI from a Figma file or a design image so it matches the design, using the project's existing tokens and components.
Also in 3 projects that use this
Discriminative-shoji607Skillimprove-ui
Audit an existing product surface against its own design evidence, identify verified UI problems, and write self-contained implementation plans for another agent. Strictly read-only on product source. Use when asked to review, refine, improve, or clean up an interface without replacing its identity; investigate design-system drift; or prepare a design handoff.
Also in 3 projects that use this
sanmidableSkillgood-css
Also in 3 projects that use this
launchapp-devSkillstate-machine
Model complex UI behavior as finite state machines with states, events, and transitions.
Also in 3 projects that use this
ItamarZand88Skillcreate-design-md
Create a new DESIGN.md file for any website, app, or custom design system. Use when the user wants to document a design system in DESIGN.md format, extract design tokens from a URL or existing CSS, create a custom design system from scratch, author a DESIGN.md for their own project, or contribute a new design to the awesome-design-md collection. Also trigger when user mentions "design system documentation", wants to formalize their app's visual language, or asks to create or generate a DESIGN.md file.
Also in 3 projects that use this
agentset-aiSkillfixing-metadata
Ship correct, complete metadata.
Also in 3 projects that use this
Other versions30 projects use a version of this.
Word for word · 3
- trycompai/crm★ 12k100% same
- julianromli/faiz-skills★ 16100% same
- SkotAlexsander/skills★ 1100% same
Edited · 24
- jakubkrehel/skills★ 13k10% same
- talebook/talebook★ 5.9k92% same
- compozy/compozy★ 2.9k35% same
- moumen-soliman/uitripled★ 1.4k37% same
- genex-games/genex-desktop★ 91835% same
- Atharvsinh-codez/ObsidianUI★ 64592% same
- boraoztunc/skills★ 47392% same
- Dimon94/dverity★ 10735% same
- Dimon94/skills★ 10735% same
- Tresnanda/kybern★ 10235% same
14 more not listed
Wrote their own version · 3
- hsynozdamar-byte/claude-skills-edited★ 4same name
- cill-i-am/skills★ 0same name
- jjfantini/humblSKILLS★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- better-accessibilitySkill
- better-colorsSkill
- better-interfaceSkill
- better-operational-interfaceSkill
- better-typographySkill
- better-uiSkill
- better-writingSkill
- bof-operational-uiSkill
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 27 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
- Distinctive: line 12
Treat the numeric values below as starting points for interfaces without an established density or spacing system.
- Very specific: line 78
Use this format only when the user asks for a standalone layout review.
- Very specific: line 114
When there are no findings, omit the tables, state "No actionable layout findings", report verification, and end with Approve.
“Common” is measured: kept by at least 6 in 10 of the 27 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.
Files
Layout that communicates structure
Layout communicates before a single word is read: position, spacing, and alignment carry hierarchy on their own, and generous space beats decoration. A good layout also survives stress: resize it, translate it, mirror it for RTL, and it should still hold together. Apply these principles when building or reviewing UI code, and express every change in the project's existing styling system (Tailwind, plain CSS, CSS-in-JS); never introduce a second styling approach.
Hit-area sizes and focus behavior are covered by the better-accessibility skill; visual polish (radius, shadows, animation) by the better-ui skill; line length and text spacing by the better-typography skill.
Treat the numeric values below as starting points for interfaces without an established density or spacing system. Preserve deliberate platform chrome, compact professional tools, and project tokens when they remain usable under hit-area, zoom, localization, and viewport stress tests.
Quick Reference
| Category | When to Use |
| Grouping & Alignment | Space vs separators, alignment edges, logical properties, importance ordering |
| Spacing & Adaptivity | Spacing between targets, layout margins, progressive disclosure, full-bleed content, breakpoints, i18n growth |
Core Principles
1. Group with Space, Not Lines
Negative space is the primary grouping tool; background shapes second; separator lines last, only where space alone can't carry the structure. The gap between groups must be at least 2× the gap within a group (8px intra-group → 16px+ inter-group), or the grouping reads as noise.
2. Keep Controls Distinct from Content
Interactive elements must look interactive: a background shape, a border, or a consistent placement zone. Never style a control identically to adjacent static text.
3. Align to Shared Edges
Pick alignment edges and stick to them; every stray edge reads as noise. Use one project spacing step for each level of subordination (16px is a useful default). Use logical properties (padding-inline-start, margin-inline-end) for direction-dependent layout; reserve physical left/right for genuinely physical geometry.
4. Order by Importance
The most important content sits near the top and the leading edge; reading order flows top-to-bottom, leading-to-trailing. Think in leading/trailing, not left/right.
5. Hint at Hidden Content
Progressive disclosure needs a visible affordance. Use the project's established cue; without one, let the next item peek 16–32px past the scroll edge or show a disclosure control. Content hidden with zero cue may as well not exist.
6. Breathing Room Between Targets
Without an established density system, start with 12px between adjacent bordered or filled controls and 24px of clearance around borderless text- and icon-only controls. Compact layouts may use less when better-accessibility hit areas do not overlap and the controls remain visually distinct.
7. Inset Buttons from the Edges
In content layouts, keep full-width buttons inside the layout margins (start near 16px inline on mobile) with a visible radius. Edge-to-edge actions are acceptable when they intentionally follow established platform or application chrome, account for safe areas, and remain distinguishable from system UI.
8. Content Bleeds, Controls Float
Backgrounds and media extend to the viewport edges; controls and text stay inside the layout margins and safe areas (env(safe-area-inset-*)). Sticky chrome floats above the content layer, it doesn't dam it.
9. Hold Structure Until It Breaks
Breakpoints come from the content, not device presets. Keep the expanded layout as long as it genuinely fits and collapse late; prefer container queries for component-level adaptation. Test the smallest and largest sizes first.
10. Plan for Growth and Clipping
Plan for substantial and language-dependent string growth rather than relying on a universal percentage: no fixed widths or heights on text containers, and let rows wrap. Never park critical actions where resizing or scrolling clips them; keep them reachable in the normal flow or stable chrome appropriate to the product.
Common Mistakes
| Mistake | Fix |
| Separator line where spacing would do | Remove the line, double the gap between groups |
margin-left / padding-right in a localizable layout | margin-inline-start / padding-inline-end |
| Content-layout button accidentally touches the viewport | Inset within the project margins; preserve intentional platform chrome |
| Carousel/scroller that looks complete | Let the next item peek 16–32px past the edge |
| Adjacent controls merge or expanded hit areas overlap | Increase the gap using the project scale; use 12px/24px as starting points |
| Breakpoints at 768/1024 because they're the defaults | Break where the content actually stops fitting |
| Fixed-width text container sized to one language | max-width + wrapping; test pseudo-localization and representative locales |
| Primary action at the clip-prone bottom of a pane | Sticky positioning or stable chrome with safe-area padding |
Review Output Format
Use this format only when the user asks for a standalone layout review. When better-interface orchestrates the review, provide domain evidence and findings to that skill and let its output format, severity scale, consolidation rules, cap, and verdict take precedence.
Present the standalone review in two parts.
Findings
Group all confirmed findings by principle. Use a markdown table with Severity, Location, Before, After, and Why columns. Never use separate "Before:" / "After:" lines.
- Severity:
HIGHblocks content or an action at a supported viewport;MEDIUMharms hierarchy, reading order, or adaptability;LOWis isolated alignment or spacing polish. - Location: cite
path/to/file:line. If the artifact has no source files, cite the exact screen and component instead. - Before / After: show the current layout and an actionable replacement.
- Why: name the violated principle and its effect on comprehension or adaptability.
Consolidate a repeated systemic issue into one row and list every affected location. Omit principles with no findings.
Example
Group with space, not lines
| Severity | Location | Before | After | Why |
| LOW | src/Settings.tsx:41 | border-b on every settings row | Remove borders; use space-y-2 within groups and space-y-8 between groups | Spacing communicates grouping with less visual noise |
| LOW | src/ProfileForm.tsx:58 | <hr> between form sections | Replace with mt-10 on each section heading | Section hierarchy should not depend on repeated rules |
Align to shared edges
| Severity | Location | Before | After | Why |
| LOW | src/Card.tsx:24 | Card text at pl-4, card icon at pl-3 | Align both to the same pl-4 edge | Shared edges create a legible structure |
| MEDIUM | src/Nav.css:19 | margin-left: 16px | margin-inline-start: 16px | Physical properties break direction-aware layouts |
Verification and Verdict
After the findings:
- Verification: list the exact checks run and their observed results across the relevant viewport widths, reading order, zoom, and RTL state. If a check was not run, state what still needs verification.
- Verdict:
Blockif anyHIGHfinding remains,Needs changesif onlyMEDIUMorLOWfindings remain, andApproveonly when no actionable findings remain.
When there are no findings, omit the tables, state "No actionable layout findings", report verification, and end with Approve.
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
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.

