Not loaded · from leandrocfe-skills
Migrates test files from `as` type assertions to @total-typescript/shoehorn for type-safe partial test data. Use when replacing `as` in tests or adding shoehorn.
Claude Code won't load this skill
It ships in leandrocfe-skills at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
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:
as unknown as Type) for intentionally wrong datanpm 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", () => {
// 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 } }));
| 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) |
Gather requirements - ask user:
as assertions causing problems?Install and migrate:
npm i @total-typescript/shoehornas assertions: grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"as Type with fromPartial()as unknown as Type with fromAny()@total-typescript/shoehornWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (leandrocfe/skills) — no native marketplace selected
npx claudepluginhub p/leandrocfe-leandrocfe-skills38 skills in this plugin
/ai-or-notJulga se uma referência foi feita por IA. Use quando o usuário colar um texto, artigo, imagem, vídeo, áudio ou link e perguntar se aquilo é IA, se é real, se foi feito por humano, ou pedir para checar de onde veio o material./ask-mattPergunte qual skill ou fluxo encaixa na sua situação. Um router sobre as skills deste repo./broReescreve a última mensagem em português simples, sem jargão. Use quando a resposta anterior ficou empolada, técnica demais ou difícil de entender./claude-handoffPassa a conversa atual para um background agent novo, que retoma o trabalho imediatamente.44 plugins ship this exact skill · first indexed Jul 13, 2026
Showing 6 of 44 plugins, one per repository first
Other plugins' skills for the same job