migrate-to-shoehorn

Refactor TypeScript test files replacing `as` assertions with @total-typescript/shoehorn alternatives.

4|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/hwj123hwj/custom-skills --skill migrate-to-shoehorn-hwj123hwj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/hwj123hwj/custom-skills/tree/main/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/hwj123hwj/custom-skills --skill migrate-to-shoehorn-hwj123hwj

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers refactor test files to replace as type assertions with @total-typescript/shoehorn, improving test data handling and TypeScript type safety.

Core Features & Use Cases

  • Refactoring as Assertions: Converts as assertions in tests to type-safe alternatives provided by shoehorn.
  • Partial Data Handling: Allows passing partial data in tests while maintaining TypeScript type safety.
  • Use Case: Ideal for developers who want to improve the quality of their test code by replacing as assertions with more robust and type-safe Shoehorn alternatives.

Quick Start

Use the migrate-to-shoehorn skill to refactor the test file 'example.test.ts' to use shoehorn for type-safe assertions.

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?

To replace `as` type assertions in TypeScript test files, you can refactor them to use type-safe alternatives from @total-typescript/shoehorn. This process converts unsafe assertions into robust type-safe statements to improve test data handling.

What is the best way to handle partial test data in TypeScript without losing type safety?

The best way to handle partial test data while maintaining TypeScript type safety is by using @total-typescript/shoehorn. It allows you to pass partial data in tests while preserving strict type checking and avoiding unsafe `as` assertions.

Do I need to install shoehorn before refactoring my test assertions?

Yes, you need to install and configure @total-typescript/shoehorn before refactoring test assertions. The migration process requires the shoehorn package to be present in your project so it can provide the type-safe alternatives for your tests.

How does replacing `as` assertions with shoehorn improve my TypeScript tests?

Replacing `as` assertions with shoehorn improves TypeScript tests by eliminating unsafe type casting and enhancing test data handling. This refactoring ensures your test code maintains strict type safety and prevents runtime errors from invalid data shapes.

Are there limitations when refactoring TypeScript tests to use shoehorn for type safety?

A limitation when refactoring TypeScript tests to use shoehorn for type safety is that it specifically targets `as` type assertions and requires prior package configuration. It is designed for test file refactoring rather than general application code type safety.