Skip to content
Kitbay
Skill

migrate-to-shoehorn

MITUpdated on Nov 19, 2026328,236GitHub stars

A skill from Matt Pocock's collection that moves TypeScript test files away from `as` type assertions and onto his @total-typescript/shoehorn library, and only in tests, never production code.

What the skill teaches

A skill from Matt Pocock's collection that moves TypeScript test files away from `as` type assertions and onto his @total-typescript/shoehorn library, and only in tests, never production code. The agent first asks which test files cause trouble, whether large objects or deliberately wrong data are involved, then installs the package, searches .test.ts and .spec.ts files for assertions, and swaps them for fromPartial() when only some properties matter or fromAny() where a double assertion passed invalid data on purpose, adding the import. A table also explains fromExact() for full objects. It finishes with a type check.

Capabilities

  • Find type assertions in test files
  • Replace assertions with fromPartial or fromAny
  • Add the shoehorn import and type-check