Migrate to Shoehorn
Replaces `as` type assertions in tests with type-safe @total-typescript/shoehorn helpers — fromPartial(), fromAny(), fromExact() — with before/after patterns and a step-by-step migration workflow
- What
- Replaces `as` type assertions in tests with type-safe @total-typescript/shoehorn helpers — fromPartial(), fromAny(), fromExact() — with before/after patterns and a step-by-step migration workflow
- Cost
- Free
- Needs
- a TypeScript project with test files using `as` assertions. The skill's workflow installs @total-typescript/shoehorn via npm.
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor — a TypeScript test-migration skill that replaces `as` type assertions with the type-safe helpers of `@total-typescript/shoehorn`, so tests can pass partial data while keeping TypeScript happy. It states the case plainly: shoehorn is test-code only, never for production code, and `as` in tests is a pain — the target type must be spelled out manually, and intentionally wrong data needs the ugly double-`as` (`as unknown as Type`). The skill teaches the three functions and when to use each: `fromPartial()` for partial data that still type-checks (the big win — pass only the properties you care about instead of faking all 20 fields of a Request), `fromAny()` for intentionally wrong data that keeps autocomplete, `fromExact()` to force a full object (swap with fromPartial later). Before/after patterns make each migration concrete, and the workflow is actionable: ask which test files have problematic `as` assertions, install (`npm i @total-typescript/shoehorn`), find test files with a grep (`grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"`), replace `as Type` with `fromPartial()`, `as unknown as Type` with `fromAny()`, add the imports, then run the type check to verify. By @mattpocock, listed here with credit to its creator. Honest caveats: test code only — shoehorn must never ship in production; it replaces assertions, it doesn't add real type coverage, so run your type checker and test suite after migrating; the workflow asks you which files to migrate first, it's not an automatic whole-repo rewrite. Skill Harbor never reviews the code, review it yourself before use.
Version:
Install
Prerequisites: a TypeScript project with test files using `as` assertions. The skill's workflow installs @total-typescript/shoehorn via npm. Install "Migrate to Shoehorn" for me. A test-migration skill that replaces `as` type assertions with type-safe @total-typescript/shoehorn helpers (fromPartial(), fromAny(), fromExact()) — with before/after patterns and a step-by-step workflow (find test files, replace, import, run type check). Test code only — never for production code. Repository: https://github.com/mattpocock/skills/blob/main/skills/misc/migrate-to-shoehorn/SKILL.md 1. Fetch the SKILL.md file (and any helper files) from the repository path into a temporary folder and summarize what it does in one or two sentences. 2. Safety check: review the SKILL.md and scripts for anything suspicious (unexpected network calls, shell commands, credential harvesting). This repo should contain zero secrets in code, credentials only via the secure vault. Verify that holds here; STOP on any red flag and tell me. 3. Install it as a skill: copy SKILL.md and its helper files into the agent's skills directory, in a folder named "mattpocock-migrate-to-shoehorn". 4. Verify with no network calls: frontmatter valid, files in place. 5. Report what was installed, where, and what I still need to do myself. GitHub is optional: if I have a GitHub account or the gh CLI, you may use it; otherwise public access is fine. Never require it unless it's in the prerequisites above. Rules: don't touch anything outside the temp folder and the install target. If anything looks off, stop and ask me.
Questions
How do I install a build?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the build up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a build before installing it.