Skip to main content
ZICQ

Skills ZICQ category:Agent Workflows migrate-to-shoehorn

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.

534921 installs

Official URL:skills.sh

What this skill does

Intro in this page language first. The official description stays in its original wording; we do not rewrite SKILL.md.

What it does

Migrate test files from `as` type assertions to @total-typescript/shoehorn

When to use it

each

How agents load it

Per Agent Skills progressive disclosure: name and description load at startup (~100 tokens); the full SKILL.md body loads when the skill activates; scripts/, references/, and assets/ load only as needed. This file's sections: Migrate to Shoehorn; Why shoehorn?; Install; Migration patterns; Large objects with few needed properties; `as Type` → `fromPartial()`. It includes spec-recommended sections: step-by-step instructions.

File analysis

File analysis: instruction-only skill (SKILL.md). The agent loads the full body when activated.

Migrate to ShoehornWhy shoehorn?InstallMigration patternsLarge objects with few needed properties`as Type` → `fromPartial()``as unknown as Type` → `fromAny()`When to use eachWorkflow

Source category:skills.sh agent-skill

SKILL.md & Agent activation

Official spec ↗
name
migrate-to-shoehorn
description
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.
  1. DiscoverThe client exposes names and descriptions to the agent.
  2. ActivateYour request or the task context selects the skill and loads its instructions.
  3. Load resourcesReferenced scripts, documentation and assets are used when needed.

Invocation syntax and available tools depend on your Agent client. Client integration guide ↗

Install this skill

Skills CLI ↗

Choose the target agent and installation scope, keep referenced package files, then verify the skill appears in the client's catalog.

Ask your Agent to install

Copy these instructions to a compatible agent and confirm the target directory matches your client.

Install the agent skill "migrate-to-shoehorn" into my project. The full SKILL.md and official description are at https://zicq.com/en/skills/skl-c5214f19762c735d-Migrate-To-Shoehorn.html
Save it as .cursor/skills/migrate-to-shoehorn/SKILL.md or .claude/skills/migrate-to-shoehorn/SKILL.md and keep the frontmatter name and description exactly as-is.

Full package on GitHub ↗

Install from the terminal · Skills CLI

Requires Node.js and npx. First inspect the repository's skill list to confirm the name.

npx skills add 'https://github.com/mattpocock/skills' --list

npx skills add 'https://github.com/mattpocock/skills' --skill 'migrate-to-shoehorn'

The CLI lets you choose the agent interactively. The default scope is the project; use -g for user scope. Confirm package availability with the discovery command, then use npx skills list to inspect installed skills.

Readable layout
--- name: migrate-to-shoehorn description: 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. --- # 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 ```bash npm i @total-typescript/shoehorn ``` ## Migration patterns ### Large objects with few needed properties Before: ```ts type Request = { body: { id: string }; headers: Record; cookies: Record; // ...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: ```ts import { fromPartial } from "@total-typescript/shoehorn"; it("gets user by id", () => { getUser( fromPartial({ body: { id: "123" }, }), ); }); ``` ### `as Type` → `fromPartial()` Before: ```ts getUser({ body: { id: "123" } } as Request); ``` After: ```ts import { fromPartial } from "@total-typescript/shoehorn"; getUser(fromPartial({ body: { id: "123" } })); ``` ### `as unknown as Type` → `fromAny()` Before: ```ts getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose ``` After: ```ts import { fromAny } from "@total-typescript/shoehorn"; getUser(fromAny({ body: { id: 123 } })); ``` ## 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

Related skills

Agent Workflows

Skill Creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that exte…

Agent Workflows

Clawdhub

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fl…

Agent Workflows

Agent Team Orchestration

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team …

Agent Workflows

Superpowers

Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan →…