OpenClaw
Deploy a managed OpenClaw agent in 60 seconds
Launch on Hostinger →
Hermes Agent
Run your Hermes agent, fully managed
Launch on Hostinger →
Apify
6,000+ web scrapers for your agent, free to start
Try Apify free →
Firecrawl
Crawl and scrape any site into clean data
Try Firecrawl free →
Context.dev
One API to scrape, enrich, and extract the web
Start building free →
SetupClaw
Done-for-you OpenClaw for founders and teams
Get it set up for you →
DataForSEO
SEO data APIs for your agent, $1 free credit
Try DataForSEO free →
Your product here
Reach thousands of AI builders a month
Learn more →
Claude Market
Menu
SkillsMCPPluginsSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Claude Market
SkillsMCPPluginsSubmit MCPSkillPluginMCPMCP, plugin, or skillAdvertise
Skills/vinvcn/mattpocock-skills-zh-cn/migrate-to-shoehorn
migrate-to-shoehorn logo

migrate-to-shoehorn

vinvcn/mattpocock-skills-zh-cn
827 installs755 stars
Run it on Hostinger, 20% off →Your friend gets 20% off too, using this linkFree API →|View on GitHub|Create your own skill →

Installation

npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill migrate-to-shoehorn

Summary

将 test files 从 `as` type assertions 迁移到 @total-typescript/shoehorn。Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

SKILL.md

Migrate to Shoehorn

Why shoehorn?

shoehorn 允许你在 tests 中传入 partial data,同时保持 TypeScript 满意。它用 type-safe alternatives 替换 as assertions。

只用于 test code。 永远不要在 production code 中使用 shoehorn。

Tests 中 as 的问题:

  • 会训练人忽略类型安全
  • 必须手动指定 target type
  • 对故意错误的数据需要 double-as(as unknown as Type)

Install

npm i @total-typescript/shoehorn

Migration patterns

Large objects with few needed properties

Before:

type Request = {
  body: { id: string };
  headers: Record<string, string>;
  cookies: Record<string, string>;
  // ...20 more properties
};

it("gets user by id", () => {
  // Only care about body.id but must fake entire Request
  getUser({
    body: { id: "123" },
    headers: {},
    cookies: {},
    // ...fake all 20 properties
  });
});

After:

import { fromPartial } from "@total-typescript/shoehorn";

it("gets user by id", () => {
  getUser(
    fromPartial({
      body: { id: "123" },
    }),
  );
});

as Type → fromPartial()

Before:

getUser({ body: { id: "123" } } as Request);

After:

import { fromPartial } from "@total-typescript/shoehorn";

getUser(fromPartial({ body: { id: "123" } }));

as unknown as Type → fromAny()

Before:

getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose

After:

import { fromAny } from "@total-typescript/shoehorn";

getUser(fromAny({ body: { id: 123 } }));

When to use each

FunctionUse case
fromPartial()传入仍能 type-check 的 partial data
fromAny()传入故意错误的数据(保留 autocomplete)
fromExact()强制 full object(之后可换成 fromPartial)

Workflow

  1. Gather requirements — 询问用户:
  • 哪些 test files 中的 as assertions 造成问题?
  • 是否在处理大型 objects,但只关心部分 properties?
  • 是否需要传入故意错误的数据来测试 error paths?
  1. Install and migrate:
  • [ ] Install: npm i @total-typescript/shoehorn
  • [ ] 查找 test files 中的 as assertions: grep -r " as [A-Z]" --include=".test.ts" --include=".spec.ts"
  • [ ] 用 fromPartial() 替换 as Type
  • [ ] 用 fromAny() 替换 as unknown as Type
  • [ ] 添加来自 @total-typescript/shoehorn 的 imports
  • [ ] 运行 type check 验证

Score

0–100
63/ 100

Grade

C

Popularity15/30

827 installs — growing adoption.

Completeness27/30

Documented: full SKILL.md body, description, one-line install. Missing: category/license metadata.

Trust15/25

