Skip to content

Commit 0e3e568

Browse files
committed
Add issue-fixer-orchestrator mode
1 parent 2d7061a commit 0e3e568

File tree

10 files changed

+1051
-131
lines changed

10 files changed

+1051
-131
lines changed

.roo/rules-issue-fixer-orchestrator/1_Workflow.xml

Lines changed: 447 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<best_practices>
2+
- Always read the entire issue and all comments before starting
3+
- Follow the project's coding standards and patterns
4+
- Focus exclusively on addressing the issue's requirements.
5+
- Make minimal, high-quality changes for bug fixes. The goal is a narrow, targeted fix, not a one-line hack.
6+
- Test thoroughly - both automated and manual testing
7+
- Document complex logic with comments
8+
- Keep commits focused and well-described
9+
- Reference the issue number in commits
10+
- Verify all acceptance criteria are met
11+
- Consider performance and security implications
12+
- Update documentation when needed
13+
- Add tests for any new functionality
14+
- Check for accessibility issues (for UI changes)
15+
- Always delegate translation tasks to translate mode when implementing user-facing changes
16+
- Check all modified files for hard-coded strings and internationalization needs
17+
- Wait for translation completion before proceeding to PR creation
18+
- Translation is required for:
19+
- Any new or modified UI components (.tsx, .jsx files)
20+
- User-facing documentation changes (.md files)
21+
- Error messages and notifications
22+
- Any strings visible to end users
23+
- The translate mode will handle:
24+
- Adding translations to all supported language files
25+
- Ensuring consistency with existing terminology
26+
- Maintaining sync across all language resources
27+
<codebase_exploration_guidelines>
28+
<principle>Always use `codebase_search` FIRST to understand the codebase structure and find all related files before using other tools like `read_file`.</principle>
29+
30+
<for_bug_fixes>
31+
<title>Investigation Checklist for Bug Fixes</title>
32+
<item>Search for the specific error message or broken functionality.</item>
33+
<item>Find all relevant error handling and logging statements.</item>
34+
<item>Locate related test files to understand expected behavior.</item>
35+
<item>Identify all dependencies and import/export patterns for the affected code.</item>
36+
<item>Find similar, working patterns in the codebase to use as a reference.</item>
37+
</for_bug_fixes>
38+
39+
<for_features>
40+
<title>Investigation Checklist for New Features</title>
41+
<item>Search for any similar existing features to use as a blueprint.</item>
42+
<item>Find potential integration points (e.g., API routes, UI component registries).</item>
43+
<item>Locate relevant configuration files that may need to be updated.</item>
44+
<item>Identify common patterns, components, and utilities that should be reused.</item>
45+
</for_features>
46+
47+
<critical_note>
48+
Always read multiple related files together to understand the full context, including coding conventions, testing patterns, and error handling approaches.
49+
</critical_note>
50+
</codebase_exploration_guidelines>
51+
</best_practices>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<common_patterns>
2+
<bug_fix_pattern>
3+
1. Reproduce the issue
4+
2. Identify root cause
5+
3. Implement minimal fix
6+
4. Add regression test
7+
5. Verify fix works
8+
6. Check for side effects
9+
</bug_fix_pattern>
10+
11+
<feature_implementation_pattern>
12+
1. Understand all requirements
13+
2. Design the solution
14+
3. Implement incrementally
15+
4. Test each component
16+
5. Integrate components
17+
6. Verify acceptance criteria
18+
7. Add comprehensive tests
19+
8. Update documentation
20+
</feature_implementation_pattern>
21+
</common_patterns>
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
<github_cli_usage>
2+
<overview>
3+
This mode uses the GitHub CLI (gh) for all GitHub operations.
4+
The mode assumes the user has gh installed and authenticated. If authentication errors occur,
5+
the mode will prompt the user to authenticate.
6+
7+
Users must provide full GitHub issue URLs (e.g., https://github.com/owner/repo/issues/123)
8+
so the mode can extract the repository information dynamically.
9+
</overview>
10+
11+
<url_parsing>
12+
<pattern>https://github.com/[owner]/[repo]/issues/[number]</pattern>
13+
<extraction>
14+
- Owner: The organization or username
15+
- Repo: The repository name
16+
- Number: The issue number
17+
</extraction>
18+
</url_parsing>
19+
20+
<authentication_handling>
21+
<approach>Assume authenticated, handle errors gracefully</approach>
22+
<when>Only check authentication if a gh command fails with auth error</when>
23+
<error_patterns>
24+
- "gh: Not authenticated"
25+
- "HTTP 401"
26+
- "HTTP 403: Resource not accessible"
27+
</error_patterns>
28+
</authentication_handling>
29+
30+
<primary_commands>
31+
<command name="gh_issue_view">
32+
<purpose>Retrieve the issue details at the start</purpose>
33+
<when>Always use first to get the full issue content</when>
34+
<syntax>gh issue view [issue-number] --repo [owner]/[repo] --json number,title,body,state,labels,assignees,milestone,createdAt,updatedAt,closedAt,author</syntax>
35+
<example>
36+
<execute_command>
37+
<command>gh issue view 123 --repo octocat/hello-world --json number,title,body,state,labels,assignees,milestone,createdAt,updatedAt,closedAt,author</command>
38+
</execute_command>
39+
</example>
40+
</command>
41+
42+
<command name="gh_issue_comments">
43+
<purpose>Get additional context and requirements from issue comments</purpose>
44+
<when>Always use after viewing issue to see full discussion</when>
45+
<syntax>gh issue view [issue-number] --repo [owner]/[repo] --comments</syntax>
46+
<example>
47+
<execute_command>
48+
<command>gh issue view 123 --repo octocat/hello-world --comments</command>
49+
</execute_command>
50+
</example>
51+
</command>
52+
53+
54+
<command name="gh_repo_view_commits">
55+
<purpose>Find recent changes to affected files</purpose>
56+
<when>Use during codebase exploration</when>
57+
<syntax>gh api repos/[owner]/[repo]/commits?path=[file-path]&per_page=10</syntax>
58+
<example>
59+
<execute_command>
60+
<command>gh api repos/octocat/hello-world/commits?path=src/api/index.ts&per_page=10 --jq '.[].sha + " " + .[].commit.message'</command>
61+
</execute_command>
62+
</example>
63+
</command>
64+
65+
<command name="gh_search_code">
66+
<purpose>Search for code patterns on GitHub</purpose>
67+
<when>Use to supplement local codebase_search</when>
68+
<syntax>gh search code "[search-query]" --repo [owner]/[repo]</syntax>
69+
<example>
70+
<execute_command>
71+
<command>gh search code "function handleError" --repo octocat/hello-world --limit 10</command>
72+
</execute_command>
73+
</example>
74+
</command>
75+
</primary_commands>
76+
77+
<optional_commands>
78+
<command name="gh_issue_comment">
79+
<purpose>Add progress updates or ask questions on issues</purpose>
80+
<when>Use if clarification needed or to show progress</when>
81+
<syntax>gh issue comment [issue-number] --repo [owner]/[repo] --body "[comment]"</syntax>
82+
<example>
83+
<execute_command>
84+
<command>gh issue comment 123 --repo octocat/hello-world --body "Working on this issue. Found the root cause in the theme detection logic."</command>
85+
</execute_command>
86+
</example>
87+
</command>
88+
89+
<command name="gh_pr_list">
90+
<purpose>Find related or similar PRs</purpose>
91+
<when>Use to understand similar changes</when>
92+
<syntax>gh pr list --repo [owner]/[repo] --search "[search-terms]"</syntax>
93+
<example>
94+
<execute_command>
95+
<command>gh pr list --repo octocat/hello-world --search "dark theme" --limit 10</command>
96+
</execute_command>
97+
</example>
98+
</command>
99+
100+
<command name="gh_pr_diff">
101+
<purpose>View the diff of a pull request</purpose>
102+
<when>Use to understand changes in a PR</when>
103+
<syntax>gh pr diff [pr-number] --repo [owner]/[repo]</syntax>
104+
<example>
105+
<execute_command>
106+
<command>gh pr diff 456 --repo octocat/hello-world</command>
107+
</execute_command>
108+
</example>
109+
</command>
110+
</optional_commands>
111+
112+
<pull_request_commands>
113+
<command name="gh_pr_create">
114+
<purpose>Create a pull request</purpose>
115+
<when>Use in step 11 after user approval</when>
116+
<important>
117+
- Target the repository from the provided URL
118+
- Use "main" as the base branch unless specified otherwise
119+
- Include issue number in PR title
120+
- Use --maintainer-can-modify flag
121+
</important>
122+
<syntax>gh pr create --repo [owner]/[repo] --base main --title "[title]" --body "[body]" --maintainer-can-modify</syntax>
123+
<example>
124+
<execute_command>
125+
<command>gh pr create --repo octocat/hello-world --base main --title "fix: Resolve dark theme button visibility (#123)" --body "## Description
126+
127+
Fixes #123
128+
129+
[Full PR description]" --maintainer-can-modify</command>
130+
</execute_command>
131+
</example>
132+
<note>
133+
If working from a fork, ensure the fork is set as the remote and push the branch there first.
134+
The gh CLI will automatically handle the fork workflow.
135+
</note>
136+
</command>
137+
138+
<command name="gh_repo_fork">
139+
<purpose>Fork the repository if user doesn't have push access</purpose>
140+
<when>Use if user needs to work from a fork</when>
141+
<syntax>gh repo fork [owner]/[repo] --clone</syntax>
142+
<example>
143+
<execute_command>
144+
<command>gh repo fork octocat/hello-world --clone</command>
145+
</execute_command>
146+
</example>
147+
</command>
148+
149+
<command name="gh_pr_checks">
150+
<purpose>Monitor CI/CD checks on a pull request</purpose>
151+
<when>Use after creating PR to ensure checks pass</when>
152+
<syntax>gh pr checks [pr-number] --repo [owner]/[repo] --watch</syntax>
153+
<example>
154+
<execute_command>
155+
<command>gh pr checks 789 --repo octocat/hello-world --watch</command>
156+
</execute_command>
157+
</example>
158+
</command>
159+
</pull_request_commands>
160+
161+
<workflow_helpers>
162+
<command name="gh_api">
163+
<purpose>Access GitHub API directly for advanced operations</purpose>
164+
<when>Use when specific gh commands don't provide needed functionality</when>
165+
<examples>
166+
<!-- Get repository information -->
167+
<execute_command>
168+
<command>gh api repos/[owner]/[repo] --jq '.default_branch'</command>
169+
</execute_command>
170+
171+
<!-- Get file contents -->
172+
<execute_command>
173+
<command>gh api repos/[owner]/[repo]/contents/README.md --jq '.content' | base64 -d</command>
174+
</execute_command>
175+
176+
<!-- Get workflow runs -->
177+
<execute_command>
178+
<command>gh api repos/[owner]/[repo]/actions/runs --jq '.workflow_runs[0:5] | .[] | .id, .status, .conclusion'</command>
179+
</execute_command>
180+
</examples>
181+
</command>
182+
183+
<command name="gh_run_list">
184+
<purpose>Check GitHub Actions workflow status</purpose>
185+
<when>Use to monitor CI/CD pipeline</when>
186+
<syntax>gh run list --repo [owner]/[repo] --limit 5</syntax>
187+
<example>
188+
<execute_command>
189+
<command>gh run list --repo octocat/hello-world --limit 5</command>
190+
</execute_command>
191+
</example>
192+
</command>
193+
</workflow_helpers>
194+
195+
<error_handling>
196+
<scenario name="not_authenticated">
197+
<error>gh: Not authenticated. Run 'gh auth login' to authenticate.</error>
198+
<action>
199+
Ask user to authenticate:
200+
<ask_followup_question>
201+
<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>
202+
<follow_up>
203+
<suggest>I've authenticated, please continue</suggest>
204+
<suggest>I need help with authentication</suggest>
205+
<suggest>Let's use a different approach</suggest>
206+
</follow_up>
207+
</ask_followup_question>
208+
</action>
209+
</scenario>
210+
211+
<scenario name="no_permissions">
212+
<error>HTTP 403: Resource not accessible by integration</error>
213+
<action>
214+
Check if working from a fork is needed:
215+
<execute_command>
216+
<command>gh repo fork [owner]/[repo] --clone</command>
217+
</execute_command>
218+
</action>
219+
</scenario>
220+
</error_handling>
221+
</github_cli_usage>

0 commit comments

Comments
 (0)