รีแฟกเตอร์โค้ดนี้ให้อ่านง่ายขึ้น
A ready-to-use “Programming” AI prompt template, designed and tested with Cursor. Replace the (bracketed) parts below with your own needs.
Prompt template
รีแฟกเตอร์โค้ดด้านล่างให้อ่านง่ายและดูแลรักษาง่ายขึ้น: 1) ปรับปรุงการตั้งชื่อ; 2) แยกฟังก์ชันที่ยาวเกินไป; 3) กำจัดโค้ดที่ซ้ำซ้อน; 4) คงพฤติกรรมไว้ไม่เปลี่ยนแปลง หลังจากนั้น อธิบายว่าเปลี่ยนอะไรและทำไม และแนบโค้ดที่รีแฟกเตอร์แล้วฉบับเต็ม โค้ด: ``` วางโค้ด ```
How to use this prompt
- Copy the whole prompt above and paste it into Cursor 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: Cursor — A code editor built for AI.