You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/code/src/main/services/agent/service.ts
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -418,12 +418,41 @@ export class AgentService extends TypedEventEmitter<AgentServiceEvents> {
418
418
419
419
privatebuildSystemPrompt(
420
420
credentials: Credentials,
421
+
taskId: string,
421
422
customInstructions?: string,
422
423
): {
423
424
append: string;
424
425
}{
425
426
letprompt=`PostHog context: use project ${credentials.projectId} on ${credentials.apiHost}. When using PostHog MCP tools, operate only on this project.`;
426
427
428
+
prompt+=`
429
+
430
+
## Attribution
431
+
Do NOT use Claude Code's default attribution (no "Co-Authored-By" trailers, no "Generated with [Claude Code]" lines).
432
+
433
+
Instead, add the following trailers to EVERY commit message (after a blank line at the end):
434
+
Generated-By: PostHog Code
435
+
Task-Id: ${taskId}
436
+
437
+
Example:
438
+
\`\`\`
439
+
git commit -m "$(cat <<'EOF'
440
+
fix: resolve login redirect loop
441
+
442
+
Generated-By: PostHog Code
443
+
Task-Id: ${taskId}
444
+
EOF
445
+
)"
446
+
\`\`\`
447
+
448
+
When creating new branches, prefix them with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`).
449
+
450
+
When creating pull requests, add the following footer at the end of the PR description:
451
+
\`\`\`
452
+
---
453
+
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*
Do NOT use Claude Code's default attribution (no "Co-Authored-By" trailers, no "Generated with [Claude Code]" lines).
1069
+
1070
+
Instead, add the following trailers to EVERY commit message (after a blank line at the end):
1071
+
Generated-By: PostHog Code
1072
+
Task-Id: ${taskId}
1073
+
1074
+
Example:
1075
+
\`\`\`
1076
+
git commit -m "$(cat <<'EOF'
1077
+
fix: resolve login redirect loop
1078
+
1079
+
Generated-By: PostHog Code
1080
+
Task-Id: ${taskId}
1081
+
EOF
1082
+
)"
1083
+
\`\`\``;
1084
+
1065
1085
if(prUrl){
1066
1086
return`
1067
1087
# Cloud Task Execution
@@ -1075,8 +1095,7 @@ After completing the requested changes:
1075
1095
1076
1096
Important:
1077
1097
- Do NOT create a new branch or a new pull request.
1078
-
- Do NOT add "Co-Authored-By" trailers to commit messages.
1079
-
- Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
1098
+
${attributionInstructions}
1080
1099
`;
1081
1100
}
1082
1101
@@ -1105,15 +1124,18 @@ Important:
1105
1124
# Cloud Task Execution
1106
1125
1107
1126
After completing the requested changes:
1108
-
1. Create a new branch with a descriptive name based on the work done
1127
+
1. Create a new branch prefixed with \`posthog-code/\` (e.g. \`posthog-code/fix-login-redirect\`) based on the work done
1109
1128
2. Stage and commit all changes with a clear commit message
1110
1129
3. Push the branch to origin
1111
-
4. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and body
1130
+
4. Create a draft pull request using \`gh pr create --draft${this.config.baseBranch ? ` --base ${this.config.baseBranch}` : ""}\` with a descriptive title and body. Add the following footer at the end of the PR description:
1131
+
\`\`\`
1132
+
---
1133
+
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*
1134
+
\`\`\`
1112
1135
1113
1136
Important:
1114
1137
- Always create the PR as a draft. Do not ask for confirmation.
1115
-
- Do NOT add "Co-Authored-By" trailers to commit messages.
1116
-
- Do NOT add "Generated with [Claude Code]" or similar attribution lines to PR descriptions.
0 commit comments