migrate-to-shoehorn
Skill0 starsChanged 6 months agoMITView on GitHub
把 test files 中的 `as` type assertions 迁移到 @total-typescript/shoehorn。当用户提到 shoehorn、想替换 tests 中的 `as`,或需要 partial test data 时使用。
- Installs packages
93 other projects use a version of this, 92 of them edited.
Adopted by
Most recently taken up by
- trajectonomics/skillsedited, first seen Nov 15, 2026
- RSickenberg/programmatic-resumeedited, first seen Nov 15, 2026
- geoffbremner/skillsedited, first seen Nov 15, 2026
- HiteSit/real-scientist-skillsedited, first seen Nov 15, 2026
- QiYueran-source/waymarkedited, first seen Nov 15, 2026
- KroxiDev/engineering-skillsedited, first seen Nov 15, 2026
Used with
Projects with it also use setup-ts-deep-modules, loop-me and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 41 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 50 projects that use this
ryotaroh180105Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 38 projects that use this
boyingliu01Skillbatch-grill-me
A relentless interview that asks every frontier question at once, round by round. Thin alias of `grilling` (#540) — upstream mattpocock/skills absorbed this protocol into grilling; XP-Gate keeps this name as the sprint-flow Phase 2 entry point so orchestration docs stay stable.
Also in 6 projects that use this
FabienDehopreSkilldecision-mapping
Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.
Also in 4 projects that use this
GoogleSkillask-matt
Ask which skill or flow fits your situation. A router over the skills in this repo.
Also in 35 projects that use this
Other versions93 projects use a version of this.
Word for word · 0
None found.
Edited · 92
- mattpocock/skills★ 325k40% same
- vinvcn/mattpocock-skills-zh-CN★ 5.8k56% same
- devcxl/mattpocock-skills-zh★ 54330% same
- mxyhi/ok-skills★ 51140% same
- amazingloft999-droid/mattpocock-skills★ 42240% same
- InditexTech/weavejs★ 26640% same
- loulanyue/skills★ 23140% same
- tt-a1i/matt-skills-with-to-goal★ 19240% same
- aurorasoft2/Matt_Pocock_Skills★ 13340% same
- QiYueran-source/waymark★ 11240% same
82 more not listed
Wrote their own version · 1
- imMamdouhaboammar/matts-skills-into-chatgpt★ 8same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- design-an-interfaceSkill
- qaSkill
- request-refactor-planSkill
- ubiquitous-languageSkill
- diagnoseSkill
- grill-with-docsSkill
- improve-codebase-architectureSkill
- prototypeSkill
- setup-matt-pocock-skillsSkill
- tddSkill
- to-issuesSkill
- to-prdSkill
- triageSkill
- zoom-outSkill
- reviewSkill
- writing-beatsSkill
- writing-fragmentsSkill
- writing-shapeSkill
- git-guardrails-claude-codeSkill
- scaffold-exercisesSkill
- setup-pre-commitSkill
- edit-articleSkill
- obsidian-vaultSkill
- cavemanSkill
- grill-meSkill
- handoffSkill
- write-a-skillSkill
The file
Files
Migrate to Shoehorn
Why shoehorn?
shoehorn 允许你在 tests 中传入 partial data,同时让 TypeScript 保持满意。它用 type-safe alternatives 替代 as assertions。
只用于 test code。 绝不要在 production code 中使用 shoehorn。
Tests 中 as 的问题:
- 我们被训练成不要使用它
- 必须手动指定 target type
- 为了 intentionally wrong data 需要 double-as(
as unknown as Type)
Install
npm i @total-typescript/shoehornMigration patterns
只需要少数属性的大对象
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 purposeAfter:
import { fromAny } from "@total-typescript/shoehorn";
getUser(fromAny({ body: { id: 123 } }));When to use each
| Function | Use case |
fromPartial() | 传入仍能 type-check 的 partial data |
fromAny() | 传入 intentionally wrong data(保留 autocomplete) |
fromExact() | 强制 full object(稍后可换成 fromPartial) |
Workflow
- Gather requirements — 询问用户:
- 哪些 test files 中有造成问题的
asassertions? - 他们是否在处理只有部分属性重要的大对象?
- 是否需要为 error testing 传入 intentionally wrong data?
- 哪些 test files 中有造成问题的
- Install and migrate:
- Install:
npm i @total-typescript/shoehorn - 查找带
asassertions 的 test files:grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts" - 把
as Type替换为fromPartial() - 把
as unknown as Type替换为fromAny() - 添加来自
@total-typescript/shoehorn的 imports - 运行 type check 验证
- Install:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

