Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问clear审计通过

visual-hierarchy-refactoring视觉层次重构

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,102

周安装

45

GitHub Stars

21

下载量

353
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:visual-hierarchy-refactoring(视觉层次重构)
来源仓库:https://github.com/sanky369/vibe-building-skills
仓库路径:skills/visual-hierarchy-refactoring
安装命令:
npx skills add https://github.com/sanky369/vibe-building-skills --skill visual-hierarchy-refactoring
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/sanky369/vibe-building-skills --skill visual-hierarchy-refactoring

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构或定位布局问题。
  • 使用时需结合项目现有设计系统、路由和构建方式,避免生成孤立片段;涉及页面改动时应配合本地预览确认效果。
  • 安装命令:npx skills add https://github.com/sanky369/vibe-building-skills --skill visual-hierarchy-refactoring
  • 注意:涉及真实页面改动时,应通过本地预览和构建检查确认视觉效果。

SKILL.md

Visual Hierarchy & Refactoring UI

Overview

Visual hierarchy is the principle that design is a function of size, weight, and contrast—not color. When done right, users instantly understand what's important and where to look next. This skill teaches you to establish clear hierarchy through systematic visual decisions.

Core Principle: The Rule of Excessive Whitespace

The most common mistake in interface design is density. When interfaces feel cluttered, the instinct is to shrink text. This is wrong.

The Solution: Start with too much space.

When you have breathing room, users can scan the interface and identify signals amongst the noise. Generous whitespace signals confidence—it implies that the content presented is important enough to stand on its own, without competing for attention.

Application

If a standard margin is 16px, try 32px or 48px. If you feel it's too much space, you're probably on the right track. Reduce from there, but never back to density.

/* Generous whitespace creates confidence */
.card {
  padding: 48px;  /* Not 16px */
  margin-bottom: 32px;  /* Not 8px */
}

.section {
  margin-top: 64px;  /* Breathing room between sections */
  margin-bottom: 64px;
}

Visual Hierarchy Through Size, Weight, and Contrast

1. Size Hierarchy

Size is the most powerful tool for establishing hierarchy. Larger elements draw attention first.

Guidelines:

  • Primary information should be 1.5-2x larger than secondary
  • Each level should be clearly distinguishable
  • Use modular scales (Major Second, Major Third, Perfect Fifth)
/* Size hierarchy */
h1 {
  font-size: 48px;  /* Primary */
}

h2 {
  font-size: 32px;  /* Secondary */
}

h3 {
  font-size: 24px;  /* Tertiary */
}

body {
  font-size: 16px;  /* Base */
}

small {
  font-size: 12px;  /* Tertiary text */
}

2. Weight Hierarchy

Font weight creates visual emphasis without changing size.

Guidelines:

  • Use 2-3 weights maximum (e.g., 400, 600, 700)
  • Bold for emphasis, not for everything
  • Lighter weight for secondary information
/* Weight hierarchy */
h1 {
  font-weight: 700;  /* Bold for primary */
  font-size: 48px;
}

h2 {
  font-weight: 600;  /* Semi-bold for secondary */
  font-size: 32px;
}

body {
  font-weight: 400;  /* Regular for body */
  font-size: 16px;
}

.secondary-text {
  font-weight: 400;  /* Regular, not bold */
  color: var(--text-secondary);
}

3. Contrast Hierarchy

Contrast creates visual separation and guides attention.

Guidelines:

  • High contrast for primary information
  • Medium contrast for secondary
  • Low contrast for tertiary/disabled
/* Contrast hierarchy */
.primary-text {
  color: var(--text-primary);  /* High contrast */
}

.secondary-text {
  color: var(--text-secondary);  /* Medium contrast */
}

.tertiary-text {
  color: var(--text-tertiary);  /* Low contrast */
}

.disabled-text {
  color: var(--text-disabled);  /* Very low contrast */
  opacity: 0.5;
}

The Color Weight System

Tinted Greys, Not True Greys

