api-and-interface-desi…
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating…
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.
Claude Code
$ npx -y skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn --agent claude-code
Codex
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a codex -y
Cursor
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a cursor -y
Gemini CLI
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a gemini-cli -y
GitHub Copilot
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a github-copilot -y
OpenCode
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a opencode -y
Windsurf
$ npx skills add kevinnft/ai-agent-skills --skill migrate-to-shoehorn -a windsurf -y
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. source_repo: "mattpocock/skills" source_url: "https://github.com/mattpocock/skills" source_license: "MIT" origin: aggregated language: en
`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:
npm 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" },
}),
);
});Before:
getUser({ body: { id: "123" } } as Request);After:
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));Before:
getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purposeAfter:
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) |
1. **Gather requirements** - ask user:
2. **Install and migrate**:
191 attribution-first agent skills for Hermes Agent, Claude Code, Cursor — one installer, 28 categories, searchable catalog. See NOTICE for upstream attribution.
Guides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating…
Tests in real browsers. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM,…
Automates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate…
Conducts multi-axis code review. Use before merging any change. Use when reviewing code written by yourself, another agent, or a…
Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder…
Optimizes agent context setup. Use when starting a new session, when agent output quality degrades, when switching between tasks,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.