Communitygithub.com

pbakaus/harden

将界面打造成生产级品质:错误处理、空状态、引导流程、国际化、文本溢出和边缘情况管理。当用户要求加固、做成生产级、处理边缘情况、添加错误状态、设计空状态、改进引导流程或修复溢出和国际化问题时使用。

harden 是什么?

该技能旨在帮助开发者将用户界面从原型或初步实现阶段加固到适合生产环境的水平。它系统地处理了生产级界面常见的六大关键领域:错误处理(如网络失败、表单验证错误)、空状态(如无数据列表、搜索结果为空)、用户引导流程(首次使用教程、功能提示)、国际化(多语言支持、文本方向)、文本溢出(截断、省略号、响应式布局)以及其他边缘情况(极端输入、权限不足等)。该技能通过提供标准化的模式、最佳实践和代码模板来加速开发,确保界面在各种条件下都能优雅地运行。它主要适用于基于React、Vue或类似前端框架的现代Web应用,但也提供通用建议。使用此技能可以减少手动处理各种异常场景的繁琐工作,显著提升应用的健壮性和用户体验。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/pbakaus/impeccable/tree/main/skills/harden

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

harden 是做什么的?

将界面打造成生产级品质:错误处理、空状态、引导流程、国际化、文本溢出和边缘情况管理。当用户要求加固、做成生产级、处理边缘情况、添加错误状态、设计空状态、改进引导流程或修复溢出和国际化问题时使用。

概述

harden 技能为你的应用增加了必要的弹性和用户友好的回退机制。它帮助识别并实现生产级界面所需的关键关注点,而不仅仅是核心功能路径。

核心关注领域

1. 错误处理

  • 实现全面的错误边界(Error Boundaries)。
  • 为网络请求处理添加 retry(重试)、fallback(回退)和 graceful degradation(优雅降级)机制。
  • 验证表单输入并提供清晰的错误消息。
  • 为 API 错误提供用户可读的消息,不要暴露技术细节。

2. 空状态

  • 为列表、搜索结果和仪表盘设计信息性的空状态。
  • 包含清晰的说明、下一步操作提示和视觉元素(图标/插画)。
  • 避免仅显示“暂无数据”文字;提供上下文指导。

3. 用户引导流程

  • 为新用户设计分步式初始设置向导。
  • 实现 Tooltip 引导或功能亮点显示模式。
  • 创建操作演示或示例数据,帮助快速理解用法。

4. 国际化(i18n)

  • 围绕 i18n 库(如 react-i18next、vue-i18n 等)标准化字符串提取。
  • 优雅地处理从右到左(RTL)的语言排版。
  • 确保日期、数字和货币属性正确本地化。

5. 文本溢出

  • 使用 CSS 属性如 text-overflow: ellipsis 处理长文本截断。
  • 对动态卡片、表格和数据列表应用响应式文本样式。
  • 实现悬停时的 Tooltip 展示全文。

6. 边缘情况处理

  • 处理极端输入(非常长或非常短的字符串、特殊字符)。
  • 处理并发操作(重复点击、快速表单提交)。
  • 处理权限不足或功能受限的情况。

如何使用

当用户要求以下内容时,请系统性地评估并应用此技能:

  • “让这个页面更健壮。”
  • “处理这里所有可能的错误。”
  • “如果列表为空时应该显示什么?”
  • “为新手添加引导流程。”
  • “添加多语言支持。”
  • “修复这个文本溢出的问题。”

支持平台

  • Web 应用(React、Vue、Angular、Svelte 等)
  • 移动原生应用(iOS、Android)
  • 桌面应用(Electron)
  • 通用 UI 模式

最佳实践

  • 始终提供可访问的回退方案(ARIA 属性、alt 文本)。
  • 使用渐进增强原则:基础功能始终可用。
  • 记录所做的决策:为什么选择某个错误策略,如何配置 i18n。
  • 测试边界情况:同时测试正常流程、错误流程和边缘情况。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

pbakaus/adapt

Adapt designs to work across different screen sizes, devices, contexts, or platforms. Implements breakpoints, fluid layouts, and touch targets. Use when the user mentions responsive design, mobile layouts, breakpoints, viewport adaptation, or cross-device compatibility.

pbakaus/animate

