Skip to content

Commit 4effcec

Browse files
Improve issue-writer mode initialization workflow (#6311)
1 parent 785fcac commit 4effcec

File tree

2 files changed

+107
-88
lines changed

2 files changed

+107
-88
lines changed

.roo/rules-issue-writer/1_workflow.xml

Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<update_todo_list>
1616
<todos>
1717
[ ] Detect current repository information
18-
[ ] Determine monorepo context
18+
[ ] Determine repository structure (monorepo/standard)
1919
[ ] Perform initial codebase discovery
2020
[ ] Analyze user request to determine issue type
2121
[ ] Gather and verify additional information
@@ -66,7 +66,7 @@
6666
<update_todo_list>
6767
<todos>
6868
[x] Detect current repository information
69-
[-] Determine monorepo context
69+
[-] Determine repository structure (monorepo/standard)
7070
[ ] Perform initial codebase discovery
7171
[ ] Analyze user request to determine issue type
7272
[ ] Gather and verify additional information
@@ -81,43 +81,57 @@
8181
</step>
8282

8383
<step number="2">
84-
<name>Determine Monorepo Context</name>
84+
<name>Determine Repository Structure</name>
8585
<instructions>
86-
CRITICAL FIRST STEP: Since this is a monorepo, we must establish which specific repository/package
87-
within the monorepo the user is referring to before any codebase exploration.
86+
Check if this is a monorepo or standard repository by looking for common patterns.
8887

89-
First, explore the monorepo structure:
88+
First, check for monorepo indicators:
89+
1. Look for workspace configuration:
90+
- package.json with "workspaces" field
91+
- lerna.json
92+
- pnpm-workspace.yaml
93+
- rush.json
94+
95+
2. Check for common monorepo directory patterns:
9096
<list_files>
9197
<path>.</path>
9298
<recursive>false</recursive>
9399
</list_files>
94100

95-
Common monorepo packages to look for:
101+
Look for directories like:
96102
- apps/ (application packages)
97103
- packages/ (shared packages)
104+
- services/ (service packages)
105+
- libs/ (library packages)
106+
- modules/ (module packages)
98107
- src/ (main source if not using workspaces)
99108

109+
If monorepo detected:
110+
- Dynamically discover packages by looking for package.json files in detected directories
111+
- Build a list of available packages with their paths
112+
100113
Based on the user's description, try to identify which package they're referring to.
101114
If unclear, ask for clarification:
102115

103116
<ask_followup_question>
104117
<question>I see this is a monorepo with multiple packages. Which specific package or application is your issue related to?</question>
105118
<follow_up>
106-
<suggest>apps/vscode - The main VSCode extension</suggest>
107-
<suggest>apps/web-roo-code - The web application</suggest>
108-
<suggest>packages/cloud - Cloud functionality</suggest>
109-
<suggest>packages/types - Type definitions</suggest>
119+
[Dynamically generated list of discovered packages]
110120
<suggest>Let me describe which package: [specify]</suggest>
111121
</follow_up>
112122
</ask_followup_question>
113123

114-
Store the monorepo context for all future codebase searches and explorations.
124+
If standard repository:
125+
- Skip package selection
126+
- Use repository root for all searches
127+
128+
Store the repository context for all future codebase searches and explorations.
115129

116130
Update todo after determining context:
117131
<update_todo_list>
118132
<todos>
119133
[x] Detect current repository information
120-
[x] Determine monorepo context
134+
[x] Determine repository structure (monorepo/standard)
121135
[-] Perform initial codebase discovery
122136
[ ] Analyze user request to determine issue type
123137
[ ] Gather and verify additional information
@@ -134,7 +148,7 @@
134148
<step number="3">
135149
<name>Perform Initial Codebase Discovery</name>
136150
<instructions>
137-
Now that we know the monorepo context, immediately search the codebase to understand
151+
Now that we know the repository structure, immediately search the codebase to understand
138152
what the user is talking about before determining the issue type.
139153

140154
DISCOVERY ACTIVITIES:
@@ -146,7 +160,7 @@
146160

147161
<codebase_search>
148162
<query>[Keywords from user's initial message/description]</query>
149-
<path>[Monorepo package path from step 1]</path>
163+
<path>[Repository or package path from step 2]</path>
150164
</codebase_search>
151165

152166
Additional searches based on initial findings:
@@ -155,7 +169,7 @@
155169
- If component mentioned: search for implementation details
156170

157171
<search_files>
158-
<path>[monorepo package path]</path>
172+
<path>[repository or package path]</path>
159173
<regex>[specific patterns found in initial search]</regex>
160174
</search_files>
161175

@@ -169,7 +183,7 @@
169183
<update_todo_list>
170184
<todos>
171185
[x] Detect current repository information
172-
[x] Determine monorepo context
186+
[x] Determine repository structure (monorepo/standard)
173187
[x] Perform initial codebase discovery
174188
[-] Analyze user request to determine issue type
175189
[ ] Gather and verify additional information
@@ -225,7 +239,7 @@
225239
<update_todo_list>
226240
<todos>
227241
[x] Detect current repository information
228-
[x] Determine monorepo context
242+
[x] Determine repository structure (monorepo/standard)
229243
[x] Perform initial codebase discovery
230244
[x] Analyze user request to determine issue type
231245
[-] Gather and verify additional information
@@ -267,13 +281,13 @@
267281

268282
Example verification searches:
269283
<search_files>
270-
<path>[monorepo package path]</path>
284+
<path>[repository or package path]</path>
271285
<regex>[exact error message from user]</regex>
272286
</search_files>
273287

274288
<codebase_search>
275289
<query>[feature or component name] implementation</query>
276-
<path>[monorepo package path]</path>
290+
<path>[repository or package path]</path>
277291
</codebase_search>
278292

279293
For Feature Requests - AGGRESSIVE VERIFICATION WITH CONCRETE EXAMPLES:
@@ -357,7 +371,7 @@
357371
<update_todo_list>
358372
<todos>
359373
[x] Detect current repository information
360-
[x] Determine monorepo context
374+
[x] Determine repository structure (monorepo/standard)
361375
[x] Perform initial codebase discovery
362376
[x] Analyze user request to determine issue type
363377
[x] Gather and verify additional information
@@ -393,9 +407,9 @@
393407
Based on findings, provide informed context in the question:
394408

395409
<ask_followup_question>
396-
<question>Based on my analysis, this [issue type] involves [brief complexity assessment from code exploration]. Are you interested in implementing this yourself, or are you reporting it for the Roo team to handle?</question>
410+
<question>Based on my analysis, this [issue type] involves [brief complexity assessment from code exploration]. Are you interested in implementing this yourself, or are you reporting it for the project team to handle?</question>
397411
<follow_up>
398-
<suggest>Just reporting the problem - the Roo team can design the solution</suggest>
412+
<suggest>Just reporting the problem - the project team can design the solution</suggest>
399413
<suggest>I want to contribute and implement this myself</suggest>
400414
<suggest>I'd like to provide issue scoping to help whoever implements it</suggest>
401415
</follow_up>
@@ -405,7 +419,7 @@
405419
<update_todo_list>
406420
<todos>
407421
[x] Detect current repository information
408-
[x] Determine monorepo context
422+
[x] Determine repository structure (monorepo/standard)
409423
[x] Perform initial codebase discovery
410424
[x] Analyze user request to determine issue type
411425
[x] Gather and verify additional information
@@ -443,7 +457,7 @@
443457
<update_todo_list>
444458
<todos>
445459
[x] Detect current repository information
446-
[x] Determine monorepo context
460+
[x] Determine repository structure (monorepo/standard)
447461
[x] Perform initial codebase discovery
448462
[x] Analyze user request to determine issue type
449463
[x] Gather and verify additional information
@@ -490,7 +504,7 @@
490504
Use codebase_search with all extracted keywords to get an overview of relevant code.
491505
<codebase_search>
492506
<query>[Combined keywords from extraction phase]</query>
493-
<path>[Monorepo package path]</path>
507+
<path>[Repository or package path]</path>
494508
</codebase_search>
495509
</iteration>
496510

@@ -747,8 +761,8 @@ Example: "The function at line X calculates [value] by [method], which results i
747761
</phase>
748762
</sub_workflow>
749763

750-
Additional monorepo considerations:
751-
- Scope all searches to the identified monorepo package
764+
Additional considerations for monorepo repositories:
765+
- Scope all searches to the identified package (if monorepo)
752766
- Check for cross-package dependencies
753767
- Verify against package-specific conventions
754768
- Look for package-specific configuration
@@ -762,7 +776,7 @@ Example: "The function at line X calculates [value] by [method], which results i
762776
<update_todo_list>
763777
<todos>
764778
[x] Detect current repository information
765-
[x] Determine monorepo context
779+
[x] Determine repository structure (monorepo/standard)
766780
[x] Perform initial codebase discovery
767781
[x] Analyze user request to determine issue type
768782
[x] Gather and verify additional information
@@ -853,7 +867,7 @@ Example: "The function at line X calculates [value] by [method], which results i
853867
<update_todo_list>
854868
<todos>
855869
[x] Detect current repository information
856-
[x] Determine monorepo context
870+
[x] Determine repository structure (monorepo/standard)
857871
[x] Perform initial codebase discovery
858872
[x] Analyze user request to determine issue type
859873
[x] Gather and verify additional information
@@ -936,7 +950,7 @@ Example: "The function at line X calculates [value] by [method], which results i
936950
<update_todo_list>
937951
<todos>
938952
[x] Detect current repository information
939-
[x] Determine monorepo context
953+
[x] Determine repository structure (monorepo/standard)
940954
[x] Perform initial codebase discovery
941955
[x] Analyze user request to determine issue type
942956
[x] Gather and verify additional information
@@ -983,12 +997,13 @@ Example: "The function at line X calculates [value] by [method], which results i
983997
<update_todo_list>
984998
<todos>
985999
[x] Detect current repository information
986-
[x] Determine monorepo context
1000+
[x] Determine repository structure (monorepo/standard)
9871001
[x] Perform initial codebase discovery
9881002
[x] Analyze user request to determine issue type
9891003
[x] Gather and verify additional information
9901004
[x] Determine if user wants to contribute
9911005
[x] Perform issue scoping (if contributing)
1006+
[x] Check for repository issue templates
9921007
[x] Draft issue content
9931008
[x] Review and confirm with user
9941009
[-] Prepare issue for submission
@@ -1011,15 +1026,15 @@ Example: "The function at line X calculates [value] by [method], which results i
10111026
If no exact duplicates are found, save the issue content to a temporary file within the project:
10121027

10131028
<write_to_file>
1014-
<path>github_issue_draft.md</path>
1015-
<content>[The complete formatted issue body from step 7]</content>
1029+
<path>./github_issue_draft.md</path>
1030+
<content>[The complete formatted issue body from step 8]</content>
10161031
<line_count>[calculated line count]</line_count>
10171032
</write_to_file>
10181033

10191034
After saving the issue draft, ask the user how they would like to proceed:
10201035

10211036
<ask_followup_question>
1022-
<question>I've saved the issue draft to github_issue_draft.md. The issue is ready for submission with the following details:
1037+
<question>I've saved the issue draft to ./github_issue_draft.md. The issue is ready for submission with the following details:
10231038

10241039
Title: "[Descriptive title with component name]"
10251040
Labels: [appropriate labels based on issue type]
@@ -1047,20 +1062,21 @@ Example: "The function at line X calculates [value] by [method], which results i
10471062
- Return to the submission question
10481063

10491064
If "I'll submit it manually":
1050-
- Inform them the draft is saved at .tmp/github_issue_draft.md
1065+
- Inform them the draft is saved at the configured location
10511066
- Provide the gh command they can use later
10521067
- Complete the workflow without submission
10531068

10541069
Update todos based on the outcome:
10551070
<update_todo_list>
10561071
<todos>
10571072
[x] Detect current repository information
1058-
[x] Determine monorepo context
1073+
[x] Determine repository structure (monorepo/standard)
10591074
[x] Perform initial codebase discovery
10601075
[x] Analyze user request to determine issue type
10611076
[x] Gather and verify additional information
10621077
[x] Determine if user wants to contribute
10631078
[x] Perform issue scoping (if contributing)
1079+
[x] Check for repository issue templates
10641080
[x] Draft issue content
10651081
[x] Review and confirm with user
10661082
[x] Prepare issue for submission
@@ -1079,19 +1095,19 @@ Example: "The function at line X calculates [value] by [method], which results i
10791095
If the user chooses to submit immediately:
10801096

10811097
<execute_command>
1082-
<command>gh issue create --repo $REPO_FULL_NAME --title "[Descriptive title]" --body-file github_issue_draft.md --label "[appropriate labels]"</command>
1098+
<command>gh issue create --repo $REPO_FULL_NAME --title "[Descriptive title]" --body-file ./github_issue_draft.md --label "[appropriate labels]"</command>
10831099
</execute_command>
10841100

10851101
Label selection based on findings:
1086-
- Bug: "bug", potentially "regression" if code shows it worked before
1087-
- Feature: "proposal", "enhancement", potentially package-specific labels
1088-
- Add "monorepo" label if affects multiple packages
1102+
- Bug: Use "bug" label
1103+
- Feature: Use "enhancement" label
1104+
- If affects multiple packages in monorepo: add "affects-multiple" label
10891105

10901106
After successful creation:
10911107
- Capture and display the issue URL
10921108
- Clean up the temporary file:
10931109
<execute_command>
1094-
<command>rm github_issue_draft.md</command>
1110+
<command>rm ./github_issue_draft.md</command>
10951111
</execute_command>
10961112
- Provide a summary of key findings included
10971113

@@ -1116,23 +1132,24 @@ Example: "The function at line X calculates [value] by [method], which results i
11161132
If the user will submit manually:
11171133

11181134
Provide clear instructions:
1119-
"The issue draft has been saved to github_issue_draft.md
1120-
1135+
"The issue draft has been saved to ./github_issue_draft.md
1136+
11211137
To submit it later, you can use:
1122-
gh issue create --repo $REPO_FULL_NAME --title "[Your title]" --body-file github_issue_draft.md --label "[labels]"
1138+
gh issue create --repo $REPO_FULL_NAME --title "[Your title]" --body-file ./github_issue_draft.md --label "[labels]"
11231139

11241140
Or you can copy the content and create the issue through the GitHub web interface."
11251141

11261142
Final todo update:
11271143
<update_todo_list>
11281144
<todos>
11291145
[x] Detect current repository information
1130-
[x] Determine monorepo context
1146+
[x] Determine repository structure (monorepo/standard)
11311147
[x] Perform initial codebase discovery
11321148
[x] Analyze user request to determine issue type
11331149
[x] Gather and verify additional information
11341150
[x] Determine if user wants to contribute
11351151
[x] Perform issue scoping (if contributing)
1152+
[x] Check for repository issue templates
11361153
[x] Draft issue content
11371154
[x] Review and confirm with user
11381155
[x] Prepare issue for submission

0 commit comments

Comments
 (0)