migrate-to-shoehorn

Replaces TypeScript 'as' assertions with Shoehorn's type-safe alternatives in test files.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps users replace 'as' type assertions with type-safe Shoehorn alternatives in their test files, improving TypeScript's type safety while handling partial data effectively.

Core Features & Use Cases

  • Type Safety in Tests: Safely handle partial data without type errors.
  • Shoehorn Integration: Leverages the Shoehorn library for advanced type handling.
  • Use Case: When users encounter 'as' type assertions in test files and want to replace them for better type safety without using 'as unknown as Type'.

Quick Start

Migrate test files from as assertions to Shoehorn's type-safe alternatives by running the migrate-to-shoehorn Skill.

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 test files with type-safe alternatives?

The migrate-to-shoehorn Skill automates replacing 'as' type assertions in TypeScript test files with Shoehorn's type-safe alternatives, eliminating the need for 'as unknown as Type' workarounds.

What's the best way to handle partial data type errors in TypeScript unit tests?

Using Shoehorn alternatives to handle partial data in TypeScript unit tests prevents type errors by enforcing type safety without relying on 'as' assertions, which this Skill automates.

Do I need the Shoehorn library to migrate 'as' assertions in my test files?

Yes, you need the Shoehorn library installed, as the migration process replaces 'as' type assertions with Shoehorn's specific type-safe alternatives to ensure proper type handling.

Does replacing 'as' assertions with Shoehorn alternatives improve TypeScript type safety?

Yes, replacing 'as' assertions with Shoehorn alternatives improves TypeScript type safety by safely handling partial data in tests without bypassing the compiler using 'as unknown as Type'.

When should I avoid using 'as' type assertions in TypeScript testing?

You should avoid using 'as' type assertions when dealing with partial data in TypeScript testing, as they bypass compiler checks; Shoehorn provides a type-safe alternative instead.