MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getPromptContent

Function getPromptContent

source code/commands/commit-push-pr.ts:28–108  ·  view source on GitHub ↗
(
  defaultBranch: string,
  prAttribution?: string,
)

Source from the content-addressed store, hash-verified

26]
27
28function getPromptContent(
29 defaultBranch: string,
30 prAttribution?: string,
31): string {
32 const { commit: commitAttribution, pr: defaultPrAttribution } =
33 getAttributionTexts()
34 // Use provided PR attribution or fall back to default
35 const effectivePrAttribution = prAttribution ?? defaultPrAttribution
36 const safeUser = process.env.SAFEUSER || ''
37 const username = process.env.USER || ''
38
39 let prefix = ''
40 let reviewerArg = ' and `--reviewer anthropics/claude-code`'
41 let addReviewerArg = ' (and add `--add-reviewer anthropics/claude-code`)'
42 let changelogSection = `
43
44## Changelog
45<!-- CHANGELOG:START -->
46[If this PR contains user-facing changes, add a changelog entry here. Otherwise, remove this section.]
47<!-- CHANGELOG:END -->`
48 let slackStep = `
49
505. After creating/updating the PR, check if the user's CLAUDE.md mentions posting to Slack channels. If it does, use ToolSearch to search for "slack send message" tools. If ToolSearch finds a Slack tool, ask the user if they'd like you to post the PR URL to the relevant Slack channel. Only post if the user confirms. If ToolSearch returns no results or errors, skip this step silently—do not mention the failure, do not attempt workarounds, and do not try alternative approaches.`
51 if (process.env.USER_TYPE === 'ant' && isUndercover()) {
52 prefix = getUndercoverInstructions() + '\n'
53 reviewerArg = ''
54 addReviewerArg = ''
55 changelogSection = ''
56 slackStep = ''
57 }
58
59 return `${prefix}## Context
60
61- \`SAFEUSER\`: ${safeUser}
62- \`whoami\`: ${username}
63- \`git status\`: !\`git status\`
64- \`git diff HEAD\`: !\`git diff HEAD\`
65- \`git branch --show-current\`: !\`git branch --show-current\`
66- \`git diff ${defaultBranch}...HEAD\`: !\`git diff ${defaultBranch}...HEAD\`
67- \`gh pr view --json number 2>/dev/null || true\`: !\`gh pr view --json number 2>/dev/null || true\`
68
69## Git Safety Protocol
70
71- NEVER update the git config
72- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
73- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
74- NEVER run force push to main/master, warn the user if they request it
75- Do not commit files that likely contain secrets (.env, credentials.json, etc)
76- Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported
77
78## Your task
79
80Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request from the git diff ${defaultBranch}...HEAD output above).
81
82Based on the above changes:
831. Create a new branch if on ${defaultBranch} (use SAFEUSER from context above for the branch name prefix, falling back to whoami if SAFEUSER is empty, e.g., \`username/feature-name\`)
842. Create a single commit with an appropriate message using heredoc syntax${commitAttribution ? `, ending with the attribution text shown in the example below` : ''}:
85\`\`\`

Callers 2

contentLengthFunction · 0.70
getPromptForCommandFunction · 0.70

Calls 3

getAttributionTextsFunction · 0.85
isUndercoverFunction · 0.85

Tested by

no test coverage detected