Token导航 LogoToken导航

Agent Skill · 前端设计

harden(harden 测试)

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

harden 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 6,004。

总安装 564周安装 24GitHub Stars 14下载 198核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:harden(harden 测试)
来源仓库:https://github.com/aladicf/better-web-ui
仓库路径:skills/harden
安装命令:
npx skills add https://github.com/aladicf/better-web-ui --skill harden
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/aladicf/better-web-ui --skill harden

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

harden 强化界面应对边缘情况、国际化问题和真实使用场景的能力,提升鲁棒性。适用于 Codex、Claude、Cursor、Gemini CLI 中需要保障极端条件下可用性的项目。将边缘案例视为设计输入而非事后修补,特别关注错误状态与通知疲劳问题。

需先加载 frontend-design 上下文,并结合语义色彩与状态通信指南实施加固。安装前建议确认权限范围和维护状态,注意是否会触发联网、命令执行或文件读写。

来源仓库内路径:skills/harden

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

harden 怎么安装?

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

harden 支持哪些 AI 工具?

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

harden 需要什么权限?

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

harden 是免费的吗?

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

harden 用的人多吗?

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

harden 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
harden

harden 测试 · 本页

56414操作浏览器未明确通过

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

SKILL.md 原文

Strengthen interfaces against edge cases, errors, internationalization issues, and real-world usage scenarios that break idealized designs.

Treat edge cases as design input, not as cleanup after the happy path already shipped.

Consult the semantic color reference when designing error, warning, success, and info states so semantic color stays clear and not purely decorative. Consult the status communication reference when hardening notification flows, activity feeds, summaries, or alert settings against fatigue and interruption overload. Consult the image treatment when hardening user-uploaded media, screenshots, icon scaling, or image bleed behavior. Consult the error-recovery reference when the task involves validation behavior, summaries, strict validators, recoverable field errors, or abandonment caused by poor recovery design. Consult the authentication and account recovery reference when hardening sign-in, session expiry, password setup, MFA, lockout, or account-recovery flows. Consult the permissions and roles UX reference when hardening role editors, request-access flows, 403 recovery, admin-vs-member surfaces, capability boundaries, or risky permission changes. Consult the language and locale selection reference when hardening language selectors, regional overrides, currency or shipping preferences, or locale-switching flows that can fail under travel, VPN, or multilingual conditions. Consult the component accessibility reference when hardening keyboard support, focus indicators, skip links, hidden-content behavior, modal focus management, or accessibility claims in custom and third-party components. Consult the empty-state patterns reference when a failure needs a dedicated route-level recovery page for states like 401, 403, 404, 429, 500, or 503. Consult the interaction design reference when hardening workflows that must stay usable under stress, urgency, operational pressure, or emergency conditions. Consult the loading feedback and perceived performance reference when hardening loading states, stale-data cues, skeleton usage, or performance-looking states that may be masking brittle real behavior. Consult the micro failures and perceived quality reference when the interface technically works but feels flaky, unstable, or trust-eroding because of tiny repeated jank, state loss, hover traps, weak feedback, or similar papercuts.

MANDATORY PREPARATION

Users start this workflow with /harden. Once this skill is active, load $frontend-design — it contains design principles, anti-patterns, and the Context Gathering Protocol. Follow that protocol before proceeding — if no design context exists yet, you MUST load $setup first. Additionally gather: the risky scenarios, edge cases, and user constraints most likely to break the current flow.

Assess Hardening Needs

Identify weaknesses and edge cases:

  1. Test with extreme inputs:

- Very long text (names, descriptions, titles) - Very short text (empty, single character) - Special characters (emoji, RTL text, accents) - Large numbers (millions, billions) - Many items (1000+ list items, 50+ options) - No data (empty states)

  • Awkward media (tiny icons, giant screenshots, user-uploaded images with chaotic crops or background colors)
  1. Test error scenarios:

- Network failures (offline, slow, timeout) - API errors (400, 401, 403, 404, 500) - Validation errors

  • Overly strict validators or mismatched formatting expectations
  • Browser back/forward behavior in forms, multi-step flows, and overlays
  • Permission errors
  • Rate limiting
  • Concurrent operations
  1. Test internationalization:

- Long translations (German is often 30% longer than English) - RTL languages (Arabic, Hebrew) - Character sets (Chinese, Japanese, Korean, emoji) - Date/time formats - Number formats (1,000 vs 1.000) - Currency symbols

  1. Test stressed-use contexts:
  • Small or split-screen workspaces
  • Noisy, interruption-heavy environments
  • Urgent decision-making with low patience
  • Users who need one clear next step instead of a dense control wall

CRITICAL: Designs that only work with perfect data aren't production-ready. Harden against reality.

Hardening Dimensions

Systematically improve resilience:

Text Overflow & Wrapping

Long text handling:

