PlugWiki

Migrate to Shoehorn Skill: Typed Partial Test Data

Rewrites `as` type assertions in your TypeScript tests to @total-typescript/shoehorn helpers so partial test data type-checks.

Installs
500.6K
on skills.sh
Stars
309.2K
on GitHub
Files
1
besides SKILL.md
Updated
Nov 2026
last repo commit

migrate-to-shoehorn makes the agent replace as Type and as unknown as Type in test files with fromPartial() and fromAny() from @total-typescript/shoehorn. That lets a test pass only the properties it cares about while TypeScript still checks the rest. It is for test code only; SKILL.md says never to use shoehorn in production code.

It starts when you mention shoehorn, want to drop as in tests, or need partial test data. It asks which test files hurt, then installs the package with npm i, finds as uses with a grep over *.test.ts and *.spec.ts, swaps them, adds imports and runs the type check.

Good for

  • TypeScript developers who fake large objects in tests
  • Teams cleaning up `as unknown as` in test files
  • Anyone adopting @total-typescript/shoehorn

Install migrate-to-shoehorn

Claude Code

  1. 1

    Copy this prompt.

    Install the migrate-to-shoehorn skill in Claude Code. Run this command:
    
    npx skills add https://github.com/mattpocock/skills --skill migrate-to-shoehorn
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

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.

Sections in SKILL.md

  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

Key facts

Installs on skills.sh
500,645 (Nov 2, 2026)
License
MIT
Last repo commit
Nov 1, 2026

What it includes

  • Replaces `as Type` with partial data that still type-checks

    Pass only the fields the test needs. TypeScript still checks the ones you give.

    Write · fromPartial()

  • Replaces `as unknown as Type` for intentionally wrong data

    Keeps autocomplete while you pass bad data on purpose.

    Write · fromAny()

  • Forces a full object

    Use it when you want the full shape now and plan to swap to fromPartial later.

    fromExact()

  • Asks which test files and what kind of data

    Large objects, or intentionally wrong data for error tests.

    Gather requirements

  • Runs npm i @total-typescript/shoehorn

    Adds a dependency to your project.

    Runs code · Install the package

  • Greps *.test.ts and *.spec.ts for " as [A-Z]"

    Lists candidate lines to migrate.

    Runs code · Find assertions

  • Swaps assertions, adds imports, runs the type check

    Final check that the migrated tests still compile.

    Runs code · Replace, import and type check

From the official docs

Permissions

Low risk

It adds a dependency and rewrites test files in bulk. Run it on a branch and review the diff.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It installs a package and edits many test files

    Review the package.json change and the test diff. Only test files should change.

Technical details
Talks tonpm registry, for npm i @total-typescript/shoehorn
Scopes
  • Edits test files in your repo

  • Adds @total-typescript/shoehorn to package.json

Questions

What does migrate-to-shoehorn do?

It rewrites as type assertions in tests to fromPartial(), fromAny() or fromExact() from @total-typescript/shoehorn, so you can pass partial test data without fighting TypeScript.

How do I install it?

Follow the install box at the top of the page.

Which helper replaces what?

as Type becomes fromPartial(). as unknown as Type becomes fromAny(). fromExact() forces a full object and can be swapped for fromPartial() later.

Can I use shoehorn in production code?

No. SKILL.md says test code only and never to use shoehorn in production code.

Does it need an API key?

SKILL.md asks for none. It installs one npm package and runs a grep and your type check.

Is it safe?

It adds an npm dependency and edits test files in place. Run it on a branch, then check the diff and your type check output.

Information

updated Nov 2, 2026

Folder
skills/misc/migrate-to-shoehorn

mattpocock/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 2
  1. migrate-to-shoehorn SKILL.md · github.com
  2. skills.sh listing · skills.sh

Updated Nov 2, 2026.