ask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
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 mattpocock/skills --skill migrate-to-shoehorn --agent claude-code
Codex
$ npx skills add mattpocock/skills --skill migrate-to-shoehorn -a codex -y
Cursor
$ npx skills add mattpocock/skills --skill migrate-to-shoehorn -a cursor -y
Gemini CLI
$ npx skills add mattpocock/skills --skill migrate-to-shoehorn -a gemini-cli -y
GitHub Copilot
$ npx skills add mattpocock/skills --skill migrate-to-shoehorn -a github-copilot -y
OpenCode
$ npx skills add mattpocock/skills --skill migrate-to-shoehorn -a opencode -y
Windsurf
$ npx skills add mattpocock/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.
`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**:
My agent skills that I use every day to do real engineering - not vibe coding. Developing real applications is hard. Approaches like GSD, BMAD, and Spec-Kit try to help by owning the process.
Ask which skill or flow fits your situation. A router over the skills in this repo.
Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes: Standards (does the code follow this…
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening…
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something…
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or…
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Act on user feedback attached to the current session. Use when the user submits feedback on the session's changes via the Submit…