Token导航 LogoToken导航

Agent Skill · 开发规范

web-ui-best-practices(网络用户界面最佳实践)

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。它适合让 Agent 根据产品场景整理页面结构、生成 UI 方案、检查视觉一致性或改进组件层级。使用时需要结合现有品牌、设计系统和用户任务,不应只堆装饰元素;涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出、对齐和响应式表现。

web-ui-best-practices 是开发规范类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在开发规范类的 1,265 个 Skill 里排第 486。

总安装 1,320周安装 55GitHub Stars 171下载 440核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:web-ui-best-practices(网络用户界面最佳实践)
来源仓库:https://github.com/jamditis/claude-skills-journalism
仓库路径:skills/web-ui-best-practices
安装命令:
npx skills add https://github.com/jamditis/claude-skills-journalism --skill web-ui-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jamditis/claude-skills-journalism --skill web-ui-best-practices

这个 Skill 是做什么的

开发规范类 Skill 用来统一代码风格、目录结构和评审口径,产出多为检查清单或改写建议。

用于辅助界面设计、视觉规范、排版、配色、布局和交互体验优化。适合根据产品场景整理页面结构、生成 UI 方案或改进组件层级。需结合现有品牌、设计系统和用户任务,不应只堆装饰元素。

安装命令:npx skills add https://github.com/jamditis/claude-skills-journalism --skill web-ui-best-practices。涉及真实页面改动时,应通过截图或浏览器预览检查文本溢出和对齐。

来源仓库内路径:skills/web-ui-best-practices

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jamditis/claude-skills-journalism --skill web-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

web-ui-best-practices 怎么安装?

在终端执行 npx skills add https://github.com/jamditis/claude-skills-journalism --skill web-ui-best-pr…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

web-ui-best-practices 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

web-ui-best-practices 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

web-ui-best-practices 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

web-ui-best-practices 用的人多吗?

公开数据是累计安装 1,320 次,近一周安装 55 次,下载 440 次,GitHub 171 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

web-ui-best-practices 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发规范类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发规范类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
vercel-react-best-practices

Vercel React 最佳实践 · Codex、Claude

8,490,72025,918操作浏览器MIT通过
web-design-guidelines

网页设计指南 · Codex、Claude

6,686,01625,885需要联网MIT有提醒
remotion-best-practices

Remotion 最佳实践 · Codex、Claude

6,505,6323,027操作浏览器MIT有提醒
supabase-postgres-best-practices

Supabase Postgres 最佳实践 · Codex、Claude

3,175,5232,030需要联网MIT通过
next-best-practices

Next.js 最佳实践 · Codex、Claude

1,848,240841操作浏览器MIT通过
web-ui-best-practices

网络用户界面最佳实践 · 本页

1,320171操作浏览器未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Web UI best practices

Principles for building web interfaces that feel fast, intentional, and respectful of the user's time. Every rule here is a smell test — violating one is fine if you have a reason, violating several means the UI needs work.

Speed

Every interaction completes in under 100ms. If it can't, fake it.

  • Optimistic UI updates — show the result before the server confirms
  • Debounce inputs, but never debounce perceived response
  • Prefetch likely next routes on hover or viewport entry
  • Use will-change and transform for animations, never top/left
  • Measure with performance.now(), not gut feel
// Optimistic delete — remove from UI immediately, reconcile later
async function handleDelete(id) {
  setItems(prev => prev.filter(i => i.id !== id));
  try {
    await api.delete(`/items/${id}`);
  } catch {
    setItems(prev => [...prev, originalItem]);
    toast("Couldn't delete. Restored.");
  }
}

Skeleton loading states

Never show a spinner when you know the shape of what's coming. Render a skeleton that matches the layout, then swap in real content.

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

No product tours

If you need a tour to explain your UI, the UI is wrong. Instead:

  • Empty states that teach by doing ("Create your first project")
  • Progressive disclosure — show features when they become relevant
  • Inline hints that disappear after first use
  • Defaults that work without configuration

URLs

