Skip to content

Commit fdd8eab

Browse files
committed
enhance: improved grammar in AI prompts
1 parent 4bfcfb8 commit fdd8eab

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/Commands/GenerateCommitMessage.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public async Task ExecAsync()
3939
{
4040
try
4141
{
42-
_onResponse?.Invoke("Waiting for pre-file analyzing to completed...\n\n");
42+
_onResponse?.Invoke("Waiting for pre-file analysis to complete...\n\n");
4343

4444
var responseBuilder = new StringBuilder();
4545
var summaryBuilder = new StringBuilder();
@@ -63,7 +63,7 @@ await _service.ChatAsync(
6363
responseBuilder.Append(update);
6464
summaryBuilder.Append(update);
6565

66-
_onResponse?.Invoke($"Waiting for pre-file analyzing to completed...\n\n{responseBuilder}");
66+
_onResponse?.Invoke($"Waiting for pre-file analysis to complete...\n\n{responseBuilder}");
6767
});
6868
}
6969

@@ -80,7 +80,7 @@ await _service.ChatAsync(
8080
var subjectBuilder = new StringBuilder();
8181
await _service.ChatAsync(
8282
_service.GenerateSubjectPrompt,
83-
$"Here are the summaries changes:\n{summaryBuilder}",
83+
$"Here are the summarized changes:\n{summaryBuilder}",
8484
_cancelToken,
8585
update =>
8686
{

src/Models/OpenAI.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -144,33 +144,33 @@ public string GenerateSubjectPrompt
144144
public OpenAIService()
145145
{
146146
AnalyzeDiffPrompt = """
147-
You are an expert developer specialist in creating commits.
148-
Provide a super concise one sentence overall changes summary of the user `git diff` output following strictly the next rules:
149-
- Do not use any code snippets, imports, file routes or bullets points.
150-
- Do not mention the route of file that has been change.
151-
- Write clear, concise, and descriptive messages that explain the MAIN GOAL made of the changes.
152-
- Use the present tense and active voice in the message, for example, "Fix bug" instead of "Fixed bug.".
153-
- Use the imperative mood, which gives the message a sense of command, e.g. "Add feature" instead of "Added feature".
154-
- Avoid using general terms like "update" or "change", be specific about what was updated or changed.
155-
- Avoid using terms like "The main goal of", just output directly the summary in plain text
147+
You are an expert developer specializing in writing commit messages.
148+
Provide a super concise, one-sentence summary of the user's git diff output, strictly following these rules:
149+
- Do not use code snippets, imports, file paths, or bullet points.
150+
- Do not mention the path of any changed file.
151+
- Write clear, concise, and descriptive messages that explain the main goal of the changes.
152+
- Use the present tense and active voice in the message (for example, "Fix bug" instead of "Fixed bug").
153+
- Use the imperative mood, which gives the message a sense of command (e.g., "Add feature" instead of "Added feature").
154+
- Avoid using general terms like "update" or "change"; be specific about what was updated or changed.
155+
- Avoid using terms like "The main goal of"; just output the summary directly in plain text.
156156
""";
157157

158158
GenerateSubjectPrompt = """
159-
You are an expert developer specialist in creating commits messages.
160-
Your only goal is to retrieve a single commit message.
161-
Based on the provided user changes, combine them in ONE SINGLE commit message retrieving the global idea, following strictly the next rules:
162-
- Assign the commit {type} according to the next conditions:
159+
You are an expert developer specializing in writing commit messages.
160+
Your sole goal is to retrieve a single commit message.
161+
Based on the provided user changes, combine them into one single commit message, capturing the global idea, and strictly following these rules:
162+
- Assign the commit {type} according to these conditions:
163163
feat: Only when adding a new feature.
164164
fix: When fixing a bug.
165165
docs: When updating documentation.
166-
style: When changing elements styles or design and/or making changes to the code style (formatting, missing semicolons, etc.) without changing the code logic.
166+
style: When changing element styles or design, and/or making changes to the code style (formatting, missing semicolons, etc.) without altering the code logic.
167167
test: When adding or updating tests.
168168
chore: When making changes to the build process or auxiliary tools and libraries.
169169
revert: When undoing a previous commit.
170-
refactor: When restructuring code without changing its external behavior, or is any of the other refactor types.
171-
- Do not add any issues numeration, explain your output nor introduce your answer.
172-
- Output directly only one commit message in plain text with the next format: {type}: {commit_message}.
173-
- Be as concise as possible, keep the message under 50 characters.
170+
refactor: When restructuring code without changing its external behavior, or when it falls under any other refactor type.
171+
- Do not add any issue numbers, explain your output, or introduce your answer.
172+
- Output directly only one commit message in plain text with the format: {type}: {commit_message}.
173+
- Be as concise as possible, keeping the message under 50 characters.
174174
""";
175175
}
176176

0 commit comments

Comments
 (0)