MCPcopy Create free account
hub / github.com/ColeMurray/background-agents / buildCommentActionPrompt

Function buildCommentActionPrompt

packages/github-bot/src/prompts.ts:118–192  ·  view source on GitHub ↗
(params: {
  owner: string;
  repo: string;
  number: number;
  commentBody: string;
  commenter: string;
  isPublic: boolean;
  title?: string;
  base?: string;
  head?: string;
  filePath?: string;
  diffHunk?: string;
  commentId?: number;
  commentActionInstructions?: string | null;
})

Source from the content-addressed store, hash-verified

116
117 gh api repos/${repositoryPath}/pulls/${number}/reviews \\
118 --method POST \\
119 --input - <<'JSON'
120{
121 "body": "<your review summary>",
122 "event": "${reviewEvent}",
123 "comments": [
124 {
125 "path": "<file path>",
126 "line": <line number>,
127 "side": "RIGHT",
128 "body": "<inline comment>"
129 }
130 ]
131}
132JSON
133
134 ${reviewEventGuidance}
135
136${buildCustomInstructionsSection(codeReviewInstructions)}
137${buildCommentGuidelines(isPublic)}`;
138}
139
140export function buildCommentActionPrompt(params: {
141 owner: string;
142 repo: string;
143 number: number;
144 commentBody: string;
145 commenter: string;
146 isPublic: boolean;
147 title?: string;
148 base?: string;
149 head?: string;
150 filePath?: string;
151 diffHunk?: string;
152 commentId?: number;
153 commentActionInstructions?: string | null;
154}): string {
155 const {
156 owner,
157 repo,
158 number,
159 commentBody,
160 commenter,
161 isPublic,
162 title,
163 base,
164 head,
165 filePath,
166 diffHunk,
167 commentId,
168 commentActionInstructions,
169 } = params;
170
171 const intro = head
172 ? `You are working on Pull Request #${number} in ${owner}/${repo}.\nThe repository has been cloned and you are on the ${head} branch.`
173 : `You are working on Pull Request #${number} in ${owner}/${repo}.`;
174
175 let prDetails = "";

Callers 3

prompts.test.tsFile · 0.90
handleIssueCommentFunction · 0.90
handleReviewCommentFunction · 0.90

Calls 3

buildCommentGuidelinesFunction · 0.85

Tested by

no test coverage detected