Visual Hierarchy Refactoring 标志

Visual Hierarchy Refactoring

社区
sanky369
visual-hierarchy-refactoring

重构杂乱或缺乏层次的界面,让用户一眼看出重点;通过尺寸、字重、对比度和留白实现,而不是增加颜色。适用于用户提出“界面看起来很乱”“所有元素都在抢注意力”“看起来很业余/很平”“用户找不到按钮”“让内容更易浏览”“这个页面让人眼花缭乱”等需求,或用户分享了没有任何突出重点的界面。系统会审查实际组件,列出每个元素当前和预期的视觉权重,然后提供重构后的组件代码(CSS/TSX)及前后视觉层级对照表,说明每项调整。先弱化次要元素,再强化主要元素,并通过间距应用格式塔分组原则。

Add to TypingMind

概览

发布者sanky369
代码仓库vibe-building-skills
技能名称visual-hierarchy-refactoring
星标数
31
复刻数
7
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 sanky369 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Visual Hierarchy Refactoring AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/visual-hierarchy-refactoring
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sanky369/vibe-building-skills.git /tmp/vibe-building-skills
mkdir -p .claude/skills
cp -r /tmp/vibe-building-skills/skills/frontend-design/visual-hierarchy-refactoring .claude/skills/visual-hierarchy-refactoring
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Visual Hierarchy Refactoring,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Visual Hierarchy Refactoring。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Visual Hierarchy Refactoring 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Visual Hierarchy Refactoring

Take a real screen or component and refactor it so the eye lands on the right things in the right order. The deliverable is refactored code plus a before/after hierarchy audit — not design commentary. Governing principles: hierarchy is a function of size, weight, and lightness contrast — color is the last resort, and the fastest fix is de-emphasis: quiet the noise before amplifying the signal.

When to use / handoffs

  • Use when a specific screen is cluttered, flat, unscannable, or "looks off" despite sane tokens.
  • No consistent tokens exist at all (every fix would be a new magic number) → skills/frontend-design/design-foundation first.
  • The problem is structural (columns misaligned, breaks on mobile) → skills/frontend-design/layout-system.
  • Font sizes themselves are chaotic across the app → skills/frontend-design/typography-system.
  • Palette is the problem (clashing hues, contrast failures everywhere) → skills/frontend-design/color-system.

Step 1 — Inspect the target

  1. Get the actual component. Read the file(s) for the screen the user named; if none named, ask for the one screen that matters most (this is the only intake question that blocks). Render or screenshot it if the environment allows.
  2. Read the available tokens (spacing scale, text sizes, grey ramp) — every fix must use them.
  3. Detect hierarchy smells in the code, with counts:
    • Emphasis inflation: how many elements per screen are bold, colored, large, or bordered? (>3 competing emphases = nothing is emphasized)
    • Cramped spacing: padding/margins ≤8px between unrelated groups
    • True greys / pure black: #808080-family, #000, text-gray-500 on colored surfaces
    • Uniform sizing: title, body, and metadata within a step of each other
    • Even spacing everywhere: identical gap inside and between groups (kills Gestalt grouping)
    • Border overuse: boxes-in-boxes where spacing would separate

Step 2 — Build the hierarchy audit

For the target screen, list every visible element and assign:

  • Intended priority: P1 (the one thing this screen exists for — one, maybe two elements), P2 (supporting), P3 (metadata/chrome).
  • Current visual weight: loud / medium / quiet, judged from size, weight, color, and surroundings.

Every mismatch is a work item. If you can't name the single P1, ask the user one question: "What should a user do or see first on this screen?" — then proceed.

Step 3 — Refactor, in this order

Apply changes strictly in this sequence — each pass often removes the need for the next:

  1. Whitespace first. Start with too much and pull back. Double the spacing between unrelated groups; keep related items close (label 8px from its input; 24px+ between form groups). If a standard margin is 16px, try 32–48px between sections. Spacing must come from the token scale.
  2. De-emphasize P2/P3 before touching P1: drop bold from labels, lighten metadata to a mid-grey step (gray-500/600), remove borders/backgrounds that box in secondary content, shrink or icon-ify tertiary actions. Secondary buttons go outline/ghost; destructive actions become quiet until confirmed.
  3. Then amplify P1 — usually needs only one move once the noise is gone: one size step up, or weight 600→700, or the darkest text step, or the single saturated CTA. Not all four.
  4. Contrast ladder via lightness, not hue: P1 text = darkest grey step, P2 = gray-600/700, P3 = gray-500. Tinted greys only (matching brand temperature) — never #808080/#000. Reserve saturated color for interactive elements and status.
  5. Group with Gestalt rules: proximity (spacing shows relationships — the gap between groups ≥2× the gap within), similarity (identical roles look identical), common region (a card/background only when spacing can't do the job). Full principle set with CSS: references/gestalt-principles.md.
  6. Size ratios: adjacent hierarchy levels differ by ~1.25–1.5×; P1 vs body ~1.5–2×. If two levels are within 10% of each other, merge them.

Canonical before/after (the shape of most fixes)

css
/* BEFORE: cramped, uniform, grey-on-grey */
.card { padding: 8px; }
.card h2 { font-size: 16px; font-weight: 400; color: #666; margin-bottom: 4px; }
.card p  { font-size: 14px; color: #999; line-height: 1.3; }

/* AFTER: room, clear ladder, tinted greys */
.card { padding: var(--space-6); }
.card h2 { font-size: var(--text-xl); font-weight: 600; color: var(--gray-900); margin-bottom: var(--space-2); }
.card p  { font-size: var(--text-base); color: var(--gray-600); line-height: 1.6; }
.card .meta { font-size: var(--text-sm); color: var(--gray-500); }

Required output format

Deliver code plus this audit:

## Hierarchy audit — [screen name]
| Element | Intended | Was | Problem | Change |
| Submit button | P1 | quiet (same as Cancel) | competing siblings | solid brand bg; Cancel → ghost |
| Section labels | P3 | loud (bold, dark) | emphasis inflation | weight 400, gray-500 |
| Card metadata | P3 | medium | too prominent | text-sm, gray-500 |
| ... every element with a mismatch |

## Refactored code
[full component/CSS — same styling system, tokens only]

## What changed and why (≤5 bullets)
- [pass applied → effect, e.g. "Doubled inter-group spacing (space-4 → space-8): groups now scannable"]

## Scan test
First / second / third thing the eye hits now: [P1] → [P2] → [P2]. Matches intent: [yes / remaining gap]

Quality bar (check before delivering)

  • Exactly one P1 per screen, and it wins the 5-second scan
  • ≤3 emphasized elements per screen; everything else visibly quiet
  • Gap between unrelated groups ≥2× gap within a group; all spacing on the token scale
  • ≤3 font weights in the result; bold never applied to whole paragraphs
  • Text ladder uses lightness steps of tinted greys; no #808080, no #000, no new hues introduced for emphasis
  • De-emphasized text still meets WCAG AA (4.5:1) — quiet ≠ illegible; P3 may go 3:1 only at large size
  • Adjacent size levels differ ≥1.25×; no two levels within 10%
  • Borders/boxes removed wherever spacing alone groups the content
  • Every change references a token — zero new magic numbers

Integration

  • Consumes: tokens from skills/frontend-design/design-foundation, type scale from skills/frontend-design/typography-system, grey ramp from skills/frontend-design/color-system, page structure from skills/frontend-design/layout-system.
  • Produces: refactored components that skills/frontend-design/component-architecture generalizes into the library; contrast decisions verified by skills/frontend-design/accessibility-excellence.
  • In skills/frontend-design/frontend-orchestrator paths, this runs after tokens exist (Path B step 2) or as margin-level refinement (Path C).

References

  • references/gestalt-principles.md — all six Gestalt principles (proximity, similarity, figure/ground, closure, symmetry, common region) with CSS applications, plus extended before/after refactor examples. Read when a grouping problem isn't solved by proximity alone or you need more worked examples.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Visual Hierarchy Refactoring AI 技能有什么作用?

重构杂乱或缺乏层次的界面,让用户一眼看出重点;通过尺寸、字重、对比度和留白实现,而不是增加颜色。适用于用户提出“界面看起来很乱”“所有元素都在抢注意力”“看起来很业余/很平”“用户找不到按钮”“让内容更易浏览”“这个页面让人眼花缭乱”等需求,或用户分享了没有任何突出重点的界面。系统会审查实际组件,列出每个元素当前和预期的视觉权重,然后提供重构后的组件代码(CSS/TSX)及前后视觉层级对照表,说明每项调整。先弱化次要元素,再强化主要元素,并通过间距应用格式塔分组原则。

为什么在 TypingMind 中使用 Visual Hierarchy Refactoring?

因为您只需安装一次,就能搭配任何模型使用。Visual Hierarchy Refactoring 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Visual Hierarchy Refactoring?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/visual-hierarchy-refactoring。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Visual Hierarchy Refactoring?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Visual Hierarchy Refactoring 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Visual Hierarchy Refactoring 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Visual Hierarchy Refactoring AI 技能免费吗?

是的。sanky369 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