Matt Pocock's skill that gives coding agents a shared vocabulary for designing deep modules: interfaces, seams, adapters, depth, leverage and locality, plus rules for testable design.
Migrate to Shoehorn (Matt Pocock) Skill
Matt Pocock's skill for replacing `as` type assertions in TypeScript tests with @total-typescript/shoehorn's fromPartial, fromAny and fromExact helpers.
Install
Other ways to install
About
- Rewrites `as Type` test data to fromPartial()
- Rewrites `as unknown as Type` to fromAny() for intentionally wrong inputs
- Explains when to use fromExact()
- Finds assertions across *.test.ts and *.spec.ts files
- Restricts shoehorn to test code
- Verifies the migration with a type check
Migrate to Shoehorn is a skill by Matt Pocock, author of Total TypeScript and of the @total-typescript/shoehorn library it migrates to. It teaches an agent to clean up TypeScript test files that fake their inputs with as Type or as unknown as Type.
The problem it targets is common in test suites: a function takes a large object (a request, a context, a config) but a test only cares about one or two properties, so the test either fakes every field or casts its way past the compiler. Shoehorn's helpers keep partial test data type-safe instead. The skill maps each pattern to its replacement: as Type becomes fromPartial(), a deliberately wrong as unknown as Type becomes fromAny() (which keeps autocomplete), and fromExact() forces a full object when that is what the test needs.
The workflow asks which test files and objects are causing trouble, installs the package, finds assertions in *.test.ts and *.spec.ts files with a grep, rewrites them, adds the imports and runs the type checker. It is explicit that shoehorn belongs in test code only, never production code.
For TypeScript developers using Claude Code, Codex, Cursor or another skills-compatible agent on a Vitest or Jest test suite. MIT licensed.
SKILL.md
The instructions your agent loads, as published by Matt Pocock.
Related Skills
See all Migrate to Shoehorn (Matt Pocock) alternativesMatt Pocock's skill that wires Husky, lint-staged and Prettier into a JavaScript or TypeScript repo, so every commit is formatted, type-checked and tested before it lands.
A coding-agent skill that works like a lazy senior developer: the smallest complete change that solves the task, no speculative code, and a short reply naming what was skipped.
Skill: Improve Codebase Architecture
by Matt Pocock
Matt Pocock's /improve-codebase-architecture command: finds shallow modules worth deepening, renders them as a visual HTML report with before/after diagrams, then grills you through the one you pick.