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.
$ npx -y skills add mattpocock/skills --skill migrate-to-shoehorn --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/migrate-to-shoehornContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
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.
Get the whole plugin, auto-invokedRepo: mattpocock/skills
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 repo's documented coding…
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a…
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a CONTEXT.md, or recording or editing an ADR.
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.