Review a feature and enhance it with purposeful animations, micro-interactions, and motion effects that improve usability and delight. Use when the user mentions adding animation, transitions, micro-interactions, motion design, hover effects, or making the UI feel more alive.

pbakaus/arrange

Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

pbakaus/audit

Run technical quality checks across accessibility, performance, theming, responsive design, and anti-patterns. Generates a scored report with P0-P3 severity ratings and actionable plan. Use when the user wants an accessibility check, performance audit, or technical quality review.

pbakaus/bolder

Amplify safe or boring designs to make them more visually interesting and stimulating. Increases impact while maintaining usability. Use when the user says the design looks bland, generic, too safe, lacks personality, or wants more visual impact and character.

pbakaus/clarify

Improve unclear UX copy, error messages, microcopy, labels, and instructions to make interfaces easier to understand. Use when the user mentions confusing text, unclear labels, bad error messages, hard-to-follow instructions, or wanting better UX writing.

pbakaus/colorize

Add strategic color to features that are too monochromatic or lack visual interest, making interfaces more engaging and expressive. Use when the user mentions the design looking gray, dull, lacking warmth, needing more color, or wanting a more vibrant or expressive palette.

pbakaus/critique

Evaluate design from a UX perspective, assessing visual hierarchy, information architecture, emotional resonance, cognitive load, and overall quality with quantitative scoring, persona-based testing, automated anti-pattern detection, and actionable feedback. Use when the user asks to review, critique, evaluate, or give feedback on a design or component.

pbakaus/delight

Add moments of joy, personality, and unexpected touches that make interfaces memorable and enjoyable to use. Elevates functional to delightful. Use when the user asks to add polish, personality, animations, micro-interactions, delight, or make an interface feel fun or memorable.

pbakaus/distill

Strip designs to their essence by removing unnecessary complexity. Great design is simple, powerful, and clean. Use when the user asks to simplify, declutter, reduce noise, remove elements, or make a UI cleaner and more focused.

pbakaus/extract

Extract and consolidate reusable components, design tokens, and patterns into your design system. Identifies opportunities for systematic reuse and enriches your component library. Use when the user asks to create components, refactor repeated UI patterns, build a design system, or extract tokens.

pbakaus/frontend-design

frontend-design — an installable skill for AI agents.

pbakaus/impeccable

Use when the user wants to design, redesign, shape, critique, audit, polish, clarify, distill, harden, optimize, adapt, animate, colorize, extract, or otherwise improve a frontend interface. Covers websites, landing pages, dashboards, product UI, app shells, components, forms, settings, onboarding, and empty states. Handles UX review, visual hierarchy, information architecture, cognitive load, accessibility, performance, responsive behavior, theming, anti-patterns, typography, fonts, spacing, layout, alignment, color, motion, micro-interactions, UX copy, error states, edge cases, i18n, and reusable design systems or tokens. Also use for bland designs that need to become bolder or more delightful, loud designs that should become quieter, live browser iteration on UI elements, or ambitious visual effects that should feel technically extraordinary. Not for backend-only or non-UI tasks.

pbakaus/layout

Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

pbakaus/normalize

Audits and realigns UI to match design system standards, spacing, tokens, and patterns. Use when the user mentions consistency, design drift, mismatched styles, tokens, or wants to bring a feature back in line with the system.

pbakaus/onboard

Designs and improves onboarding flows, empty states, and first-run experiences to help users reach value quickly. Use when the user mentions onboarding, first-time users, empty states, activation, getting started, or new user flows.

pbakaus/optimize

Diagnoses and fixes UI performance across loading speed, rendering, animations, images, and bundle size. Use when the user mentions slow, laggy, janky, performance, bundle size, load time, or wants a faster, smoother experience.

pbakaus/overdrive

Pushes interfaces past conventional limits with technically ambitious implementations — shaders, spring physics, scroll-driven reveals, 60fps animations. Use when the user wants to wow, impress, go all-out, or make something that feels extraordinary.

pbakaus/polish

Performs a final quality pass fixing alignment, spacing, consistency, and micro-detail issues before shipping. Use when the user mentions polish, finishing touches, pre-launch review, something looks off, or wants to go from good to great.

pbakaus/quieter

Tones down visually aggressive or overstimulating designs, reducing intensity while preserving quality. Use when the user mentions too bold, too loud, overwhelming, aggressive, garish, or wants a calmer, more refined aesthetic.

相关技能