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

Function getPromptContent

source code/commands/commit.ts:14–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12]
13
14function getPromptContent(): string {
15 const { commit: commitAttribution } = getAttributionTexts()
16
17 let prefix = ''
18 if (process.env.USER_TYPE === 'ant' && isUndercover()) {
19 prefix = getUndercoverInstructions() + '\n'
20 }
21
22 return `${prefix}## Context
23
24- Current git status: !\`git status\`
25- Current git diff (staged and unstaged changes): !\`git diff HEAD\`
26- Current branch: !\`git branch --show-current\`
27- Recent commits: !\`git log --oneline -10\`
28
29## Git Safety Protocol
30
31- NEVER update the git config
32- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
33- CRITICAL: ALWAYS create NEW commits. NEVER use git commit --amend, unless the user explicitly requests it
34- Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files
35- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
36- 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
37
38## Your task
39
40Based on the above changes, create a single git commit:
41
421. Analyze all staged changes and draft a commit message:
43 - Look at the recent commits above to follow this repository's commit message style
44 - Summarize the nature of the changes (new feature, enhancement, bug fix, refactoring, test, docs, etc.)
45 - Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.)
46 - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
47
482. Stage relevant files and create the commit using HEREDOC syntax:
49\`\`\`
50git commit -m "$(cat <<'EOF'
51Commit message here.${commitAttribution ? `\n\n${commitAttribution}` : ''}
52EOF
53)"
54\`\`\`
55
56You have the capability to call multiple tools in a single response. Stage and create the commit using a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.`
57}
58
59const command = {
60 type: 'prompt',

Callers 1

getPromptForCommandFunction · 0.70

Calls 3

getAttributionTextsFunction · 0.85
isUndercoverFunction · 0.85

Tested by

no test coverage detected