Migrate to Shoehorn (Matt Pocock skill)
Migrates test files from `as` assertions to @total-typescript/shoehorn, Matt Pocock's library that lets partial data through without upsetting TypeScript. Three substitutions: `as Type` becomes fromPartial(), `as unknown as Type` becomes fromAny() which keeps autocomplete on deliberately wrong data, and fromExact() forces the full object when you want it pinned. Strict instruction: test code only, never production. Mind the distribution scope: this skill lives in skills/misc/, a folder plugin.json does not declare, so `claude plugins install mattpocock-skills` does NOT install it. You only get it through the skills.sh installer (`npx skills@latest add mattpocock/skills`), which copies the files into your repo.
Strengths
- An explicit table of the three helpers by intent: partial data, deliberately wrong data, pinned full object
- fromAny() keeps autocomplete where `as unknown as` destroyed it entirely
- Explicitly bans shoehorn in production code, avoiding the usual drift into application code
- A mechanical migration with a checklist, so it runs over a large test folder without per-file thinking
Limitations
- Outside the plugin: the misc/ folder is not declared in plugin.json, so the plugin install does not provide it
- Adds a test dependency to your package.json for a problem not every repo has
- TypeScript only, and pointless if your suite already builds fixtures through typed factories
Best for
- TypeScript test suites where `as unknown as` became the reflex for any sizeable object
- Repos testing HTTP handlers that must fabricate a full Request to read a single field
- Quality cleanup passes where you want tests to break when a type changes