Individual skill

migrate-to-shoehorn

将测试文件从 `as` 类型断言迁移到 @total-typescript/shoehorn。当用户提到 shoehorn、想要在测试中替换 `as`、或需要部分测试数据时使用。

skills/misc/migrate-to-shoehorn/SKILL.md

Read pinned source

Source commit 30fc5dbf9380144598f3593e6c1e22c713a52c2a

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
No
Repository scan complete
No
Skill scan complete
No
Observed behavior
Not checked yet
Last checked
Nov 7, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
533
Repository last updated
Nov 3, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# 迁移到 Shoehorn

## 为什么使用 shoehorn?

`shoehorn` 让你在测试中传递部分数据,同时保持 TypeScript 类型正确。它用类型安全的替代方案取代了 `as` 断言。

**仅限测试代码。** 切勿在生产代码中使用 shoehorn。

`as` 在测试中的问题:

- 习惯上被训练不要使用它
- 必须手动指定目标类型
- 双重 `as`(`as unknown as Type`)用于传递故意错误的数据