Skip to content

Commit 1acbd45

Browse files
refactor: update issue-fixer mode to use GitHub CLI instead of MCP (RooCodeInc#5320)
1 parent a1ae29c commit 1acbd45

File tree

7 files changed

+319
-250
lines changed

7 files changed

+319
-250
lines changed

.roo/rules-issue-fixer/1_Workflow.xml

Lines changed: 72 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,41 @@
11
<workflow>
22
<step number="1">
3-
<name>Determine Workflow Type and Retrieve Context</name>
3+
<name>Retrieve Issue Context</name>
44
<instructions>
5-
First, determine what type of work is needed. The user will provide either:
6-
- An issue number/URL (e.g., "#123" or GitHub issue URL) - for new implementation
7-
- A PR number/URL (e.g., "#456" or GitHub PR URL) - for addressing review feedback
8-
- A description of changes needed for an existing PR
9-
10-
For Issue-based workflow:
11-
Extract the issue number and retrieve it:
12-
13-
<use_mcp_tool>
14-
<server_name>github</server_name>
15-
<tool_name>get_issue</tool_name>
16-
<arguments>
17-
{
18-
"owner": "RooCodeInc",
19-
"repo": "Roo-Code",
20-
"issue_number": [extracted number]
21-
}
22-
</arguments>
23-
</use_mcp_tool>
24-
25-
For PR Review workflow:
26-
Extract the PR number and retrieve it:
27-
28-
<use_mcp_tool>
29-
<server_name>github</server_name>
30-
<tool_name>get_pull_request</tool_name>
31-
<arguments>
32-
{
33-
"owner": "RooCodeInc",
34-
"repo": "Roo-Code",
35-
"pull_number": [extracted number]
36-
}
37-
</arguments>
38-
</use_mcp_tool>
39-
40-
Then get PR review comments:
41-
42-
<use_mcp_tool>
43-
<server_name>github</server_name>
44-
<tool_name>get_pull_request_reviews</tool_name>
45-
<arguments>
46-
{
47-
"owner": "RooCodeInc",
48-
"repo": "Roo-Code",
49-
"pull_number": [extracted number]
50-
}
51-
</arguments>
52-
</use_mcp_tool>
53-
54-
Analyze the context to determine:
55-
1. Type of work (new issue implementation vs PR feedback)
56-
2. All requirements and acceptance criteria
57-
3. Specific changes requested (for PR reviews)
58-
4. Technical details mentioned
59-
5. Any linked issues or discussions
5+
The user should provide a full GitHub issue URL (e.g., "https://github.com/owner/repo/issues/123") for implementation.
6+
7+
Parse the URL to extract:
8+
- Owner (organization or username)
9+
- Repository name
10+
- Issue number
11+
12+
For example, from https://github.com/RooCodeInc/Roo-Code/issues/123:
13+
- Owner: RooCodeInc
14+
- Repo: Roo-Code
15+
- Issue: 123
16+
17+
Then retrieve the issue:
18+
19+
<execute_command>
20+
<command>gh issue view [issue-number] --repo [owner]/[repo] --json number,title,body,state,labels,assignees,milestone,createdAt,updatedAt,closedAt,author</command>
21+
</execute_command>
22+
23+
If the command fails with an authentication error (e.g., "gh: Not authenticated" or "HTTP 401"), ask the user to authenticate:
24+
<ask_followup_question>
25+
<question>GitHub CLI is not authenticated. Please run 'gh auth login' in your terminal to authenticate, then let me know when you're ready to continue.</question>
26+
<follow_up>
27+
<suggest>I've authenticated, please continue</suggest>
28+
<suggest>I need help with authentication</suggest>
29+
<suggest>Let's use a different approach</suggest>
30+
</follow_up>
31+
</ask_followup_question>
32+
33+
Analyze the issue to determine:
34+
1. All requirements and acceptance criteria
35+
2. Technical details mentioned
36+
3. Any linked issues or discussions
37+
38+
Note: For PR review feedback, users should use the dedicated pr-fixer mode instead.
6039
</instructions>
6140
</step>
6241

@@ -69,23 +48,20 @@
6948
- Community suggestions
7049
- Any decisions or changes to requirements
7150

72-
<use_mcp_tool>
73-
<server_name>github</server_name>
74-
<tool_name>get_issue_comments</tool_name>
75-
<arguments>
76-
{
77-
"owner": "RooCodeInc",
78-
"repo": "Roo-Code",
79-
"issue_number": [issue number]
80-
}
81-
</arguments>
82-
</use_mcp_tool>
51+
<execute_command>
52+
<command>gh issue view [issue number] --repo [owner]/[repo] --comments</command>
53+
</execute_command>
8354

8455
Also check for:
8556
1. Related issues mentioned in the body or comments
8657
2. Linked pull requests
8758
3. Referenced discussions
8859

60+
If related PRs are mentioned, view them:
61+
<execute_command>
62+
<command>gh pr view [pr-number] --repo [owner]/[repo]</command>
63+
</execute_command>
64+
8965
Document all requirements and constraints found.
9066
</instructions>
9167
</step>
@@ -109,16 +85,9 @@
10985
- Identify patterns to follow
11086
- Find related components and utilities
11187

112-
For PR Reviews:
113-
- Search for files mentioned in review comments
114-
- Find related files that use similar patterns
115-
- Locate test files for modified functionality
116-
- Identify files that import/depend on changed code
117-
11888
Example searches based on issue type:
11989
- Bug: Search for error messages, function names, component names
12090
- Feature: Search for similar functionality, API endpoints, UI components
121-
- PR Review: Search for patterns mentioned in feedback
12291

12392
CRITICAL: Always read multiple related files together to understand:
12493
- Current code patterns and conventions
@@ -133,10 +102,15 @@
133102
- read_file to examine specific implementations (read multiple files at once)
134103
- search_files for specific patterns or error messages
135104

136-
Also use GitHub tools:
137-
- list_commits to see recent changes to affected files
138-
- get_commit to understand specific changes
139-
- list_pull_requests to find related PRs
105+
Also use GitHub CLI to check recent changes:
106+
<execute_command>
107+
<command>gh api repos/[owner]/[repo]/commits?path=[file-path]&per_page=10 --jq '.[].sha + " " + .[].commit.message'</command>
108+
</execute_command>
109+
110+
Search for related PRs:
111+
<execute_command>
112+
<command>gh pr list --repo [owner]/[repo] --search "[relevant search terms]" --limit 10</command>
113+
</execute_command>
140114

141115
Document:
142116
- All files that need modification
@@ -464,13 +438,13 @@
464438

465439
**Branch:** [branch-name]
466440
**Title:** [PR title]
467-
**Target:** RooCodeInc/Roo-Code (main branch)
441+
**Target:** [owner]/[repo] (main branch)
468442

469443
Here's the PR description:
470444

471445
[Show prepared PR description]
472446

473-
Would you like me to create this pull request to RooCodeInc/Roo-Code?</question>
447+
Would you like me to create this pull request to [owner]/[repo]?</question>
474448
<follow_up>
475449
<suggest>Yes, create the pull request</suggest>
476450
<suggest>Let me review the PR description first</suggest>
@@ -484,46 +458,28 @@
484458
<step number="11">
485459
<name>Create Pull Request</name>
486460
<instructions>
487-
Once user approves, create the pull request using GitHub MCP:
488-
489-
<use_mcp_tool>
490-
<server_name>github</server_name>
491-
<tool_name>create_pull_request</tool_name>
492-
<arguments>
493-
{
494-
"owner": "RooCodeInc",
495-
"repo": "Roo-Code",
496-
"title": "[Type]: [Brief description] (#[issue-number])",
497-
"head": "[user-fork-owner]:[branch-name]",
498-
"base": "main",
499-
"body": "[Complete PR description from step 9]",
500-
"draft": false,
501-
"maintainer_can_modify": true
502-
}
503-
</arguments>
504-
</use_mcp_tool>
505-
506-
Note: The "head" parameter format depends on where the branch exists:
507-
- If user has push access: "branch-name"
508-
- If working from a fork: "username:branch-name"
461+
Once user approves, create the pull request using GitHub CLI:
462+
463+
If the user doesn't have push access to [owner]/[repo], fork the repository:
464+
<execute_command>
465+
<command>gh repo fork [owner]/[repo] --clone</command>
466+
</execute_command>
467+
468+
Create the pull request:
469+
<execute_command>
470+
<command>gh pr create --repo [owner]/[repo] --base main --title "[Type]: [Brief description] (#[issue-number])" --body "[Complete PR description from step 10]" --maintainer-can-modify</command>
471+
</execute_command>
472+
473+
The gh CLI will automatically handle the fork workflow if needed.
509474

510475
After PR creation:
511-
1. Capture the PR number and URL from the response
476+
1. Capture the PR number and URL from the command output
512477
2. Link the PR to the issue by commenting on the issue
513478
3. Inform the user of the successful creation
514479

515-
<use_mcp_tool>
516-
<server_name>github</server_name>
517-
<tool_name>add_issue_comment</tool_name>
518-
<arguments>
519-
{
520-
"owner": "RooCodeInc",
521-
"repo": "Roo-Code",
522-
"issue_number": [original issue number],
523-
"body": "PR #[new PR number] has been created to address this issue: [PR URL]"
524-
}
525-
</arguments>
526-
</use_mcp_tool>
480+
<execute_command>
481+
<command>gh issue comment [original issue number] --repo [owner]/[repo] --body "PR #[new PR number] has been created to address this issue: [PR URL]"</command>
482+
</execute_command>
527483

528484
Final message to user:
529485
```
@@ -550,7 +506,7 @@
550506
After the PR is created, monitor the CI/CD checks to ensure they pass:
551507

552508
<execute_command>
553-
<command>gh pr checks --watch</command>
509+
<command>gh pr checks [PR number] --repo [owner]/[repo] --watch</command>
554510
</execute_command>
555511

556512
This command will:

0 commit comments

Comments
 (0)