migrate-to-shoehorn

Migrate TypeScript test files from 'as' assertions to @total-typescript/shoehorn alternatives.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @total-typescript/shoehorn.

What problem does it solve?

This Skill simplifies the process of replacing 'as' type assertions in TypeScript tests with type-safe alternatives, improving test reliability and readability.

Core Features & Use Cases

  • Type Safe Replacements: Automatically convert 'as' assertions to fromPartial() and fromAny() to ensure type safety without losing functionality.
  • Partial Data Handling: Enables the passing of partial test data while maintaining strong typing.
  • Use Case: For developers who are transitioning their TypeScript test suite to use the @total-typescript/shoehorn library, this Skill automates the migration process, reducing manual work and potential errors.

Quick Start

To begin using the 'migrate-to-shoehorn' skill, run the following command in your project directory:

use migrate-to-shoehorn

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?

You can replace 'as' type assertions in TypeScript tests by migrating them to the `fromPartial()` and `fromAny()` functions provided by the `@total-typescript/shoehorn` library, ensuring type safety without losing functionality.

What is the best way to automate migrating legacy 'as' syntax to shoehorn in a test suite?

Automating the migration of legacy 'as' syntax to `@total-typescript/shoehorn` involves running a dedicated migration skill that automatically converts type assertions, reducing manual work and potential errors across modern TypeScript test suites.

Does the shoehorn migration approach support passing partial test data while maintaining strong typing?

Yes, the shoehorn migration approach supports partial data handling by using the `fromPartial()` function, which enables passing partial test data while maintaining strict typing and improving overall test reliability.

Why should I convert 'as' assertions in my TypeScript test files?

You should convert 'as' assertions to type-safe alternatives because it improves test reliability and readability by enforcing strict type checking, preventing silent type errors that can occur when bypassing the compiler with direct type assertions.

Do I need to manually install @total-typescript/shoehorn before migrating my test files?

You need the `@total-typescript/shoehorn` dependency available in your project environment before migrating test files, as the migration process replaces 'as' assertions with the library's specific `fromPartial()` and `fromAny()` type-safe functions.