ss-lint

GitHub

快速自动化设计系统违规检测,通过扫描代码识别硬编码颜色、原始像素值等常见问题。支持基于注册表的精确制品边界检查与机器可读输出,适用于提交后即时反馈。

engine/.claude/skills/ss-lint/SKILL.md bitjaru/styleseed

Trigger Scenarios

用户要求快速检查设计系统规范 需要检测前端组件中的样式违规 CI流程中执行快速Lint检查

Install

npx skills add bitjaru/styleseed --skill ss-lint -g -y
More Options

Non-standard path

npx skills add https://github.com/bitjaru/styleseed/tree/main/engine/.claude/skills/ss-lint -g -y

Use without installing

npx skills use bitjaru/styleseed@ss-lint

指定 Agent (Claude Code)

npx skills add bitjaru/styleseed --skill ss-lint -a claude-code -g -y

安装 repo 全部 skill

npx skills add bitjaru/styleseed --all -g -y

预览 repo 内 skill

npx skills add bitjaru/styleseed --list

SKILL.md

Frontmatter
{
    "name": "ss-lint",
    "description": "Quick automated lint — detects common design system violations in seconds",
    "allowed-tools": "Read, Grep, Glob, Bash",
    "argument-hint": "[file-path or directory]"
}

Design Lint (Quick Check)

Registry-first artifact boundary

When .styleseed/project.json and .styleseed/artifacts/index.json exist, resolve the requested artifact ID first, then read only .styleseed/bundles/<artifact-id>.md and .styleseed/manifests/<artifact-id>.json. Never fall back to the global legacy bundle for a registry project. Legacy projects may use .styleseed/effective-rules.md only when no registry exists.

Canonical executable check

For a reproducible, artifact-bound scan with machine-readable output, use:

node <installed-ss-score>/scripts/styleseed-check.mjs scan \
  --project-root . --artifact <artifact-id> --format json
node <installed-ss-score>/scripts/styleseed-check.mjs scan \
  --project-root . --all --format sarif

The checker treats only contract, containment, manifest/hash, malformed-report, and required coverage failures as hard errors. Detector findings (SS001SS006) remain warnings and include a stable file, line, evidence snippet, severity, and fix. Use styleseed-check ... verify to recompute the bound evidence run; do not turn a string or stale report into a pass.

Read .styleseed/effective-rules.md and .styleseed/manifest.json; invoke /ss-resolve or $ss-resolve first when they are missing or stale. Lint detects deterministic drift; it must not flag an exact grammar/recipe/profile/adapter contract as a violation or let an arbitrary lock value create an exception.

When NOT to use

  • For deeper review of design judgment (composition, hierarchy, rhythm) → use /ss-review
  • For accessibility specifically → use /ss-a11y
  • For Nielsen UX heuristics → use /ss-audit
  • For applying refactors — this only flags violations; use /ss-review to fix

Target: $ARGUMENTS

What This Does

Fast, grep-based scan for common design violations. Runs in seconds (unlike /ss-review which is a deep manual audit). Run this after every file change.

Checks

1. Hardcoded Colors

Search for hex colors in className strings that should be semantic tokens:

grep -n '#[0-9a-fA-F]\{3,8\}' [file] | grep -v 'theme.css\|tokens\|\.json'

