/claude-thai-skills:thai-id-validatefrom claude-thai-skills
Validates Thai national ID and tax ID checksums, normalizes phone numbers between +66 and 0X formats, and builds PromptPay QR payloads following EMVCo TLV specifications.
Ships in claude-thai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ตรวจสอบ checksum ของเลขบัตรประชาชนไทย / เลขประจำตัวผู้เสียภาษี (13 หลัก), แปลงเบอร์โทรระหว่างรูป +66 กับ 0X, และสร้าง payload สำหรับ PromptPay QR (รูปแบบ EMVCo TLV). Algorithm and TLV layout follow the official Thai Revenue Department and ITMX PromptPay specifications.
+66 81 234 5678 แต่ระบบเก็บ 0812345678| Function | ภาษาไทย | Returns |
|---|---|---|
is_valid_thai_id(s) | ตรวจ checksum | bool |
normalize_phone(s) | แปลงเป็น +66XXXXXXXXX | str |
format_phone_thai(s) | แปลงเป็น 0XX-XXX-XXXX | str |
build_promptpay_payload(target, amount?) | สร้าง QR payload | str |
ให้ตัวเลข 12 หลักแรก คูณด้วยน้ำหนัก [13,12,11,10,9,8,7,6,5,4,3,2] แล้วรวมกัน. นำผลรวม mod 11, เอา 11 ลบ, แล้ว mod 10 อีกครั้ง = check digit (หลักที่ 13).
- () แล้ว+66, 66, หรือ 0 ถือว่าเทียบเท่ากัน00 Payload Format Indicator 0101 POI Method: 11 static / 12 dynamic (with amount)29 Merchant Account Info → sub-tag 00 AID A000000677010111, sub-tag 01 phone (0066 + เบอร์, pad to 13 chars) or 02 national ID (13 digits)53 Currency 764 (THB)54 Amount (optional)58 Country TH63 CRC-16/CCITT-FALSE (uppercase 4-hex) over the entire payload including the 6304 tag/length prefixvalidate.py — python validate.py runs all self-testsvalidate.ts — npx tsx validate.ts runs all self-testsหลักแรกของเลข 13 หลักบอก ประเภท ของผู้ถือบัตรตามที่กรมการปกครอง (DOPA) กำหนด มี 8 ประเภทหลัก:
| หลักแรก | ความหมาย (TH) | Meaning (EN) |
|---|---|---|
| 1 | สัญชาติไทย เกิดและแจ้งเกิดตามกำหนด ตั้งแต่ 1 ม.ค. 2527 | Thai citizen born ≥ 1 Jan 1984 with timely birth registration |
| 2 | สัญชาติไทย เกิดและแจ้งเกิดเกินกำหนด ตั้งแต่ 1 ม.ค. 2527 | Thai citizen born ≥ 1984 with late birth registration |
| 3 | สัญชาติไทย มีชื่อในทะเบียนบ้านก่อน 1 ม.ค. 2527 | Thai citizen already in household registry before 1984 |
| 4 | สัญชาติไทย ไม่มีชื่อในทะเบียนบ้านก่อน 1 ม.ค. 2527 (เพิ่มชื่อช่วงสำรวจ) | Thai citizen not in the initial pre-1984 registry |
| 5 | สัญชาติไทย เพิ่มชื่อเข้าทะเบียนบ้านภายหลัง (รวมแจ้งเกิดเกินกำหนดและกรณีกลับคืนสัญชาติ) | Thai citizen added to registry later (incl. late birth & re-recognition) |
| 6 | บุคคลที่เข้าเมืองโดยชอบด้วยกฎหมายชั่วคราว / ผู้พลัดถิ่น / ชนกลุ่มน้อย | Lawful temporary resident, displaced person, or ethnic minority awaiting status |
| 7 | บุตรของบุคคลประเภท 6 ที่เกิดในประเทศไทย | Children of category-6 persons, born in Thailand |
| 8 | บุคคลต่างด้าวที่ได้รับสัญชาติไทย / มีถิ่นที่อยู่ถาวร | Naturalized Thai citizen or permanent-residence holder |
หมายเหตุ: หลักแรก 0 เคยใช้กับกรณีพิเศษบางอย่างในอดีต แต่พบได้น้อยมากในระบบปัจจุบัน. ใช้สำหรับงาน HR/KYC เพื่อเข้าใจ background ของผู้สมัคร — ห้าม ใช้หลักแรกเพียงอย่างเดียวเป็นเกณฑ์เลือกปฏิบัติ (เช่น ปฏิเสธรับสมัครงานเพราะหลักแรกไม่ใช่ 1–5) เพราะผิดทั้งกฎหมายแรงงานและไม่ตรงเจตนาของระบบเลขประจำตัว.
แอปธนาคารไทยยุคใหม่ฝัง QR code ไว้บนสลิปโอนเงินทุกใบ เพื่อให้ผู้รับเงิน ยืนยันสลิปได้จริง แทนที่จะเชื่อภาพ JPG ที่อาจถูกตัดต่อ.
โครงสร้าง payload. เป็น EMVCo TLV (รูปแบบเดียวกับ PromptPay payment QR) แต่เป็น คนละ profile — เก็บข้อมูลธุรกรรมแทนข้อมูลผู้รับเงิน. ฟิลด์ทั่วไปที่อยู่ใน TLV ของสลิป:
764), country (TH)การยืนยัน. เมื่อสแกน QR บนสลิป แอปธนาคารจะดึง (sending_bank_id, transaction_ref_id) ออกจาก payload แล้วยิง API ของธนาคารผู้ออกสลิป (เช่น KBank Slip Verification API, SCB Slip Verify) เพื่อขอข้อมูลธุรกรรมจริงกลับมาเทียบ. ถ้าธนาคารตอบกลับว่า "ไม่พบธุรกรรม" หรือจำนวนเงินไม่ตรง = สลิปปลอม.
เหตุผลที่มี. กันการปลอมสลิปด้วยการแก้ภาพ — ภาพสลิปปลอมทำได้ง่ายมาก (แค่ Photoshop) แต่ QR ปลอมไม่ได้เพราะข้อมูลถูก validate ที่ฝั่ง server ของธนาคารผู้ออกสลิป ไม่ใช่ในตัว QR เอง. ผู้ค้ารายย่อยที่รับโอน PromptPay ควรสแกน QR บนสลิปลูกค้าก่อนปล่อยของ ไม่ใช่ดูแค่ภาพ.
Known gap. validate.py / validate.ts ในสกิลนี้ ไม่ parse slip QR — รองรับเฉพาะการ สร้าง PromptPay payment payload เท่านั้น. ถ้าต้องการ parse/verify สลิปจริง ใช้ไลบรารีเฉพาะทาง (เช่น slipverify, thanakan) ที่เรียก API ธนาคารผู้ออกสลิปได้.
% 10 step. When total % 11 == 0, 11 - 0 = 11. Mod 10 yields 1, not 11."6304" tag+length, not just the body before tag 63.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./", skills.3: Invalid string: must start with "./", skills.4: Invalid string: must start with "./", skills.5: Invalid string: must start with "./", skills.6: Invalid string: must start with "./", skills.7: Invalid string: must start with "./", skills.8: Invalid string: must start with "./", skills.9: Invalid string: must start with "./", skills.10: Invalid string: must start with "./", skills.11: Invalid string: must start with "./"
.claude-plugin/plugin.json: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./", skills.3: Invalid string: must start with "./", skills.4: Invalid string: must start with "./", skills.5: Invalid string: must start with "./", skills.6: Invalid string: must start with "./", skills.7: Invalid string: must start with "./", skills.8: Invalid string: must start with "./", skills.9: Invalid string: must start with "./", skills.10: Invalid string: must start with "./", skills.11: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
12 skills in this plugin
/thai-addressUse this skill for any task involving Thai postal address parsing, validation, formatting, or province/postcode lookup. Trigger whenever the user asks to: parse a Thai address into fields, validate a 5-digit Thai postcode, look up a province from its postcode, or format an address for a shipping label. Also trigger for requests like "แยกที่อยู่ไทย", "ตรวจรหัสไปรษณีย์", "แปลที่อยู่เป็นภาษาอังกฤษ", "ที่อยู่จัดส่ง", or any variation involving Thai addresses with ตำบล/แขวง/อำเภอ/เขต/จังหวัด./thai-customer-serviceUse this skill for any task involving Thai customer service messaging — replies, apologies, status updates, refund/return scripts, and auto-replies on LINE OA, Facebook Page, Shopee, Lazada, Instagram DM, TikTok Shop, and similar channels. Trigger whenever the user asks to: reply to a Thai customer, draft an apology, write a refund or return message, write an auto-reply, de-escalate an angry customer, or send a shipping/status update in Thai. Also trigger for requests like "ตอบลูกค้า", "reply LINE OA", "ตอบแชท", "Shopee reply", "ข้อความขอโทษลูกค้า", "customer service Thai", "เขียน auto reply", "ตอบ inbox", or any variation. If the output is a Thai message from a business to a customer, use this skill./thai-date-formatUse this skill for any task involving Thai date formatting, Buddhist Era (พ.ศ.) ↔ Gregorian (ค.ศ.) year conversion, or Arabic ↔ Thai numeral conversion. Trigger whenever the user asks to: convert พ.ศ. to ค.ศ. or vice versa, format a date in Thai government / business / casual style, parse a Thai date string with full or abbreviated month names, or convert digits between 0123456789 and ๐๑๒๓๔๕๖๗๘๙. Also trigger for requests like "แปลง พ.ศ. เป็น ค.ศ.", "จัดรูปแบบวันที่ไทย", "วันที่แบบราชการ", "เปลี่ยนเป็นเลขไทย", or any variation involving Thai calendar dates./thai-festival-cardUse this skill for any task involving Thai festival greetings, condolences, wedding cards, royal-occasion messages, or seasonal cards. Trigger whenever the user asks to: write a Songkran/Loy Krathong/New Year greeting, draft a condolence message, write a wedding card, compose a Mother's/Father's Day message, write a royal-occasion blessing, or pick auspicious wording for a Thai card. Also trigger for requests like "อวยพรปีใหม่", "การ์ดสงกรานต์", "ข้อความลอยกระทง", "คำไว้อาลัย", "การ์ดแต่งงาน", "อวยพรวันแม่", "อวยพรวันพ่อ", "ทรงพระเจริญ", "ตรุษจีน", or any festival/ceremonial greeting in Thai./thai-government-formUse this skill for any task involving Thai government letters, official correspondence, formal petitions, authorization letters, leave requests, or ราชการ forms. Trigger whenever the user asks to: write หนังสือราชการ, draft a คำร้อง, write an authorization (หนังสือมอบอำนาจ), submit a leave form (ใบลา), petition a government agency, or write a formal letter to a Thai official. Also trigger for requests like "เขียนหนังสือราชการ", "ยื่นเรื่อง", "คำร้อง", "หนังสือถึงราชการ", "ทำหนังสือถึง", "ใบลา", "หนังสือมอบอำนาจ", "official Thai letter", or any formal ราชการ document task./thai-invoiceUse this skill for any task involving Thai tax invoices, receipts, quotations, or withholding-tax certificates. Trigger whenever the user asks to: draft a Thai tax invoice (ใบกำกับภาษี), receipt (ใบเสร็จ), quotation (ใบเสนอราคา), credit/debit note (ใบลดหนี้/ใบเพิ่มหนี้), or WHT certificate (ภ.ง.ด.3/53). Also trigger for requests like "ออกใบกำกับภาษี", "ใบเสร็จ", "ใบเสนอราคา", "Thai tax invoice", "VAT 7%", "ภาษีหัก ณ ที่จ่าย", or any variation. If the context involves Thai accounting documents under Revenue Code §86/4, use this skill.2 plugins in one repository ship this exact skill · first indexed Oct 22, 2026
Other plugins' skills for the same job