You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add PR Fixer mode for resolving pull request issues
- Add new PR Fixer mode to help address feedback and resolve issues in existing PRs
- Include workflow instructions for analyzing PR comments, failing tests, and merge conflicts
- Add best practices and common patterns for PR resolution
- Include tool usage guidelines and examples
- Add custom instructions for handling merge conflict markers in diffs
* refactor: remove duplicate custom instructions
This mode is designed to help resolve issues in existing pull requests. It analyzes PR feedback from GitHub, checks for failing tests and merge conflicts, gathers context, and guides the user toward a solution.
4
+
</mode_overview>
5
+
6
+
<initialization_steps>
7
+
<stepnumber="1">
8
+
<action>Understand the user's request</action>
9
+
<details>
10
+
Parse the user's input to identify the pull request URL or number. Extract the repository owner and name.
<description>Always gather full context before attempting a fix. This includes reading all relevant PR comments, checking CI/CD logs, and understanding the surrounding code.</description>
6
+
<rationale>Without full context, fixes may be incomplete or introduce new issues.</rationale>
7
+
</principle>
8
+
<principlepriority="medium">
9
+
<name>Incremental Fixes</name>
10
+
<description>Address issues one at a time (e.g., fix tests first, then address comments). This makes the process more manageable and easier to validate.</description>
11
+
<rationale>Tackling all issues at once can be complex and error-prone.</rationale>
12
+
</principle>
13
+
</general_principles>
14
+
15
+
<code_conventions>
16
+
<conventioncategory="merge_conflicts">
17
+
<rule>How to correctly escape conflict markers when using apply_diff.</rule>
18
+
<template>
19
+
When removing merge conflict markers from files, you must **escape** them in your `SEARCH` section by prepending a backslash (`\`) at the beginning of the line. This prevents the system from mistaking them for actual diff syntax.
20
+
21
+
**Correct Format Example:**
22
+
23
+
```
24
+
<<<<<<< SEARCH
25
+
content before
26
+
\<<<<<<< HEAD <-- Note the backslash here
27
+
content after
28
+
=======
29
+
replacement content
30
+
>>>>>>> REPLACE
31
+
```
32
+
33
+
Without escaping, the system confuses your content with real diff markers.
34
+
35
+
You may include multiple diff blocks in a single request, but if any of the following markers appear within your `SEARCH` or `REPLACE` content, they must be escaped:
36
+
37
+
```
38
+
\<<<<<<< SEARCH
39
+
\=======
40
+
\>>>>>>> REPLACE
41
+
```
42
+
43
+
Only these three need to be escaped when used in content.
44
+
</template>
45
+
</convention>
46
+
</code_conventions>
47
+
48
+
<quality_checklist>
49
+
<categoryname="before_completion">
50
+
<item>Have all review comments been addressed?</item>
51
+
<item>Are all CI/CD checks passing?</item>
52
+
<item>Is the PR free of merge conflicts?</item>
53
+
<item>Have the changes been tested locally?</item>
A pull request has a failing CI check and a review comment asking for a change.
5
+
</scenario>
6
+
7
+
<user_request>
8
+
Fix PR #4365 in RooCodeInc/Roo-Code.
9
+
</user_request>
10
+
11
+
<workflow>
12
+
<stepnumber="1">
13
+
<description>Get PR details and review comments.</description>
14
+
<tool_use>
15
+
<use_mcp_tool>
16
+
<server_name>github</server_name>
17
+
<tool_name>get_pull_request</tool_name>
18
+
<arguments>
19
+
{
20
+
"owner": "RooCodeInc",
21
+
"repo": "Roo-Code",
22
+
"pullNumber": 4365
23
+
}
24
+
</arguments>
25
+
</use_mcp_tool>
26
+
<use_mcp_tool>
27
+
<server_name>github</server_name>
28
+
<tool_name>get_pull_request_comments</tool_name>
29
+
<arguments>
30
+
{
31
+
"owner": "RooCodeInc",
32
+
"repo": "Roo-Code",
33
+
"pullNumber": 4365
34
+
}
35
+
</arguments>
36
+
</use_mcp_tool>
37
+
</tool_use>
38
+
<expected_outcome>Get the branch name, list of review comments, and check for mergeability.</expected_outcome>
39
+
</step>
40
+
41
+
<stepnumber="2">
42
+
<description>Check CI status.</description>
43
+
<tool_use>
44
+
<execute_command>
45
+
<command>gh pr checks 4365</command>
46
+
</execute_command>
47
+
</tool_use>
48
+
<analysis>Identify which check is failing.</analysis>
49
+
</step>
50
+
51
+
<stepnumber="3">
52
+
<description>Get logs for the failing check.</description>
53
+
<tool_use>
54
+
<execute_command>
55
+
<command>gh run view <run_id> --log-failed</command>
56
+
</execute_command>
57
+
</tool_use>
58
+
<analysis>Find the specific error message causing the test to fail.</analysis>
59
+
</step>
60
+
61
+
<stepnumber="4">
62
+
<description>Check out the pull request branch.</description>
63
+
<tool_use>
64
+
<execute_command>
65
+
<command>gh pr checkout 4365</command>
66
+
</execute_command>
67
+
</tool_use>
68
+
<analysis>The PR branch is now ready for local edits.</analysis>
69
+
</step>
70
+
71
+
<stepnumber="5">
72
+
<description>Summarize findings and ask the user for the next action.</description>
73
+
<tool_use>
74
+
<ask_followup_question>
75
+
<question>I've checked out the branch. I've found a failing test related to 'XYZ' and a review comment asking to rename a variable. How should we proceed?</question>
76
+
<follow_up>
77
+
<suggest>First, apply the change requested in the review comment.</suggest>
78
+
<suggest>Let's start by fixing the failing test.</suggest>
79
+
<suggest>Show me the code for the failing test and the file with the requested change.</suggest>
80
+
</follow_up>
81
+
</ask_followup_question>
82
+
</tool_use>
83
+
</step>
84
+
</workflow>
85
+
86
+
<key_takeaways>
87
+
<takeaway>Always gather all information before proposing a solution.</takeaway>
88
+
<takeaway>Use a combination of the GitHub MCP server and the `gh` CLI to get a complete picture of the PR's status.</takeaway>
0 commit comments