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(pr-fixer-orchestrator): enhance workflow safety and user control
- Add user approval checkpoint before committing changes
- Implement large diff handling (>2000 lines) with automatic summarization
- Replace dangerous `git add -A` with selective file staging
- Enforce context preservation in shared temp directory for all delegated tasks
- Add exact PR template format specification
- Update best practices to reflect new safety measures
BREAKING CHANGE: Workflow now requires explicit user approval before commits
<description>The orchestrator coordinates but doesn't implement. Use specialized modes for analysis, coding, testing, and review.</description>
6
+
<rationale>Each mode has specific expertise and permissions optimized for their tasks.</rationale>
7
+
</principle>
8
+
9
+
<principlepriority="critical">
10
+
<name>Maintain Context Between Steps</name>
11
+
<description>Use temporary files in .roo/temp/pr-fixer-orchestrator/[TASK_ID]/ to pass context between subtasks. ALL delegated tasks must save outputs to this directory.</description>
12
+
<rationale>Subtasks run in isolation and need explicit context sharing. Files saved elsewhere will be inaccessible to subsequent steps.</rationale>
13
+
</principle>
14
+
15
+
<principlepriority="critical">
16
+
<name>Get User Approval Before Committing</name>
17
+
<description>ALWAYS present changes and get explicit user approval before committing. Show modified files, summarize changes, and ask for confirmation.</description>
18
+
<rationale>Users must maintain control over what gets committed to their PR. Unexpected changes can break functionality or introduce unwanted modifications.</rationale>
19
+
</principle>
20
+
21
+
<principlepriority="critical">
22
+
<name>Understand Requirements First</name>
23
+
<description>Always analyze the PR's underlying purpose and requirements before fixing issues.</description>
24
+
<rationale>Fixing review comments without understanding the feature can lead to incomplete or incorrect solutions.</rationale>
25
+
</principle>
26
+
27
+
<principlepriority="high">
28
+
<name>Handle Large Diffs Gracefully</name>
29
+
<description>Check diff size before processing. If over 2000 lines, create a summary instead of including the full diff.</description>
30
+
<rationale>Large diffs can overwhelm context windows and make analysis difficult. Summaries maintain clarity.</rationale>
31
+
</principle>
32
+
</orchestration_principles>
33
+
34
+
<pr_fixing_guidelines>
35
+
- Always understand the PR's purpose and requirements first
36
+
- Analyze before implementing - understand all issues comprehensively
37
+
- Address review feedback with the same priority as the reviewer's authority
38
+
- Fix root causes of test failures, not just symptoms
39
+
- Ensure all original PR requirements are met, not just review comments
40
+
- Resolve conflicts carefully, understanding both sides of changes
41
+
- Validate all changes before committing to avoid breaking the PR further
42
+
- NEVER use `git add -A` - always stage specific files intentionally
43
+
- Get user approval before committing any changes
44
+
- Keep commits focused and well-described
45
+
- Always check if PR is from a fork to push to correct remote
46
+
- Monitor CI/CD checks in real-time after pushing
47
+
- Consider translation needs for any user-facing changes
48
+
- Document what was changed and why in the PR update message
49
+
- Use the EXACT PR template format specified in 6_pr_template_format.xml
50
+
</pr_fixing_guidelines>
51
+
52
+
<git_operation_best_practices>
53
+
<practicecategory="conflict_resolution">
54
+
<name>Non-Interactive Rebasing</name>
55
+
<description>Always use GIT_EDITOR=true for automated rebase operations</description>
56
+
<example>GIT_EDITOR=true git rebase origin/main</example>
57
+
</practice>
58
+
59
+
<practicecategory="remote_handling">
60
+
<name>Fork-Aware Pushing</name>
61
+
<description>Always check isCrossRepository before pushing</description>
62
+
<steps>
63
+
- Check if PR is from fork using gh pr view --json isCrossRepository
64
+
- Add fork remote if needed
65
+
- Push to correct remote (origin vs fork)
66
+
</steps>
67
+
</practice>
68
+
69
+
<practicecategory="safe_pushing">
70
+
<name>Force with Lease</name>
71
+
<description>Use --force-with-lease for safer force pushing</description>
72
+
<fallback>If it fails, fetch and use --force</fallback>
73
+
</practice>
74
+
75
+
<practicecategory="staging_files">
76
+
<name>Selective File Staging</name>
77
+
<description>Always stage files individually, never use git add -A</description>
78
+
<steps>
79
+
- Review all modified files with git status
80
+
- Stage only files that were intentionally modified
81
+
- Use git add [specific-file] for each file
82
+
- Double-check staged files with git diff --cached
83
+
</steps>
84
+
<rationale>Prevents accidentally committing temporary files, debug logs, or unintended changes</rationale>
85
+
</practice>
86
+
87
+
<practicecategory="diff_management">
88
+
<name>Large Diff Handling</name>
89
+
<description>Check diff size before including in context files</description>
90
+
<steps>
91
+
- Save diff to file and check line count with wc -l
92
+
- If over 2000 lines, create a summary instead
93
+
- Include file counts, insertion/deletion stats
94
+
- List most significantly changed files
95
+
</steps>
96
+
</practice>
97
+
</git_operation_best_practices>
98
+
99
+
<subtask_delegation_patterns>
100
+
<patternname="analysis_delegation">
101
+
<to_mode>architect</to_mode>
102
+
<purpose>Comprehensive analysis and planning</purpose>
103
+
<provides>Detailed reports and implementation plans</provides>
104
+
<output_requirement>MUST save all outputs to .roo/temp/pr-fixer-orchestrator/[TASK_ID]/</output_requirement>
105
+
</pattern>
106
+
107
+
<patternname="implementation_delegation">
108
+
<to_mode>code</to_mode>
109
+
<purpose>Executing code changes and fixes</purpose>
110
+
<provides>Implemented solutions and change summaries</provides>
111
+
<output_requirement>MUST save changes_implemented.md to .roo/temp/pr-fixer-orchestrator/[TASK_ID]/</output_requirement>
112
+
</pattern>
113
+
114
+
<patternname="validation_delegation">
115
+
<to_mode>test</to_mode>
116
+
<purpose>Testing and validating changes</purpose>
117
+
<provides>Test results and validation reports</provides>
118
+
<output_requirement>MUST save validation_report.md to .roo/temp/pr-fixer-orchestrator/[TASK_ID]/</output_requirement>
119
+
</pattern>
120
+
121
+
<patternname="review_delegation">
122
+
<to_mode>pr-reviewer</to_mode>
123
+
<purpose>Final quality review before submission</purpose>
124
+
<provides>Quality assessment and recommendations</provides>
125
+
<output_requirement>MUST save final_review.md to .roo/temp/pr-fixer-orchestrator/[TASK_ID]/</output_requirement>
126
+
</pattern>
127
+
128
+
<patternname="translation_delegation">
129
+
<to_mode>translate</to_mode>
130
+
<purpose>Updating translations for UI changes</purpose>
131
+
<provides>Synchronized translations across languages</provides>
132
+
<output_requirement>MUST save translation_summary.md to .roo/temp/pr-fixer-orchestrator/[TASK_ID]/</output_requirement>
133
+
</pattern>
134
+
</subtask_delegation_patterns>
135
+
136
+
<error_handling>
137
+
<scenarioname="auth_failure">
138
+
<error>GitHub CLI authentication error</error>
139
+
<action>Prompt user to run 'gh auth login'</action>
140
+
</scenario>
141
+
142
+
<scenarioname="no_linked_issue">
143
+
<error>No linked issue found</error>
144
+
<action>Extract requirements from PR description and comments</action>
145
+
</scenario>
146
+
147
+
<scenarioname="push_failure">
148
+
<error>Force-with-lease push fails</error>
149
+
<action>Fetch latest and retry with --force</action>
150
+
</scenario>
151
+
152
+
<scenarioname="large_diff">
153
+
<error>Diff exceeds 2000 lines</error>
154
+
<action>Create summary with stats instead of full diff</action>
155
+
</scenario>
156
+
157
+
<scenarioname="missing_context_files">
158
+
<error>Expected context files not found in temp directory</error>
159
+
<action>Check if delegated task saved to correct location, re-run if needed</action>
160
+
</scenario>
161
+
</error_handling>
162
+
163
+
<user_interaction_guidelines>
164
+
<guidelinepriority="critical">
165
+
<name>Pre-Commit Approval</name>
166
+
<description>Always get explicit user approval before committing changes</description>
167
+
<implementation>
168
+
- Show list of modified files
169
+
- Summarize key changes made
170
+
- Present clear approval options
171
+
- Wait for user confirmation
172
+
</implementation>
173
+
</guideline>
174
+
175
+
<guidelinepriority="high">
176
+
<name>Clear Communication</name>
177
+
<description>Present information clearly and concisely</description>
0 commit comments