@@ -65,7 +65,22 @@ export const terminalCommandOutputSchema = z.union([
6565 } ) ,
6666] )
6767
68- export const gitCommitGuidePrompt = `
68+ const isFreebuffBuild = process . env . FREEBUFF_MODE === 'true'
69+
70+ /**
71+ * Build commit guidance for the product that owns the current binary.
72+ *
73+ * FREEBUFF_MODE is a compile-time flag for the Freebuff CLI build. Keeping the
74+ * default in this shared prompt preserves Codebuff's existing attribution
75+ * while Freebuff binaries no longer ask models to claim Codebuff commits.
76+ */
77+ export const getGitCommitGuidePrompt = (
78+ isFreebuff = isFreebuffBuild ,
79+ ) : string => {
80+ const productName = isFreebuff ? 'Freebuff' : 'Codebuff'
81+ const productDomain = isFreebuff ? 'freebuff.com' : 'codebuff.com'
82+
83+ return `
6984### Using git to commit changes
7085
7186When the user requests a new git commit, please follow these steps closely:
@@ -92,16 +107,16 @@ When the user requests a new git commit, please follow these steps closely:
92107
931084. **Create the commit, ending with this specific footer:**
94109 \`\`\`
95- Generated with Codebuff 🤖
96- Co-Authored-By: Codebuff <noreply@codebuff.com >
110+ Generated with ${ productName } 🤖
111+ Co-Authored-By: ${ productName } <noreply@${ productDomain } >
97112 \`\`\`
98113 Commands run in bash on every OS (Git Bash on Windows), so always use HEREDOC syntax to format the message:
99114 \`\`\`
100115 git commit -m "$(cat <<'EOF'
101116 Your commit message here.
102117
103- 🤖 Generated with Codebuff
104- Co-Authored-By: Codebuff <noreply@codebuff.com >
118+ 🤖 Generated with ${ productName }
119+ Co-Authored-By: ${ productName } <noreply@${ productDomain } >
105120 EOF
106121 )"
107122 \`\`\`
@@ -115,6 +130,11 @@ When the user requests a new git commit, please follow these steps closely:
115130- Do not create an empty commit if there are no changes.
116131- Make sure your commit message is concise yet descriptive, focusing on the intention behind the changes rather than merely describing them.
117132`
133+ }
134+
135+ export const gitCommitGuidePrompt = getGitCommitGuidePrompt ( )
136+ const commitProductName = isFreebuffBuild ? 'Freebuff' : 'Codebuff'
137+ const commitProductDomain = isFreebuffBuild ? 'freebuff.com' : 'codebuff.com'
118138
119139const toolName = 'run_terminal_command'
120140const endsAgentStep = true
@@ -195,8 +215,8 @@ ${$getNativeToolCallExampleString({
195215 input : {
196216 command : `git commit -m "Your commit message here.
197217
198- 🤖 Generated with Codebuff
199- Co-Authored-By: Codebuff <noreply@codebuff.com >"` ,
218+ 🤖 Generated with ${ commitProductName }
219+ Co-Authored-By: ${ commitProductName } <noreply@${ commitProductDomain } >"` ,
200220 } ,
201221 endsAgentStep,
202222} ) }
0 commit comments