Skip to content
SkillModel-led677 tokens in use

Migrate to Shoehorn

Replace as type assertions in TypeScript tests with shoehorn helpers so partial or deliberately wrong test data keeps type safety.

328,791 stars on the repository MIT Licensemattpocock/skills · skills/misc/migrate-to-shoehorn
claude plugin install mattpocock-skills@claude-plugins-official
View source

Install command as written in the repository's README

Skill label

measured from its files

What installing Migrate to Shoehorn costs

51tokens idle
677tokens in use

Idle is what sits in context while the skill is installed. In use is its instructions, loaded when it runs. Counts are approximate, made offline with cl100k_base.

Model dependence Model-led

Script-ledMixedModel-led

Mostly instructions, so how well it works depends on the model that follows them.

This describes the skill's structure, how much of it is scripts. It does not say how well it works.

Touches

shelldetected

Declared tags come from the skill's frontmatter; detected ones from its scripts, its code blocks and the commands it names in inline code. This is detected, not audited.

How it scores

Quality

How well the skill is written, counted from its own files: its frontmatter, its steps, examples, stated output and constraints, its size and whether every file it ships is one it names.How we score it →
Good
  • Frontmatter12/15
  • Structure18/25
  • Examples12/15
  • Output10/15
  • Size15/15
  • Resources0/15

Security

Starts at 100 and loses points for each thing in the skill's files that a reader should look at first.How we score it →
Excellent
  • Runs shell commands−5

    does this on the machine, and the frontmatter does not say so

    SKILL.md, line 23

Repository health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
Excellent
  • Development activity96
  • Maintenance100
  • Community56
  • Maturity32
  • Momentum40

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.

Join founders building with open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on SubstackJoin 750+ subscribers