Chuyển đến nội dung
Skillpedia
Giao diện (UI/UX)48k · #6038

ui-lint

Skill này làm gì

Kiểm tra nhanh xem code thiết kế của bạn có tuân theo quy tắc hay không. Nó tìm các lỗi thường gặp như màu viết sai cách hoặc kích thước trang dùng pixel thay vì đơn vị chuẩn.

Khi nào nên dùng

  • ✓Sau khi thay đổi code nhỏ.
  • ✓Khi bạn muốn đảm bảo thiết kế nhất quán.
  • ✓Trước khi gửi code để review.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ui-lint/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ui-lint/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Kiểm tra code của tôi xem có lỗi thiết kế thường gặp nào không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tìm các mẫu cụ thể trong code không tuân theo quy tắc thiết kế đã thiết lập. Nếu tìm thấy điều gì bất thường, nó sẽ cảnh báo bạn.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Design Lint (Quick Check)

When to Use

Use this skill when you need quick automated lint — detects common design system violations in seconds.

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-[#721FE5] 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. Forbidden Colors

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

Violation: Any pure black Fix: Use skin's text-primary token

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

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.

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
  • Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
Câu hỏi thường gặp

“Hardcoded colors” (màu cố định) là gì?

Đây là các màu được viết trực tiếp trong code bằng mã như #3C3C3C, thay vì dùng tên màu được định nghĩa trong hệ thống thiết kế (như “text-primary”).

Vì sao không nên dùng pixel (px) ở một số phần của code?

Dùng pixel có thể làm thiết kế không thích ứng tốt với các kích thước màn hình khác nhau. Nên dùng đơn vị chuẩn của hệ thống thiết kế (như “p-6” thay vì “p-[24px]”).

“Physical Properties (LTR-only)” nghĩa là gì?

Đây là các lệnh về khoảng cách (như margin và padding) hoạt động khác nhau tùy theo hướng chữ (từ trái sang phải hoặc từ phải sang trái). Hệ thống ưu tiên các lệnh hoạt động được trong cả hai trường hợp (như “ms” và “me”).

Chi tiết

Mô tả gốc của tác giả

Quick automated lint — detects common design system violations in seconds

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#6038
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự