migrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
Skill by mattpocock
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/mattpocock-migrate-to-shoehorn
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/migrate-to-shoehorn
What's inside
- Skill 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.
- License
- MIT
- Instructions
- 115 lines in SKILL.md · view on GitHub
Files (2)
- SKILL.md
- openai.yaml · agents/
SKILL.md (first lines)
# Migrate to Shoehorn
## Why shoehorn?
`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:
- Trained not to use it
- Must manually specify target type
- Double-as (`as unknown as Type`) for intentionally wrong data
## Install
```bash
npm i @total-typescript/shoehorn
```
## Migration patterns
### Large objects with few needed properties
Before:
```ts
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:
```ts
import { fromPartial } from "@total-typescript/shoehorn";
it("gets user by id", () => {
getUser(
fromPartial({
body: { id: "123" },
}),
);
});
```
### `as Type` → `fromPartial()`
Before:
```ts
getUser({ body: { id: "123" } } as Request);
```
After:
```ts
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
```
### `as unknown as Type` → `fromAny()`
Before:
```ts
getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose
```
After:
```ts
import { fromAny } from "@total-typescript/shoehorn";
getUser(fromAny({ body: { id: 123 } }));
```
## When to use each
| 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) |
## Workflow
1. **Gather requirements** - ask user:
- What test files have `as` assertions causing problems?
- Are they dealing with large objects where only some properties matter?
- Do they need to pass intentionally wrong data for error testing?
2. **Install and migrate**:
- [ ] Install: `npm i @total-typescript/shoehorn`
- [ ] Find test files with `as` assertions: `grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"`
- [ ] Replace `as Type` with `fromPartial()`
- [ ] Replace `as unknown as Type` with `fromAny()`
- [ ] Add imports from `@total-typescript/shoehorn`
- [ ] Run type check to verifyFrom mattpocock/skills, MIT.
More from mattpocock/skills
- 0.885score
setup-pre-commit
mattpocock
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.885score
scaffold-exercises
mattpocock
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.882score
setup-ts-deep-modules
mattpocock
Wire dependency-cruiser into a TypeScript repo so each package is a deep module, with implementation hidden in subfolders and reachable only through its…
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
writing-shape
mattpocock
Writing, exploit: shape raw material into an article, paragraph by paragraph.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
chief-of-staff
mattpocock
Pursue a long-running goal in a single session by co-ordinating subagents.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
writing-beats
mattpocock
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.875score
writing-fragments
mattpocock
Writing, explore: mine raw fragments, no structure yet.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.750score
diagnosing-bugs
mattpocock
Diagnosis loop for hard bugs and performance regressions.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.750score
git-guardrails-claude-code
mattpocock
Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.745score
codebase-design
mattpocock
Shared vocabulary for designing deep modules.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.745score
code-review
mattpocock
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…
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.745score
domain-modeling
mattpocock
Build and sharpen a project's domain model.
SkillAFreshness: A★ 302.4KClaude Code +9
Compare and alternatives
Signals
- Stars
- 302,383
- Forks
- 25,428
- Open issues
- 184
- Last commit (this folder)
- Jul 13, 2026 (3 months ago)
- Last release
- Oct 4, 2026 (24 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/mattpocock/skills
- Website
- aihero.dev/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.358score
migrate-to-shoehorn
caterpi11ar
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillAFreshness: A★ 8Claude Code +9 - 0.354score
migrate-to-shoehorn
leandrocfe
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillBFreshness: B★ 40Claude Code +9 - 0.347score
migrate-to-shoehorn
tajo9128
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillAFreshness: A★ 4Claude Code +9 - 0.347score
migrate-to-shoehorn
vasyapym
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillBFreshness: B★ 20Claude Code +9 - 0.334score
migrate-to-shoehorn
xs1128
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillAFreshness: A★ 1Claude Code +9 - 0.334score
migrate-to-shoehorn
fveracoechea
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillAFreshness: A★ 1Claude Code +9 - 0.324score
migrate-to-shoehorn
JacobStephens2
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillAFreshness: AClaude Code +9 - 0.322score
migrate-to-shoehorn
tt-a1i
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillCFreshness: C★ 187Claude Code +9 - 0.306score
migrate-to-shoehorn
uwvwko-zzz
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillCFreshness: C★ 10Claude Code +9 - 0.304score
migrate-to-shoehorn
harshit2490
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillCFreshness: C★ 6Claude Code +9 - 0.300score
migrate-to-shoehorn
Eresea
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillBFreshness: BClaude Code +9 - 0.297score
migrate-to-shoehorn
danilocasim
Migrate test files from `as` type assertions to @total-typescript/shoehorn.
SkillBFreshness: BClaude Code +9
More from mattpocock
- 0.885score
setup-pre-commit
mattpocock
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.885score
scaffold-exercises
mattpocock
Create exercise directory structures with sections, problems, solutions, and explainers that pass linting.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.882score
setup-ts-deep-modules
mattpocock
Wire dependency-cruiser into a TypeScript repo so each package is a deep module, with implementation hidden in subfolders and reachable only through its…
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
writing-shape
mattpocock
Writing, exploit: shape raw material into an article, paragraph by paragraph.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
writing-beats
mattpocock
Writing, exploit; assemble raw material into a journey of beats, grounding each term before a beat leans on it.
SkillAFreshness: A★ 302.4KClaude Code +9 - 0.878score
chief-of-staff
mattpocock
Pursue a long-running goal in a single session by co-ordinating subagents.
SkillAFreshness: A★ 302.4KClaude Code +9
Cite this page
migrate-to-shoehorn skill. Agent Mart. https://agentmart.dev/skills/mattpocock-migrate-to-shoehorn (last updated 2026-10-24)