migrate-to-shoehorn

Migrate TypeScript test files from as assertions to shoehorn helpers.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/ClyptAI/Clypt-Frontend --skill migrate-to-shoehorn-clyptai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-to-shoehorn
Source: https://github.com/ClyptAI/Clypt-Frontend/tree/main/.agents/skills/mattpocock-skills/migrate-to-shoehorn
Command: npx skills add https://github.com/ClyptAI/Clypt-Frontend --skill migrate-to-shoehorn-clyptai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrate test files from TypeScript's as type assertions to use @total-typescript/shoehorn, enabling safer partial data handling in tests and avoiding production-style types in tests.

Core Features & Use Cases

  • Replaces as Type with fromPartial for safe partial data
  • Replaces as unknown as Type with fromAny for intentionally wrong data while preserving autocomplete
  • Provides migration guidance and workflow for test suites

Quick Start

Run a migration pass to replace test assertions that use as with shoehorn's fromPartial or fromAny helpers.

Frequently Asked Questions about migrate-to-shoehorn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate TypeScript test assertions from as to shoehorn?

The shoehorn fromPartial helper replaces as type assertions in TypeScript test files to provide safe partial data handling and preserve autocomplete, avoiding production-style types in tests.

Can I use shoehorn fromPartial to replace as unknown as in unit tests?

You can use shoehorn fromAny to replace as unknown as Type in TypeScript unit tests to inject intentionally wrong data while preserving autocomplete, whereas fromPartial handles standard as assertions for safe partial data.

Do I need shoehorn installed before migrating test files?

Yes, the migration workflow requires @total-typescript/shoehorn to be installed in your project before replacing as assertions with fromPartial or fromAny helpers and updating imports.

What's the best way to replace as type assertions in TypeScript integration tests?

The best way to replace as type assertions in TypeScript integration tests is using shoehorn's fromPartial helper to enforce safe partial data guards and avoid production-style types in test suites.

Why use shoehorn instead of as assertions in TypeScript unit tests?

Using shoehorn instead of as assertions in TypeScript unit tests enables safer partial data handling and prevents production-style types from leaking into tests, replacing unsafe casts with fromPartial and fromAny helpers.