Error Handling Recovery 标志

Error Handling Recovery

社区
sanky369
error-handling-recovery

端到端审查并实现应用的错误体验:改写错误消息、将消息放在恰当的位置、添加恢复操作,并为验证、网络、权限、系统和 404 错误构建错误状态。当用户说“改进我的错误处理”“错误提示太糟糕了”“出错时用户会卡住”“添加表单验证错误”“处理离线/网络错误”“设计 404 页面”,或审查发现页面只显示“出了点问题”、错误悄无声息或没有后续处理方式时使用。最终提供错误状态矩阵(每种失败模式 × 消息 × 恢复操作),以及已实现的错误组件和文案。

Add to TypingMind

概览

发布者sanky369
代码仓库vibe-building-skills
技能名称error-handling-recovery
星标数
31
复刻数
7
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 sanky369 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Error Handling Recovery AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/error-handling-recovery
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sanky369/vibe-building-skills.git /tmp/vibe-building-skills
mkdir -p .claude/skills
cp -r /tmp/vibe-building-skills/skills/frontend-design/error-handling-recovery .claude/skills/error-handling-recovery
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Error Handling Recovery,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Error Handling Recovery。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Error Handling Recovery 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Error Handling & Recovery

Turn every failure into a guided path forward: find each way the app can fail, give it a specific human message, a correct placement, and at least one recovery action. The prime directive: never blame the user, and never leave them at a dead end — every error state ships with a way out. Deliver an error-state matrix covering the failure modes plus the implemented components and copy — not messaging guidelines alone.

When to use / when not to

Use for: error message copy, validation UX, network/offline failure handling, permission-denied and 404 pages, recovery workflows, graceful degradation, error accessibility.

Hand off instead when the real need is:

  • Preventing the wait/failure in the first place (retries as performance, optimistic rollback mechanics) → skills/frontend-design/performance-optimization
  • The loading half of the async lifecycle (skeletons, spinners, empty states) → skills/frontend-design/loading-states — this skill owns what happens when loading fails
  • Error animation timing → skills/frontend-design/interaction-physics
  • Full accessibility audit beyond error surfaces → skills/frontend-design/accessibility-excellence

