add Address Reviews mode
This commit is contained in:
@@ -74,6 +74,31 @@ await mcp.call("gh_pullfrog/list_pull_request_reviews", {
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### `reply_to_review_comment`
|
||||||
|
reply to a PR review comment thread explaining how the feedback was addressed.
|
||||||
|
|
||||||
|
**parameters:**
|
||||||
|
- `pull_number` (number): the pull request number
|
||||||
|
- `comment_id` (number): the ID of the review comment to reply to
|
||||||
|
- `body` (string): the reply text explaining how the feedback was addressed
|
||||||
|
|
||||||
|
**replaces:** `gh api repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies`
|
||||||
|
|
||||||
|
**returns:**
|
||||||
|
the created reply comment including:
|
||||||
|
- comment id, body, html_url
|
||||||
|
- in_reply_to_id showing it's a reply to the specified comment
|
||||||
|
|
||||||
|
**example:**
|
||||||
|
```typescript
|
||||||
|
// after addressing a review comment
|
||||||
|
await mcp.call("gh_pullfrog/reply_to_review_comment", {
|
||||||
|
pull_number: 47,
|
||||||
|
comment_id: 2567334961,
|
||||||
|
body: "removed the function as requested"
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### other tools
|
### other tools
|
||||||
|
|
||||||
see individual files for documentation on other tools:
|
see individual files for documentation on other tools:
|
||||||
|
|||||||
@@ -168,3 +168,35 @@ export const UpdateWorkingCommentTool = tool({
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const ReplyToReviewComment = type({
|
||||||
|
pull_number: type.number.describe("the pull request number"),
|
||||||
|
comment_id: type.number.describe("the ID of the review comment to reply to"),
|
||||||
|
body: type.string.describe("the reply text explaining how the feedback was addressed"),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const ReplyToReviewCommentTool = tool({
|
||||||
|
name: "reply_to_review_comment",
|
||||||
|
description:
|
||||||
|
"Reply to a PR review comment thread explaining how the feedback was addressed. Use this after addressing each review comment to provide specific context about the changes made.",
|
||||||
|
parameters: ReplyToReviewComment,
|
||||||
|
execute: contextualize(async ({ pull_number, comment_id, body }, ctx) => {
|
||||||
|
const bodyWithFooter = addFooter(body, ctx.payload);
|
||||||
|
|
||||||
|
const result = await ctx.octokit.rest.pulls.createReplyForReviewComment({
|
||||||
|
owner: ctx.owner,
|
||||||
|
repo: ctx.name,
|
||||||
|
pull_number,
|
||||||
|
comment_id,
|
||||||
|
body: bodyWithFooter,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
success: true,
|
||||||
|
commentId: result.data.id,
|
||||||
|
url: result.data.html_url,
|
||||||
|
body: result.data.body,
|
||||||
|
in_reply_to_id: result.data.in_reply_to_id,
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
CreateCommentTool,
|
CreateCommentTool,
|
||||||
CreateWorkingCommentTool,
|
CreateWorkingCommentTool,
|
||||||
EditCommentTool,
|
EditCommentTool,
|
||||||
|
ReplyToReviewCommentTool,
|
||||||
UpdateWorkingCommentTool,
|
UpdateWorkingCommentTool,
|
||||||
} from "./comment.ts";
|
} from "./comment.ts";
|
||||||
import { DebugShellCommandTool } from "./debug.ts";
|
import { DebugShellCommandTool } from "./debug.ts";
|
||||||
@@ -66,6 +67,7 @@ export async function startMcpHttpServer(): Promise<{ url: string; close: () =>
|
|||||||
EditCommentTool,
|
EditCommentTool,
|
||||||
CreateWorkingCommentTool,
|
CreateWorkingCommentTool,
|
||||||
UpdateWorkingCommentTool,
|
UpdateWorkingCommentTool,
|
||||||
|
ReplyToReviewCommentTool,
|
||||||
IssueTool,
|
IssueTool,
|
||||||
IssueInfoTool,
|
IssueInfoTool,
|
||||||
GetIssueCommentsTool,
|
GetIssueCommentsTool,
|
||||||
|
|||||||
@@ -33,6 +33,32 @@ export const modes: Mode[] = [
|
|||||||
9. When you are done, create a final commit. If relevant, indicate which issue the PR addresses somewhere in the commit message (e.g. "Fixes #123"). Create a PR with an informative title and body. If relevant, include links to the issue or comment that triggered the PR.
|
9. When you are done, create a final commit. If relevant, indicate which issue the PR addresses somewhere in the commit message (e.g. "Fixes #123"). Create a PR with an informative title and body. If relevant, include links to the issue or comment that triggered the PR.
|
||||||
|
|
||||||
10. Update the Working Comment one final time with a summary of the results. Include links to any created issues/PRs, e.g. \`[View PR](https://github.com/org/repo/pull/123)\`
|
10. Update the Working Comment one final time with a summary of the results. Include links to any created issues/PRs, e.g. \`[View PR](https://github.com/org/repo/pull/123)\`
|
||||||
|
`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Address Reviews",
|
||||||
|
description:
|
||||||
|
"Address PR review feedback; respond to reviewer comments; make requested changes to an existing PR",
|
||||||
|
prompt: `Follow these steps:
|
||||||
|
1. ${initialCommentInstruction}
|
||||||
|
|
||||||
|
2. Get PR info with ${ghPullfrogMcpName}/get_pull_request (this automatically fetches and checks out the PR branch)
|
||||||
|
|
||||||
|
3. Review the feedback provided. Understand each review comment and what changes are being requested.
|
||||||
|
|
||||||
|
4. If the request requires understanding the codebase structure, dependencies, or conventions, gather relevant context. Read AGENTS.md if it exists.
|
||||||
|
|
||||||
|
5. Make the necessary code changes to address the feedback. Work through each review comment systematically.
|
||||||
|
|
||||||
|
6. After addressing each review comment, use ${ghPullfrogMcpName}/reply_to_review_comment to reply directly to that comment thread explaining what change was made (keep replies concise, 1-2 sentences).
|
||||||
|
|
||||||
|
7. Test your changes to ensure they work correctly.
|
||||||
|
|
||||||
|
8. Update your working comment using ${ghPullfrogMcpName}/update_working_comment to share overall progress.
|
||||||
|
|
||||||
|
9. When done, commit and push your changes to the existing PR branch. Do not create a new branch or PR - you are updating an existing one.
|
||||||
|
|
||||||
|
10. Update the Working Comment one final time with a summary of all changes made.
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user