Agent skill · software engineering · aiskillstore
migrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Why this skill is useful
Adds specific migration patterns and usage examples for the @total-typescript/shoehorn library that the AI wouldn't reliably generate on its own.
What it needs
Requires @total-typescript/shoehorn installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
Migrate to Shoehorn Why shoehorn? shoehorn lets you pass partial data in tests while keeping TypeScript happy. It replaces as assertions with type-safe alternatives. Test code only. Never use shoehorn in production code. Problems with as in tests: Trained not to use it Must manually specify target type Double-as (as unknown as Type) for intentionally wrong data Install Migration patterns Large objects with few needed properties Before: After: as Type → fromPartial() Before: After: as unknown as Type → fromAny() Before: After: When to use each Function Use case --------------- -------------------------------------------------- fromPartial() Pass partial data that still type-checks fromAny() Pass intentionally wrong data (keeps autocomplete) fromExact() Force full object (swap with fromPartial later) Workflow 1. Gather requirements - ask user: What test files have as assertions causing problems? Are they dealing with large objects where only some properties matter? Do they need to pass intentionally wrong data for error testing? 2. Install and migrate: [ ] Install: npm i @total-typescript/shoehorn [ ] Find test files with as assertions: grep -r " as [A-Z]" --include=".test.ts" --include=".spec.ts" [ ] Replace as Type with fromPartial() [ ] Replace as unknown as Type with fromAny() [ ] Add imports from @total-typescript/shoehorn [ ] Run type check to verify
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/migrate-to-shoehorn