# Migrate To Shoehorn

> Migrate test casts from `as` to @total-typescript/shoehorn.

- Skill: `redpanda-data/migrate-to-shoehorn` (Agent Skill)
- Install (CLI): `npx skillmds@latest add redpanda-data/migrate-to-shoehorn`
- Raw SKILL.md: https://api.skillmd.com/api/skills/redpanda-data/migrate-to-shoehorn/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: redpanda-data (https://skillmd.com/u/redpanda-data)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/redpanda-data/migrate-to-shoehorn

---


# Migrate to Shoehorn

Test code only. Never prod.

`@total-typescript/shoehorn` replaces test `as` casts with type-safe helpers for partial data.

## Install

```bash
bun add -d @total-typescript/shoehorn
```

## Patterns

`as Type` with partial object -> `fromPartial()`:

```ts
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
```

Intentionally invalid data -> `fromPartial()` plus targeted override helper from package docs. Avoid `as unknown as`.

## Workflow

1. Limit to tests: `*.test.*`, `*.spec.*`, fixtures.
2. Find casts: `rg " as |as unknown as"`.
3. Replace one cluster at a time.
4. Run related tests + type check.
5. Keep production files untouched.

