Migrate to Shoehorn walks an agent through converting test files that use as and as unknown as assertions to fromPartial, fromAny and fromExact from @total-typescript/shoehorn.
It covers large request-style objects where only a few properties matter, and intentionally wrong data used for error tests. It applies to test code only.
What You Get
- Test files with as assertions replaced by fromPartial and fromAny
- Imports from @total-typescript/shoehorn added
- The package installed as a dev dependency
- A type check run to confirm the result
Common Use Cases
- Faking a large request object when a test needs only the body id
- Cleaning up double as unknown as casts used for bad input
- Keeping autocomplete while passing intentionally wrong data
- Swapping fromExact for fromPartial once a fixture is complete
What Makes It Unique
It targets one library and one situation, so the guidance is concrete: three function mappings, a decision table and a hard rule never to use shoehorn in production code. The workflow starts with a short set of questions about which tests hurt.
Under The Hood
The skill is Markdown with code samples and an agent metadata file for Codex. The agent installs one npm package, searches test files with a grep over test and spec names, edits those files and runs the project’s type check. It reaches the npm registry through the install command.