Slugs are short, readable, and human-guessable. No UUIDs, no query param soup.

Good:  /projects/weather-app
       /settings/billing
       /docs/api/auth

Bad:   /projects/550e8400-e29b-41d4-a716-446655440000
       /app?view=settings&tab=billing&subsection=plan
       /dashboard#!/module/documents/list?filter=active
  • Use slugs derived from user-provided names
  • Keep nesting to 3 segments max
  • Make URLs copyable and shareable — they are the product's memory

Persistent resumable state

Users leave and come back. Respect that.

  • Save draft form state to localStorage or the server
  • Restore scroll position on back navigation
  • Preserve filter/sort selections across sessions
  • URL encodes the current view state — sharing a URL reproduces the view
// Persist form state across sessions
function usePersistentForm(key, defaults) {
  const [state, setState] = useState(() => {
    const saved = localStorage.getItem(key);
    return saved ? JSON.parse(saved) : defaults;
  });

  useEffect(() => {
    localStorage.setItem(key, JSON.stringify(state));
  }, [key, state]);

  return [state, setState];
}

Color restraint

Not more than 3 colors. One primary, one accent, one for danger/destructive. Everything else is shades of gray.

:root {
  --color-primary: #2563eb;
  --color-accent: #f59e0b;
  --color-danger: #ef4444;

  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-400: #a1a1aa;
  --gray-600: #52525b;
  --gray-900: #18181b;
}
  • Use opacity and lightness to create hierarchy, not new hues
  • Dark mode is the same 3 colors with inverted grays
  • If you reach for a 4th color, you're compensating for weak layout

No visible scrollbars

Hide them unless the user is actively scrolling. Content feels infinite, not trapped.

/* Hide scrollbar across browsers */
.scroll-container {
  overflow-y: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}
.scroll-container::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

Use scroll shadows to hint at overflow without chrome:

.scroll-shadow {
  background:
    linear-gradient(white 30%, transparent),
    linear-gradient(transparent, white 70%) 0 100%,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.15), transparent),
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.15), transparent) 0 100%;
  background-repeat: no-repeat;
  background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
  background-attachment: local, local, scroll, scroll;
}

Navigation depth

All navigation is 3 steps or fewer from anywhere. If the user needs more than 3 clicks to reach a destination, flatten the hierarchy.

  • Breadcrumbs for depth, not for navigation
  • Global nav always visible, never hidden behind a hamburger on desktop
  • Use Cmd+K / Ctrl+K as the escape hatch for power users

Command palette (Cmd+K)

Every app with more than one page needs a command palette.

// Minimal Cmd+K listener
useEffect(() => {
  function handleKeyDown(e) {
    if ((e.metaKey || e.ctrlKey) && e.key === "k") {
      e.preventDefault();
      setCommandPaletteOpen(true);
    }
  }
  document.addEventListener("keydown", handleKeyDown);
  return () => document.removeEventListener("keydown", handleKeyDown);
}, []);

Keep the palette simple:

  • Fuzzy search over page names, recent actions, settings
  • Show keyboard shortcuts inline
  • Most recent items first
  • No categories until you have 20+ commands

Clipboard

Copy and paste should work everywhere the user expects it.

  • One-click copy on codes, URLs, API keys, IDs
  • Paste from clipboard into file uploads, image fields
  • Show brief confirmation on copy ("Copied!") that auto-dismisses
async function copyToClipboard(text, label = "Copied") {
  await navigator.clipboard.writeText(text);
  toast(label, { duration: 1500 });
}

Hit targets

Larger hit targets for buttons and inputs. Minimum 44x44px touch targets (WCAG 2.5.8). On desktop, generous padding is still faster than precise aim.

button, .btn, [role="button"] {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 20px;
}

input, select, textarea {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;  /* Prevents iOS zoom on focus */
}
  • Adjacent clickable elements need at least 8px gap
  • Icon-only buttons get larger padding than labeled buttons
  • Don't rely on hover states for critical affordances — they don't exist on touch

Honest cancellation

