Skip to content
GitHub

Prompt Engineering for Code (Code ရေးဖို့ AI ကို ခိုင်းနည်း)

Code ကောင်းကောင်းရဖို့ ဒီ (၄) ချက် ပါအောင် ပြောပါ။

  1. Role: “You are a Senior React Developer.” (ကျွမ်းကျင်သူ တစ်ယောက်လို ဖြေခိုင်းတာ)
  2. Context: “I am building a dashboard for a hospital.” (ဘာလုပ်နေလဲ ပြောပြတာ)
  3. Task: “Create a patient registration form.” (ဘာလုပ်ခိုင်းတာလဲ)
  4. Constraints: “Use TypeScript, Shadcn UI, and React Hook Form.” (ဘာတွေ သုံးရမယ်၊ မသုံးရဘူး ကန့်သတ်တာ)

Bad Prompt: “Write a function to sort numbers.”

Good Prompt: “Write a TypeScript function to sort an array of objects by a specific key. The function should be generic. Handle edge cases like empty arrays.”

  • Be Specific: Library ဘာသုံးမလဲ တိတိကျကျ ပြောပါ။
  • Provide Examples: ကိုယ်လိုချင်တဲ့ Code ပုံစံ (One-shot prompting) ကို နမူနာ ပြပါ။
  • Iterate: တစ်ခါတည်းနဲ့ အမှန် မရနိုင်ပါဘူး။ “ဒီနေရာလေး ပြင်ပေးပါ” ဆိုပြီး ဆက်ပြောပါ။