migrate-to-shoehorn

Convert TypeScript 'as' assertions to type-safe Shoehorn alternatives in tests.

6|Updated Nov 30, 2025
One-click install
npx skills add https://github.com/christopher-buss/bedrock --skill migrate-to-shoehorn-christopher-buss
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/christopher-buss/bedrock/tree/main/.agents/skills/migrate-to-shoehorn
Command: npx skills add https://github.com/christopher-buss/bedrock --skill migrate-to-shoehorn-christopher-buss

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the issue of using 'as' assertions in TypeScript tests, which can lead to manual specification of target types and the need for double-as for intentionally wrong data.

Core Features & Use Cases

  • Replace 'as' Assertions: Converts 'as' assertions to type-safe Shoehorn alternatives.
  • Partial Data Handling: Allows passing partial data in tests while maintaining type safety.
  • Use Case: When a user wants to replace 'as' in tests with a more robust solution like Shoehorn, or when they need to work with partial test data.

Quick Start

Run the migrate-to-shoehorn skill to update your test files from 'as' assertions 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' assertions in TypeScript tests with type-safe alternatives?

To replace 'as' assertions in TypeScript tests, use the migrate-to-shoehorn skill to automatically convert them into type-safe Shoehorn alternatives, eliminating manual target type specifications and double-as patterns.

Why does using 'as' in TypeScript tests cause type safety issues?

Using 'as' in TypeScript tests causes type safety issues by requiring manual target type specifications and double-as assertions for intentional type mismatches. Shoehorn resolves this by providing type-safe alternatives for partial data handling.

Do I need to install the Shoehorn library before migrating TypeScript test assertions?

Yes, you need the Shoehorn library installed as a dependency before migrating TypeScript test assertions. The migrate-to-shoehorn skill requires @total-typescript/shoehorn to implement the type-safe alternatives replacing 'as' assertions.

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

The best way to handle partial test data in TypeScript without losing type safety is migrating 'as' assertions to Shoehorn. Shoehorn allows passing partial data in tests while maintaining strict type checking and avoiding intentional type mismatches.

Can I use Shoehorn for intentional type mismatches in test environments?

Yes, you can use Shoehorn for intentional type mismatches in test environments. The migrate-to-shoehorn skill replaces double-as patterns with Shoehorn alternatives, ensuring partial data handling and intentional wrong data remain type-safe.