Violation: text-[#3C3C3C], bg-[#3182F6] Fix: text-text-primary, bg-brand

2. Raw Pixel Values in Tailwind

grep -n 'p-\[.*px\]\|m-\[.*px\]\|gap-\[.*px\]' [file]

Violation: p-[24px], gap-[12px] Fix: p-6, gap-3

3. Old Width/Height Syntax

grep -n 'w-[0-9] h-[0-9]\|w-\[.*\] h-\[' [file]

Violation: w-4 h-4 Fix: size-4

4. Physical Properties (LTR-only)

grep -n ' ml-\| mr-\| pl-\| pr-' [file]

Violation: ml-2, mr-4 Fix: ms-2, me-4

5. Uncontracted Hard Black

grep -n 'text-black\|bg-black\|#000000\|#000"' [file]

Violation: Pure black without an exact structural role in the selected grammar/profile Fix: Use the semantic ink token, or cite the maintained contract that requires hard black

6. Missing data-slot

grep -n 'function [A-Z]' [file] # find components
grep -n 'data-slot' [file]       # check if present

Violation: Component without data-slot Fix: Add data-slot="component-name"

7. Font Size CSS Variables (CRITICAL — Tailwind v4 conflict)

grep -n 'text-\[var(--' [file]
grep -n '\-\-text-.*px\|--fs-.*px' [file]

Violation: text-[var(--text-sm)] or --text-sm: 13px in theme.css Fix: Use explicit text-[13px]. CSS variable font sizes conflict with Tailwind v4's --text-* namespace — Tailwind reads them as color, not font-size.

8. className Without cn()

grep -n 'className={`' [file]

Violation: Template literal className Fix: Use cn() for all className composition

9. Universal Soft-card Drift

Search for repeated rounded-2xl, shadow-[var(--shadow-card)], and mx-6 in pattern files. Flag the combination when the selected recipe is not calm-consumer. Fix: use ss-pattern-surface, ss-page-gutter, and the other recipe-aware helper classes.

Output Format

🔴 FAIL  [file:line] Hardcoded hex: text-[#3C3C3C] → use text-text-primary
🔴 FAIL  [file:line] Raw px: p-[24px] → use p-6
🟡 WARN  [file:line] Physical prop: ml-2 → use ms-2
🟡 WARN  [file:line] Missing data-slot on MyComponent
🟢 PASS  No violations found

Total: X errors, Y warnings

If errors > 0, list specific fixes for each violation.

Version History

  • bfd06d8 Current 2026-08-19 16:27

    新增Registry-first artifact boundary机制,优先解析指定制品ID而非全局遗留bundle;增加可复现的制品绑定扫描命令及SARIF格式支持。

  • e0a0991 2026-08-05 10:45
  • 0e2cb9a 2026-08-01 05:38

    将配置读取源从 PRODUCT-PRINCIPLES 等文档更新为 effective-rules.md 和 manifest.json,并新增对 Tailwind v4 CSS 变量冲突及 data-slot 缺失的检查规则。

  • 2ec6162 2026-07-19 22:38

    新增第7项检查:检测与 Tailwind v4 冲突的 CSS 变量字体大小;优化第5项:将‘禁止纯黑’细化为‘未收缩的硬黑色’,允许特定结构角色下的硬黑;更新示例以反映 StyleSeed v3 设计语法引擎的变化。

  • 575d99a 2026-07-05 18:21

Same Skill Collection

engine/.claude/skills/ss-a11y/SKILL.md
engine/.claude/skills/ss-audit/SKILL.md
engine/.claude/skills/ss-build/SKILL.md
engine/.claude/skills/ss-component/SKILL.md
engine/.claude/skills/ss-copy/SKILL.md
engine/.claude/skills/ss-dial/SKILL.md
engine/.claude/skills/ss-feedback/SKILL.md
engine/.claude/skills/ss-flow/SKILL.md
engine/.claude/skills/ss-learn/SKILL.md
engine/.claude/skills/ss-motion/SKILL.md
engine/.claude/skills/ss-page/SKILL.md
engine/.claude/skills/ss-pattern/SKILL.md
engine/.claude/skills/ss-reference/SKILL.md
engine/.claude/skills/ss-resolve/SKILL.md
engine/.claude/skills/ss-restyle/SKILL.md
engine/.claude/skills/ss-review/SKILL.md
engine/.claude/skills/ss-score/SKILL.md
engine/.claude/skills/ss-setup/SKILL.md
engine/.claude/skills/ss-studio/SKILL.md
engine/.claude/skills/ss-tokens/SKILL.md
engine/.claude/skills/ss-verify/SKILL.md
engine/.claude/skills/styleseed/SKILL.md
extensions/learning/skills/ss-learn/SKILL.md
skills/ss-a11y/SKILL.md
skills/ss-audit/SKILL.md
skills/ss-build/SKILL.md
skills/ss-component/SKILL.md
skills/ss-copy/SKILL.md
skills/ss-dial/SKILL.md
skills/ss-feedback/SKILL.md
skills/ss-flow/SKILL.md
skills/ss-learn/SKILL.md
skills/ss-lint/SKILL.md
skills/ss-motion/SKILL.md
skills/ss-page/SKILL.md
skills/ss-pattern/SKILL.md
skills/ss-reference/SKILL.md
skills/ss-resolve/SKILL.md
skills/ss-restyle/SKILL.md
skills/ss-review/SKILL.md
skills/ss-score/SKILL.md
skills/ss-setup/SKILL.md
skills/ss-studio/SKILL.md
skills/ss-tokens/SKILL.md
skills/ss-verify/SKILL.md
skills/styleseed-design-review/SKILL.md
skills/styleseed/SKILL.md
engine/.claude/skills/ss-update/SKILL.md
skills/ss-update/SKILL.md

Metadata

Files
0
Version
bfd06d8
Hash
d7949e53
Indexed
2026-07-05 18:21

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-26 06:21
浙ICP备14020137号-1 $Map of visitor$