diff --git a/.roo/rules-merge-resolver/1_workflow.xml b/.roo/rules-merge-resolver/1_workflow.xml
new file mode 100644
index 00000000000..a63809db70e
--- /dev/null
+++ b/.roo/rules-merge-resolver/1_workflow.xml
@@ -0,0 +1,142 @@
+
+
+ This mode resolves merge conflicts for a specific pull request by analyzing git history,
+ commit messages, and code changes to make intelligent resolution decisions. It receives
+ a PR number (e.g., "#123") and handles the entire conflict resolution process.
+
+
+
+
+ Parse PR number from user input
+
+ Extract the PR number from input like "#123" or "PR #123"
+ Validate that a PR number was provided
+
+
+
+
+ Fetch PR information
+
+ gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName
+
+
+ Get PR title and description to understand the intent
+ Identify the source and target branches
+
+
+
+
+ Checkout PR branch and prepare for rebase
+
+ gh pr checkout [PR_NUMBER] --force
+ git fetch origin main
+ git rebase origin/main
+
+
+ Force checkout the PR branch to ensure clean state
+ Fetch the latest main branch
+ Attempt to rebase onto main to reveal conflicts
+
+
+
+
+ Check for merge conflicts
+
+ git status --porcelain
+ git diff --name-only --diff-filter=U
+
+
+ Identify files with merge conflicts (marked with 'UU')
+ Create a list of files that need resolution
+
+
+
+
+
+
+ Analyze each conflicted file to understand the changes
+
+ Read the conflicted file to identify conflict markers
+ Extract the conflicting sections between <<<<<<< and >>>>>>>
+ Run git blame on both sides of the conflict
+ Fetch commit messages and diffs for relevant commits
+ Analyze the intent behind each change
+
+
+
+
+ Determine the best resolution strategy for each conflict
+
+ Categorize changes by intent (bugfix, feature, refactor, etc.)
+ Evaluate recency and relevance of changes
+ Check for structural overlap vs formatting differences
+ Identify if changes can be combined or if one should override
+ Consider test updates and related changes
+
+
+
+
+ Apply the resolution strategy to resolve conflicts
+
+ For each conflict, apply the chosen resolution
+ Ensure proper escaping of conflict markers in diffs
+ Validate that resolved code is syntactically correct
+ Stage resolved files with git add
+
+
+
+
+ Verify the resolution and prepare for commit
+
+ Run git status to confirm all conflicts are resolved
+ Check for any compilation or syntax errors
+ Review the final diff to ensure sensible resolutions
+ Prepare a summary of resolution decisions
+
+
+
+
+
+
+ gh pr checkout [PR_NUMBER] --force
+ Force checkout the PR branch to ensure clean state
+
+
+
+ git fetch origin main
+ Get the latest main branch from origin
+
+
+
+ git rebase origin/main
+ Rebase current branch onto main to reveal conflicts
+
+
+
+ git blame -L [start_line],[end_line] [commit_sha] -- [file_path]
+ Get commit information for specific lines
+
+
+
+ git show --format="%H%n%an%n%ae%n%ad%n%s%n%b" --no-patch [commit_sha]
+ Get commit metadata including message
+
+
+
+ git show [commit_sha] -- [file_path]
+ Get the actual changes made in a commit
+
+
+
+ git ls-files -u
+ List unmerged files with stage information
+
+
+
+
+ All merge conflicts have been resolved
+ Resolved files have been staged
+ No syntax errors in resolved code
+ Resolution decisions are documented
+
+
\ No newline at end of file
diff --git a/.roo/rules-merge-resolver/2_best_practices.xml b/.roo/rules-merge-resolver/2_best_practices.xml
new file mode 100644
index 00000000000..5bf1b393eb2
--- /dev/null
+++ b/.roo/rules-merge-resolver/2_best_practices.xml
@@ -0,0 +1,165 @@
+
+
+
+ Intent-Based Resolution
+
+ Always prioritize understanding the intent behind changes rather than
+ just looking at the code differences. Commit messages, PR descriptions,
+ and issue references provide crucial context.
+
+
+ Code changes have purpose - bugfixes should be preserved, features
+ should be integrated properly, and refactors should maintain consistency.
+
+
+ Conflict between a bugfix and a refactor
+ Apply the bugfix logic within the refactored structure
+ Simply choose one side without considering both intents
+
+
+
+
+ Preserve All Valuable Changes
+
+ When possible, combine non-conflicting changes from both sides rather
+ than discarding one side entirely.
+
+
+ Both sides of a conflict often contain valuable changes that can coexist
+ if properly integrated.
+
+
+
+
+ Escape Conflict Markers
+
+ When using apply_diff or search_and_replace tools, always escape merge
+ conflict markers with backslashes to prevent parsing errors.
+
+
+
+
+
+ Consider Related Changes
+
+ Look beyond the immediate conflict to understand related changes in
+ tests, documentation, or dependent code.
+
+
+ A change might seem isolated but could be part of a larger feature
+ or fix that spans multiple files.
+
+
+
+
+
+
+ Bugfixes generally take precedence over features
+
+ Bugfixes address existing problems and should be preserved,
+ while features can be reintegrated around the fix.
+
+
+
+
+ More recent changes are often more relevant
+
+ Recent changes likely reflect the current understanding of
+ requirements and may supersede older implementations.
+
+
+ When older changes are bugfixes or security patches that
+ haven't been addressed in newer code.
+
+
+
+
+ Changes that include test updates are likely more complete
+
+ Developers who update tests alongside code changes demonstrate
+ thoroughness and understanding of the impact.
+
+
+
+
+ Logic changes take precedence over formatting changes
+
+ Formatting can be reapplied, but logic changes represent
+ functional improvements or fixes.
+
+
+
+
+
+
+ Blindly choosing one side without analysis
+
+ You might lose important changes or introduce regressions
+
+
+ Always analyze both sides using git blame and commit history
+
+
+
+
+ Ignoring the PR description and context
+
+ The PR description often explains the why behind changes,
+ which is crucial for proper resolution
+
+
+ Always fetch and read the PR information before resolving
+
+
+
+
+ Not validating the resolved code
+
+ Merged code might be syntactically incorrect or introduce
+ logical errors
+
+
+ Always check for syntax errors and review the final diff
+
+
+
+
+ Not escaping conflict markers in diffs
+
+ Unescaped conflict markers (<<<<<<, =======, >>>>>>) in SEARCH
+ or REPLACE sections will be interpreted as actual diff syntax,
+ causing the apply_diff tool to fail or produce incorrect results
+
+
+ Always escape conflict markers with a backslash (\) when they
+ appear in the content you're searching for or replacing.
+ Example: \<<<<<<< HEAD instead of <<<<<<< HEAD
+
+
+
+
+
+
+ - Fetch PR title and description for context
+ - Identify all files with conflicts
+ - Understand the overall change being merged
+
+
+
+ - Run git blame on conflicting sections
+ - Read commit messages for intent
+ - Consider if changes can be combined
+ - Escape conflict markers in diffs
+
+
+
+ - Verify no conflict markers remain
+ - Check for syntax/compilation errors
+ - Review the complete diff
+ - Document resolution decisions
+
+
+
\ No newline at end of file
diff --git a/.roo/rules-merge-resolver/3_tool_usage.xml b/.roo/rules-merge-resolver/3_tool_usage.xml
new file mode 100644
index 00000000000..35f3b5da759
--- /dev/null
+++ b/.roo/rules-merge-resolver/3_tool_usage.xml
@@ -0,0 +1,228 @@
+
+
+
+ execute_command
+ For all git and gh CLI operations
+ Git commands provide the historical context needed for intelligent resolution
+
+
+
+ read_file
+ To examine conflicted files and understand the conflict structure
+ Need to see the actual conflict markers and code
+
+
+
+ apply_diff or search_and_replace
+ To resolve conflicts by replacing conflicted sections
+ Precise editing of specific conflict blocks
+
+
+
+
+
+
+ Always use gh CLI for GitHub operations instead of MCP tools
+ Chain git commands with && for efficiency
+ Use --format options for structured output
+ Capture command output for parsing
+
+
+
+
+ Get PR information
+ gh pr view [PR_NUMBER] --json title,body,headRefName,baseRefName
+
+
+
+ Checkout PR branch
+ gh pr checkout [PR_NUMBER] --force
+
+
+
+ Fetch latest main branch
+ git fetch origin main
+
+
+
+ Rebase onto main to reveal conflicts
+ git rebase origin/main
+
+
+
+ Check conflict status
+ git status --porcelain | grep "^UU"
+
+
+
+ Get blame for specific lines
+ git blame -L [start],[end] HEAD -- [file] | cut -d' ' -f1
+
+
+
+ Get commit message
+ git log -1 --format="%s%n%n%b" [commit_sha]
+
+
+
+ Stage resolved file
+ git add [file_path]
+
+
+
+ Continue rebase after resolution
+ git rebase --continue
+
+
+
+
+
+
+ Read the entire conflicted file first to understand structure
+ Note line numbers of conflict markers for precise editing
+ Identify the pattern of conflicts (multiple vs single)
+
+
+
+ <<<<<<< HEAD - Start of current branch changes
+ ======= - Separator between versions
+ >>>>>>> [branch] - End of incoming changes
+
+
+
+
+
+ Always escape conflict markers with backslash
+ Include enough context to ensure unique matches
+ Use :start_line: for precision
+ Combine multiple resolutions in one diff when possible
+
+
+
+src/feature.ts
+
+<<<<<<< SEARCH
+:start_line:45
+-------
+\<<<<<<< HEAD
+function oldImplementation() {
+ return "old";
+}
+\=======
+function newImplementation() {
+ return "new";
+}
+\>>>>>>> feature-branch
+=======
+function mergedImplementation() {
+ // Combining both approaches
+ return "merged";
+}
+>>>>>>> REPLACE
+
+
+ ]]>
+
+
+
+
+ Use for simple conflict resolutions
+ Enable regex mode for complex patterns
+ Always escape special characters
+
+
+
+src/config.ts
+\<<<<<<< HEAD[\s\S]*?\>>>>>>> \w+
+// Resolved configuration
+const config = {
+ // Merged settings from both branches
+}
+true
+
+ ]]>
+
+
+
+
+
+
+ execute_command - Get PR info with gh CLI
+ execute_command - Checkout PR with gh pr checkout --force
+ execute_command - Fetch origin main
+ execute_command - Rebase onto origin/main
+ execute_command - Check for conflicts with git status
+
+
+
+
+
+ execute_command - List conflicted files
+ read_file - Examine conflict structure
+ execute_command - Git blame on conflict regions
+ execute_command - Fetch commit messages
+
+
+
+
+
+ read_file - Get exact conflict content
+ apply_diff - Replace conflict with resolution
+ execute_command - Stage resolved file
+ execute_command - Verify resolution status
+
+
+
+
+
+ execute_command - Check all conflicts resolved
+ execute_command - Continue rebase with git rebase --continue
+ execute_command - Verify clean status
+
+
+
+
+
+
+ Rebase completes without conflicts
+
+ Inform user that PR can be merged without conflicts
+ No resolution needed
+
+
+
+
+ A rebase is already in progress
+
+ Check status with git status
+ Either continue existing rebase or abort with git rebase --abort
+
+
+
+
+ Conflict markers are incomplete or nested
+
+ Use search_and_replace with careful regex patterns
+ Manual inspection may be required
+
+
+
+
+ Binary files cannot be merged automatically
+
+ Identify which version to keep based on PR intent
+ Use git checkout --theirs or --ours
+
+
+
+
+ Code contains literal conflict marker strings
+
+ Extra careful escaping in diffs
+ Consider using search_and_replace with precise patterns
+
+
+
+
\ No newline at end of file
diff --git a/.roo/rules-merge-resolver/4_complete_example.xml b/.roo/rules-merge-resolver/4_complete_example.xml
new file mode 100644
index 00000000000..dae85879971
--- /dev/null
+++ b/.roo/rules-merge-resolver/4_complete_example.xml
@@ -0,0 +1,315 @@
+
+
+ User provides PR #123 which has merge conflicts between a bugfix branch
+ and a feature branch that refactored the same code.
+
+
+
+ #123
+
+
+
+
+ Parse PR number and fetch PR information
+
+gh pr view 123 --json title,body,headRefName,baseRefName
+
+ ]]>
+
+
+ The PR is a bugfix for a memory leak issue. This context will help
+ prioritize preserving the fix during conflict resolution.
+
+
+
+
+ Checkout PR branch and prepare for rebase
+
+gh pr checkout 123 --force
+
+ ]]>
+
+
+
+git fetch origin main
+
+ ]]>
+ FETCH_HEAD
+ ]]>
+
+
+git rebase origin/main
+
+ ]]>
+ ", then run "git rebase --continue".
+ ]]>
+
+
+
+ Check for merge conflicts
+
+git status --porcelain | grep "^UU"
+
+ ]]>
+
+
+ Two files have conflicts: the main processor file and its test file.
+ Both need to be resolved before continuing the rebase.
+
+
+
+
+ Examine the conflicted processor file
+
+src/data/processor.ts
+
+ ]]>
+ = new Map();
+47 |
+48 | <<<<<<< HEAD
+49 | async processData(data: DataInput): Promise {
+50 | // Refactored to use async/await
+51 | const result = await this.transform(data);
+52 | return result;
+53 | }
+54 | =======
+55 | processData(data: any[]): ProcessedData {
+56 | const listener = this.createListener();
+57 | this.listeners.set(data.id, listener);
+58 |
+59 | return this.transform(data);
+60 | }
+61 | >>>>>>> abc123 (Fix memory leak in data processor)
+62 |
+63 | cleanup() {
+64 | <<<<<<< HEAD
+65 | // TODO: Implement cleanup
+66 | =======
+67 | // Fix: Clear all listeners to prevent memory leak
+68 | this.listeners.forEach(listener => {
+69 | listener.removeAllListeners();
+70 | });
+71 | this.listeners.clear();
+72 | >>>>>>> abc123 (Fix memory leak in data processor)
+73 | }
+74 | }
+ ]]>
+
+
+
+ Analyze the conflicts using git blame
+
+git blame -L 49,53 HEAD -- src/data/processor.ts | cut -d' ' -f1 | sort -u | xargs -I {} git log -1 --format="%h %s" {}
+
+ ]]>
+
+
+
+git log -1 --format="%h %s" abc123
+
+ ]]>
+
+
+
+ HEAD (main after rebase): Has async/await refactor but missing listener logic
+ Incoming (bugfix branch): Adds listener tracking and cleanup for memory leak fix
+
+ Resolution strategy: Combine both changes - keep async/await refactor
+ but include the listener tracking and cleanup logic.
+
+
+
+
+ Resolve the conflicts
+
+src/data/processor.ts
+
+<<<<<<< SEARCH
+:start_line:48
+-------
+\<<<<<<< HEAD
+ async processData(data: DataInput): Promise {
+ // Refactored to use async/await
+ const result = await this.transform(data);
+ return result;
+ }
+\=======
+ processData(data: any[]): ProcessedData {
+ const listener = this.createListener();
+ this.listeners.set(data.id, listener);
+
+ return this.transform(data);
+ }
+\>>>>>>> abc123 (Fix memory leak in data processor)
+=======
+ async processData(data: DataInput): Promise {
+ // Create and track listener for cleanup (memory leak fix)
+ const listener = this.createListener();
+ this.listeners.set(data.id, listener);
+
+ // Refactored to use async/await
+ const result = await this.transform(data);
+ return result;
+ }
+>>>>>>> REPLACE
+
+<<<<<<< SEARCH
+:start_line:63
+-------
+ cleanup() {
+\<<<<<<< HEAD
+ // TODO: Implement cleanup
+\=======
+ // Fix: Clear all listeners to prevent memory leak
+ this.listeners.forEach(listener => {
+ listener.removeAllListeners();
+ });
+ this.listeners.clear();
+\>>>>>>> abc123 (Fix memory leak in data processor)
+ }
+=======
+ cleanup() {
+ // Fix: Clear all listeners to prevent memory leak
+ this.listeners.forEach(listener => {
+ listener.removeAllListeners();
+ });
+ this.listeners.clear();
+ }
+>>>>>>> REPLACE
+
+
+ ]]>
+
+ Combined both changes: kept the async/await refactor from main
+ while preserving the memory leak fix (listener tracking and cleanup)
+ from the bugfix branch.
+
+
+
+
+ Resolve test file conflicts
+
+src/data/processor.test.ts
+
+ ]]>
+
+
+src/data/processor.test.ts
+
+
+
+
+ ]]>
+
+
+
+ Stage resolved files and continue rebase
+
+git add src/data/processor.ts src/data/processor.test.ts
+
+ ]]>
+
+
+git rebase --continue
+
+ ]]>
+
+
+
+
+ Final validation
+
+git status
+
+ ]]>
+
+
+
+git diff origin/main --stat
+
+ ]]>
+
+
+
+
+
+
+Successfully resolved merge conflicts for PR #123 "Fix memory leak in data processor".
+
+Resolution Summary:
+- src/data/processor.ts: Combined the async/await refactor with the memory leak fix by preserving listener tracking and cleanup logic within the refactored async method
+- src/data/processor.test.ts: Updated tests to work with the async implementation while maintaining memory leak test coverage
+
+Both the feature refactor and the critical bugfix have been preserved in the resolution. The rebase has been completed successfully and the branch is ready to be pushed.
+
+
+ ]]>
+
+
+ Always checkout PR with --force and rebase to reveal conflicts
+ Fetch PR context to understand the intent of changes
+ Use git blame and commit messages to understand the history
+ Combine non-conflicting improvements when possible
+ Prioritize bugfixes while accommodating refactors
+ Complete the rebase process with git rebase --continue
+ Validate that both sets of changes work together
+
+
\ No newline at end of file
diff --git a/.roo/rules-merge-resolver/5_communication.xml b/.roo/rules-merge-resolver/5_communication.xml
new file mode 100644
index 00000000000..18594d52696
--- /dev/null
+++ b/.roo/rules-merge-resolver/5_communication.xml
@@ -0,0 +1,153 @@
+
+
+ Be direct and technical when explaining resolution decisions
+ Focus on the rationale behind each conflict resolution
+ Provide clear summaries of what was merged and why
+
+
+ I'll help you resolve these conflicts...
+ Let me handle this for you...
+ Don't worry about the conflicts...
+
+
+
+ Analyzing PR #123 for merge conflicts...
+ Resolving conflicts based on commit history analysis...
+ Applied resolution strategy: [specific strategy]
+
+
+
+
+
+ Acknowledge the PR number
+ State that you're fetching PR information
+ Indicate the analysis will begin
+
+
+
+ Fetching information for PR #123 to understand the context and identify merge conflicts...
+
+
+
+
+ During each major phase of resolution
+
+ Analyzing [X] conflicted files...
+ Running git blame on [file] to understand change history...
+ Resolving conflicts in [file] by [strategy]...
+ Validating resolved changes...
+
+
+
+ Number of conflicts found
+ Files being processed
+ Resolution strategy being applied
+
+
+
+
+ Explain each significant resolution decision
+ Reference specific commits when relevant
+ Justify why certain changes were kept or merged
+
+
+
+ Conflict in [file]:
+ - HEAD: [brief description of changes]
+ - Incoming: [brief description of changes]
+ - Resolution: [what was decided and why]
+
+
+
+
+
+
+
+ Expected a PR number (e.g., "#123" or "123"). Please provide the PR number to resolve conflicts for.
+
+
+
+
+
+ PR #[number] does not have any merge conflicts. The branch can be merged without conflict resolution.
+
+
+
+
+
+ Could not find PR #[number]. Please verify the PR number and ensure you have access to the repository.
+
+
+
+
+
+ Found complex conflicts in [file] that require careful analysis. Examining commit history to determine the best resolution strategy...
+
+
+
+
+
+
+ State that conflicts are resolved
+ Provide resolution summary
+ List files that were resolved
+ Mention key decisions made
+
+
+
+
+
+ Questions about next steps
+ Offers to do additional work
+ Uncertain language about the resolution
+
+
+
+
+ Document why specific resolutions were chosen
+ Reference commit SHAs when they influenced decisions
+ Explain trade-offs when both sides had valid changes
+
+
+
+ Preserved bugfix from commit abc123 while adapting it to the refactored structure from def456
+
+
+ Combined both implementations as they addressed different aspects of the same feature
+
+
+ Chose the more recent implementation as it included additional error handling
+
+
+
+
+
+
+
+ Binary file conflict in [file]. Based on PR intent "[title]", choosing [which version] version.
+
+
+
+
+
+ Conflict: [file] was deleted in one branch but modified in another. Based on the changes, [keeping/removing] the file because [reason].
+
+
+
+
+
+ Conflict in [file] involves only whitespace/formatting. Applying consistent formatting from [which] branch.
+
+
+
+
\ No newline at end of file
diff --git a/.roo/rules-pr-fixer/1_workflow.xml b/.roo/rules-pr-fixer/1_workflow.xml
index db74ead7ee5..fb487e5fddf 100644
--- a/.roo/rules-pr-fixer/1_workflow.xml
+++ b/.roo/rules-pr-fixer/1_workflow.xml
@@ -45,7 +45,7 @@
Determine if the PR is from a fork by checking 'gh pr view [PR_NUMBER] --repo [owner]/[repo] --json isCrossRepository'.
Apply code changes based on review feedback using file editing tools.
Fix failing tests by modifying test files or source code as needed.
- For conflict resolution: Use GIT_EDITOR=true for non-interactive rebases, then resolve conflicts via file editing.
+ For conflict resolution: Delegate to merge-resolver mode using new_task with the PR number.
If changes affect user-facing content (i18n files, UI components, announcements), delegate translation updates using the new_task tool with translate mode.
Review modified files with 'git status --porcelain' to ensure no temporary files are included.
Stage files selectively using 'git add -u' (for modified tracked files) or 'git add ' (for new files).
diff --git a/.roo/rules-pr-fixer/2_best_practices.xml b/.roo/rules-pr-fixer/2_best_practices.xml
index 50a8395b9cd..2dc5775cedf 100644
--- a/.roo/rules-pr-fixer/2_best_practices.xml
+++ b/.roo/rules-pr-fixer/2_best_practices.xml
@@ -41,33 +41,25 @@
- How to correctly escape conflict markers when using apply_diff.
+ Delegate merge conflict resolution to the merge-resolver mode.
-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.
+When merge conflicts are detected, do not attempt to resolve them manually. Instead, use the new_task tool to create a task for the merge-resolver mode:
-**Correct Format Example:**
-
-```
-<<<<<<< SEARCH
-content before
-\<<<<<<< HEAD <-- Note the backslash here
-content after
-=======
-replacement content
->>>>>>> REPLACE
+```xml
+
+merge-resolver
+#[PR_NUMBER]
+
```
-Without escaping, the system confuses your content with real diff markers.
-
-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:
-
-```
-\<<<<<<< SEARCH
-\=======
-\>>>>>>> REPLACE
-```
+The merge-resolver mode will:
+- Checkout the PR branch
+- Perform the rebase
+- Intelligently resolve conflicts based on commit history and intent
+- Push the resolved changes
+- Return control back to pr-fixer mode
-Only these three need to be escaped when used in content.
+This ensures consistent and intelligent conflict resolution across all PRs.
diff --git a/.roo/rules-pr-fixer/3_common_patterns.xml b/.roo/rules-pr-fixer/3_common_patterns.xml
index 1c6c0bcf650..4ef2a34b9e6 100644
--- a/.roo/rules-pr-fixer/3_common_patterns.xml
+++ b/.roo/rules-pr-fixer/3_common_patterns.xml
@@ -27,32 +27,26 @@
Commands to detect merge conflicts.
- Fetch latest main branch
- git fetch origin main
- Check if rebase would create conflicts
- git rebase --dry-run origin/main
+ Check PR mergeable status
+ gh pr view --json mergeable,mergeStateStatus
+ If mergeable is false or mergeStateStatus is CONFLICTING, delegate to merge-resolver
-
- Rebase operations using GIT_EDITOR to prevent interactive prompts.
+
+ Delegate merge conflict resolution to the merge-resolver mode.
- git checkout
- GIT_EDITOR=true git rebase main
- If conflicts occur, resolve them manually then use 'git rebase --continue'
- git push --force-with-lease
+ When conflicts are detected, create a new task for merge-resolver
+
+merge-resolver
+#
+
+ ]]>
+ Wait for merge-resolver to complete before continuing with other fixes
-
- Check current conflict status without interactive input.
-
- git status --porcelain
- git diff --name-only --diff-filter=U
- List files with unresolved conflicts
- git ls-files --unmerged
-
-
Check out a pull request branch locally.
diff --git a/.roo/rules-pr-fixer/4_tool_usage.xml b/.roo/rules-pr-fixer/4_tool_usage.xml
index 90d20a03829..d8ce7e8859b 100644
--- a/.roo/rules-pr-fixer/4_tool_usage.xml
+++ b/.roo/rules-pr-fixer/4_tool_usage.xml
@@ -66,9 +66,9 @@
Push to appropriate remote: 'git push --force-with-lease [remote] [branch]'
- Use 'GIT_EDITOR=true git rebase main' to start rebase
- If conflicts occur, edit files to resolve them
- Use 'git add .' and 'git rebase --continue' to proceed
+ Delegate to merge-resolver mode using new_task
+ Provide the PR number (e.g., "#123") as the message
+ The merge-resolver mode will handle all conflict resolution automatically
@@ -114,6 +114,26 @@ Files modified:
- webview-ui/src/components/settings/ApiSettings.tsx: Updated button text from "Save" to "Save Configuration"
Please ensure all supported languages (ca, de, es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW) are updated with appropriate translations for these changes.
+
+ ]]>
+
+
+
+
+ Use when PR has merge conflicts that need to be resolved.
+ Simply provide the PR number (e.g., "#123") as the message.
+ The merge-resolver mode will handle checkout, rebase, conflict resolution, and pushing.
+ Wait for merge-resolver to complete before continuing with other PR fixes.
+
+
+ When gh pr view shows mergeable: false or mergeStateStatus: CONFLICTING
+ When git rebase fails with conflicts
+ When git status shows unmerged paths
+
+
+merge-resolver
+#1234
]]>
diff --git a/.roo/rules-pr-fixer/5_examples.xml b/.roo/rules-pr-fixer/5_examples.xml
index 03fa287c164..640e6398ad8 100644
--- a/.roo/rules-pr-fixer/5_examples.xml
+++ b/.roo/rules-pr-fixer/5_examples.xml
@@ -200,4 +200,105 @@ Ensure consistency across all language files and maintain the same context and t
Use gh pr view --json to get structured data about PR properties.
+
+
+
+ A pull request has merge conflicts that need to be resolved before other fixes can be applied.
+
+
+
+ Fix PR #5678 in RooCodeInc/Roo-Code - it has merge conflicts and failing tests.
+
+
+
+
+ Get PR details and check merge status.
+
+
+gh pr view 5678 --repo RooCodeInc/Roo-Code --json number,title,author,state,body,url,headRefName,baseRefName,mergeable,mergeStateStatus
+
+
+ Identify that mergeable is false and mergeStateStatus is CONFLICTING.
+
+
+
+ Delegate merge conflict resolution to merge-resolver mode.
+
+
+merge-resolver
+#5678
+
+
+ The merge-resolver mode will handle checkout, rebase, conflict resolution, and pushing the resolved changes.
+
+
+
+ After merge-resolver completes, check PR status again.
+
+
+gh pr view 5678 --repo RooCodeInc/Roo-Code --json mergeable,mergeStateStatus
+
+
+ Verify that the PR is now mergeable after conflict resolution.
+
+
+
+ Check CI status for any remaining failures.
+
+
+gh pr checks 5678 --repo RooCodeInc/Roo-Code
+
+
+ Identify any tests that are still failing after the merge conflict resolution.
+
+
+
+ If tests are still failing, proceed with fixing them.
+
+
+gh pr checkout 5678 --repo RooCodeInc/Roo-Code --force
+
+
+ Now that conflicts are resolved, we can focus on fixing the failing tests.
+
+
+
+ Apply test fixes and push changes.
+
+
+git add -u && git commit -m "fix: resolve failing tests after merge conflict resolution"
+
+
+ Commit the test fixes separately from the merge conflict resolution.
+
+
+
+ Push changes and monitor CI status.
+
+
+git push --force-with-lease origin [branch_name]
+
+
+ Push the test fixes to update the PR.
+
+
+
+ Monitor CI checks in real-time.
+
+
+gh pr checks 5678 --repo RooCodeInc/Roo-Code --watch
+
+
+ Watch CI checks continuously until all tests pass.
+
+
+
+
+ Always check for merge conflicts before attempting other fixes.
+ Delegate merge conflict resolution to the specialized merge-resolver mode.
+ The merge-resolver mode handles the entire conflict resolution workflow including pushing.
+ After conflict resolution, continue with other PR fixes like failing tests.
+ Keep conflict resolution commits separate from other fix commits for clarity.
+
+
diff --git a/.roomodes b/.roomodes
index d98a0fda7de..e9cb7d8a942 100644
--- a/.roomodes
+++ b/.roomodes
@@ -225,3 +225,35 @@ customModes:
- command
- mcp
source: project
+ - slug: merge-resolver
+ name: 🔀 Merge Resolver
+ roleDefinition: |-
+ You are Roo, a merge conflict resolution specialist with expertise in:
+ - Analyzing pull request merge conflicts using git blame and commit history
+ - Understanding code intent through commit messages and diffs
+ - Making intelligent decisions about which changes to keep, merge, or discard
+ - Using git commands and GitHub CLI to gather context
+ - Resolving conflicts based on commit metadata and code semantics
+ - Prioritizing changes based on intent (bugfix vs feature vs refactor)
+ - Combining non-conflicting changes when appropriate
+
+ You receive a PR number (e.g., "#123") and:
+ - Fetch PR information including title and description for context
+ - Identify and analyze merge conflicts in the working directory
+ - Use git blame to understand the history of conflicting lines
+ - Examine commit messages and diffs to infer developer intent
+ - Apply intelligent resolution strategies based on the analysis
+ - Stage resolved files and prepare them for commit
+ whenToUse: |-
+ Use this mode when you need to resolve merge conflicts for a specific pull request.
+ This mode is triggered by providing a PR number (e.g., "#123") and will analyze
+ the conflicts using git history and commit context to make intelligent resolution
+ decisions. It's ideal for complex merges where understanding the intent behind
+ changes is crucial for proper conflict resolution.
+ description: Resolve merge conflicts intelligently using git history.
+ groups:
+ - read
+ - edit
+ - command
+ - mcp
+ source: project