/officialunofficial-skills:migrate-to-shoehornfrom Official Unofficial Skills
Converts `as` type assertions in test files to @total-typescript/shoehorn helpers for type-safe partial data.
Ships in Official Unofficial Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
shoehorn (published as @total-typescript/shoehorn) lets a test hand a function partial data without the compiler complaining. It swaps casts for helpers that stay type-checked, so the test still fails when the real shape drifts.
Tests only. Keep shoehorn out of production code.
What as costs you in tests:
as unknown as Typenpm i @total-typescript/shoehorn
Before:
type Request = {
body: { id: string };
headers: Record<string, string>;
cookies: Record<string, string>;
// ...20 more properties
};
it("gets user by id", () => {
// The test only reads body.id, yet has to fabricate a whole 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 becomes fromPartial()Before:
getUser({ body: { id: "123" } } as Request);
After:
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
as unknown as Type becomes 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 } }));
| Function | Use case |
|---|---|
fromPartial() | Supply partial data that still type-checks |
fromAny() | Supply deliberately wrong data (autocomplete stays) |
fromExact() | Require the full object (swap for fromPartial later) |
Scope the change — ask the user:
as assertions?Install, then migrate:
npm i @total-typescript/shoehorngrep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"as Type into fromPartial()as unknown as Type into fromAny()@total-typescript/shoehornWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub officialunofficial/skills --plugin officialunofficial-skills85 skills in this plugin
/alignmentMeasures a running page for edges, gaps, centres and radii that miss by a pixel or two, judges visual weight, and returns a numbered report with proof./animateBuilds a web animation from scratch and writes the code. Decides in order whether it should animate at all, its purpose, the tool, the properties, the easing and duration or spring, how it interrupts and exits, and reduced motion. Use when asked to animate something, add motion, build a transition, or make a component feel alive. For React Native or Expo use animate-expo. To critique existing motion use review-animations. To audit a whole codebase use improve-animations./animate-expoOther plugins' skills for the same job