Skip to content

Commit ce4234d

Browse files
committed
feat: refine PR workflow instructions for non-interactive operations and improve clarity
1 parent 9dce6fb commit ce4234d

File tree

4 files changed

+20
-31
lines changed

4 files changed

+20
-31
lines changed

.roo/rules-pr-fixer/1_workflow.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
</phase>
4040

4141
<phase name="implementation">
42-
<description>Execute the user's chosen course of action using non-interactive commands only.</description>
42+
<description>Execute the user's chosen course of action.</description>
4343
<steps>
44-
<step>Check out the PR branch locally using 'gh pr checkout --force' to avoid interactive prompts.</step>
44+
<step>Check out the PR branch locally using 'gh pr checkout --force'.</step>
4545
<step>Determine if the PR is from a fork by checking 'gh pr view --json isCrossRepository'.</step>
4646
<step>Apply code changes based on review feedback using file editing tools.</step>
4747
<step>Fix failing tests by modifying test files or source code as needed.</step>
48-
<step>For conflict resolution: Use automated detection first, then manual resolution via file editing, avoiding interactive rebase.</step>
48+
<step>For conflict resolution: Use GIT_EDITOR=true for non-interactive rebases, then resolve conflicts via file editing.</step>
4949
<step>If changes affect user-facing content (i18n files, UI components, announcements), delegate translation updates using the new_task tool with translate mode.</step>
5050
<step>Commit changes using git commands.</step>
5151
<step>Push changes to the correct remote (origin for same-repo PRs, fork remote for cross-repo PRs) using 'git push --force-with-lease'.</step>

.roo/rules-pr-fixer/3_common_patterns.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
</pattern>
3939

4040
<pattern name="non_interactive_rebase">
41-
<usage>Non-interactive rebase operations for when no conflicts are detected.</usage>
41+
<usage>Rebase operations using GIT_EDITOR to prevent interactive prompts.</usage>
4242
<template>
4343
<command tool="git">git checkout <pr_branch></command>
44-
<command tool="git">git rebase main</command>
45-
<comment>Only proceed if rebase succeeds without conflicts</comment>
46-
<command tool="git">git push --force-with-lease origin <pr_branch></command>
44+
<command tool="git">GIT_EDITOR=true git rebase main</command>
45+
<comment>If conflicts occur, resolve them manually then use 'git rebase --continue'</comment>
46+
<command tool="git">git push --force-with-lease <remote> <pr_branch></command>
4747
</template>
4848
</pattern>
4949

@@ -57,12 +57,11 @@
5757
</template>
5858
</pattern>
5959
<pattern name="checking_out_pr">
60-
<usage>Command to check out a pull request branch locally without interactive prompts.</usage>
60+
<usage>Check out a pull request branch locally.</usage>
6161
<template>
6262
<command tool="gh">gh pr checkout <pr_number_or_url> --force</command>
63-
<comment>Alternative: Use git commands if gh checkout fails</comment>
64-
<command tool="git">git fetch origin pull/<pr_number>/head:<branch_name></command>
65-
<command tool="git">git checkout <branch_name></command>
63+
<comment>Alternative if gh checkout fails:</comment>
64+
<command tool="git">git fetch origin pull/<pr_number>/head:<branch_name> && git checkout <branch_name></command>
6665
</template>
6766
</pattern>
6867

.roo/rules-pr-fixer/4_tool_usage.xml

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,26 @@
4646

4747
<tool name="gh pr checkout">
4848
<best_practices>
49-
<practice>Always use --force flag to avoid interactive branch selection.</practice>
50-
<practice>Format: 'gh pr checkout <pr_number> --force'</practice>
51-
<practice>If gh checkout fails, fallback to git fetch + checkout pattern.</practice>
49+
<practice>Use --force flag: 'gh pr checkout <pr_number> --force'</practice>
50+
<practice>If gh checkout fails, use: git fetch origin pull/<pr_number>/head:<branch_name></practice>
5251
</best_practices>
53-
<non_interactive_alternatives>
54-
<alternative>git fetch origin pull/<pr_number>/head:<branch_name></alternative>
55-
<alternative>git checkout <branch_name></alternative>
56-
</non_interactive_alternatives>
5752
</tool>
5853

5954
<tool name="git operations">
6055
<best_practices>
6156
<practice>Use --force-with-lease for safer force pushing.</practice>
62-
<practice>Check git status programmatically with --porcelain flag.</practice>
63-
<practice>Use git rebase --dry-run to detect conflicts before attempting rebase.</practice>
57+
<practice>Use GIT_EDITOR=true to prevent interactive prompts during rebases.</practice>
6458
<practice>Always determine the correct remote before pushing (origin vs fork).</practice>
6559
</best_practices>
6660
<remote_handling>
6761
<step>Check if PR is from a fork: 'gh pr view <pr_number> --json isCrossRepository'</step>
68-
<step>If isCrossRepository is true, the PR is from a fork</step>
69-
<step>For fork PRs, check if fork remote exists: 'git remote -v'</step>
70-
<step>If fork remote doesn't exist, add it: 'git remote add fork https://github.com/<fork_owner>/<repo>.git'</step>
62+
<step>If isCrossRepository is true, add fork remote if needed</step>
7163
<step>Push to appropriate remote: 'git push --force-with-lease <remote> <branch>'</step>
7264
</remote_handling>
7365
<conflict_resolution>
74-
<step>Use 'git rebase --dry-run main' to detect conflicts</step>
75-
<step>If conflicts detected, resolve manually via file editing</step>
76-
<step>Use 'git status --porcelain' to identify conflicted files</step>
77-
<step>Edit files to resolve conflicts, removing conflict markers</step>
78-
<step>Use 'git add .' and commit the resolved changes</step>
66+
<step>Use 'GIT_EDITOR=true git rebase main' to start rebase</step>
67+
<step>If conflicts occur, edit files to resolve them</step>
68+
<step>Use 'git add .' and 'git rebase --continue' to proceed</step>
7969
</conflict_resolution>
8070
</tool>
8171

.roo/rules-pr-fixer/5_examples.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@
5959
</step>
6060

6161
<step number="4">
62-
<description>Check out the pull request branch using non-interactive command.</description>
62+
<description>Check out the pull request branch.</description>
6363
<tool_use>
6464
<execute_command>
6565
<command>gh pr checkout 4365 --force</command>
6666
</execute_command>
6767
</tool_use>
68-
<analysis>The PR branch is now ready for local edits. Using --force avoids interactive prompts.</analysis>
68+
<analysis>The PR branch is now ready for local edits.</analysis>
6969
</step>
7070

7171
<step number="5">
@@ -133,7 +133,7 @@
133133
<command>gh pr checkout 1234 --force</command>
134134
</execute_command>
135135
</tool_use>
136-
<analysis>Make the requested button text changes in the UI components. Using --force to avoid interactive prompts.</analysis>
136+
<analysis>Make the requested button text changes in the UI components.</analysis>
137137
</step>
138138

139139
<step number="3">

0 commit comments

Comments
 (0)