[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75X1GF3XSCWFGJDR0TJ3GZX":3,"skill-same:01M75X1GF3XSCWFGJDR0TJ3GZX":54},{"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":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M75X1GF3XSCWFGJDR0TJ3GZX","migrate-to-shoehorn",null,"Migrate test files from `as` type assertions to @total-typescript\u002Fshoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.","mambo-wang\u002FCodeWiki-Plus","mambo-wang","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17296917?v=4","01M75489WXT2KCG0TDVRGMTEET","WanderingBug","01M75WY0F23J9DB5GBVTH8F8Q9",21,"MIT","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002F.codebuddy\u002Fskills\u002Fmigrate-to-shoehorn\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: migrate-to-shoehorn\ndescription: Migrate test files from `as` type assertions to @total-typescript\u002Fshoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.\n---\n\n# Migrate to Shoehorn\n\n## Why shoehorn?\n\n`shoehorn` lets you pass partial data in tests while keeping TypeScript happy. It replaces `as` assertions with type-safe alternatives.\n\n**Test code only.** Never use shoehorn in production code.\n\nProblems with `as` in tests:\n\n- Trained not to use it\n- Must manually specify target type\n- Double-as (`as unknown as Type`) for intentionally wrong data\n\n## Install\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## Migration patterns\n\n### Large objects with few needed properties\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 Only care about body.id but must fake entire 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` → `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` → `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## When to use each\n\n| Function        | Use case                                           |\n| --------------- | -------------------------------------------------- |\n| `fromPartial()` | Pass partial data that still type-checks           |\n| `fromAny()`     | Pass intentionally wrong data (keeps autocomplete) |\n| `fromExact()`   | Force full object (swap with fromPartial later)    |\n\n## Workflow\n\n1. **Gather requirements** - ask user:\n   - What test files have `as` assertions causing problems?\n   - Are they dealing with large objects where only some properties matter?\n   - Do they need to pass intentionally wrong data for error testing?\n\n2. **Install and migrate**:\n   - [ ] Install: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] Find test files with `as` assertions: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] Replace `as Type` with `fromPartial()`\n   - [ ] Replace `as unknown as Type` with `fromAny()`\n   - [ ] Add imports from `@total-typescript\u002Fshoehorn`\n   - [ ] Run type check to verify\n","# Migrate to Shoehorn\n\n## Why shoehorn?\n\n`shoehorn` lets you pass partial data in tests while keeping TypeScript happy. It replaces `as` assertions with type-safe alternatives.\n\n**Test code only.** Never use shoehorn in production code.\n\nProblems with `as` in tests:\n\n- Trained not to use it\n- Must manually specify target type\n- Double-as (`as unknown as Type`) for intentionally wrong data\n\n## Install\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## Migration patterns\n\n### Large objects with few needed properties\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 Only care about body.id but must fake entire 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` → `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` → `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## When to use each\n\n| Function        | Use case                                           |\n| --------------- | -------------------------------------------------- |\n| `fromPartial()` | Pass partial data that still type-checks           |\n| `fromAny()`     | Pass intentionally wrong data (keeps autocomplete) |\n| `fromExact()`   | Force full object (swap with fromPartial later)    |\n\n## Workflow\n\n1. **Gather requirements** - ask user:\n   - What test files have `as` assertions causing problems?\n   - Are they dealing with large objects where only some properties matter?\n   - Do they need to pass intentionally wrong data for error testing?\n\n2. **Install and migrate**:\n   - [ ] Install: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] Find test files with `as` assertions: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] Replace `as Type` with `fromPartial()`\n   - [ ] Replace `as unknown as Type` with `fromAny()`\n   - [ ] Add imports from `@total-typescript\u002Fshoehorn`\n   - [ ] Run type check to verify\n",{"name":5,"description":7},"develop","ba8919e7a5182cc94dbe3e9b3a46f4c2e8fa209d",".codebuddy\u002Fskills\u002Fmigrate-to-shoehorn",4,"https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus","https:\u002F\u002Fpypi.org\u002Fproject\u002Fcodewiki-plus\u002F","https:\u002F\u002Fgithub.com\u002Fmambo-wang","https:\u002F\u002Fblog.csdn.net\u002Fsinat_27143551","专注Java后端开发，喜欢运动","2026-11-13 15:29:46",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add mambo-wang\u002FCodeWiki-Plus --skill migrate-to-shoehorn",{"tool":40,"command":41},"bunx","bunx skills add mambo-wang\u002FCodeWiki-Plus --skill migrate-to-shoehorn",{"tool":43,"command":44},"pnpm","pnpm dlx skills add mambo-wang\u002FCodeWiki-Plus --skill migrate-to-shoehorn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002F.codebuddy\u002Fskills\u002Fmigrate-to-shoehorn\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"agents\u002Fopenai.yaml","REFERENCE","参考文档",110,"https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002F.codebuddy\u002Fskills\u002Fmigrate-to-shoehorn\u002Fagents\u002Fopenai.yaml",[55,62,69,76,83,90],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M75XA78546E66PCC3JV2TM3Q","write-doc-file-content-file-sidechannel","write_doc_file 建档报目标路径已被手写文件占用\u002F路由冲突时——走 content_file 临时文件侧通道：正文写临时文件→删占位文件→write_doc_file(content_file=...) 正式建档→删临时文件","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwrite-doc-file-content-file-sidechannel\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M75X9YQNDX8B6ZEVMKGM2TYR","windows-python-release","当要手动发布 Python 包（codewiki-plus）到 PyPI 并建 GitHub Release 时——CI 不发布、Windows 控制台为 GBK、可能无 gh CLI、本机网络对 upload.pypi.org 的 Python TLS 握手有干扰——先核对 tag 区间与工作区未提交改动定 bump 级别，再按 8 步主干执行：同步四处版本→bump 提交（只 add 具体文件）→聚焦+ruff+全量闸门→清 dist 构建→PR 合并 main→tag merge commit 建 Release→uv publish（TLS 超时则 curl.exe 直传）→PyPI JSON API 核对","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwindows-python-release\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M75X9MGBPRG6JDCRAY97E5T0","windows-dev-env","Windows\u002FPowerShell 下做 git 写操作、跑子进程或批量文件\u002F测试清理时：shell 漂移与中文路径致命令静默失败、无控制台宿主子进程闪窗、GCM 每次弹 OAuth 框、原生 DLL 被锁——须显式复核落盘、subprocess 加 CREATE_NO_WINDOW、gh auth setup-git 持久化凭据，并用 cmd \u002Fc 绕 safe-delete 钩子","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fwindows-dev-env\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M75X9H4YYF5C29JR7AF44K84","repowiki-conclusion-update","已落库 repowiki 结论发生变化时，按「结论方向 vs 表述」分流：方向变则新写 decision 笔记+reject_note 旧+confirm 并回源 ADR，仅表述\u002F证据变则 edit_doc_file 原地改","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Frepowiki-conclusion-update\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M75X9CD6FDMX1RDE9NZEFNVY","maintain-fork-pr-merge","当合入 fork 来源的 PR 且 mergeStateStatus=CONFLICTING\u002FDIRTY 时——先 git merge-tree 探测冲突清单，查 maintainer_can_modify，再在 worktree 隔离目录解冲突后 push fork 分支，勿因 CI 绿直接 merge","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fmaintain-fork-pr-merge\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M75X98KRKX80JQ9Y4PR8WZCK","git-commit-hygiene","在共享 worktree 多会话并行或暂存区有残留时提交代码——用显式 pathspec 只提交自己的文件并排除临时目录，禁止 git add -A 或裸 commit 扫入并行会话的改动","https:\u002F\u002Fgithub.com\u002Fmambo-wang\u002FCodeWiki-Plus\u002Fblob\u002Fdevelop\u002Frepowiki\u002Fskills\u002Fgit-commit-hygiene\u002FSKILL.md",[],[]]