|
1 | 1 | <workflow> |
2 | 2 | <step number="1"> |
3 | | - <name>Determine Workflow Type and Retrieve Context</name> |
| 3 | + <name>Retrieve Issue Context</name> |
4 | 4 | <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. |
60 | 39 | </instructions> |
61 | 40 | </step> |
62 | 41 |
|
|
69 | 48 | - Community suggestions |
70 | 49 | - Any decisions or changes to requirements |
71 | 50 |
|
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> |
83 | 54 |
|
84 | 55 | Also check for: |
85 | 56 | 1. Related issues mentioned in the body or comments |
86 | 57 | 2. Linked pull requests |
87 | 58 | 3. Referenced discussions |
88 | 59 |
|
| 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 | + |
89 | 65 | Document all requirements and constraints found. |
90 | 66 | </instructions> |
91 | 67 | </step> |
|
109 | 85 | - Identify patterns to follow |
110 | 86 | - Find related components and utilities |
111 | 87 |
|
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 | | - |
118 | 88 | Example searches based on issue type: |
119 | 89 | - Bug: Search for error messages, function names, component names |
120 | 90 | - Feature: Search for similar functionality, API endpoints, UI components |
121 | | - - PR Review: Search for patterns mentioned in feedback |
122 | 91 |
|
123 | 92 | CRITICAL: Always read multiple related files together to understand: |
124 | 93 | - Current code patterns and conventions |
|
133 | 102 | - read_file to examine specific implementations (read multiple files at once) |
134 | 103 | - search_files for specific patterns or error messages |
135 | 104 |
|
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> |
140 | 114 |
|
141 | 115 | Document: |
142 | 116 | - All files that need modification |
|
464 | 438 |
|
465 | 439 | **Branch:** [branch-name] |
466 | 440 | **Title:** [PR title] |
467 | | - **Target:** RooCodeInc/Roo-Code (main branch) |
| 441 | + **Target:** [owner]/[repo] (main branch) |
468 | 442 |
|
469 | 443 | Here's the PR description: |
470 | 444 |
|
471 | 445 | [Show prepared PR description] |
472 | 446 |
|
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> |
474 | 448 | <follow_up> |
475 | 449 | <suggest>Yes, create the pull request</suggest> |
476 | 450 | <suggest>Let me review the PR description first</suggest> |
|
484 | 458 | <step number="11"> |
485 | 459 | <name>Create Pull Request</name> |
486 | 460 | <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. |
509 | 474 |
|
510 | 475 | 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 |
512 | 477 | 2. Link the PR to the issue by commenting on the issue |
513 | 478 | 3. Inform the user of the successful creation |
514 | 479 |
|
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> |
527 | 483 |
|
528 | 484 | Final message to user: |
529 | 485 | ``` |
|
550 | 506 | After the PR is created, monitor the CI/CD checks to ensure they pass: |
551 | 507 |
|
552 | 508 | <execute_command> |
553 | | - <command>gh pr checks --watch</command> |
| 509 | + <command>gh pr checks [PR number] --repo [owner]/[repo] --watch</command> |
554 | 510 | </execute_command> |
555 | 511 |
|
556 | 512 | This command will: |
|
0 commit comments