law-of-common-region — Claude Code skill for UI grouping
A Gestalt skill that tells your agent when to group elements with a container, background or border instead of spacing alone.
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a claude-codeWhat law-of-common-region does
The skill teaches an agent to apply the Law of Common Region: elements inside one boundary or on a shared background read as a group even when they sit far apart. It covers the principle itself, a side-by-side comparison with the Law of Proximity, and a table of typical uses — cards, sidebars, modals, form sections, table rows, tag groups, tooltips.
The rule of thumb it gives: try proximity first, reach for a container when spacing is not enough. Pick the weakest container that does the job — background before border, border before a card surface. A separate section covers when containment backfires. Cards on everything flatten hierarchy, nesting past two levels adds noise, and a border for its own sake is clutter.
There is also a practical side: consistent corner radius, padding and shadow for containers inside a design system, plus a check that groupings hold up in dark mode and low contrast. If spacing already communicates the group, adding a border is redundant — worth a second look at the layout rather than extra decoration.
What it helps with
- split a long form into logical sections
- make a card read as a discrete item users can act on
- separate sidebar navigation from page content
- tie scattered content together with a section background
- highlight a table row on hover or selection
Example prompts for the agent
- Group the fields in this form by meaning — use law-of-common-region, not just spacing
- Review this layout: where is proximity not enough and a common region needed? Apply law-of-common-region
- Too many cards here and the hierarchy is gone. Walk the layout with law-of-common-region and drop redundant containers
How to install law-of-common-region
1Skills CLI (Vercel)
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a claude-code2Manually: put the files in place
~/.claude/skills/law-of-common-region/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/law-of-common-region/
1Skills CLI (Vercel)
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a codex2Manually: put the files in place
.agents/skills/law-of-common-region/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a cursor2Manually: put the files in place
.cursor/skills/law-of-common-region/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Owl-Listener/designer-skills law-of-common-region2Manually: put the files in place
.github/skills/law-of-common-region/SKILL.md1Skills CLI (Vercel)
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a gemini-cli2Platform CLI
gemini skills install https://github.com/Owl-Listener/designer-skills --path ui-design/skills/law-of-common-regionManually: put the files in place
.devin/skills/law-of-common-region/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about law-of-common-region
How do I install law-of-common-region in Claude?
Run npx skills add Owl-Listener/designer-skills --skill law-of-common-region -a claude-code. The skill file then lands at ~/.claude/skills/law-of-common-region/SKILL.md.
What does law-of-common-region do?
It helps the agent group interface elements through a shared boundary or background: cards, panels, form sections, modals. The skill explains when a container earns its place and when spacing is enough.
How is law-of-common-region different from law-of-proximity?
Proximity works through distance and adds no visual weight; common region works through a border or background. The skill says to start with proximity and add a container when it falls short.
Source text
SKILL.md · MIT
--- name: law-of-common-region description: Apply the Law of Common Region — a shared container, background, or border groups elements regardless of spacing. Use when grouping must survive a tight layout. For grouping by spacing alone, use `law-of-proximity`. --- # Law of Common Region You are an expert in Gestalt visual organization and containment-based grouping. ## What You Do You apply the Law of Common Region to create clear groupings using visual boundaries — backgrounds, borders, cards, and surfaces — so users understand which elements belong together. ## The Principle Elements enclosed within a shared boundary or placed on a shared background are perceived as a group, even when they are not especially close together. Containment is one of the strongest grouping signals available: - A card with a background creates an unambiguous group - A colored section background ties disparate content into a unit - A panel border tells users that everything inside belongs together ## Common Region vs Proximity Both signal grouping; they work differently: | | Law of Proximity | Law of Common Region | |---|---|---| | Mechanism | Spatial closeness | Shared boundary or background | | Best for | Related items already close | Items that need a stronger or explicit boundary | | Overhead | Zero — just spacing | Visual weight — a border or background is present | | When to prefer | Most layout grouping | Cards, panels, sidebars, tabbed sections, modals | Use proximity first; add common region when proximity alone is insufficient or when the grouping boundary needs to be explicit (e.g. a card that can be acted on as a unit, a form section within a larger form). ## Applications | Pattern | Common Region Role | |---|---| | Cards | Container clearly delimits a discrete item | | Sidebar | Background or border separates navigation from content | | Modal / sheet | Surface elevation signals an isolated task context | | Form sections | Background or rule divides logical groups within a long form | | Table rows | Hover/selection background shows a row as a unit | | Tag groups | Pill background makes each tag a discrete object | | Tooltip | Container boundary distinguishes overlay from page content | ## When Containment Is Counterproductive - Using cards for everything flattens hierarchy — not every group needs a container - Nested common regions create visual noise; limit nesting depth to two levels - A border for its own sake adds clutter; if proximity already communicates the grouping, the border is redundant ## Best Practices - Give containers consistent corner radius, padding, and shadow within a design system - Use the weakest container that gets the job done — background before border, border before card surface - Ensure common regions survive in low-contrast or dark mode contexts - Don't combine proximity and common region redundantly on the same grouping unless you are establishing hierarchy (a card inside a panel section, for example)
© Owl-Listener · MIT · Owl-Listener/designer-skills