From 855cf007fa95b7c8ba7d1b30cf54e4d2b53f5856 Mon Sep 17 00:00:00 2001 From: Ammar Bandukwala Date: Wed, 11 Sep 2024 17:24:09 -0500 Subject: [PATCH] Update commit message guidelines in BuildPrompt --- prompt.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/prompt.go b/prompt.go index 70265e8..59dbaeb 100644 --- a/prompt.go +++ b/prompt.go @@ -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"), }, }