|
73 | 73 | ---@return string prompt The formatted prompt |
74 | 74 | function Generator._create_prompt(diff, lang) |
75 | 75 | return string.format( |
76 | | - [[You are a commit message generator. Generate exactly ONE Conventional Commit message for the provided git diff. |
| 76 | + [[You are a commit message generator. Generate exactly ONE complete Conventional Commit message for the provided git diff. |
77 | 77 |
|
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 |
| 78 | +CRITICAL FORMAT REQUIREMENTS: |
| 79 | +1. MUST generate exactly ONE commit message, never multiple messages |
| 80 | +2. MUST include a title line and at least one bullet point description |
| 81 | +3. MUST analyze ALL changes in the diff as a single logical unit |
| 82 | +4. MUST respond with ONLY the commit message, no explanations or extra text |
83 | 83 |
|
84 | | -Format: type(scope): description |
| 84 | +MANDATORY FORMAT: |
| 85 | +type(scope): brief description |
| 86 | +
|
| 87 | +- detailed description point 1 |
| 88 | +- detailed description point 2 (if needed) |
| 89 | +- detailed description point 3 (if needed) |
85 | 90 |
|
86 | 91 | Types: feat, fix, docs, style, refactor, perf, test, chore |
87 | 92 | Language: %s |
88 | 93 |
|
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 |
| 94 | +RULES: |
| 95 | +- Title: Use imperative mood ("add" not "added"), keep under 50 characters |
| 96 | +- Body: At least ONE bullet point describing the changes |
| 97 | +- For large diffs: Focus on the most significant changes, group related changes |
93 | 98 | - Choose the primary type that best represents the overall change |
| 99 | +- Even with extensive changes, generate only ONE unified commit message |
94 | 100 |
|
95 | | -Example output format: |
| 101 | +REQUIRED EXAMPLES: |
96 | 102 | feat(auth): add OAuth2 integration |
97 | 103 |
|
98 | 104 | - implement Google OAuth provider |
99 | | -- update authentication flow |
| 105 | +- update user authentication flow |
| 106 | +- add integration tests |
| 107 | +
|
| 108 | +fix(api): resolve data validation issues |
| 109 | +
|
| 110 | +- fix null pointer exceptions in user data |
| 111 | +- improve input validation for API endpoints |
100 | 112 |
|
101 | | -Generate ONE commit message for this diff: |
| 113 | +Generate ONE complete commit message for this diff: |
102 | 114 | ```diff |
103 | 115 | %s |
104 | 116 | ``` |
105 | 117 |
|
106 | | -Response format: Return only the commit message, nothing else.]], |
| 118 | +Return ONLY the commit message in the exact format shown above.]], |
107 | 119 | lang or "English", |
108 | 120 | diff |
109 | 121 | ) |
|
0 commit comments