Agent skill · Testing & QA

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.

stevesolungithub.com/stevesolunGitHub ↗
claude-codeMIT
Install
npx skills add stevesolun/ctx --skill migrate-to-shoehorn --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 3 KB
Bundled scripts: none
Path: imported-skills/mattpocock/migrate-to-shoehorn/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 569
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

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:

What's inside
Steps it walks through
  1. Why shoehorn?
  2. Install
  3. Migration patterns
  4. Large objects with few needed properties
  5. as Type → fromPartial()
  6. as unknown as Type → fromAny()
  7. When to use each
  8. Workflow
Commands it runs
npm i @total-typescript/shoehorn
More from ctx
All skills →
About this skill
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 it?

Run `npx skills add stevesolun/ctx --skill migrate-to-shoehorn --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From stevesolun/ctx, a repository with 569 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going