Install
$ agentstack add skill-boom-vitt-skills-thai-migrate-to-shoehorn ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
ย้ายไปใช้ Shoehorn
ทำไมต้อง shoehorn?
shoehorn ช่วยให้ส่ง data แบบ partial ใน test ได้โดยที่ TypeScript ยังแฮปปี้ มันมาแทน assertion แบบ as ด้วยทางเลือกที่ type-safe
ใช้ใน test code เท่านั้น ห้ามใช้ shoehorn ใน production code เด็ดขาด
ปัญหาของ as ใน test:
- โมเดลถูก train มาไม่ให้ใช้มัน
- ต้องระบุ type ปลายทางเองทุกครั้ง
- ต้องใช้ double-as (
as unknown as Type) เวลาตั้งใจส่ง data ผิด type
ติดตั้ง
npm i @total-typescript/shoehorn
รูปแบบการ migrate
object ใหญ่แต่ใช้จริงแค่ไม่กี่ property
ก่อน:
type Request = {
body: { id: string };
headers: Record;
cookies: Record;
// ...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
});
});
หลัง:
import { fromPartial } from "@total-typescript/shoehorn";
it("gets user by id", () => {
getUser(
fromPartial({
body: { id: "123" },
}),
);
});
as Type → fromPartial()
ก่อน:
getUser({ body: { id: "123" } } as Request);
หลัง:
import { fromPartial } from "@total-typescript/shoehorn";
getUser(fromPartial({ body: { id: "123" } }));
as unknown as Type → fromAny()
ก่อน:
getUser({ body: { id: 123 } } as unknown as Request); // wrong type on purpose
หลัง:
import { fromAny } from "@total-typescript/shoehorn";
getUser(fromAny({ body: { id: 123 } }));
เลือกใช้ตัวไหนเมื่อไหร่
| ฟังก์ชัน | กรณีใช้งาน | | --------------- | -------------------------------------------------- | | fromPartial() | ส่ง data แบบ partial ที่ยังผ่าน type check | | fromAny() | ส่ง data ที่ตั้งใจให้ผิด type (ยังได้ autocomplete) | | fromExact() | บังคับ object แบบเต็ม (ค่อยสลับเป็น fromPartial ทีหลัง) |
ขั้นตอนการทำงาน
- เก็บ requirement - ถาม user:
- test file ไหนบ้างที่มี assertion แบบ
asแล้วสร้างปัญหา? - กำลังเจอ object ใหญ่ ๆ ที่สนใจจริงแค่บาง property หรือเปล่า?
- ต้องส่ง data ที่ตั้งใจให้ผิด type สำหรับ test เคส error ไหม?
- ติดตั้งแล้ว migrate:
- [ ] ติดตั้ง:
npm i @total-typescript/shoehorn - [ ] หา test file ที่มี assertion แบบ
as:grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts" - [ ] แทนที่
as Typeด้วยfromPartial() - [ ] แทนที่
as unknown as Typeด้วยfromAny() - [ ] เพิ่ม import จาก
@total-typescript/shoehorn - [ ] รัน type check เพื่อยืนยันว่าผ่าน
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: Boom-Vitt
- Source: Boom-Vitt/skills-thai
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.