migrate-to-shoehorn

Replace unsafe TypeScript test assertions with shoehorn fromPartial and fromAny helpers.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps TypeScript developers remove brittle as assertions from tests by providing safer patterns for creating partial and intentionally invalid test data.

Core Features & Use Cases

  • Assertion Migration: Convert test-only as TypeScript assertions into shoehorn helpers such as fromPartial and fromAny.
  • Test Data Simplification: Reduce the need to construct large mock objects when only a few properties matter.
  • Use Case: When updating a TypeScript test suite that relies on as unknown as Type patterns, use this Skill to migrate those cases to safer shoehorn-based alternatives.

Quick Start

Ask the skill to migrate my TypeScript tests from as assertions to @total-typescript/shoehorn patterns.

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 unsafe as assertions in TypeScript tests?

To replace unsafe as assertions in TypeScript tests, migrate them to shoehorn helpers like fromPartial and fromAny, which provide typed test data fixtures for partial objects and intentionally invalid mock inputs.

What is the best way to create partial mock objects in TypeScript testing?

Creating partial mock objects in TypeScript testing is best handled by using shoehorn helper functions like fromPartial, which safely replace brittle as unknown as Type patterns and simplify test data construction.

Can I migrate as unknown as Type patterns to safer test fixtures?

Yes, you can migrate as unknown as Type patterns to safer test fixtures by identifying these assertion patterns and applying shoehorn-based typed test data helpers instead of relying on unsafe type assertions.

Do I need any dependencies to use shoehorn for test migration?

No external dependencies are required to start migrating tests with shoehorn patterns, as this Skill operates independently to identify assertion patterns and apply appropriate typed helper functions.

Why should I remove as assertions from my TypeScript test suite?

You should remove as assertions from your TypeScript test suite because they are brittle and unsafe, whereas shoehorn helpers provide safer patterns for creating partial and intentionally invalid test data without large mock objects.

Does shoehorn work with intentionally invalid test inputs in TypeScript?

Yes, shoehorn works with intentionally invalid test inputs in TypeScript by using helpers like fromAny to safely generate invalid mock data, replacing unsafe type assertions during test migration workflows.