Community skill with a public GitHub source repository you can review.

Freshness6/15

No update timestamp is tracked for this skill in our catalog.

Scored automatically from popularity, completeness, trust, and freshness — computed only from data in our catalog, never fabricated.

Proud of your score? Add this badge to your README.

Paste a snippet into your GitHub README. The badge updates automatically and links back to this page.

Migrate To Shoehorn skill score badge previewScore badge

Markdown

[![Migrate To Shoehorn skill](https://www.claudemarket.ai/skills/vinvcn/mattpocock-skills-zh-cn/migrate-to-shoehorn/badges/score.svg)](https://www.claudemarket.ai/skills/vinvcn/mattpocock-skills-zh-cn/migrate-to-shoehorn)

HTML

<a href="https://www.claudemarket.ai/skills/vinvcn/mattpocock-skills-zh-cn/migrate-to-shoehorn"><img src="https://www.claudemarket.ai/skills/vinvcn/mattpocock-skills-zh-cn/migrate-to-shoehorn/badges/score.svg" alt="Migrate To Shoehorn skill"/></a>

Migrate To Shoehorn FAQ

How do I install the Migrate To Shoehorn skill?

Run “npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill migrate-to-shoehorn” in your terminal. The skill is added to your agent's skills directory and picked up automatically on the next run — no restart or extra configuration needed.

What does the Migrate To Shoehorn skill do?

将 test files 从 `as` type assertions 迁移到 @total-typescript/shoehorn。Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data. The full SKILL.md on this page shows the exact instructions the skill gives your agent.

Is the Migrate To Shoehorn skill free?

Yes. Migrate To Shoehorn is a free, open-source skill published from vinvcn/mattpocock-skills-zh-cn. As with any third-party skill, review the source repository before installing it into an agent with sensitive access.

Does Migrate To Shoehorn work with Claude Code and OpenClaw?

Yes. Skills use the portable SKILL.md format, so Migrate To Shoehorn works with Claude Code, OpenClaw, Codex, Hermes, and any other agent that reads SKILL.md skills.

Recommended skills

Browse all →
azure-cloud-migrate logo

azure-cloud-migrate

microsoft/azure-skills

433K installsInstall
migrate-to-shoehorn logo

migrate-to-shoehorn

mattpocock/skills

184K installsInstall
find-skills logo

find-skills

vercel-labs/skills

2.8M installsInstall
grill-me logo

grill-me

mattpocock/skills

754K installsInstall
frontend-design logo

frontend-design

anthropics/skills

742K installsInstall
grill-with-docs logo

grill-with-docs

mattpocock/skills

640K installsInstall

Related guides

Hand-picked reading to help you choose, install, and use agent skills.

GuideBest Testing Skills For AI AgentsGuideBest Openclaw Skills 2026GuideHow To Evaluate Openclaw Skill Before Installing

Skills by category

FrontendBackend & APIsTesting & QASecurityDevOps & CI/CDMCP & ToolingAutomationData & Analysis+20 more

MCP servers by category

AI & MLDeveloper ToolsVector & MemoryFiles & DocsDatabasesFinance & PaymentsBrowser & ScrapingCommunication+8 more

Plugins by category

developmentproductivitycommunicationdesignsecuritydatabaseworkflowcompliance+34 more

The Agent Stack

Weekly Claude Code, Agent SDK, and MCP moves worth your time — free.

Claude Market

AI agent skills directory, marketplace, and workflow hub for OpenClaw, Hermes Agent, Claude Code, Codex, and MCP-powered operator stacks.

Independent project, not affiliated with Anthropic.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Plugins

More

  • Submit a Tool
  • Create a Skill
  • Advertise
  • Free Tools
  • API
  • Shipping
  • Contact
  • Terms
  • Privacy
© 2026 Claude Market · Not affiliated with Anthropic
Fazier badgeFeatured on Twelve ToolsFeatured on Wired BusinessRemote OpenClaw - Featured on AI Agents DirectoryListed on Turbo0Featured on Uneed