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

Function getPromptForCommand

source code/commands/commit-push-pr.ts:121–157  ·  view source on GitHub ↗
(args, context)

Source from the content-addressed store, hash-verified

119 progressMessage: 'creating commit and PR',
120 source: 'builtin',
121 async getPromptForCommand(args, context) {
122 // Get default branch and enhanced PR attribution
123 const [defaultBranch, prAttribution] = await Promise.all([
124 getDefaultBranch(),
125 getEnhancedPRAttribution(context.getAppState),
126 ])
127 let promptContent = getPromptContent(defaultBranch, prAttribution)
128
129 // Append user instructions if args provided
130 const trimmedArgs = args?.trim()
131 if (trimmedArgs) {
132 promptContent += `\n\n## Additional instructions from user\n\n${trimmedArgs}`
133 }
134
135 const finalContent = await executeShellCommandsInPrompt(
136 promptContent,
137 {
138 ...context,
139 getAppState() {
140 const appState = context.getAppState()
141 return {
142 ...appState,
143 toolPermissionContext: {
144 ...appState.toolPermissionContext,
145 alwaysAllowRules: {
146 ...appState.toolPermissionContext.alwaysAllowRules,
147 command: ALLOWED_TOOLS,
148 },
149 },
150 }
151 },
152 },
153 '/commit-push-pr',
154 )
155
156 return [{ type: 'text', text: finalContent }]
157 },
158} satisfies Command
159
160export default command

Callers

nothing calls this directly

Calls 4

getDefaultBranchFunction · 0.85
getEnhancedPRAttributionFunction · 0.85
getPromptContentFunction · 0.70

Tested by

no test coverage detected