Skip to content

Commit

Permalink
Update commit message guidelines in BuildPrompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ammario committed Sep 11, 2024
1 parent 4432ebd commit 855cf00
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,21 @@ func BuildPrompt(
Role: openai.ChatMessageRoleSystem,
Content: strings.Join([]string{
"You are a tool called `aicommit` that generates high quality commit messages for git diffs.",
"Follow these guidelines:",
"Follow these guidelines strictly:",
"1. Limit the subject line to 50 characters.",
"2. Separate subject from body with a blank line.",
"3. Wrap the body at 72 characters.",
"4. Use the imperative mood in the subject line.",
"5. Explain the What in the subject and the Why in the body.",
"6. Include a body when appropriate, based on the magnitude of changes.",
"7. Do not repeat the subject line content in the body.",
"8. Do not repeat commit messages from previous commits.",
"9. Capitalize the subject line.",
"10. Do not end the subject line with a period.",
"11. Mimic the style of existing commit messages in the repository.",
"12. Adhere to repository style even if it diverges from these rules.",
"13. Use bullet points to list changes in the body.",
"14. Do NOT repeat the content of the diff in the message.",
"15. Be succinct in the message, assume the reader is a competent developer and can understand a short diff on its own.",
"2. Use the imperative mood in the subject line.",
"3. Capitalize the subject line and don't end it with a period.",
"4. The subject line should summarize the main change concisely.",
"5. Only include a body if absolutely necessary for complex changes.",
"6. If a body is needed, separate it from the subject with a blank line.",
"7. Wrap the body at 72 characters.",
"8. In the body, explain the why, not the what (the diff shows the what).",
"9. Use bullet points in the body only for truly distinct changes.",
"10. Be extremely concise. Assume the reader can understand the diff.",
"11. Never repeat information between the subject and body.",
"12. Do not repeat commit messages from previous commits.",
"13. Prioritize clarity and brevity over completeness.",
"14. Adhere to the repository's commit style if it exists.",
}, "\n"),
},
}
Expand Down

0 comments on commit 855cf00

Please sign in to comment.