code-agent-auto-commit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/core/ai.js +11 -5
  2. package/package.json +1 -1
package/dist/core/ai.js CHANGED
@@ -92,15 +92,21 @@ function splitModelRef(modelRef, defaultProvider) {
92
92
  }
93
93
  function buildUserPrompt(summary, maxLength) {
94
94
  return [
95
- `Generate a short commit message in format "<type>: <subject>" (<= ${maxLength} chars).`,
96
- "Allowed types: feat, fix, refector.",
95
+ `Generate a concise commit message (<= ${maxLength} chars) in Conventional Commits format: "<type>(<scope>): <description>".`,
96
+ "Rules:",
97
+ "- type: feat | fix | refactor | docs | style | test | chore | perf | ci | build",
98
+ "- scope: optional, the module or file area affected (e.g. cli, ai, config)",
99
+ "- description: imperative mood, lowercase, no period, explain WHAT and WHY briefly",
100
+ "- Do NOT just say 'update <filename>' — describe the actual change",
101
+ "- Output exactly one line, no quotes, no code block",
102
+ "",
97
103
  "Changed files:",
98
104
  summary.nameStatus || "(none)",
99
105
  "Diff stat:",
100
106
  summary.diffStat || "(none)",
101
107
  "Patch excerpt:",
102
108
  summary.patch || "(none)",
103
- ].join("\n\n");
109
+ ].join("\n");
104
110
  }
105
111
  async function generateOpenAiStyleMessage(provider, model, summary, maxLength, signal) {
106
112
  const apiKey = getApiKey(provider);
@@ -120,7 +126,7 @@ async function generateOpenAiStyleMessage(provider, model, summary, maxLength, s
120
126
  messages: [
121
127
  {
122
128
  role: "system",
123
- content: "You generate exactly one commit message line in format '<type>: <subject>'. Type must be one of feat, fix, refector. No quotes. No code block.",
129
+ content: "You generate exactly one conventional commit message. Format: '<type>(<scope>): <description>'. Scope is optional. Allowed types: feat, fix, refactor, docs, style, test, chore, perf, ci, build. Description must be imperative, lowercase, no period. Describe the actual change, not just 'update <file>'. No quotes. No code block.",
124
130
  },
125
131
  {
126
132
  role: "user",
@@ -154,7 +160,7 @@ async function generateAnthropicStyleMessage(provider, model, summary, maxLength
154
160
  model,
155
161
  max_tokens: 120,
156
162
  temperature: 0.2,
157
- system: "Generate exactly one commit message line in format '<type>: <subject>'. Type must be feat, fix, or refector.",
163
+ system: "Generate exactly one conventional commit message. Format: '<type>(<scope>): <description>'. Scope is optional. Allowed types: feat, fix, refactor, docs, style, test, chore, perf, ci, build. Description must be imperative, lowercase, no period. Describe the actual change, not just 'update <file>'. No quotes. No code block.",
158
164
  messages: [
159
165
  {
160
166
  role: "user",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "code-agent-auto-commit",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "CAC provides configurable AI auto-commit(using your git account) for OpenCode, Claude Code, Codex, and other AI code agents",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",