/refactoring-ui-skills:apply-consistent-spacingfrom refactoring-ui-skills
Applies a systematic spacing scale with 25% minimum jumps for UI layouts. Evaluates and fixes margin/padding to create clear visual grouping and breathing room.
Ships in refactoring-ui-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use a systematic spacing scale to create rhythm, group related elements, and separate distinct sections while starting with generous whitespace and removing as needed.
Generative + Evaluative
Maps spatial relationships to a systematic spacing scale with minimum 25% differences between values, ensuring clear grouping and breathing room.
Base: 16px (browser default)
4px, 8px, 12px, 16px, 24px, 32px, 48px, 64px, 96px
Why these values:
| Spacing | Usage |
|---|---|
| 4px | Icon gaps, tight internal padding |
| 8px | Small component gaps, tight button padding |
| 12px | Input padding, component internal spacing |
| 16px | Standard gap, card padding |
| 24px | Section internal padding, larger gaps |
| 32px | Major section separation |
| 48-64px | Page section breaks |
| 96px | Hero sections, major page divisions |
Instead of adding space until something looks okay, start with way too much space and remove until it's right.
Why: Elements given minimum breathing room look "not actively bad" but not great. Starting with excess ensures adequate whitespace in the final design.
Ensure there is more space around the entire group than within the group.
Example - Form Labels:
Just because you have 1200-1400px of canvas doesn't mean content should stretch to fill it.
Instead of using borders to separate elements:
| Failure | Description | Fix |
|---|---|---|
| Arbitrary Values | 15px here, 17px there | Use systematic scale exclusively |
| Weak Grouping | Equal spacing within and between groups | Make between-group spacing significantly larger |
| Ambiguous Spacing | Label and input have same margin | Reduce within-group, increase between-groups |
| Border-Dependence | Using borders instead of space | Increase gap, remove border |
| Canvas Filling | Content stretched to 1200px unnecessarily | Use only the space needed; let whitespace fill rest |
| Minimal Breathing Room | Adding just enough space to not look bad | Start with excess, remove until right |
| Inconsistent Padding | Some buttons 8px, others 12px | Pick one scale value, apply everywhere |
establish-visual-hierarchy (spacing reinforces hierarchy)group-related-elements (proximity shows relationships)Input: Form with: Title (margin-bottom: 16px), Label (margin-bottom: 12px), Input (margin-bottom: 12px), next Label (margin-top: 12px)
Evaluation: FAIL - Ambiguous spacing
Recommendation:
Before:
Label A
[Input A]
Label B <- Ambiguous: belongs to A or B?
[Input B]
After:
Label A
[Input A]
Label B <- Clearly belongs to B
[Input B]
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub gnurio/refactoring-ui-plugin --plugin refactoring-ui-skills11 skills in this plugin
/establish-visual-hierarchyDetermine what UI element draws attention first, second, third using size, weight, color, and de-emphasis strategies/apply-typography-scaleCreate clear typographic hierarchy using hand-crafted font sizes, weights, and colors/build-color-paletteCreate comprehensive palette with 8-10 greys, 5-10 primary, 5-10 accent shades/design-button-hierarchyCreate clear primary/secondary/tertiary action distinctions/eliminate-visual-clutterRemove unnecessary borders, backgrounds, shadows, decorations/design-empty-statesCreate helpful, actionable zero-content statesOther plugins' skills for the same job