Agent Skills › netalertx/NetAlertX › ux-design-patterns

ux-design-patterns

GitHub

前端UI设计模式指南,规定添加或修改界面元素前需复用现有模式。提供设计决策优先级(已有行为>直观性等),并给出实操检查清单,旨在避免重复造轮子,确保UI一致性与主题兼容。

.claude/skills/ux-design-patterns/SKILL.md netalertx/NetAlertX

Trigger Scenarios

新增前端UI组件 修改现有界面交互 设计UI布局或控件

Install

npx skills add netalertx/NetAlertX --skill ux-design-patterns -g -y
More Options

Non-standard path

npx skills add https://github.com/netalertx/NetAlertX/tree/main/.claude/skills/ux-design-patterns -g -y

Use without installing

npx skills use netalertx/NetAlertX@ux-design-patterns

指定 Agent (Claude Code)

npx skills add netalertx/NetAlertX --skill ux-design-patterns -a claude-code -g -y

安装 repo 全部 skill

npx skills add netalertx/NetAlertX --all -g -y

预览 repo 内 skill

npx skills add netalertx/NetAlertX --list

SKILL.md

Frontmatter
{
    "name": "ux-design-patterns",
    "description": "Read before adding or changing any front\/ UI element - a control, layout, button, or interaction pattern. Covers the don't-invent-new-UX-without-a-PRD rule and the priority order for design tradeoffs (existing behavior > intuitiveness > information density > usability > utility > uniqueness > industry practices > generic UI)."
}

UX / Frontend Design Patterns

Core principle: reuse before inventing

Don't introduce new UX behavior or visual patterns unless a PRD explicitly calls for it. Before building any new UI element, search the existing frontend for a pattern that already solves this exact need, and reuse its markup/CSS/behavior instead of inventing a new one.

Real, recent example: a presence-page Prev/Next pager was first built with custom <button class="btn btn-xs"> elements floated in a .box-header. The DataTables pagination pattern (dataTables_wrapper / dataTables_paginate / ul.pagination / li.paginate_button.previous|next) already existed elsewhere in the app and does the exact same job. The custom version looked visually broken in the actual UI and had to be reimplemented using the existing pattern once that was caught in manual testing - reusing it also picked up dark-mode theming (front/css/dark-patch.css's .pagination li > a / .disabled rules) for free, which the hand-rolled version didn't have. Grep first: e.g. grep -rn "pagination\|paginate_button" front/ before adding a "previous/next" control of your own; the same applies to modals, filter inputs, badges, tooltips, tables - anything that already has an established shape somewhere in front/.

Priority order for design decisions

When several options are all locally reasonable, resolve the choice in this order - highest wins on conflict:

  1. Existing behavior - what does this codebase already do for the same or a similar need? Copy it.
  2. Intuitiveness - will a user already familiar with the rest of the app understand this without being told?
  3. Information density - does it show what's needed without wasting space or hiding what matters?
  4. Usability - is it easy and low-friction to actually use (reachability, click count, error tolerance)?
  5. Utility - does it solve the real problem, not just resemble a solution?
  6. Uniqueness - is this the app's own distinct answer, used only where nothing generic fits well?
  7. Industry practices - conventions users bring in from other apps.
  8. Generic UI - a default/framework-provided look, used only when nothing above applies.

This list exists to end debates quickly, not to be argued from the bottom up. The reason it's written down is that #1 is exactly the step that gets skipped under time pressure - checking it first is meant to be fast, not a detour.

Practical checklist before building a new UI element

  1. Grep front/js/, front/css/, front/php/ for an existing implementation of the same interaction - a table, a pager, a filter box, a modal, a badge, a status indicator.
  2. If found, reuse its markup and CSS classes directly rather than writing new ones - matching classes inherit theming (dark mode, responsive breakpoints) a new hand-rolled version won't have.
  3. If nothing fits, check whether the PRD driving this change actually calls for new UX. If it doesn't, that's a signal to look harder for an existing pattern, not license to invent one.
  4. If a new pattern is genuinely warranted and the PRD says so, design it using the priority order above, and record the choice and why existing patterns didn't fit in the PRD - the next change will hit the same fork and shouldn't have to re-derive the answer.
  5. Verify visually in a real browser/devcontainer before calling it done. A change that "should work" per the markup isn't confirmed until it's actually rendered - matches the project's general "test the golden path in a browser" rule for frontend changes.

Version History

  • cd1d0ed Current 2026-09-22 11:06

Same Skill Collection

.claude/skills/database-patterns/SKILL.md
.claude/skills/git-workflow/SKILL.md
.claude/skills/install-scripts/SKILL.md
.claude/skills/plugin-development/SKILL.md
.claude/skills/plugin-readme/SKILL.md
.claude/skills/plugin-review/SKILL.md
.claude/skills/pr-analysis/SKILL.md
.claude/skills/prd-writing/SKILL.md
.claude/skills/scan-pipeline/SKILL.md
.claude/skills/skill-hygiene/SKILL.md
.claude/skills/testing-workflow/SKILL.md
.gemini/skills/database-patterns/SKILL.md
.gemini/skills/devcontainer-management/SKILL.md
.gemini/skills/git-workflow/SKILL.md
.gemini/skills/install-scripts/SKILL.md
.gemini/skills/logging-standards/SKILL.md
.gemini/skills/mcp-activation/SKILL.md
.gemini/skills/plugin-review/SKILL.md
.gemini/skills/pr-analysis/SKILL.md
.gemini/skills/prd-writing/SKILL.md
.gemini/skills/project-navigation/SKILL.md
.gemini/skills/scan-pipeline/SKILL.md
.gemini/skills/settings/SKILL.md
.gemini/skills/skill-hygiene/SKILL.md
.gemini/skills/skills-index/SKILL.md
.gemini/skills/testing-workflow/SKILL.md
.gemini/skills/ux-design-patterns/SKILL.md
.github/skills/api-development/SKILL.md
.github/skills/authentication/SKILL.md
.github/skills/code-standards/SKILL.md
.github/skills/database-patterns/SKILL.md
.github/skills/database-reset/SKILL.md
.github/skills/devcontainer-configs/SKILL.md
.github/skills/devcontainer-services/SKILL.md
.github/skills/devcontainer-setup/SKILL.md
.github/skills/docker-build/SKILL.md
.github/skills/docker-prune/SKILL.md
.github/skills/git-workflow/SKILL.md
.github/skills/install-scripts/SKILL.md
.github/skills/logging-standards/SKILL.md
.github/skills/mcp-activation/SKILL.md
.github/skills/plugin-readme/SKILL.md
.github/skills/plugin-review/SKILL.md
.github/skills/plugin-run-development/SKILL.md
.github/skills/pr-analysis/SKILL.md
.github/skills/prd-writing/SKILL.md
.github/skills/project-navigation/SKILL.md
.github/skills/sample-data/SKILL.md
.github/skills/scan-pipeline/SKILL.md

Metadata

Files
0
Version
f6010e0
Hash
94dbd5e1
Indexed
2026-09-22 11:06

Home - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-30 04:25
浙ICP备14020137号-1