layout-spacing-checker

[设计系统] 根据间距比例和网格规则验证边距/填充/间隙值。当(1)检查间距值是否遵循设计系统比例,(2)发现偏离比例或不一致的间距,(3)审计组件间的布局一致性,(4)用户要求"检查间距"、"验证布局"、"审计边距/填充"或"查找偏离比例的值"时使用。

📖 中文导读:[设计系统] 根据间距比例和网格规则验证边距/填充/间隙值。当(1)检查间距值是否遵循设计系统比例,(2)发现偏离比例或不一致的间距,(3)审计组件间的布局一致性,(4)用户要求"检查间距"、"验证布局"、"审计边距/填充"或"查找偏离比例的值"时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: layout-spacing-checker description: "[Design System] Validate margin/padding/gap values against spacing scale and grid rules. Use when (1) checking if spacing values follow the design system scale, (2) finding off-scale or inconsistent spacing, (3) auditing layout consistency across components, (4) user asks to 'check spacing', 'validate layout', 'audit margins/padding', or 'find off-scale values'."

Layout & Spacing Scale Checker

Validate spacing values against a defined scale and find inconsistencies.

Quick Start

python3 scripts/check_spacing.py --scale spacing.yml --source src/

Issue Types

Type Severity Description
off-scale warning Value not in spacing scale
inconsistent info Different spacing for similar components
zero-spacing info Potentially missing spacing
excessive warning Unusually large spacing value

Detection Examples

CSS/SCSS

/* off-scale: 17px not in scale */
.card { padding: 17px; }
/* Suggested: 16px (md) or 20px */

SwiftUI

// off-scale: 15 not in scale
.padding(15)
// Suggested: .padding(16) or spacing token .md