thiserror-expert
使用 thiserror 改善 Rust 錯誤
Rust 錯誤 enum 可能變得冗長,並遺失來源脈絡。此 skill 會引導 Claude、Codex 和 Claude Code 建立慣用的 thiserror 型別。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "thiserror-expert" from https://skillstore.io/skills/emillindfors-thiserror-expert.md and its manifest at https://skillstore.io/api/skills/emillindfors-thiserror-expert/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「thiserror-expert」。 小型 Rust error enum 的手動 Display 實作。
預期結果:
此 skill 會建議精簡的 thiserror derive、更清楚的 variant 訊息,並移除重複的 display 樣板程式碼。
正在使用「thiserror-expert」。 包裝 IO 錯誤但沒有來源 metadata 的 error variant。
預期結果:
此 skill 會說明應保留底層原因,讓呼叫端可以檢查原始 IO 失敗。
正在使用「thiserror-expert」。 具有 database、domain 和 application failures 的分層服務。
預期結果:
此 skill 會為每一層提出分開的 error enums,並說明自動轉換應發生的位置。
安全審計
安全The static findings are false positives from Markdown backticks, Rust code fences, and Rust validation examples in SKILL.md. I found no prompt injection, command execution instructions, network access, filesystem writes, or data exfiltration intent.
風險因素
⚙️ 外部命令 (48)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/emillindfors-thiserror-expert/audits/4?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/emillindfors-thiserror-expert?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/emillindfors-thiserror-expert?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/emillindfors-thiserror-expert/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/emillindfors-thiserror-expert.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>學術引用 (APA · BibTeX · CFF)
APA 引用
EmilLindfors. (2026). thiserror-expert security audit report (audit version 4) [Author version 1.0.0]. Skillstore. https://skillstore.io/skills/emillindfors-thiserror-expert/audits/4BibTeX 引用
@techreport{emillindfors-emillindfors-thiserror-expert-2026,
author = {EmilLindfors},
title = {thiserror-expert security audit report (audit version 4)},
institution = {Skillstore},
year = {2026},
number = {4},
url = {https://skillstore.io/skills/emillindfors-thiserror-expert/audits/4},
note = {Author version 1.0.0}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "thiserror-expert security audit report (audit version 4)"
version: "1.0.0"
type: report
authors:
- name: "EmilLindfors"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/emillindfors-thiserror-expert/audits/4"
identifiers:
- type: other
value: "skillstore:emillindfors-thiserror-expert:audit:4"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 高你可以打造什麼
重構手動錯誤實作
將手寫的 Display 和 Error 實作轉換為精簡的 thiserror enums。
設計函式庫錯誤 API
建立穩定的公開錯誤型別,具備清楚訊息並保留來源鏈結。
檢視錯誤傳播模式
檢查 #[from]、#[source] 或 transparent wrappers 是否適合各個錯誤邊界。
試試這些提示
檢視我的 Rust error enum,並建議一個具備清楚訊息與正確 derives 的 thiserror 版本。
檢查我的 error variants 是否缺少來源鏈結。說明應在哪裡使用 #[from] 或 #[source]。
為我的 domain、infrastructure 和 application layers 設計 thiserror enums。說明轉換邊界。
稽核我的公開 Rust error API 的 thiserror 使用方式、穩定 variant names、來源保留和可採取行動的訊息。
最佳實務
- 使用可採取行動的錯誤訊息,包含有用脈絡但不揭露機密。
- 在適當時使用 #[from]、#[source] 或 transparent wrappers 保留底層原因。
- 保持公開函式庫錯誤穩定,並避免洩漏私有實作細節。
避免
- 使用像 Error 或 Something went wrong 這類模糊訊息。
- 包裝 dependency errors 卻未保留來源鏈結。
- 在建構期間必須加入自訂脈絡時使用 #[from]。
常見問題
這個 skill 可以協助什麼?
它會執行 cargo commands 嗎?
我何時應該使用 #[from]?
我何時應該使用 #[source]?
它能協助 library APIs 嗎?
它會取代錯誤處理設計嗎?
開發者詳細資訊
作者
EmilLindfors授權
MIT
作者版本
v1.0.0
Skillstore 修訂
r1
引用
a06681402992ceae98ba04d54cfd4ab004862696
維護新鮮度
2026/7/18
使用量
4 次下載 · 192 次瀏覽
檔案結構
📄 SKILL.md