Migrate to Shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Install
/plugin marketplace add mattpocock/skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add mattpocock/skills --skill migrate-to-shoehorngit clone --depth 1 https://github.com/mattpocock/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/misc/migrate-to-shoehorn ~/.claude/skills/migrate-to-shoehornPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Migrate to Shoehorn
## Why shoehorn?
`shoehorn` lets you pass partial data in tests while keeping TypeScript happy. It replaces `as` assertions with type-safe alternatives.
**Test code only.** Never use shoehorn in production code.
Problems with `as` in tests:
- Trained not to use it
- Must manually specify target type
- Double-as (`as unknown as Type`) for intentionally wrong data
## Install
```bash
npm i @total-typescript/shoehorn
```
## Migration patterns
### Large objects with few needed properties
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:Details
- Skill name
migrate-to-shoehorn- Repository
- mattpocock/skills
- Path
skills/misc/migrate-to-shoehorn/SKILL.md- License
- MIT
- Repo updated
- 30 October 2026
- Listed in
- VoltAgent/awesome-agent-skills
FAQ
What does the Migrate to Shoehorn skill do?
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
How do I install the Migrate to Shoehorn skill?
Claude Code plugin: /plugin marketplace add mattpocock/skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Migrate to Shoehorn popular?
It lives in mattpocock/skills, which has 307,829 GitHub stars and 25,903 forks, and is included in 1 curated skill list.
Related skills
Ask Matt
308kmattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
Chief of Staff
308kmattpocock/skills
Pursue a long-running goal in a single session by co-ordinating subagents.
Claude Handoff
308kmattpocock/skills
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Setup Pre Commit
308kmattpocock/skills
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
Rea CI Tests Audit
414kmorluto/rea
Audit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.
TDD
308kmattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Browse the most popular Claude skills, all testing & qa skills, or write your own with the skills generator.