dsh-error-handling 精选
Apply error-handling principles when designing or reviewing failures, recovery, retries, background tasks, and user-visible error reports.
安装方式
cp -r .agents/skills/dsh-error-handling ~/.claude/skills/dsh-error-handling把该 skill 目录放进客户端 skills 目录。不同客户端的目录可能不同,Claude Code 默认是 ~/.claude/skills/
https://raw.githubusercontent.com/deepseek-ai/deepseek-harness/d743267388641bc76f17c45ce8b4c231aed1d32c/.agents/skills/dsh-error-handling/SKILL.md下载后另存为 ~/.claude/skills/dsh-error-handling/SKILL.md。链接锁定采集时的 commit,内容与本站展示一致。
整仓一次性获取:git clone --depth 1 https://github.com/deepseek-ai/deepseek-harness.git
依赖与权限
- 无需 API Key
- 需要联网访问外部服务
- 无外部命令依赖
- 以上为按正文与 frontmatter 自动推断的信号,仅供参考;安装前建议先阅读原文。
SKILL.md 正文
DeepSeek Harness Error Handling
Define failures, their owners, and what remains safe after failure.
Typed, structured failures
Expected failures need declared types, stable discriminants, and handling-relevant details. Reuse package error conventions, preserve causes, and separate machine identity from display text. Never route handling by parsing messages. Unexpected defects such as assertNever may remain plain Error; containment must never turn them into success.
Catch, recover, or stop
For each failure, define handling and reporting owners, containment, and guarantees in the owning API documentation: valid invariants, absent/partial/committed/unknown effects, and cleanup responsibility. Background work retains these obligations.
Catching limits exception propagation, not mutations. Only the affected state's owner can establish safe continuation. Otherwise stop dependent work, discard invalid state or instances, or escalate. Logging alone is not recovery. Retries require safe repetition, cancellation, and an explicit owner; finite operations need budgets, while continuing supervision needs lifecycle ownership and observable degradation.
Localized, actionable, visible reports
Every final report needs a readable summary, affected operation, and safe next action. Localize through the receiving application's locale mechanism where one exists; other diagnostics use their existing output language. Keep sensitive internal details out of user-facing text.
Untrusted state or unknown outcomes must be visible through UI or default-enabled, accessible logs: report the impact, uncertainty, system disposition, and safe next step. Persistent invalid state needs persistent visibility. Never claim success, rollback, or safe retry without guarantees. Reporting failures need an independent fallback.
Verify resulting state and visible outcomes, not merely that an exception was caught.
Foundations
Meyer's Object-Oriented Software Construction (1997): contracts and invariants; Sutter's Exceptional C++ (1999): exception safety guarantees; Armstrong's thesis (2003): isolation and supervision.
质量与来源
- 所属仓库
- deepseek-ai/deepseek-harness
- 仓库星标
- 25 万
- 最近更新
- 3 天前
- 采集时间
- 今天
- commit
- d74326738864
- 内容指纹
- sha256:fcde7e278056263
- 文件路径
- .agents/skills/dsh-error-handling/SKILL.md