MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getPromptForCommand

Function getPromptForCommand

src/commands/commit-push-pr.ts:119–155  ·  view source on GitHub ↗
(args, context)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getDefaultBranchFunction · 0.85
getEnhancedPRAttributionFunction · 0.85
getPromptContentFunction · 0.70

Tested by

no test coverage detected