A definitive marker of amateur design is using "True Grey" (#808080) or "True Black" (#000000) on colored backgrounds.

The Principle: Always use tinted greys. If your brand is blue, your "grey" should be a deeply desaturated blue. If your brand is warm/orange, your grey should be warm.

/* Bad - True Grey */
.text-on-blue {
  color: #808080;  /* True grey - looks wrong */
}

/* Good - Tinted Grey */
.text-on-blue {
  color: #4B5563;  /* Deeply desaturated blue - feels right */
}

/* Bad - True Black */
.text {
  color: #000000;  /* True black - harsh */
}

/* Good - Tinted Black */
.text {
  color: #030712;  /* Deeply desaturated blue-black - softer */
}

Building a Color Weight System

Create 8-10 shades per hue before writing any code. This prevents "hex code drift" where a codebase accumulates 50 slightly different versions of the same color.

/* Color weight system - 10 shades per hue */
:root {
  /* Primary Blue */
  --blue-50:   #F0F9FF;
  --blue-100:  #E0F2FE;
  --blue-200:  #BAE6FD;
  --blue-300:  #7DD3FC;
  --blue-400:  #38BDF8;
  --blue-500:  #0EA5E9;
  --blue-600:  #0284C7;
  --blue-700:  #0369A1;
  --blue-800:  #075985;
  --blue-900:  #0C3D66;

  /* Tinted Greys (desaturated blue) */
  --gray-50:   #F8FAFC;
  --gray-100:  #F1F5F9;
  --gray-200:  #E2E8F0;
  --gray-300:  #CBD5E1;
  --gray-400:  #94A3B8;
  --gray-500:  #64748B;
  --gray-600:  #475569;
  --gray-700:  #334155;
  --gray-800:  #1E293B;
  --gray-900:  #0F172A;
}

Contrast Hierarchy with Color Weight

Use color sparingly. Text hierarchy should be handled first by lightness (size/weight), then by color.

/* Contrast hierarchy - color reserved for interactive elements */
.heading {
  color: var(--gray-900);  /* Darkest - highest contrast */
  font-weight: 700;
  font-size: 32px;
}

.body-text {
  color: var(--gray-700);  /* Dark - good contrast */
  font-weight: 400;
  font-size: 16px;
}

.secondary-text {
  color: var(--gray-500);  /* Medium - reduced contrast */
  font-weight: 400;
  font-size: 14px;
}

.button-primary {
  background-color: var(--blue-600);  /* Color for interactive elements */
  color: white;
}

.button-secondary {
  background-color: var(--gray-100);  /* Subtle background */
  color: var(--gray-900);
}

Gestalt Principles: How Humans Perceive Visual Groups

Gestalt principles explain how humans naturally group visual elements. Use these to create clear hierarchy and organization.

1. Proximity

Elements that are close together are perceived as related.

Application:

  • Group related items together
  • Increase space between unrelated groups
  • Use spacing to show relationships
/* Proximity - group related items */
.form-group {
  margin-bottom: 24px;  /* Space between groups */
}

.form-group label {
  display: block;
  margin-bottom: 8px;  /* Close to input */
}

.form-group input {
  width: 100%;
}

2. Similarity

Elements that look similar are perceived as related.

Application:

  • Use consistent styling for related items
  • Vary styling to show differences
  • Buttons of the same type should look identical
/* Similarity - consistent styling for related items */
.button-primary {
  background: var(--blue-600);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
}

.button-primary:hover {
  background: var(--blue-700);
}

/* All primary buttons look the same */
.button-primary.small {
  padding: 8px 16px;
  font-size: 14px;
}

3. Figure/Ground

Humans naturally distinguish foreground from background.

Application:

  • Use contrast to separate foreground from background
  • Active states should stand out from inactive
  • Modals should have clear distinction from background
/* Figure/Ground - clear foreground/background separation */
.modal-overlay {
  background: rgba(0, 0, 0, 0.5);  /* Darkened background */
}

.modal {
  background: white;  /* Clear foreground */
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

.button.active {
  background: var(--blue-600);  /* Foreground */
  color: white;
}

.button.inactive {
  background: var(--gray-100);  /* Background */
  color: var(--gray-600);
}

4. Closure

Humans complete incomplete shapes. Minimalist designs work because of this principle.

Application:

  • Use negative space to imply forms
  • Incomplete shapes are still perceived as complete
  • Reduces visual clutter while maintaining clarity
/* Closure - incomplete shapes are still perceived */
.icon-incomplete {
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-right: none;
  border-bottom: none;
  /* Brain completes the square */
}

5. Symmetry & Order

Balanced layouts feel stable. Asymmetry draws attention.

Application:

  • Use grids for stable, organized layouts
  • Intentional asymmetry draws attention to important elements
  • Symmetry creates trust and predictability
/* Symmetry - stable, organized layout */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Asymmetry - draws attention */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.5fr;  /* Unequal columns */
  gap: 48px;
  align-items: center;
}

6. Common Region

Boundaries create groupings. Enclosed areas are perceived as related.

Application:

  • Use cards to group related content
  • Use backgrounds or borders to define regions
  • Sections with backgrounds feel grouped
/* Common Region - boundaries create groupings */
.card {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 24px;
  background: white;
  /* Everything inside is perceived as grouped */
}

.section-with-background {
  background: var(--gray-50);
  padding: 48px;
  border-radius: 12px;
  /* Content inside is grouped */
}

Practical Refactoring: From Cluttered to Clear

Before: Cluttered Interface

/* Dense, hard to scan */
.old-interface {
  padding: 8px;
  margin: 4px;
}

.old-interface h2 {
  font-size: 16px;
  font-weight: 400;  /* Not bold */
  color: #666;  /* Medium grey */
  margin-bottom: 4px;
}

.old-interface p {
  font-size: 14px;
  color: #999;  /* Light grey */
  line-height: 1.3;
  margin-bottom: 4px;
}

After: Clear Hierarchy

/* Spacious, easy to scan */
.new-interface {
  padding: 48px;
  margin: 32px;
}

.new-interface h2 {
  font-size: 32px;
  font-weight: 700;  /* Bold */
  color: var(--gray-900);  /* Dark */
  margin-bottom: 16px;
}

.new-interface p {
  font-size: 16px;
  color: var(--gray-700);  /* Darker grey */
  line-height: 1.6;
  margin-bottom: 16px;
}

How to Use This Skill with Claude Code

Audit Visual Hierarchy

"I'm using the visual-hierarchy-refactoring skill. Can you audit my interface?
- Is my whitespace generous or cramped?
- Are my size differences clear?
- Am I using tinted greys or true greys?
- Do I apply Gestalt principles effectively?
- What's one thing I could improve immediately?"

Refactor Cluttered Interfaces

"Can you help me refactor this cluttered interface using visual hierarchy principles?
- Increase whitespace
- Establish clear size hierarchy
- Use tinted greys instead of true greys
- Apply Gestalt principles for grouping
- Show me before/after comparison"

Build a Color Weight System

"Can you help me build a color weight system?
- Create 8-10 shades for my brand color
- Create tinted greys for my brand
- Show me how to use them for hierarchy
- Provide CSS variables"

Integration with Other Skills

  • design-foundation — Design tokens for spacing and color
  • typography-system — Size and weight hierarchy
  • color-system — Color weight system and tinted greys
  • component-architecture — Hierarchy in components
  • accessibility-excellence — Contrast and readability

Key Principles

1. Size, Weight, Contrast First Establish hierarchy through these before using color.

2. Whitespace is Active Generous spacing signals confidence and improves scannability.

3. Tinted Greys, Not True Greys Colors should feel cohesive with your brand.

4. Gestalt Principles Guide Perception Use proximity, similarity, and grouping to organize information.

5. Hierarchy Should Be Obvious If you have to explain it, it's not clear enough.

Checklist: Is Your Visual Hierarchy Ready?

  • Whitespace is generous (not cramped)
  • Size differences are clear (1.5-2x between levels)
  • Weight hierarchy is consistent (2-3 weights max)
  • Contrast hierarchy is clear (dark for primary, lighter for secondary)
  • Greys are tinted to your brand (not true grey)
  • Color is used sparingly (interactive elements only)
  • Gestalt principles are applied (proximity, similarity, grouping)
  • Information is easy to scan
  • Hierarchy is obvious without explanation
  • Interfaces feel spacious, not cramped

Clear visual hierarchy transforms interfaces from confusing to intuitive.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

27.48%
按下载量换算97

Antigravity

25.38%
按下载量换算90

Codex

17.16%
按下载量换算61

Gemini CLI

12.74%
按下载量换算45

OpenCode

7.23%
按下载量换算26

Cursor

3.76%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills