本文へスキップ
Kitbay
スキル

migrate-to-shoehorn

MIT2026年11月19日 更新328,236GitHubスター

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.

スキルの内容

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.

できること

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