migrate-to-shoehorn

Replace TypeScript `as` type assertions with Shoehorn's fromPartial() and fromAny() functions.

Updated May 15, 2026
One-click install
npx skills add https://github.com/ruskibeats/t1d --skill migrate-to-shoehorn-ruskibeats
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/ruskibeats/t1d/tree/main/.agents/skills-archive/misc/migrate-to-shoehorn
Command: npx skills add https://github.com/ruskibeats/t1d --skill migrate-to-shoehorn-ruskibeats

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @total-typescript/shoehorn, and includes scripts (resource) components.

What problem does it solve?

This Skill helps developers refactor TypeScript tests by replacing as type assertions with Shoehorn's type-safe alternatives, improving test code quality and maintainability.

Core Features & Use Cases

  • Type-Safe Refactoring: Converts as assertions to Shoehorn's fromPartial() and fromAny() functions for safer test data handling.
  • Test Code Optimization: Removes unnecessary type assertions and enhances code readability.
  • Use Case: When a developer wants to refactor a test suite that uses as assertions, this Skill can automate the process, ensuring that tests remain type-safe and functional.

Quick Start

Run the migrate-to-shoehorn skill to automatically refactor your TypeScript test files.

Frequently Asked Questions about migrate-to-shoehorn

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

FAQPage Schema
How do I refactor TypeScript tests to remove `as` type assertions?

To refactor TypeScript tests and remove `as` type assertions, you can use Shoehorn's `fromPartial()` and `fromAny()` functions, which provide type-safe alternatives for handling test data without manual assertions.

What is Shoehorn used for in TypeScript test automation?

Shoehorn is used in TypeScript test automation to replace unsafe `as` type assertions with type-safe alternatives like `fromPartial()`, ensuring test suites maintain strict type safety and better code quality.

Can I automatically migrate type assertions in my test suite to Shoehorn?

Yes, you can automatically migrate type assertions in your test suite to Shoehorn by running the migration script, which parses TypeScript source code and converts `as` assertions to type-safe Shoehorn functions.

Do I need Shoehorn installed to refactor my TypeScript test files?

Yes, you need the `@total-typescript/shoehorn` dependency installed, as the refactoring process requires Shoehorn and TypeScript to parse and modify your source code for type-safe test data handling.

What is the best way to improve type safety in TypeScript tests?

The best way to improve type safety in TypeScript tests is to replace manual `as` type assertions with Shoehorn's `fromPartial()` and `fromAny()` functions, optimizing test code readability and maintainability.

Are there limitations to automating TypeScript test refactoring with Shoehorn?

Automating TypeScript test refactoring with Shoehorn is limited to replacing `as` type assertions with type-safe alternatives, requiring valid TypeScript source code to parse and modify without manual type assertions.