Migrate To Shoehorn
Type-safe partial test data helpers that replace as assertions in test files only.
- CCM score
- 66 of 100
- skills.sh installs
- 5.8K
- GitHub stars
- 6.2K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers migrating
as Type,as unknown as Type, and large partial objects in tests tofromPartial(),fromAny(), andfromExact() - Provides a decision table mapping each helper to its case: type-checked partials, intentionally wrong data, or full objects
- Includes a migration workflow with a
grepcommand to locateasassertions in*.test.tsand*.spec.tsfiles - Designed for test code only; production code must never use shoehorn, and the package installs via
npm i @total-typescript/shoehorn
Install
$ npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill migrate-to-shoehorn -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
迁移到 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)
安装
npm i @total-typescript/shoehorn
迁移模式
只需要少数属性的大型 objects
Before:
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:
import { fromPartial } from "@total-typescript/shoehorn";
it("gets user by id", () => {
getUser(
fromPartial({
body: { id: "123" },
}),
);
});
as Type → fromPartial()
Before:
getUser({ body: { id: "123" } } as Request);
After:
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
as unknown as Type → fromAny()
Before:
Details
- Repository
- github.com/vinvcn/mattpocock-skills-zh-cn
- Categories
- Testing & QA, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What is migrate-to-shoehorn?
migrate-to-shoehorn is an agent skill listed on Claude Marketplaces in the Testing & QA category. Its page on Claude Marketplaces links to the migrate-to-shoehorn source on GitHub.
How do I install migrate-to-shoehorn?
Run npx -y skills add vinvcn/mattpocock-skills-zh-cn --skill migrate-to-shoehorn -y in a project to install migrate-to-shoehorn. After that, the agent can use migrate-to-shoehorn in that project.
Which category is migrate-to-shoehorn in?
migrate-to-shoehorn is in the Testing & QA category on Claude Marketplaces. Other listings in that category next to migrate-to-shoehorn include tdd, migrate-to-shoehorn and test-driven-development.
Where is the source code of migrate-to-shoehorn?
The source code of migrate-to-shoehorn is on GitHub at https://github.com/vinvcn/mattpocock-skills-zh-cn. The vinvcn account on GitHub publishes migrate-to-shoehorn.
More from vinvcn/mattpocock-skills-zh-cn
All 24- Teach5.6K
- Grilling4.9K
- Domain Modeling4.6K
- Code Review4.6K
- Ask Matt4.6K
- Diagnosing Bugs4.6K
- Implement4.5K
- Codebase Design4.5K
- Research4.4K
- Writing Shape3.9K
- Writing Fragments3.9K
- Writing Beats3.9K
- Grill Me7.1K
- Grill With Docs6.7K
- Setup Matt Pocock Skills6.4K
- Handoff6.3K
- Tdd6.3K
- Improve Codebase Architecture6.2K
- Prototype6.2K
- Triage6K
- Git Guardrails Claude Code5.8K
- Scaffold Exercises5.8K
- Setup Pre Commit5.8K
Similar to Migrate To Shoehorn
More Testing & QAplaywright-expertjeffallan/claude-skills5.8K installsUse when writing E2E tests with Playwright, setting up test infrastructure, or debugging flaky browser tests. Invoke to write test scripts, create page objects,
swift-testing-expertavdlee/swift-testing-agent-skill5.7K installsExpert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting
react-native-testingcallstack/react-native-testing-library5.7K installsWrite tests using React Native Testing Library (RNTL) v13 and v14 (`@testing-library/react-native`). Use when writing, reviewing, or fixing React Native compone
k6grafana/skills5.6K installsGenerate, validate, and review k6 test scripts — load, stress, spike, soak, smoke, breakpoint, functional, and protocol. Covers HTTP, WebSocket, gRPC, browser,
code-testing-agentdotnet/skills5.4K installsMANDATORY ENTRY POINT for generating or writing tests. Invoke this skill before editing files whenever the user asks to generate tests, write/add unit tests, sc
cmux-testingmanaflow-ai/cmux5.2K installscmux testing rules for Swift Testing, test target compilation, test wiring, and package/refactor validation. Use when adding or changing tests, touching package