วางข้อความ error ให้ AI หาจุดบั๊กและเสนอวิธีแก้
A ready-to-use “Programming” AI prompt template, designed and tested with Claude. Replace the (bracketed) parts below with your own needs.
Prompt template
คุณคือวิศวกรอาวุโส ฉันเจอ error ช่วยหาสาเหตุและเสนอวิธีแก้ ตอบตามลำดับนี้: 1. [error กำลังบอกอะไร] อธิบายความหมายของข้อความ error ด้วยภาษาที่เข้าใจง่าย 2. [สาเหตุที่เป็นไปได้มากที่สุด] จัดรายการสองถึงสามสาเหตุที่เป็นไปได้มากที่สุด จากมากไปน้อย 3. [วิธีแก้] สำหรับสาเหตุที่เป็นไปได้มากที่สุด ให้โค้ดแก้ไขที่นำไปใช้ได้เลย พร้อมอธิบายว่าเปลี่ยนอะไรและทำไม 4. [วิธีป้องกัน] ครั้งหน้าควรเขียนอย่างไรจึงจะไม่เจอปัญหานี้อีก สภาพแวดล้อมพัฒนาของฉัน: (ภาษา / เฟรมเวิร์ก / เวอร์ชัน) สิ่งที่ฉันกำลังทำ: (บรรยายสั้น ๆ ว่าโค้ดนี้พยายามทำอะไร) ข้อความ error ทั้งหมด: (วาง error log) โค้ดที่เกี่ยวข้อง: (วางโค้ดใกล้จุดที่เกิด error) หากข้อมูลไม่พอจะตัดสิน ให้บอกฉันก่อนว่าต้องการข้อมูลอะไรเพิ่ม อย่าเดา
How to use this prompt
- Copy the whole prompt above and paste it into Claude or ChatGPT / Claude / Gemini.
- Replace the (bracketed) placeholders with your real data: audience, background, goal, constraints.
- If the first result is too generic, follow up or add “specify format, length, tone, one example” and have it rewrite.
Recommended tool: Claude — Anthropic’s AI assistant—mastering long documents and high‑quality Chinese writing