Skip to content
← Back to Articles
AI

AI එකෙන් හොඳ commit messages සහ Pull Request විස්තර ලියමු | Write Better Commit Messages and Pull Request Descriptions With AI

"fix stuff" වගේ commit messages වලට සමුදෙන්න. AI coding assistant එකක් පාවිච්චි කරලා පැහැදිලි commit සහ PR විස්තර ලියන ප්‍රායෝගික ක්‍රමය.

Paperskeep
Paperskeep
Dec 06, 2026 · 4 min read

සිංහල පළමුව, English version below.

සිංහල

ඔයාගේ Git history එක බැලුවම "update", "fix", "final fix", "final final fix" වගේ commits දකින්න ලැබෙනවද? කෝඩ් එක ලියන එකට වඩා, ඒ කෝඩ් එකේ වෙනස මොකක්ද කියලා වචන කිහිපයකින් කියන එක සමහර වෙලාවට අමාරුයි. මෙන්න මෙතනදී AI එකක් හොඳ සහායකයෙක්.

හොඳ commit message එකක් කියන්නේ මොකක්ද

AI එකෙන් ඉල්ලන්න කලින්, අපිට ඕන මොකක්ද කියලා දැනගන්න ඕන:

  • කෙටි subject line එකක්: වෙනස මොකක්ද කියලා එක පේළියකින් ("Add retry to payment webhook handler")
  • ඇයි කියන එක: body එකේ, මේ වෙනස අවශ්‍ය වුණේ ඇයි කියලා
  • බලපෑම: වෙනත් කොටස් වලට බලපානවද, migration එකක් ඕනද වගේ දේවල්

මාස හයකට පස්සේ මේ කෝඩ් එක කියවන කෙනා (සමහරවිට ඔයාමයි) "මොකද මෙහෙම කළේ?" කියලා අහනකොට උත්තරය commit එකේ තියෙන්න ඕන.

Diff එක AI එකට දෙන්න

git diff --staged command එකෙන් එන output එක copy කරලා AI chat එකට දාන්න. GitHub Copilot, Claude Code වගේ tools නම් බොහෝ විට staged changes කෙලින්ම කියවන්න පුළුවන්. Prompt එකට මෙහෙම දෙයක් එකතු කරන්න:

"මේ diff එකට commit message එකක් ලියන්න. Subject line එක අකුරු 60ට අඩුවෙන්. Body එකේ මේ වෙනස ඇයි කළේද කියලා කෙටියෙන්. අපේ team එක Conventional Commits format එක පාවිච්චි කරනවා."

වැදගත්: diff එකේ API keys, passwords, customer data වගේ දේවල් තියෙනවා නම් ඒවා paste කරන්න එපා.

"ඇයි" කියන එක ඔයාම කියන්න

AI එකට diff එකෙන් පේන්නේ මොකක්ද වෙනස් වුණේ කියන එක විතරයි. ඇයි කියන එක දන්නේ ඔයා. ඒ නිසා එක වාක්‍යයක් හරි එකතු කරන්න: "Customers දෙපාරක් charge වෙන bug එකක් තිබ්බා, ඒක නවත්තන්න." එතකොට ලැබෙන message එක ගොඩක් වටිනවා.

AI එකට පේන්නේ කෝඩ් එකේ වෙනස විතරයි. ඒ වෙනස කළේ ඇයි කියන කතාව දන්නේ ඔයා විතරයි.

Pull Request විස්තරය

PR එකක් කියන්නේ commits ගොඩක එකතුවක්. Reviewer කෙනෙකුට ඉක්මනින් තේරුම්ගන්න පුළුවන් විදියට මේ කොටස් ඉල්ලන්න:

  1. සාරාංශය: මේ PR එකෙන් කරන්නේ මොකක්ද, වාක්‍ය දෙක තුනකින්
  2. වෙනස්කම් ලැයිස්තුව: ප්‍රධාන files හෝ features
  3. Test කළ විදිය: ඔයා අතින් හෝ automated tests වලින් check කළේ මොනවද
  4. අවධානය යොමු කළ යුතු තැන්: reviewer විශේෂයෙන් බලන්න ඕන කොටස්

"Test කළ විදිය" කොටස AI එකට හිතලා ලියන්න දෙන්න එපා. ඔයා ඇත්තටම කළ දේ විතරක් ලියන්න.

අවසාන check එක

Submit කරන්න කලින් එක පාරක් කියවන්න. AI එක සමහර වෙලාවට diff එකේ නැති දේවල් "improved performance" වගේ වචන වලින් එකතු කරනවා. ඇත්ත නොවන හෝ ඔප්පු කරන්න බැරි claims අයින් කරන්න. කෙටි, ඇත්ත, පැහැදිලි message එකක් තමයි හොඳම එක.


English

Does your Git history read "update", "fix", "final fix", "final final fix"? Sometimes describing a change in a few words is harder than writing the code. This is a small, everyday job where an AI assistant really earns its keep.

What a good commit message looks like

Before asking AI for one, know what you want:

  • A short subject line: one line saying what changed ("Add retry to payment webhook handler")
  • The why: in the body, why the change was needed
  • The impact: does it affect other parts, does it need a migration, and so on

Six months from now, whoever reads this code (possibly you) will ask "why was this done?" The answer should be in the commit.

Give the AI the diff

Copy the output of git diff --staged into your AI chat. Tools such as GitHub Copilot and Claude Code can often read staged changes directly. Add something like:

"Write a commit message for this diff. Keep the subject line under 60 characters. In the body, briefly explain why the change was made. Our team uses the Conventional Commits format."

Important: if the diff contains API keys, passwords or customer data, do not paste it.

Supply the why yourself

From a diff, AI can only see what changed. You know why. Add even one sentence: "There was a bug where customers were charged twice; this stops it." The resulting message becomes far more useful.

AI can only see what changed in the code. Only you know the story of why it changed.

Pull request descriptions

A pull request bundles several commits. Ask for these sections so a reviewer can get up to speed quickly:

  1. Summary: what the PR does, in two or three sentences
  2. List of changes: the main files or features touched
  3. How it was tested: what you checked by hand or with automated tests
  4. Areas to look at: parts the reviewer should pay special attention to

Never let the AI invent the "How it was tested" section. Write only what you actually did.

One last check

Read it once before you submit. AI sometimes adds things the diff does not show, such as "improved performance". Remove any claim that is not true or that you cannot back up. A short, honest, clear message beats a long, impressive one every time.

Enjoyed this piece?

Get the next one in your inbox, every other Friday.

More from Paperskeep