Step 0 — Inspect the codebase, then ask only what's left

  1. Harvest existing error surfaces: grep for catch, .catch(, onError, error state variables, toast.error, alert(, error boundary components, and string literals like "error", "failed", "wrong", "invalid". Collect the actual message strings — the current copy is your before-picture.
  2. Map failure classes present in the app: forms (validation), API calls (network/server), auth'd resources (permission), routing (404), plus anything domain-specific (payment declines, quota limits, file-type rejections).
  3. Find the gaps: catch blocks that swallow errors silently, fetches with no error branch, forms that only style the border red, missing error boundaries around independent sections, no offline handling.
  4. Check a11y wiring: search for role="alert", aria-live, aria-invalid, aria-describedby. Absence = automatic fix items.

Ask the user (one batch, only if not inferable): the support channel to point to (email/help center — needed for system-error copy), and whether any operations are high-stakes (payments, destructive actions) needing extra-careful recovery. If unanswerable, use a placeholder support link, flag it, and proceed.

Workflow

1. Build the error-state matrix

For every failure mode found in Step 0, fill one row: failure mode → what the user was doing → message (what happened / why / what to do) → placement → recovery action(s) → a11y wiring. This matrix is the audit deliverable and the implementation checklist.

2. Write each message with the four-part anatomy

  1. What happened — specific, plain language ("Email already in use", not "Invalid input")
  2. Why — one line of context, no jargon (never surface "CORS policy violation" to a user)
  3. What to do — the concrete next step(s)
  4. Where to get help — support pointer for system errors, with an error/reference ID when the backend provides one

Copy rules: never blame ("you entered an invalid…" → "please enter a…"); state the fix, not just the rule; keep the user's data intact in the message's promises only if the app actually preserves it — never claim "we saved your work" unless it's true.

3. Decide placement and recovery per failure class

ClassPlacementTimingRecovery
ValidationInline, adjacent to the fieldOn blur or submit — never on each keystroke of an incomplete entry; clear immediately once fixedFix guidance; shortcut when it exists ("Sign in instead")
NetworkSection-level state or toast; full state if the whole view failedOn failureRetry button; preserve entered data; offline continuation if supported
PermissionFull state replacing the blocked contentOn load/actionExplain why + "Request access" or path to the owner
System/5xxSection or page stateOn failureRetry + support contact + error ID
404Dedicated pageOn routeSearch + links to key destinations

Fork rules:

  • Inline vs modal vs page: field-scoped → inline; a blocking, high-stakes failure mid-flow (payment declined) → modal recovery; the whole resource unavailable → full page/section state. Toasts only for failures unrelated to the user's current focus — never for form validation.
  • Auto-retry vs manual: idempotent reads may retry automatically with backoff; mutations get an explicit user-triggered retry only (never silently resubmit a payment or post).
  • Degrade, don't break: an unavailable feature is disabled with an explanation, not hidden and not a crash. Wrap independent UI regions in error boundaries so one failure can't blank the page.

4. Implement with accessibility built in

  • Dynamic errors announce via role="alert" (task-blocking) or aria-live="polite" (background).
  • Fields: aria-invalid="true" + aria-describedby pointing at the message element.
  • On submit failure, move focus to the first invalid field or an error summary linking to each.
  • Icon + text + color on every indicator — never color alone.
  • Canonical markup/CSS for every class and the recovery patterns: references/patterns.md — read it when writing the code.

5. Verify

Force each failure (invalid input, network offline in devtools, a 500 via bad endpoint, an unknown route) and confirm: message renders in the right place, recovery action works, entered data survives, screen reader announcement fires (or the wiring is present), nothing fails silently.

Required output format

Deliver both artifacts:

1. The code — implemented error components, copy strings, error boundaries, and a11y wiring, edited into the app's existing component and styling conventions.

2. Error-State Matrix (markdown):

## Error-state matrix
| # | Failure mode | Class | Message (final copy) | Placement | Recovery | A11y | Status |
| 1 | Signup email taken | validation | "Email already in use…" | inline under field | "Sign in instead" link | aria-invalid + describedby + role=alert | implemented |
| 2 | Feed fetch fails | network | "We couldn't load your feed…" | section state | Retry | polite live region | implemented |
| 3 | Card declined | system | "Your card was declined…" | modal | Try again / other method | alertdialog, focus trapped | implemented |

## Silent failures fixed
| Location | Was | Now |

## Copy changes
| Before | After |

## Assumptions
[Support contact used, failure modes you could not reproduce, etc.]

Quality bar (check before delivering)

  • Every row in the matrix has a recovery action — zero dead ends
  • No message blames the user; no raw technical jargon (stack traces, status codes, CORS) shown to users
  • Every message states what to do, not only what went wrong
  • Validation fires on blur/submit and clears on fix; no keystroke-nagging
  • Errors sit adjacent to their cause (no orphaned error summaries without field links)
  • All indicators use icon/text + color, never color alone
  • role="alert"/aria-live, aria-invalid, aria-describedby, and focus management implemented
  • No catch block in touched code swallows an error without a user-facing or logged consequence
  • Mutations never auto-retry; user data is preserved across failures in touched flows

Hard don'ts: don't promise recovery the app can't deliver ("your work is saved" without persistence); don't use humor for destructive or payment failures; don't add error UI that hides the actual error from developers — keep console/telemetry logging intact.

Integration

  • skills/frontend-design/loading-states → hands you its error-empty placements; you expand them into full messages + recovery. The loading→error transition should reuse the same layout slot.
  • skills/frontend-design/performance-optimization → optimistic-UI rollbacks from that skill need your failure toasts/messages when a background sync fails.
  • skills/frontend-design/component-architecture → provides the form/input components you add error variants to; add ErrorState as a shared component there.
  • skills/frontend-design/accessibility-excellence ← audits your live-region and focus behavior; build to its standards up front.

References

  • references/patterns.md — bad→good message rewrites, complete markup for each failure class (validation, network, permission, system, 404), inline/modal/progressive recovery patterns, graceful-degradation snippets, error styling CSS, and the a11y wiring blocks. Read it when writing the components and copy.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Error Handling Recovery AI 技能有什么作用?

端到端审查并实现应用的错误体验:改写错误消息、将消息放在恰当的位置、添加恢复操作,并为验证、网络、权限、系统和 404 错误构建错误状态。当用户说“改进我的错误处理”“错误提示太糟糕了”“出错时用户会卡住”“添加表单验证错误”“处理离线/网络错误”“设计 404 页面”,或审查发现页面只显示“出了点问题”、错误悄无声息或没有后续处理方式时使用。最终提供错误状态矩阵(每种失败模式 × 消息 × 恢复操作),以及已实现的错误组件和文案。

为什么在 TypingMind 中使用 Error Handling Recovery?

因为您只需安装一次,就能搭配任何模型使用。Error Handling Recovery 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Error Handling Recovery?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/error-handling-recovery。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Error Handling Recovery?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Error Handling Recovery 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Error Handling Recovery 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Error Handling Recovery AI 技能免费吗?

是的。sanky369 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