migrate-to-shoehorn

Refactors AS type assertions in test files to use @total-typescript/shoehorn alternatives.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Migrates test files from as type assertions to @total-typescript/shoehorn, enhancing type safety and improving test efficiency.

Core Features & Use Cases

  • Type-Safe Assertions: Replaces as assertions with @total-typescript/shoehorn to maintain type safety without manual type specification.
  • Partial Data Testing: Facilitates passing partial data in tests, beneficial for complex objects and selective data verification.
  • Use Case: Useful when refactoring test files with many as assertions to improve code readability and maintainability.

Quick Start

Migrate test files using the migrate-to-shoehorn skill by executing the following command: run migrate-to-shoehorn --files path/to/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 replace 'as' type assertions in TypeScript test files?

To replace 'as' type assertions in TypeScript test files, you can migrate to @total-typescript/shoehorn. This refactoring tool swaps unsafe type assertions for type-safe alternatives, maintaining type safety without manual type specification.

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

The best way to improve type safety in TypeScript tests is replacing 'as' assertions with @total-typescript/shoehorn. This approach ensures type safety while facilitating partial data testing for complex objects and selective data verification.

Can I pass partial data in TypeScript tests without losing type safety?

Yes, you can pass partial data in TypeScript tests without losing type safety by using @total-typescript/shoehorn. It replaces 'as' type assertions, allowing selective data verification for complex structures while maintaining strict typing.

Does migrate-to-shoehorn handle large objects in test files?

Migrate-to-shoehorn handles large objects and complex structures in test files with ease. It refactors 'as' type assertions to use @total-typescript/shoehorn, improving test readability and maintainability across extensive test suites.

Do I need the shoehorn library to migrate type assertions?

Yes, you need the @total-typescript/shoehorn library installed as a dependency to migrate type assertions. This Skill refactors 'as' assertions by replacing them with type-safe alternatives sourced directly from the shoehorn package.

Why should I remove 'as' type assertions from my test code?

You should remove 'as' type assertions from test code to enhance type safety and improve test efficiency. Migrating to @total-typescript/shoehorn eliminates manual type specification, reducing runtime errors and improving code readability.