/* Single line with ellipsis */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Multi-line with clamp */
.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Allow wrapping */
.wrap {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

Flex/Grid overflow:

/* Prevent flex items from overflowing */
.flex-item {
  min-width: 0; /* Allow shrinking below content size */
  overflow: hidden;
}

/* Prevent grid items from overflowing */
.grid-item {
  min-width: 0;
  min-height: 0;
}

Responsive text sizing:

  • Use clamp() for fluid typography
  • Set minimum readable sizes (14px in compact layouts)
  • Test text scaling (zoom to 200%)
  • Ensure containers expand with text

Internationalization (i18n)

Text expansion:

  • Add 30-40% space budget for translations
  • Use flexbox/grid that adapts to content
  • Test with longest language (usually German)
  • Avoid fixed widths on text containers
// ❌ Bad: Assumes short English text
<button className="w-24">Submit</button>

// ✅ Good: Adapts to content
<button className="px-4 py-2">Submit</button>

RTL (Right-to-Left) support:

/* Use logical properties */
margin-inline-start: 1rem; /* Not margin-left */
padding-inline: 1rem; /* Not padding-left/right */
border-inline-end: 1px solid; /* Not border-right */

/* Or use dir attribute */
[dir="rtl"] .arrow { transform: scaleX(-1); }

Character set support:

  • Use UTF-8 encoding everywhere
  • Test with Chinese/Japanese/Korean (CJK) characters
  • Test with emoji (they can be 2-4 bytes)
  • Handle different scripts (Latin, Cyrillic, Arabic, etc.)

Date/Time formatting:

// ✅ Use Intl API for proper formatting
new Intl.DateTimeFormat('en-US').format(date); // 1/15/2024
new Intl.DateTimeFormat('de-DE').format(date); // 15.1.2024

new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD'
}).format(1234.56); // $1,234.56

Pluralization:

// ❌ Bad: Assumes English pluralization
`${count} item${count !== 1 ? 's' : ''}`

// ✅ Good: Use proper i18n library
t('items', { count }) // Handles complex plural rules

Error Handling

Network errors:

  • Show clear error messages
  • Provide retry button
  • Explain what happened
  • Offer offline mode (if applicable)
  • Handle timeout scenarios
// Error states with recovery
{error && (
  <ErrorMessage>
    <p>Failed to load data. {error.message}</p>
    <button onClick={retry}>Try again</button>
  </ErrorMessage>
)}

Form validation errors:

  • Inline errors near fields
  • Clear, specific messages
  • Suggest corrections
  • Don't block submission unnecessarily
  • Preserve user input on error
  • Allow override paths for real-world formats like address or phone when blocking would create abandonment and the risk model allows it

API errors:

  • Handle each status code appropriately

- 400: Show validation errors - 401: Prompt sign-in or session refresh, and preserve the intended destination when possible - 403: Show a permission state with a clear access path - 404: Show a not-found state with strong recovery navigation - 429: Show a temporary rate-limit state with retry timing when known - 500: Show a server-error state with retry plus a safe fallback or support path - 503: Show a maintenance or temporary-outage state with status/ETA when available

When the failure takes over the whole route, design it as a dedicated error page rather than a tiny inline message or toast.

Graceful degradation:

  • Core functionality works without JavaScript
  • Images have alt text
  • Progressive enhancement
  • Fallbacks for unsupported features

Edge Cases & Boundary Conditions

With Power Comes Responsibility

The more powerful a feature is, the more carefully the interface must communicate consequences and prevent accidental damage.

High-power surfaces include:

  • bulk actions
  • admin panels
  • permission editors
  • automation and integrations
  • AI tools that can change or generate large amounts of content
  • destructive editing, publishing, billing, and account operations

Guardrails to add:

  • role-based permissions and clear capability boundaries
  • previews, summaries, or counts before high-impact actions run
  • undo for reversible actions, confirmations for irreversible or high-cost ones
  • audit trails or visible history when actions have organizational consequences
  • safe defaults, explicit warnings, and plain-language consequence copy

Power should feel controlled, not risky. If a feature can cause large-scale mistakes, design the interface so users have to understand what will happen before it happens.

Empty states:

  • No items in list
  • No search results
  • No notifications
  • No data to display
  • Provide clear next action

Notification edge cases:

  • Volume spikes (too many events in a short window)
  • Duplicate or near-duplicate notifications
  • Stale unread badges after state changes
  • Quiet hours, mute, or snooze states not being respected
  • Users who need summaries instead of real-time interruption

Loading states:

  • Initial load
  • Pagination load
  • Refresh
  • Show what's loading ("Loading your projects...")
  • Time estimates for long operations

Large datasets:

  • Pagination or virtual scrolling
  • Search/filter capabilities
  • Performance optimization
  • Don't load all 10,000 items at once

Concurrent operations:

  • Prevent double-submission (disable button while loading)
  • Handle race conditions
  • Optimistic updates with rollback
  • Conflict resolution

Permission states:

  • No permission to view
  • No permission to edit
  • Read-only mode
  • Clear explanation of why
  • Path to request access or understand who controls the permission when relevant

Browser compatibility:

  • Polyfills for modern features
  • Fallbacks for unsupported CSS
  • Feature detection (not browser detection)
  • Test in target browsers

Images, Screenshots & User Media

