migrate-to-shoehorn

Migrate TypeScript tests from as assertions to shoehorn fromPartial() and fromAny() helpers.

Updated Mar 23, 2026
One-click install
npx skills add https://github.com/fray-cloud/coin --skill migrate-to-shoehorn-fray-cloud
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/fray-cloud/coin/tree/main/.agents/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/fray-cloud/coin --skill migrate-to-shoehorn-fray-cloud

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate test files from using as assertions to the safer Shoehorn helpers, reducing brittle tests and improving type safety.

Core Features & Use Cases

  • Safe migration: replace as and as unknown as with fromPartial() and fromAny() where appropriate.
  • Maintainability: minimize boilerplate by inferring partial shapes for tests.
  • Use Case: ideal when test suites contain large objects but only a subset of properties matter for the assertion.

Quick Start

Run the migration tool on your TypeScript test suite to replace as assertions with shoehorn-based helpers (fromPartial and fromAny) where appropriate.

Frequently Asked Questions about migrate-to-shoehorn

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

FAQPage Schema
How do I replace TypeScript `as` assertions in unit tests with safer helpers?▼

Replace `as` assertions in TypeScript unit tests by migrating to Shoehorn helpers like `fromPartial()` and `fromAny()`, which provide type-safe partial data construction and reduce brittle test assertions.

What is the best way to handle large test objects when only a few properties matter?▼

Use `fromPartial()` to infer partial shapes for large test objects, minimizing boilerplate while maintaining type safety when only a subset of properties matters for the assertion.

When should I use `fromPartial()` versus `fromAny()` for TypeScript test data?▼

Use `fromPartial()` to define partial data shapes safely, and apply `fromAny()` for safe variations when migrating `as unknown as` assertions, following structured migration workflows with explicit Shoehorn imports.

Can I migrate test suites that heavily rely on `as unknown as` casts to Shoehorn?▼

Yes, you can migrate test suites relying on `as unknown as` casts by replacing them with Shoehorn-based helpers, improving type safety and test maintainability across your TypeScript codebase.

Does migrating TypeScript tests to Shoehorn require explicit imports?▼

Yes, migrating to Shoehorn requires explicit imports of Shoehorn utilities to ensure structured migration workflows and proper usage of `fromPartial()` and `fromAny()` helpers.