|
73 | 73 | ---@return string prompt The formatted prompt
|
74 | 74 | function Generator._create_prompt(diff, lang)
|
75 | 75 | return string.format(
|
76 |
| - [[Generate Conventional Commit compliant messages |
| 76 | + [[You are a commit message generator. Generate exactly ONE Conventional Commit message for the provided git diff. |
77 | 77 |
|
78 |
| -When to use: |
79 |
| -• When analyzing git diffs for commit messages |
80 |
| -• When standardizing commit format across projects |
81 |
| -• When ensuring consistent commit message patterns |
82 |
| -• When generating structured commit documentation |
83 |
| -
|
84 |
| -Best practices: |
85 |
| -• Must include required type (feat, fix, docs, style, refactor, perf, test, chore) |
86 |
| -• Use lowercase for type, optional scope in parentheses |
87 |
| -• Start description with imperative verb, keep under 50 characters |
88 |
| -• Add body with bullet points for complex changes |
89 |
| -• Ensure language matches specification: %s |
| 78 | +CRITICAL RULES: |
| 79 | +1. Generate ONLY ONE commit message, never multiple messages |
| 80 | +2. Analyze ALL changes in the diff as a single logical unit |
| 81 | +3. Choose the most significant change type if multiple types exist |
| 82 | +4. Respond with ONLY the commit message, no additional text or explanations |
90 | 83 |
|
91 | 84 | Format: type(scope): description
|
92 | 85 |
|
93 |
| -Example: |
| 86 | +Types: feat, fix, docs, style, refactor, perf, test, chore |
| 87 | +Language: %s |
| 88 | +
|
| 89 | +Requirements: |
| 90 | +- Use imperative mood ("add" not "added") |
| 91 | +- Keep description under 50 characters |
| 92 | +- Add body with bullet points for complex changes only if necessary |
| 93 | +- Choose the primary type that best represents the overall change |
| 94 | +
|
| 95 | +Example output format: |
94 | 96 | feat(auth): add OAuth2 integration
|
95 | 97 |
|
96 | 98 | - implement Google OAuth provider
|
97 |
| -- update user authentication flow |
98 |
| -- add integration tests |
| 99 | +- update authentication flow |
99 | 100 |
|
100 |
| -Generate commit message for this diff: |
| 101 | +Generate ONE commit message for this diff: |
101 | 102 | ```diff
|
102 | 103 | %s
|
103 |
| -```]], |
| 104 | +``` |
| 105 | +
|
| 106 | +Response format: Return only the commit message, nothing else.]], |
104 | 107 | lang or "English",
|
105 | 108 | diff
|
106 | 109 | )
|
|
0 commit comments