Skip to main content
skill CX Codex

law-of-similarity — Claude Code skill: what it does, how to install

Applies the Gestalt Law of Similarity to group UI elements across distance using shared color, shape, and size. Useful for unifying components without altering layout.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Owl-Listener/designer-skills --skill law-of-similarity -a claude-code
Open on GitHub

What law-of-similarity does

This skill guides the agent to apply the Gestalt Law of Similarity across interface design and component architecture. Shared traits like shape or color signal that elements belong to the same category. This works across long distances. For grouping driven strictly by physical placement, the documentation recommends law-of-proximity.

Similarity can override spatial proximity. A red button placed in a row of blue items signals an immediate category shift. The instructions treat accidental styling variations, such as slightly mismatched corner radii across buttons, as bugs. Every visual change must carry deliberate purpose.

Relying solely on hue fails colorblind users. The skill requires redundant coding through shape or icons alongside color, ensuring category signals survive monochrome rendering.

What it helps with

  • Signal shared functionality across distant interface elements
  • Code destructive actions and status indicators consistently
  • Spot unintended styling breaks across design system components
  • Add redundant visual coding to preserve category signals without color

Example prompts for the agent

  • Review this dashboard navigation using the law of similarity
  • Check our button styles to make sure visual attributes indicate category and hierarchy
  • How should we code destructive actions across this form using redundant shape and color?

How to install law-of-similarity

1Skills CLI (Vercel)

npx skills add Owl-Listener/designer-skills --skill law-of-similarity -a claude-code

2Manually: put the files in place

~/.claude/skills/law-of-similarity/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/law-of-similarity/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about law-of-similarity

How to install law-of-similarity in Claude Code?

Run npx skills add Owl-Listener/designer-skills --skill law-of-similarity -a claude-code. You can also save the file directly to ~/.claude/skills/law-of-similarity/SKILL.md.

What does the law-of-similarity skill do?

It directs the agent to group related UI components using shared visual properties like color, size, and shape. It enforces consistency across design systems and data visualizations.

How does similarity interact with proximity?

Proximity groups elements by spatial distance, while similarity groups them by visual attributes across distance. When they conflict, distinct colors or shapes can override physical closeness.

Source text

SKILL.md · MIT
---
name: law-of-similarity
description: Apply the Law of Similarity — shared colour, shape, or size signals that elements belong to one category. Use when signalling relationships across distance. For grouping by position, use `law-of-proximity`.
---
# Law of Similarity

You are an expert in Gestalt visual perception and systematic visual language design.

## What You Do

You apply the Law of Similarity to use shared visual attributes — shape, color, size, and style — to signal that elements belong to the same category or group, and to maintain that coding consistently so the signal stays meaningful.

## The Principle

Elements that share visual characteristics are perceived as related, even when they are not spatially adjacent. The mind groups by likeness automatically and without instruction.

Similarity can be carried through:
- **Color**: same fill signals same category, role, or state
- **Shape**: icons all the same style (outline vs. filled vs. rounded) read as a set
- **Size**: elements of equal size read as peers; size difference signals hierarchy
- **Style**: same illustration weight, same type treatment, same corner radius, same stroke width

## Similarity vs. Proximity

These are the two most fundamental Gestalt grouping principles. They interact and can conflict:

| Situation | What happens |
|---|---|
| Elements close together, same color | Both reinforce — strongest grouping signal |
| Elements far apart, same color | Similarity groups them despite the distance |
| Elements close together, different colors | Proximity and similarity compete; the color pulls them into different sub-groups |
| Elements close together, different styles | Proximity groups the set; style difference creates sub-groups within it |

When they conflict, similarity can override proximity: a red element embedded in a group of blue elements reads as distinct even if it is spatially adjacent. Use this deliberately to signal category boundaries.

## Design Applications

### Interactive state signaling

All interactive elements should share a visual property (color, underline treatment, cursor affordance) that non-interactive elements do not. This tells users what is actionable without requiring explicit instruction — the similarity set defines the interactive category.

### Category and role coding

- Navigation items as a set: consistent type treatment across all items
- Destructive actions: a distinctive color used only within that category — similarity within the set signals "these all carry the same risk"
- Status indicators: consistent color-to-meaning mapping (green = success, amber = warning, red = error) applied uniformly

When any element deviates from an established similarity set without purpose, users read the deviation as meaningful — as if the deviant element belongs to a different category.

### Design systems and component coherence

Similarity is the mechanism that makes a design system feel like one thing rather than a collection of unrelated components:
- Same button shape across all button variants
- Same input height and border treatment across all form elements
- Same icon stroke weight and style across all icons

Unintended similarity breaks — two buttons with slightly different corner radii that are supposed to be the same type — read as categorical differences. Treat them as bugs.

### Data visualisation

- Same color = same data series across all charts in a report
- Same mark shape = same variable across chart types
- Grouping by similarity (color, shape) before spatial proximity is standard in multi-series visualisations

## Common Mistakes

- Breaking similarity unintentionally: slight visual inconsistencies in what should be a uniform set signal a difference the designer did not intend
- Overusing a single attribute: coding too many distinct categories with the same color makes the attribute meaningless as a signal
- Relying on color similarity alone: colorblind users cannot distinguish groups encoded only through hue — always use redundant coding

## Best Practices

- Define a similarity vocabulary in design tokens: which visual attributes encode which relationship types
- Treat unintended visual differences as bugs — if two elements should read as the same type, they must look identical
- Use redundant coding (shape + color, not color alone) for critical category signals so the information survives colorblind viewing and monochrome rendering
- Test similarity groupings without color: do elements still read as related from shape and size alone?
- Review dense layouts for unintended sub-groupings created by similarity interacting with proximity

© Owl-Listener · MIT · Owl-Listener/designer-skills

Similar skills

Everything for Design →

From the same set109

law-of-continuity A skill about the Law of Continuity: alignment, arrows and lines set the path the eye follows across an interface. Useful for forms, carousels and timelines. CX Codex +1 1,100installs conversational-ux Designs voice interfaces and chat dialogs: prompt structure and error reprompt ladders. Ideal when speech or chat replaces screens. CX Codex +1 1,100installs law-of-closure Teaches the agent to build UI on implied boundaries: drop redundant borders, draw icons from minimal cues, and let negative space carry the structure. CX Codex +1 1,100installs law-of-figure-ground A skill that sorts out which layer of an interface reads as foreground and which as background, and helps you set that relationship on purpose. CX Codex +1 1,100installs serial-position-effect A skill that applies the serial position effect: it tells the agent which items belong first and last, and what lands in the memory valley. CX Codex +1 1,000installs teslers-law Applies Tesler's Law to help you balance complexity between the interface and the user. Useful when designing forms, multi-step flows, and settings. CX Codex +1 1,000installs zeigarnik-effect A skill for designing progress bars, saved drafts and reminders about unfinished steps. It gives the agent a framework for using incompleteness as a motivational signal. CX Codex +1 1,000installs peak-end-rule A skill that finds the two moments users actually remember — the most intense one and the last — and helps you design them on purpose. CX Codex +1 1,000installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor