[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7886J5GSHJG6TMV96PC7962":3,"skill-same:01M7886J5GSHJG6TMV96PC7962":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7886J5GSHJG6TMV96PC7962","migrate-to-shoehorn",null,"Convert `as` type assertions in test files to @total-typescript\u002Fshoehorn helpers. Use when the user mentions shoehorn, wants to remove `as` from tests, or needs to pass partial data to a typed function under test.","officialunofficial\u002Fskills","officialunofficial","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F127067914?v=4","01M78827JABEMMN63AC8J1RCXV","Official Unofficial, Inc.","01M78827KC164SFKN4DXTCKK7N",7,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fmigrate-to-shoehorn\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: migrate-to-shoehorn\ndescription: Convert `as` type assertions in test files to @total-typescript\u002Fshoehorn helpers. Use when the user mentions shoehorn, wants to remove `as` from tests, or needs to pass partial data to a typed function under test.\n---\n\n# Migrate to shoehorn\n\n## Why shoehorn\n\n`shoehorn` (published as `@total-typescript\u002Fshoehorn`) lets a test hand a function partial data without the compiler complaining. It swaps casts for helpers that stay type-checked, so the test still fails when the real shape drifts.\n\n**Tests only.** Keep shoehorn out of production code.\n\nWhat `as` costs you in tests:\n\n- It defeats the compiler you are trying to lean on\n- You restate the target type by hand at every call site\n- Deliberately wrong fixtures need the double cast `as unknown as Type`\n\n## Install\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## Migration patterns\n\n### A large object where the test needs a couple of fields\n\nBefore:\n\n```ts\ntype Request = {\n  body: { id: string };\n  headers: Record\u003Cstring, string>;\n  cookies: Record\u003Cstring, string>;\n  \u002F\u002F ...20 more properties\n};\n\nit(\"gets user by id\", () => {\n  \u002F\u002F The test only reads body.id, yet has to fabricate a whole Request\n  getUser({\n    body: { id: \"123\" },\n    headers: {},\n    cookies: {},\n    \u002F\u002F ...fake all 20 properties\n  });\n});\n```\n\nAfter:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\nit(\"gets user by id\", () => {\n  getUser(\n    fromPartial({\n      body: { id: \"123\" },\n    }),\n  );\n});\n```\n\n### `as Type` becomes `fromPartial()`\n\nBefore:\n\n```ts\ngetUser({ body: { id: \"123\" } } as Request);\n```\n\nAfter:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromPartial({ body: { id: \"123\" } }));\n```\n\n### `as unknown as Type` becomes `fromAny()`\n\nBefore:\n\n```ts\ngetUser({ body: { id: 123 } } as unknown as Request); \u002F\u002F wrong type on purpose\n```\n\nAfter:\n\n```ts\nimport { fromAny } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromAny({ body: { id: 123 } }));\n```\n\n## Which helper to reach for\n\n| Function        | Use case                                            |\n| --------------- | --------------------------------------------------- |\n| `fromPartial()` | Supply partial data that still type-checks          |\n| `fromAny()`     | Supply deliberately wrong data (autocomplete stays) |\n| `fromExact()`   | Require the full object (swap for fromPartial later) |\n\n## Workflow\n\n1. **Scope the change** — ask the user:\n   - Which test files carry the problematic `as` assertions?\n   - Are these large objects where the test reads only a few fields?\n   - Do any tests intentionally pass malformed data to exercise error paths?\n\n2. **Install, then migrate**:\n   - [ ] Install: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] Locate the casts: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] Turn `as Type` into `fromPartial()`\n   - [ ] Turn `as unknown as Type` into `fromAny()`\n   - [ ] Import the helpers from `@total-typescript\u002Fshoehorn`\n   - [ ] Run the type checker to confirm the tests still compile\n","# Migrate to shoehorn\n\n## Why shoehorn\n\n`shoehorn` (published as `@total-typescript\u002Fshoehorn`) lets a test hand a function partial data without the compiler complaining. It swaps casts for helpers that stay type-checked, so the test still fails when the real shape drifts.\n\n**Tests only.** Keep shoehorn out of production code.\n\nWhat `as` costs you in tests:\n\n- It defeats the compiler you are trying to lean on\n- You restate the target type by hand at every call site\n- Deliberately wrong fixtures need the double cast `as unknown as Type`\n\n## Install\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## Migration patterns\n\n### A large object where the test needs a couple of fields\n\nBefore:\n\n```ts\ntype Request = {\n  body: { id: string };\n  headers: Record\u003Cstring, string>;\n  cookies: Record\u003Cstring, string>;\n  \u002F\u002F ...20 more properties\n};\n\nit(\"gets user by id\", () => {\n  \u002F\u002F The test only reads body.id, yet has to fabricate a whole Request\n  getUser({\n    body: { id: \"123\" },\n    headers: {},\n    cookies: {},\n    \u002F\u002F ...fake all 20 properties\n  });\n});\n```\n\nAfter:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\nit(\"gets user by id\", () => {\n  getUser(\n    fromPartial({\n      body: { id: \"123\" },\n    }),\n  );\n});\n```\n\n### `as Type` becomes `fromPartial()`\n\nBefore:\n\n```ts\ngetUser({ body: { id: \"123\" } } as Request);\n```\n\nAfter:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromPartial({ body: { id: \"123\" } }));\n```\n\n### `as unknown as Type` becomes `fromAny()`\n\nBefore:\n\n```ts\ngetUser({ body: { id: 123 } } as unknown as Request); \u002F\u002F wrong type on purpose\n```\n\nAfter:\n\n```ts\nimport { fromAny } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromAny({ body: { id: 123 } }));\n```\n\n## Which helper to reach for\n\n| Function        | Use case                                            |\n| --------------- | --------------------------------------------------- |\n| `fromPartial()` | Supply partial data that still type-checks          |\n| `fromAny()`     | Supply deliberately wrong data (autocomplete stays) |\n| `fromExact()`   | Require the full object (swap for fromPartial later) |\n\n## Workflow\n\n1. **Scope the change** — ask the user:\n   - Which test files carry the problematic `as` assertions?\n   - Are these large objects where the test reads only a few fields?\n   - Do any tests intentionally pass malformed data to exercise error paths?\n\n2. **Install, then migrate**:\n   - [ ] Install: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] Locate the casts: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] Turn `as Type` into `fromPartial()`\n   - [ ] Turn `as unknown as Type` into `fromAny()`\n   - [ ] Import the helpers from `@total-typescript\u002Fshoehorn`\n   - [ ] Run the type checker to confirm the tests still compile\n",{"name":5,"description":7},"main","e1e71e8aa302edca3e052370aefa9272f86d07ee","skills\u002Fmisc\u002Fmigrate-to-shoehorn",0,"https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills","https:\u002F\u002Fgithub.com\u002Fofficialunofficial","officialunofficial.com","2026-11-06 10:07:10",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add officialunofficial\u002Fskills --skill migrate-to-shoehorn",{"tool":38,"command":39},"bunx","bunx skills add officialunofficial\u002Fskills --skill migrate-to-shoehorn",{"tool":41,"command":42},"pnpm","pnpm dlx skills add officialunofficial\u002Fskills --skill migrate-to-shoehorn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fmigrate-to-shoehorn\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7887BDP2BC5HFHEKCNMBZ4Q","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-great-skills\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M788772K4QYXCZX3Y2P2AX9V","technical-writing","House style for technical writing — the voice, sentence craft, formatting, and user-facing-copy rules that make docs and product text clear, direct, and consistent. Use when writing or editing a README, docs, a spec, release notes, a changelog, help text, or any error\u002FCLI\u002FUI copy a person reads; when reviewing a diff that touches prose or messages; or when a project needs a writing standard. Reference-heavy mechanics live in REFERENCE.md.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Ftechnical-writing\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M78875087F1XKP7C6VRC49CY","teach","Teach the user a new skill or concept, within this workspace.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fteach\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M78872Z38MACN22AQDY9410P","handoff","Compact the current conversation into a handoff document for another agent to pick up.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fhandoff\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M78870FVRDYRT1WVP9HJ6FQ3","grilling","Interrogate the user's plan or design one decision at a time until you both share the same understanding. Use when the user wants to pressure-test an idea before building it, or reaches for any 'grill' trigger phrase.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrilling\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7886XGPEWXZYDA6K310HNYP","grill-me","A relentless, one-decision-at-a-time interview that sharpens a plan or design.","https:\u002F\u002Fgithub.com\u002Fofficialunofficial\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrill-me\u002FSKILL.md",[],[]]