You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The commit introduces several improvements to the commit message generation instructions:
- Added a detailed `<type-table>` with comprehensive guidance on when to use each commit type
- Enhanced the existing instructions with more nuanced explanations
- Improved readability and formatting of the instructions
- Added a note about "customInstructions" potentially overriding default instructions
- Maintained the core principles of generating concise and meaningful commit messages
The changes provide clearer guidance for generating conventional commit messages while preserving the original intent of the configuration.
Copy file name to clipboardExpand all lines: src/commitMessageGenerator.ts
+33-16Lines changed: 33 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -14,23 +14,40 @@ export class CommitMessageGenerator {
14
14
"You are a seasoned software engineer with more than 25 years of experience with an extraordinary ability for assessing and interpreting git diffs and writing detailed conventional commit messages and following 'instructions' and 'customInstructions' when generating them."
15
15
16
16
constprompt=`
17
-
<task>
18
-
Generate a detailed conventional commit message for the following Git diff:
17
+
<task>
18
+
Generate a detailed conventional commit message for the following Git diff:
19
19
20
-
${diff}
21
-
</task>
22
-
<instructions>
23
-
- Use ONLY ${config.allowedTypes.map((val)=>`'${val}'`).join(" | ")} as appropriate for the type of change.
24
-
- When assessing the commit type, consider the real impact of the change on the codebase and reserve 'feat' for significant changes or true feature additions.
25
-
- Always include a scope.
26
-
- Never use '!' or 'BREAKING CHANGE' in the commit message.
27
-
- Avoid excessive adjectives like 'enhance', 'comprehensive' etc
28
-
- Output will use markdown formatting for lists etc.
- Use ONLY ${config.allowedTypes.map((val)=>`'${val}'`).join(" | ")} as appropriate for the type of change.
24
+
- When assessing the commit type, consider actual impact of the commit. Refer to the "type-table" below for further guidance on the default commit types.
25
+
- Always include a scope.
26
+
- Never use '!' or 'BREAKING CHANGE' in the commit message.
27
+
- Avoid excessive adjectives like 'enhance', 'comprehensive' etc
28
+
- Output will use markdown formatting for lists etc.
29
+
- Output will ONLY contain the commit message.
30
+
- Do not explain the output.
31
+
- "customInstructions" override these instructions if they are provided and conflict.
| chore | Routine maintenance or updates | Use when updating configs or non-code changes. (eg updating dependencies, modifying configs, updating types, etc.) |
38
+
| ci | Continuous integration adjustments | Use when updating CI/CD config files. (eg GitHub Actions, Workflows, Pipelines, etc.) |
39
+
| docs | Documentation-only changes | Use only when updating or adding documentation, comments, or README files. (Do NOT use when adding or updating page content in web apps. eg Astro content collections.) |
40
+
| feat | New feature | Use only when adding new, user-facing feature or functionality or a fundamental change in an existing feature's functionality. |
41
+
| fix | Bug fix | Use when fixing a bug or issue in code that may or may not affect functionality. |
42
+
| perf | Performance improvement | Use when improving performance. (eg by optimising code.) |
43
+
| refactor | Code restructuring | Use when restructuring code without changing functionality or fixing bugs. (This can include significant code changes like abstracting code to its own component.) |
44
+
| style | Code formatting or styling | Use when code changes do not affect functionality. (eg linting, formatting adjustments, colour, margin, padding, etc.) |
45
+
| test | Adding or updating tests | Use when adding, updating, or removing tests. |
0 commit comments