migrate-to-shoehorn

Convert TypeScript test assertions from 'as' to 'fromPartial()' and 'fromAny()' using @total-typescript/shoehorn.

Updated May 17, 2026
One-click install
npx skills add https://github.com/Thalfman/lifegroups --skill migrate-to-shoehorn-thalfman
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/Thalfman/lifegroups/tree/main/.agents/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/Thalfman/lifegroups --skill migrate-to-shoehorn-thalfman

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill unit addresses the need for migrating as type assertions to more type-safe alternatives in TypeScript tests, improving code quality and maintainability.

Core Features & Use Cases

  • Type Safety: Converts as assertions to type-safe alternatives using @total-typescript/shoehorn.
  • Test Code Optimization: Enhances test code readability and maintainability.
  • Use Case: When you want to replace as assertions in tests with a more robust solution that provides type safety and partial data support.

Quick Start

Run the migrate-to-shoehorn skill to automatically 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 convert TypeScript test assertions from 'as' to type-safe alternatives?▼

You can convert TypeScript test assertions from 'as' to type-safe alternatives by running the migrate-to-shoehorn skill, which automatically transforms them into Shoehorn's fromPartial() and fromAny() functions. This enhances test code maintainability and prevents type-related bugs.

What is the best way to replace 'as' assertions in my test suite with partial data support?▼

The best way to replace 'as' assertions with partial data support is using @total-typescript/shoehorn. This skill automates the test refactoring process, converting unsafe assertions into type-safe alternatives that provide robust type checking and partial data handling.

Does @total-typescript/shoehorn work for automated test refactoring in TypeScript?▼

Yes, @total-typescript/shoehorn works for automated test refactoring in TypeScript. The migrate-to-shoehorn script executes this refactoring by converting 'as' type assertions to fromPartial() and fromAny() functions, ensuring type safety during test suite maintenance.

Why should I migrate my TypeScript test assertions away from 'as'?▼

You should migrate TypeScript test assertions away from 'as' to improve code quality and prevent type-related bugs. Using Shoehorn's type-safe alternatives provides better type checking and partial data support, which enhances overall test code readability and maintainability.

What are the limitations of using Shoehorn for test assertion conversion?▼

The limitations of using Shoehorn for test assertion conversion relate to its specific scope: it is designed exclusively for migrating 'as' assertions to fromPartial() and fromAny() within test files. It requires the @total-typescript/shoehorn dependency to function correctly.