migrate-to-shoehorn

Migrate TypeScript test files from as assertions to shoehorn helpers.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/raphaelmans/agent-skills --skill migrate-to-shoehorn-raphaelmans
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/raphaelmans/agent-skills/tree/main/migrate-to-shoehorn
Command: npx skills add https://github.com/raphaelmans/agent-skills --skill migrate-to-shoehorn-raphaelmans

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrates TypeScript test files from as type assertions to shoehorn replacements to improve type-safety and readability in tests.

Core Features & Use Cases

  • FromPartial migration: Replace as Type with fromPartial for partial data in tests.
  • FromAny migration: Replace as unknown as Type with fromAny to preserve autocomplete while testing edge cases.
  • Safe workflows: Adds necessary imports and encourages safe testing patterns, avoiding production usage.

Quick Start

Migrate test files by replacing as Type with fromPartial and as unknown as Type with fromAny, then add the required imports.

Frequently Asked Questions about migrate-to-shoehorn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate TypeScript tests from as type assertions to shoehorn?

Migrate TypeScript tests by replacing `as Type` with `fromPartial` and `as unknown as Type` with `fromAny`, then add the required shoehorn imports to ensure type-safety and readability.

What is the difference between fromPartial and fromAny in shoehorn test migrations?

`fromPartial` replaces `as Type` for partial test data, while `fromAny` replaces `as unknown as Type` to preserve autocomplete when testing edge cases with intentional type mismatches.

How do I handle intentional type mismatches when migrating tests to shoehorn?

Handle intentional type mismatches during shoehorn migration by replacing `as unknown as Type` wrappers with `fromAny`, which preserves autocomplete while safely testing edge cases.

Can I use shoehorn migrations for production code instead of just test files?

Shoehorn migration targets TypeScript test suites using `as` assertions and encourages safe testing patterns, explicitly avoiding production usage to maintain strict type-safety boundaries.

Does migrate-to-shoehorn work with TypeScript test suites using unknown as wrappers?

Yes, the migration applies to TypeScript test suites using `as` assertions or `unknown as` wrappers, converting them to `fromPartial` and `fromAny` usage with corresponding imports.