migrate-to-shoehorn
將測試遷移到 Shoehorn
測試中的型別斷言可能會隱藏缺少的欄位與不清楚的意圖。此技能會引導 Claude、Codex 和 Claude Code 將它們替換為 shoehorn 輔助函式。
使用我的智慧代理安裝
將此請求複製給你的智慧代理,其中包含權威 Skill 頁面和清單。
Review the Skillstore skill "migrate-to-shoehorn" from https://skillstore.io/skills/mattpocock-migrate-to-shoehorn.md and its manifest at https://skillstore.io/api/skills/mattpocock-migrate-to-shoehorn/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智慧代理仍應顯示其計畫,並依安全政策請求必要確認。
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「migrate-to-shoehorn」。 測試建立一個大型 request 物件,只是為了提供一個 body 欄位。
預期結果:
此技能會建議使用部分輔助函式、加入套件匯入,並在遷移後進行型別檢查。
正在使用「migrate-to-shoehorn」。 測試刻意傳入無效資料,以驗證錯誤處理。
預期結果:
此技能會將該案例識別為刻意無效的資料,並建議使用專為該目的設計的輔助函式。
正在使用「migrate-to-shoehorn」。 團隊想要為許多測試檔案制定安全的遷移計畫。
預期結果:
此技能會將探索、相依性確認、聚焦編輯和最終驗證拆分成可審查的步驟。
安全審計
安全All 29 static findings are false positives caused by Markdown backticks, fenced examples, or ordinary prose. The skill documents expected npm and grep commands, but contains no command runner, dynamic execution, hidden behavior, or prompt injection.
風險因素
⚙️ 外部命令 (28)
分享與引用此報告
分享版本化評估報告、中性徽章、嵌入卡片與引用。Skillstore 只報告證據,不判斷該 Skill 是否安全。
複製報告連結
https://skillstore.io/skills/mattpocock-migrate-to-shoehorn/audits/6?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/mattpocock-migrate-to-shoehorn?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/mattpocock-migrate-to-shoehorn?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/mattpocock-migrate-to-shoehorn/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/mattpocock-migrate-to-shoehorn.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 引用
mattpocock. (2026). migrate-to-shoehorn security audit report (audit version 6) [Author version unspecified]. Skillstore. https://skillstore.io/skills/mattpocock-migrate-to-shoehorn/audits/6BibTeX 引用
@techreport{mattpocock-mattpocock-migrate-to-shoehorn-2026,
author = {mattpocock},
title = {migrate-to-shoehorn security audit report (audit version 6)},
institution = {Skillstore},
year = {2026},
number = {6},
url = {https://skillstore.io/skills/mattpocock-migrate-to-shoehorn/audits/6},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "migrate-to-shoehorn security audit report (audit version 6)"
version: "unspecified"
type: report
authors:
- name: "mattpocock"
date-released: "2026-07-23"
url: "https://skillstore.io/skills/mattpocock-migrate-to-shoehorn/audits/6"
identifiers:
- type: other
value: "skillstore:mattpocock-migrate-to-shoehorn:audit:6"
description: "Skillstore immutable audit report identifier"
Skillstore 評分
評分依據 證據置信度: 中你可以打造什麼
清理 TypeScript 測試
將不安全的測試斷言替換為 shoehorn 輔助函式,同時維持相同的測試行為。
簡化大型測試 Fixture
只傳入測試需要的欄位,而不是建立大型假物件。
引導可審查的遷移
建立清楚的遷移計畫,將部分 fixture 與刻意無效的資料區分開來。
試試這些提示
將這個測試檔案從 TypeScript `as` 斷言遷移到 shoehorn。保持行為不變,並說明每個替換。
找出含有 `as` 斷言的 test 與 spec 檔案,並在編輯前提出 shoehorn 遷移計畫。不要變更生產檔案。
將部分測試 fixture 重構為使用 `fromPartial`,將刻意無效的 fixture 改為使用 `fromAny`,並將完整 fixture 改為使用 `fromExact`。加入匯入並執行型別檢查。
稽核這個測試套件中不安全的型別斷言,將安全案例與刻意無效的資料分開,遷移選定案例,並摘要剩餘風險。
最佳實務
- 僅在 test 與 spec 檔案上使用此技能。
- 在執行安裝命令前,先確認相依性變更。
- 每次遷移後執行型別檢查與測試。
避免
- 將 shoehorn 輔助函式套用到生產程式碼。
- 在未理解刻意無效資料的情況下替換斷言。
- 略過對產生的匯入與相依性變更的審查。
常見問題
此技能會遷移什麼?
我可以在生產程式碼中使用它嗎?
它會自動安裝套件嗎?
它會說明哪些輔助函式?
它能與 Claude Code 和 Codex 搭配使用嗎?
遷移後我應該檢查什麼?
開發者詳細資訊
作者
mattpocock授權
MIT
Skillstore 修訂
r2
版本提示
作者未聲明版本。
引用
ebdfe608f5de2b66ff37ab4af12af8ac4f5e8006
維護新鮮度
2026/7/26
使用量
2 次下載 · 0 次瀏覽
檔案結構
📄 SKILL.md