migrate-to-shoehorn

Convert TypeScript test 'as' assertions to Shoehorn type-safe alternatives.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill unit addresses the issue of 'as' assertions in TypeScript tests, allowing for the conversion to type-safe alternatives with Shoehorn.

Core Features & Use Cases

  • Test Code Transformation: Migrates as type assertions to Shoehorn's type-safe equivalents.
  • Partial Data Testing: Facilitates passing partial data in tests while maintaining TypeScript type safety.
  • Use Case: When you need to replace 'as' assertions in tests to ensure more robust and type-safe testing practices.

Quick Start

Run the 'migrate-to-shoehorn' skill to convert 'as' assertions in your test files to Shoehorn's type-safe alternatives.

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 'as' type assertions in TypeScript tests with type-safe alternatives?

To replace 'as' type assertions in TypeScript tests, you can convert them to Shoehorn's type-safe alternatives, allowing you to pass partial data while maintaining strict type checking. This tool automates that exact migration process.

What is the best way to use partial data in TypeScript tests without 'as' assertions?

Using partial data in TypeScript tests without 'as' assertions is best achieved by migrating to Shoehorn, which provides type-safe equivalents for handling partial test data while ensuring your test files remain fully type-checked.

Do I need the @total-typescript/shoehorn package to migrate type assertions in my test code?

Yes, you need the @total-typescript/shoehorn package installed as a dependency. The migration converts your 'as' type assertions into the type-safe alternatives provided specifically by this package.

Can I use this code migration tool for production source files or is it only for test code?

This code migration tool is intended only for test code. It specifically targets 'as' type assertions within your TypeScript test files and transforms them into Shoehorn's type-safe alternatives to improve testing practices.

Why should I migrate 'as' assertions in my TypeScript tests to Shoehorn?

Migrating 'as' assertions in TypeScript tests to Shoehorn improves type safety by replacing unsafe casts with type-safe alternatives. This enables robust partial data testing while preventing type errors that 'as' assertions normally suppress.

Are there limitations when converting 'as' type assertions to type-safe alternatives?

The primary limitation when converting 'as' type assertions is that this process targets test code exclusively and requires the @total-typescript/shoehorn package to provide the type-safe alternatives for partial data.