One-click cancel. No guilt trips, no dark patterns, no "Are you sure you want to miss out?"

  • Cancel button is always visible alongside confirm
  • Account deletion works on the first try
  • Unsubscribe is one click, not a preference center
  • Downgrade flows don't require contacting support

Tooltips

Very minimal. Tooltips are a confession that the UI doesn't speak for itself.

  • Only on icon-only buttons (to provide the label)
  • Never on text that's already readable
  • Show on hover after 300ms delay, not instantly
  • Dismiss on scroll
  • Never use tooltips for essential information

Copy

Active voice. Max 7 words per sentence. Talk like a person, not a legal document.

Good:  "Project created"
       "Saved 2 minutes ago"
       "Delete this file?"

Bad:   "Your project has been successfully created!"
       "Changes were last saved approximately 2 minutes ago"
       "Are you sure you want to permanently delete this file? This action cannot be undone."
  • Buttons are verbs: "Save", "Delete", "Send" — not "Submit", "OK", "Confirm"
  • Error messages say what happened and what to do next
  • Never blame the user ("Invalid input" → "Enter a valid email")
  • Use sentence case everywhere, never Title Case in UI copy

Optical alignment

Optical alignment over geometric alignment. The eye doesn't see pixels, it sees weight.

  • Play icons shift 2-3px right inside circles to look centered
  • Text with leading capital letters aligns optically left of its bounding box
  • Icons next to text need 1-2px vertical offset depending on the glyph
  • Padding around text is visually balanced, not mathematically equal — bottom padding is often 1-2px more than top
/* Geometric center ≠ optical center */
.play-button svg {
  transform: translateX(2px);
}

/* Visually balanced card padding */
.card {
  padding: 20px 24px 22px 24px;
}

Left-to-right reading flow

Optimized for L-to-R reading and the F-pattern scan.

  • Most important content in the top-left quadrant
  • Primary actions on the right (where the eye ends a line)
  • Labels above inputs, not beside them
  • Tables: most-scanned column is leftmost
  • Don't center-align body text — left-align everything except single-line headings

Reassurance about loss

Users fear losing work. Prevent it and prove it.

  • Auto-save with visible "Saved" indicator and timestamp
  • Undo after destructive actions (soft delete, not hard delete)
  • "You have unsaved changes" on navigation away
  • Version history for anything longer than a tweet
  • Confirmation only for irreversible actions, not routine ones
// Warn on unsaved changes
useEffect(() => {
  function handleBeforeUnload(e) {
    if (hasUnsavedChanges) {
      e.preventDefault();
      e.returnValue = "";
    }
  }
  window.addEventListener("beforeunload", handleBeforeUnload);
  return () => window.removeEventListener("beforeunload", handleBeforeUnload);
}, [hasUnsavedChanges]);

Copyable brand assets

Ship a /brand or /press page with a downloadable SVG logo and brand kit. Don't make people screenshot your logo.

  • SVG logo with transparent background
  • Color codes (hex, RGB, HSL)
  • Font names and weights
  • Usage guidelines (minimum size, clear space, don'ts)
  • One-click download as ZIP

Checklist

Use this when reviewing any web UI:

  • Every interaction under 100ms (or optimistically faked)
  • No product tour or onboarding modal
  • URLs are short, readable, no UUIDs
  • State persists across sessions and page reloads
  • 3 colors max (plus grays)
  • No visible scrollbars at rest
  • Any destination reachable in 3 steps or fewer
  • SVG logo and brand kit downloadable
  • Skeleton loaders, not spinners
  • Clipboard copy works on codes, keys, URLs
  • Touch targets 44px minimum
  • Cancel is honest and one-click
  • Cmd+K command palette exists
  • Tooltips only on icon-only buttons
  • Copy is active voice, 7 words max
  • Optical alignment, not geometric
  • Content follows L-to-R F-pattern
  • Auto-save with visible status and undo

平台分布

Codex

37.15%
按下载量换算163

Claude

26.8%
按下载量换算118

Cursor

16.56%
按下载量换算73

Gemini CLI

9.58%
按下载量换算42

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills