Skip to content

Commit 2404339

Browse files
committed
Give example of commit message terminal command
1 parent 123978c commit 2404339

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

backend/src/system-prompt/prompts.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { STOP_MARKER } from '@codebuff/common/constants'
2-
import {
3-
flattenTree,
4-
getLastReadFilePaths,
5-
} from '@codebuff/common/project-file-tree'
62
import {
73
codebuffConfigFile,
84
CodebuffConfigSchema,
95
} from '@codebuff/common/json-config/constants'
106
import { stringifySchema } from '@codebuff/common/json-config/stringify-schema'
7+
import {
8+
flattenTree,
9+
getLastReadFilePaths,
10+
} from '@codebuff/common/project-file-tree'
1111
import {
1212
createMarkdownFileBlock,
1313
ProjectFileContext,
1414
} from '@codebuff/common/util/file'
1515
import { truncateString } from '@codebuff/common/util/string'
1616

17-
import { truncateFileTreeBasedOnTokenBudget } from './truncate-file-tree'
1817
import { closeXml } from '@codebuff/common/util/xml'
18+
import { truncateFileTreeBasedOnTokenBudget } from './truncate-file-tree'
1919

2020
export const configSchemaPrompt = `
2121
# Codebuff Configuration (${codebuffConfigFile})
@@ -257,7 +257,7 @@ When the user requests a new git commit, please follow these steps closely:
257257
258258
1. **Run two run_terminal_command tool calls:**
259259
- Run \`git diff\` to review both staged and unstaged modifications.
260-
- Run \`git log\` to check recent commit messages, ensuring consistency with this repositorys style.
260+
- Run \`git log\` to check recent commit messages, ensuring consistency with this repository's style.
261261
262262
2. **Select relevant files to include in the commit:**
263263
Use the git context established at the start of this conversation to decide which files are pertinent to the changes. Stage any new untracked files that are relevant, but avoid committing previously modified files (from the beginning of the conversation) unless they directly relate to this commit.

backend/src/tools/definitions/tool/run-terminal-command.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,19 @@ ${getToolCallString(
7777
},
7878
endsAgentStep
7979
)}
80+
81+
${getToolCallString(
82+
toolName,
83+
{
84+
command: `git commit -m "$(cat <<'EOF'
85+
Your commit message here.
86+
87+
🤖 Generated with Codebuff
88+
Co-Authored-By: Codebuff <noreply@codebuff.com>
89+
EOF
90+
)"`,
91+
},
92+
endsAgentStep
93+
)}
8094
`.trim(),
8195
} satisfies CodebuffToolDef

0 commit comments

Comments
 (0)