Migrate to shoehorn

From redpanda-data/ui-harness · View interactive version

Migrate to shoehorn is an AI agent skill from the GitHub repository redpanda-data/ui-harness. Migrate test casts from `as` to @total-typescript/shoehorn.

How to use this skill

Skill file

Migrate to Shoehorn

Test code only. Never prod.

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

Install

bun add -d @total-typescript/shoehorn

Patterns

as Type with partial object -> fromPartial():

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.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.