User-uploaded images:

  • Force images into controlled containers with deliberate aspect ratios
  • Use cover/cropping instead of preserving chaotic intrinsic layouts that break the grid
  • Prevent background bleed with a subtle inner shadow or inner border when images blend into the page

Screenshots:

  • Beware screenshots scaled too small to read
  • Prefer tighter crops, partial screenshots, or screenshots taken at a smaller source layout when detail matters

Icons & visual assets:

  • Don't enlarge tiny icons far beyond the size they were designed for
  • Don't shrink detailed artwork so far that it turns to mush

Input Validation & Sanitization

Postel's Law in Forms and Inputs

Be conservative in what the interface outputs, and forgiving about harmless input variation when the system can normalize it safely.

Good resilience moves:

  • accept phone numbers with or without spaces, dashes, or country-code punctuation when the meaning is still clear
  • trim leading/trailing whitespace automatically instead of failing a required field on a pasted value
  • treat case-insensitive identifiers, tags, and search queries consistently when case does not matter
  • normalize pasted content gracefully instead of punishing users for bringing data from another tool
  • preserve the user's raw input on failure so correction is easy

Be strict only where ambiguity, security, or irreversible errors actually matter. The goal is not permissiveness for its own sake — it is reducing needless precision work.

Client-side validation:

  • Required fields
  • Format validation (email, phone, URL)
  • Length limits
  • Pattern matching
  • Custom validation rules

Server-side validation (always):

  • Never trust client-side only
  • Validate and sanitize all inputs
  • Protect against injection attacks
  • Rate limiting

Constraint handling:

<!-- Set clear constraints -->
<input
  type="text"
  maxlength="100"
  pattern="[A-Za-z0-9]+"
  required
  aria-describedby="username-hint"
/>
<small id="username-hint">
  Letters and numbers only, up to 100 characters
</small>

Prefer normalization before rejection when safe:

  • normalize whitespace, punctuation, and casing before declaring input invalid
  • show users the standardized result when formatting changes affect meaning or confidence
  • reject inputs that are unsafe, ambiguous, or materially wrong — but explain why and how to fix them

Accessibility Resilience

Keyboard navigation:

  • All functionality accessible via keyboard
  • Logical tab order
  • Focus management in modals
  • Skip links for long content

Screen reader support:

  • Proper ARIA labels
  • Announce dynamic changes (live regions)
  • Descriptive alt text
  • Semantic HTML

Motion sensitivity:

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

High contrast mode:

  • Test in Windows high contrast mode
  • Don't rely only on color
  • Provide alternative visual cues

Performance Resilience

Slow connections:

  • Progressive image loading
  • Skeleton screens
  • Optimistic UI updates
  • Offline support (service workers)

Memory leaks:

  • Clean up event listeners
  • Cancel subscriptions
  • Clear timers/intervals
  • Abort pending requests on unmount

Throttling & Debouncing:

// Debounce search input
const debouncedSearch = debounce(handleSearch, 300);

// Throttle scroll handler
const throttledScroll = throttle(handleScroll, 100);

Testing Strategies

Manual testing:

  • Test with extreme data (very long, very short, empty)
  • Test in different languages
  • Test offline
  • Test slow connection (throttle to 3G)
  • Test in a noisy, busy, or split-screen environment when the product is used under operational pressure
  • Test with screen reader
  • Test keyboard-only navigation
  • Test on old browsers
  • Run at least one stress or emergency drill if the workflow includes incidents, deadlines, approvals, or other high-stakes moments

Automated testing:

  • Unit tests for edge cases
  • Integration tests for error scenarios
  • E2E tests for critical paths
  • Visual regression tests
  • Accessibility tests (axe, WAVE)

IMPORTANT: Hardening is about expecting the unexpected. Real users will do things you never imagined.

NEVER:

  • Assume perfect input (validate everything)
  • Ignore internationalization (design for global)
  • Leave error messages generic ("Error occurred")
  • Forget offline scenarios
  • Trust client-side validation alone
  • Use fixed widths for text
  • Assume English-length text
  • Block entire interface when one component errors
  • Let user-uploaded images dictate layout shape and spacing
  • Scale screenshots so small that the content becomes illegible
  • Blow up tiny icons past their intended visual size and call it "responsive"

Verify Hardening

Test thoroughly with edge cases:

  • Long text: Try names with 100+ characters
  • Emoji: Use emoji in all text fields
  • RTL: Test with Arabic or Hebrew
  • CJK: Test with Chinese/Japanese/Korean
  • Network issues: Disable internet, throttle connection
  • Large datasets: Test with 1000+ items
  • Concurrent actions: Click submit 10 times rapidly
  • Errors: Force API errors, test all error states
  • Empty: Remove all data, test empty states

Remember: You're hardening for production reality, not demo perfection. Expect users to input weird data, lose connection mid-flow, and use your product in unexpected ways. Build resilience into every component.

平台分布

Codex

35.7%
按下载量换算71

Claude

28.96%
按下载量换算57

Cursor

19.4%
按下载量换算38

Gemini CLI

9.74%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

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

安装前确认

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

继续浏览同类 Skills