Agent skill · Audited from source
migrate-to-shoehorn
skill · vinvcn/mattpocock-skills-zh-cnMIT licenceAudited 13 Nov 2026 · source f6d20665ed99
Is it safe? Yes — SAFE, grade B (89/100). We read this skill's source at commit f6d20665ed99 and found no filesystem, network or shell access and no hard-coded secrets. What it does: 将测试文件从 `as` 类型断言迁移到 @total-typescript/shoehorn。适用于用户提到 shoehorn、想替换测试中的 `as`,或需要局部测试数据时。
Cite
Cite this page
ModelsAtlas. “migrate-to-shoehorn (vinvcn/mattpocock-skills-zh-cn)”. Retrieved 13 Nov 2026. https://modelsatlas.com/skills/vinvcn/migrate-to-shoehorn
Trust audit
Audit 0.4.1 · source read 13 Nov 2026
SAFE means nothing in the source contradicts what the skill says it does. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (0)
No findings at any severity. We re-audit when the source changes.
Audit 0.4.1 · source sha f6d20665ed99 · 13 Nov 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishervinvcn GitHub userOwner of the repository this skill is read from
- Source foldervinvcn/mattpocock-skills-zh-cn/skills/misc/migrate-to-shoehornThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictf6d20665ed99A new audit runs when the source changes
- Repository statusNot archivedLast push 2 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: 将测试文件从 `as` 类型断言迁移到 @total-typescript/shoehorn。适用于用户提到 shoehorn、想替换测试中的 `as`,或需要局部测试数据时。
---
name: migrate-to-shoehorn
description: 将测试文件从 `as` 类型断言迁移到 @total-typescript/shoehorn。适用于用户提到 shoehorn、想替换测试中的 `as`,或需要局部测试数据时。
---
# 迁移到 Shoehorn
## 为什么用 shoehorn?
`shoehorn` 允许你在 tests 中传入 partial data,同时保持 TypeScript 满意。它用 type-safe alternatives 替换 `as` assertions。
**只用于 test code。** 永远不要在 production code 中使用 shoehorn。
Tests 中 `as` 的问题:
- 经过训练,不去使用它
- 必须手动指定 target type
- 对故意错误的数据需要 double-as(`as unknown as Type`)
## 安装
```bash
npm i @total-typescript/shoehorn
```
## 迁移模式
### 只需要少数属性的大型 objects
Before:
```ts
type Request = {
body: { id: string };
headers: Record<string, string>;
cookies: Record<string, string>;
// ...20 more properties
};
it("gets user by id", () => {
// Only care about body.id but must fake entire Request
getUser({
body: { id: "123" },
headers: {},
cookies: {},
// ...fake all 20 properties
});
});
```
After:
```ts
import { fromPartial } from "@total-typescript/shoehorn";
it("gets user by id", () => {
getUser(
fromPartial({
body: { id: "123" },
}),
);
});
```
### `as Type` → `fromPartial()`
Before:
```ts
getUser({ body: { id: "123" } } as Request);
```
After:
```ts
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
```
### `as unknown as Type` → `fromAny()`
Before:
```ts
getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose
```
After:
```ts
import { fromAny } from "@total-typescript/shoehorn";
getUser(fromAny({ body: { id: 123 } }));
```
## 何时使用哪一个
| Function | Use case |
| --------------- | -------------------------------------------------- |
| `fromPartial()` | 传入仍能 type-check 的 partial data |
| `fromAny()` | 传入故意错误的数据(保留 autocomplete) |
| `fromExact()` | 强制 full object(之后可换成 fromPartial) |
## 工作流
1. **Gather requirements** - 询问用户:
- 哪些 test files 中的 `as` assertions 造成问题?
- 是否在处理大型 objects,但只关心部分 properties?
- 是否需要传入故意错误的数据来测试 error paths?
2. **Install and migrate**:
- [ ] Install: `npm i @total-typescript/shoehorn`
- [ ] 查找 test files 中的 `as` assertions: `grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"`
- [ ] 用 `fromPartial()` 替换 `as Type`
- [ ] 用 `fromAny()` 替换 `as unknown as Type`
- [ ] 添加来自 `@total-typescript/shoehorn` 的 imports
- [ ] 运行 type check 验证Excerpt, first 2,411 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit f6d2066
npm i @total-typescript/shoehorn
git clone https://github.com/vinvcn/mattpocock-skills-zh-cn git -C mattpocock-skills-zh-cn checkout f6d20665ed99
Commands as the repository documents them: shown, never run by us. Our verdict covers commit f6d20665ed99 only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- ✓SAFE B 89 / 100
first audit · source
f6d20665ed99
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/vinvcn/migrate-to-shoehorn/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →vinvcn/mattpocock-skills-zh-cn
构建一次性原型来回答一个设计问题。适用于用户想验证某个 state model 或 logic 是否感觉对,或探索 UI 应该长什么样时。
vinvcn/mattpocock-skills-zh-cn
将 mattpocock/skills 的内容翻译、刷新或复核到简体中文本地化仓库 vinvcn/mattpocock-skills-zh-CN 时使用这个项目级 skill。适用于 skill files、README content、CLAUDE.md、GLOSSARY.md、docs,以及其他需要保留行为关键 identifiers 的上游用户可见内容。
vinvcn/mattpocock-skills-zh-cn
扫描代码库中的深化机会,生成可视化 HTML 报告,然后围绕你选中的候选项继续追问。
vinvcn/mattpocock-skills-zh-cn
在这个工作区中,就我想构建的工作流规格访谈我。
vinvcn/mattpocock-skills-zh-cn
把当前对话压缩成交接文档,让另一个代理接手。
vinvcn/mattpocock-skills-zh-cn
基于 spec 或 ticket 集合实现一段工作。
Add this badge to your README
[](https://modelsatlas.com/skills/vinvcn/migrate-to-shoehorn/)
<a href="https://modelsatlas.com/skills/vinvcn/migrate-to-shoehorn/"><img src="https://modelsatlas.com/skills/vinvcn/migrate-to-shoehorn/badge.svg" alt="ModelsAtlas: SAFE B"></a>
Questions about migrate-to-shoehorn
What does the migrate-to-shoehorn skill do?
Is migrate-to-shoehorn safe to install?
What can migrate-to-shoehorn access on my machine?
How current is this page?
Sources
- github.com/vinvcn/mattpocock-skills-zh-cn/tree/main/skills/misc/ — the audited source at commit f6d20665ed99 and every finding aboveObserved · 13 Nov 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the migrate-to-shoehorn skill do?
- Is migrate-to-shoehorn safe to install?
- What can migrate-to-shoehorn access on my machine?