[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78EMTHHFQBZPZJYNC6QPF9G":3,"skill-same:01M78EMTHHFQBZPZJYNC6QPF9G":47},{"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":31,"updatedAt":32,"install":33,"resources":46},"01M78EMTHHFQBZPZJYNC6QPF9G","migrate-to-shoehorn",null,"ย้าย test file จาก type assertion แบบ `as` ไปใช้ @total-typescript\u002Fshoehorn ใช้เมื่อ user พูดถึง shoehorn อยากเลิกใช้ `as` ใน test หรือต้องการส่ง test data แบบ partial","Boom-Vitt\u002Fskills-thai","Boom-Vitt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F169876956?v=4","01M78EJ7J23WSZJ2R2WTZGGAPR","Vittawat","01M78EJ7JPKFWHN7WJ94HE7F9R",5,"MIT","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fmigrate-to-shoehorn\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: migrate-to-shoehorn\ndescription: ย้าย test file จาก type assertion แบบ `as` ไปใช้ @total-typescript\u002Fshoehorn ใช้เมื่อ user พูดถึง shoehorn อยากเลิกใช้ `as` ใน test หรือต้องการส่ง test data แบบ partial\n---\n\n# ย้ายไปใช้ Shoehorn\n\n## ทำไมต้อง shoehorn?\n\n`shoehorn` ช่วยให้ส่ง data แบบ partial ใน test ได้โดยที่ TypeScript ยังแฮปปี้ มันมาแทน assertion แบบ `as` ด้วยทางเลือกที่ type-safe\n\n**ใช้ใน test code เท่านั้น** ห้ามใช้ shoehorn ใน production code เด็ดขาด\n\nปัญหาของ `as` ใน test:\n\n- โมเดลถูก train มาไม่ให้ใช้มัน\n- ต้องระบุ type ปลายทางเองทุกครั้ง\n- ต้องใช้ double-as (`as unknown as Type`) เวลาตั้งใจส่ง data ผิด type\n\n## ติดตั้ง\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## รูปแบบการ migrate\n\n### object ใหญ่แต่ใช้จริงแค่ไม่กี่ property\n\nก่อน:\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\nหลัง:\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\nก่อน:\n\n```ts\ngetUser({ body: { id: \"123\" } } as Request);\n```\n\nหลัง:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromPartial({ body: { id: \"123\" } }));\n```\n\n### `as unknown as Type` → `fromAny()`\n\nก่อน:\n\n```ts\ngetUser({ body: { id: 123 } } as unknown as Request); \u002F\u002F wrong type on purpose\n```\n\nหลัง:\n\n```ts\nimport { fromAny } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromAny({ body: { id: 123 } }));\n```\n\n## เลือกใช้ตัวไหนเมื่อไหร่\n\n| ฟังก์ชัน        | กรณีใช้งาน                                          |\n| --------------- | -------------------------------------------------- |\n| `fromPartial()` | ส่ง data แบบ partial ที่ยังผ่าน type check          |\n| `fromAny()`     | ส่ง data ที่ตั้งใจให้ผิด type (ยังได้ autocomplete) |\n| `fromExact()`   | บังคับ object แบบเต็ม (ค่อยสลับเป็น fromPartial ทีหลัง) |\n\n## ขั้นตอนการทำงาน\n\n1. **เก็บ requirement** - ถาม user:\n   - test file ไหนบ้างที่มี assertion แบบ `as` แล้วสร้างปัญหา?\n   - กำลังเจอ object ใหญ่ ๆ ที่สนใจจริงแค่บาง property หรือเปล่า?\n   - ต้องส่ง data ที่ตั้งใจให้ผิด type สำหรับ test เคส error ไหม?\n\n2. **ติดตั้งแล้ว migrate**:\n   - [ ] ติดตั้ง: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] หา test file ที่มี assertion แบบ `as`: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] แทนที่ `as Type` ด้วย `fromPartial()`\n   - [ ] แทนที่ `as unknown as Type` ด้วย `fromAny()`\n   - [ ] เพิ่ม import จาก `@total-typescript\u002Fshoehorn`\n   - [ ] รัน type check เพื่อยืนยันว่าผ่าน\n","# ย้ายไปใช้ Shoehorn\n\n## ทำไมต้อง shoehorn?\n\n`shoehorn` ช่วยให้ส่ง data แบบ partial ใน test ได้โดยที่ TypeScript ยังแฮปปี้ มันมาแทน assertion แบบ `as` ด้วยทางเลือกที่ type-safe\n\n**ใช้ใน test code เท่านั้น** ห้ามใช้ shoehorn ใน production code เด็ดขาด\n\nปัญหาของ `as` ใน test:\n\n- โมเดลถูก train มาไม่ให้ใช้มัน\n- ต้องระบุ type ปลายทางเองทุกครั้ง\n- ต้องใช้ double-as (`as unknown as Type`) เวลาตั้งใจส่ง data ผิด type\n\n## ติดตั้ง\n\n```bash\nnpm i @total-typescript\u002Fshoehorn\n```\n\n## รูปแบบการ migrate\n\n### object ใหญ่แต่ใช้จริงแค่ไม่กี่ property\n\nก่อน:\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\nหลัง:\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\nก่อน:\n\n```ts\ngetUser({ body: { id: \"123\" } } as Request);\n```\n\nหลัง:\n\n```ts\nimport { fromPartial } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromPartial({ body: { id: \"123\" } }));\n```\n\n### `as unknown as Type` → `fromAny()`\n\nก่อน:\n\n```ts\ngetUser({ body: { id: 123 } } as unknown as Request); \u002F\u002F wrong type on purpose\n```\n\nหลัง:\n\n```ts\nimport { fromAny } from \"@total-typescript\u002Fshoehorn\";\n\ngetUser(fromAny({ body: { id: 123 } }));\n```\n\n## เลือกใช้ตัวไหนเมื่อไหร่\n\n| ฟังก์ชัน        | กรณีใช้งาน                                          |\n| --------------- | -------------------------------------------------- |\n| `fromPartial()` | ส่ง data แบบ partial ที่ยังผ่าน type check          |\n| `fromAny()`     | ส่ง data ที่ตั้งใจให้ผิด type (ยังได้ autocomplete) |\n| `fromExact()`   | บังคับ object แบบเต็ม (ค่อยสลับเป็น fromPartial ทีหลัง) |\n\n## ขั้นตอนการทำงาน\n\n1. **เก็บ requirement** - ถาม user:\n   - test file ไหนบ้างที่มี assertion แบบ `as` แล้วสร้างปัญหา?\n   - กำลังเจอ object ใหญ่ ๆ ที่สนใจจริงแค่บาง property หรือเปล่า?\n   - ต้องส่ง data ที่ตั้งใจให้ผิด type สำหรับ test เคส error ไหม?\n\n2. **ติดตั้งแล้ว migrate**:\n   - [ ] ติดตั้ง: `npm i @total-typescript\u002Fshoehorn`\n   - [ ] หา test file ที่มี assertion แบบ `as`: `grep -r \" as [A-Z]\" --include=\"*.test.ts\" --include=\"*.spec.ts\"`\n   - [ ] แทนที่ `as Type` ด้วย `fromPartial()`\n   - [ ] แทนที่ `as unknown as Type` ด้วย `fromAny()`\n   - [ ] เพิ่ม import จาก `@total-typescript\u002Fshoehorn`\n   - [ ] รัน type check เพื่อยืนยันว่าผ่าน\n",{"name":5,"description":7},"main","97984d244d381a97b3637b4bd699369ba8e51ac0","skills\u002Fmisc\u002Fmigrate-to-shoehorn",1,"https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai","https:\u002F\u002Fgithub.com\u002FBoom-Vitt","boombignose.org","🐼 AI ภาษาไทยแบบโอเพนซอร์ส · Claude Code skills & plugins · BoomBigNose Lab (Thai dialect ASR) · YouTube @BoomBigNose","2026-10-22 18:20:06",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Boom-Vitt\u002Fskills-thai --skill migrate-to-shoehorn",{"tool":39,"command":40},"bunx","bunx skills add Boom-Vitt\u002Fskills-thai --skill migrate-to-shoehorn",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Boom-Vitt\u002Fskills-thai --skill migrate-to-shoehorn","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fmisc\u002Fmigrate-to-shoehorn\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M78ENEAFFV60T0N5AZ71D4G5","writing-great-skills","อ้างอิงสำหรับการเขียนและแก้ไข skill ให้ดี — คำศัพท์และหลักการที่ทำให้ skill ทำงานได้อย่างคาดเดาได้","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-great-skills\u002FSKILL.md",[],[],{"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},"01M78ENCCQYAY3NW5VC0B1QCE0","teach","สอน skill หรือ concept ใหม่ให้ผู้ใช้ ภายใน workspace นี้","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fteach\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},"01M78ENA816K7VBBWJ7J9897QN","handoff","บีบอัดบทสนทนาปัจจุบันให้เป็นเอกสาร handoff สำหรับให้ agent ตัวอื่นรับช่วงต่อ","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fhandoff\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},"01M78EN896S7B63SXKPDEDGMBC","grilling","ซักถาม user อย่างไม่ปรานีเกี่ยวกับแผนหรือ design ใช้เมื่อ user อยาก stress-test แผนก่อนลงมือสร้าง หรือใช้ trigger phrase ใด ๆ ที่มีคำว่า 'grill'","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrilling\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},"01M78EN6PYS1E3T9QTPZ9J10EN","grill-me","บทสัมภาษณ์แบบไม่ปล่อยผ่าน เพื่อทำให้ plan หรือ design คมขึ้น","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fgrill-me\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},"01M78EN4A7TXNABFXQWHK2FS01","obsidian-vault","ค้นหา สร้าง และจัดการ note ใน Obsidian vault ด้วย wikilinks และ index note ใช้เมื่อ user อยากหา สร้าง หรือจัดระเบียบ note ใน Obsidian","https:\u002F\u002Fgithub.com\u002FBoom-Vitt\u002Fskills-thai\u002Fblob\u002Fmain\u002Fskills\u002Fpersonal\u002Fobsidian-vault\u002FSKILL.md",[],[]]