Skip to content

Commit ac41c19

Browse files
committed
refactor: streamline PR analysis by implementing inline processing and removing subtask creation
1 parent 5a7c240 commit ac41c19

1 file changed

Lines changed: 106 additions & 116 deletions

File tree

.roo/rules-release-notes-writer/1_main_workflow.xml

Lines changed: 106 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -107,58 +107,60 @@ gh pr list --repo RooCodeInc/Roo-Code --state merged --base main --limit 1000 \
107107
</phase>
108108

109109
<phase name="pr_processing">
110-
<initialization priority="CRITICAL">
111-
<action>Create .roo/tmp/release-notes/temp_pr_analysis_v[version].md</action>
110+
<overview>
111+
Process each PR inline to gather details, categorize changes, and identify documentation needs.
112+
All analysis happens within this task without spawning subtasks.
113+
</overview>
114+
115+
<initialization>
116+
<action>Create tracking file for PR analysis</action>
117+
<file>.roo/tmp/release-notes/temp_pr_analysis_v[version].md</file>
112118
<details>
113-
Parent task MUST create this file (and .roo/tmp/release-notes/temp_pr_inclusion_v[version].json, .roo/tmp/release-notes/temp_pr_list_v[VERSION].md if needed) before ANY subtasks.
114-
Subtasks will ONLY add entries to these temp files using the available safe file-editing capability (preserve existing content; no overwrites).
115-
Parent task MUST NOT add entries to temp_pr_analysis_v[version].md; this file is reserved exclusively for subtask outputs. The parent may only create/initialize the empty file(s).
116-
Temp files live under .roo/tmp/release-notes/
119+
Create the temp directory and file to track PR analysis results.
120+
Each PR analysis will be appended to this file as it completes.
117121
</details>
118122
</initialization>
119123

120-
<subtask_pattern priority="CRITICAL">
124+
<inline_analysis_workflow>
121125
<for_each>PR in list</for_each>
122-
<action>Create investigation subtask using new_task tool</action>
123-
<implementation>
124-
<tool>new_task</tool>
125-
<mode>release-notes-writer</mode>
126-
<description>
127-
For each PR in the fetched or provided list, create a separate subtask
128-
using the new_task tool. Each subtask investigates one PR independently.
129-
</description>
130-
<iteration_approach>
131-
Process PRs sequentially or in batches, creating a new_task for each PR number.
132-
Wait for all subtasks to complete before proceeding to compilation phase.
133-
</iteration_approach>
134-
</implementation>
135-
<message_template>
136-
Investigate PR #[number] for release notes v[version].
137-
1. Get PR details: gh pr view [number] --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labels,body,url
138-
2. Extract linked issues from PR body
139-
3. Get issue details if linked
140-
4. Categorize change (Feature/QOL/Bug Fix/Provider Update)
141-
5. Identify documentation needs (new features, behavior changes, deprecations)
142-
6. Add to .roo/tmp/release-notes/temp_pr_analysis_v[version].md at the start, preserving existing content (use the available safe file-editing capability)
143-
144-
Include documentation flags:
145-
- docs-new: Completely new feature
146-
- docs-update: Existing docs need updating
147-
- docs-example: New examples needed
148-
- docs-migration: Breaking changes
149-
150-
CRITICAL: Never overwrite existing content; only add entries while preserving prior content.
151-
MANDATORY: Insert the marker line '&lt;!-- generated-by-subtask: true --&gt;' immediately before the '---' separator in each PR entry.
152-
</message_template>
153-
<todos_template>
154-
[ ] Fetch PR #[number] details using gh pr view --repo RooCodeInc/Roo-Code
155-
[ ] Extract linked issues from PR body
156-
[ ] Get issue details for each linked issue
157-
[ ] Categorize the change (Feature/QOL/Bug Fix/Provider Update)
158-
[ ] Identify documentation needs
159-
[ ] Write analysis to .roo/tmp/release-notes/temp_pr_analysis_v[version].md
160-
</todos_template>
161-
</subtask_pattern>
126+
<action>Analyze PR inline using gh CLI</action>
127+
<steps>
128+
<step number="1">
129+
<action>Fetch PR details</action>
130+
<command>gh pr view [NUMBER] --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labels,body,url</command>
131+
</step>
132+
<step number="2">
133+
<action>Extract linked issues from PR body</action>
134+
<details>Parse the PR body for issue references (Fixes #123, Closes #456, etc.)</details>
135+
</step>
136+
<step number="3">
137+
<action>Fetch linked issue details if present</action>
138+
<command>gh issue view [ISSUE_NUMBER] --repo RooCodeInc/Roo-Code --json number,title,author,body</command>
139+
</step>
140+
<step number="4">
141+
<action>Categorize the change</action>
142+
<categories>
143+
<category>Feature - New functionality</category>
144+
<category>QOL Improvement - UI/UX enhancement</category>
145+
<category>Bug Fix - Resolves an issue</category>
146+
<category>Provider Update - API provider changes</category>
147+
</categories>
148+
</step>
149+
<step number="5">
150+
<action>Identify documentation needs</action>
151+
<flags>
152+
<flag name="docs-new">Completely new feature requiring new documentation page</flag>
153+
<flag name="docs-update">Existing documentation needs updating</flag>
154+
<flag name="docs-example">New examples or use cases to add</flag>
155+
<flag name="docs-migration">Migration guide needed for breaking changes</flag>
156+
</flags>
157+
</step>
158+
<step number="6">
159+
<action>Append analysis to tracking file</action>
160+
<file>.roo/tmp/release-notes/temp_pr_analysis_v[version].md</file>
161+
</step>
162+
</steps>
163+
</inline_analysis_workflow>
162164

163165
<output_format>
164166
## PR #[number]: [Title]
@@ -170,38 +172,15 @@ gh pr list --repo RooCodeInc/Roo-Code --state merged --base main --limit 1000 \
170172
**Contributors**: [list]
171173
**Documentation Needs**: [none|docs-new|docs-update|docs-example|docs-migration]
172174
**Documentation Notes**: [If applicable, what needs documenting]
173-
&lt;!-- generated-by-subtask: true --&gt;
174175

175176
---
176177
</output_format>
177178

178-
<subtask_creation_example>
179-
<description>Example of creating subtasks for a PR list</description>
180-
<scenario>Given PRs: #1234, #1235, #1236 for version 3.20.1</scenario>
181-
<implementation><![CDATA[
182-
<!-- For each PR, create a subtask like this: -->
183-
<new_task>
184-
<mode>release-notes-writer</mode>
185-
<message>Investigate PR #1234 for release notes v3.20.1.
186-
187-
Get PR details: gh pr view 1234 --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labels,body,url
188-
Extract linked issues and get details
189-
Categorize the change and identify documentation needs
190-
Add analysis to .roo/tmp/release-notes/temp_pr_analysis_v3.20.1.md at the start, preserving existing content</message>
191-
<todos>
192-
[ ] Fetch PR #1234 details
193-
[ ] Extract linked issues and get details
194-
[ ] Categorize and analyze
195-
[ ] Write to temp_pr_analysis_v3.20.1.md
196-
</todos>
197-
</new_task>
198-
]]></implementation>
199-
<critical_notes>
200-
- Parent creates temp files first
201-
- Each PR gets its own subtask
202-
- Subtasks only add entries; never overwrite existing content
203-
</critical_notes>
204-
</subtask_creation_example>
179+
<processing_guidance>
180+
<note>Process PRs sequentially, appending each analysis to the tracking file</note>
181+
<note>For large PR lists (10+), provide progress updates every 5 PRs</note>
182+
<note>If a PR fetch fails, note the error and continue with remaining PRs</note>
183+
</processing_guidance>
205184
</phase>
206185

207186
<phase name="changelog_alignment">
@@ -341,11 +320,11 @@ fi
341320
- Author signal: if bullet contains "thanks @user", "by @user", or "PR by @user" and that user equals the PR author or credited issue reporter, add +0.20 to score
342321
- Keyword boost: +0.05 when provider/model/domain keywords (e.g., OpenAI, Claude, Grok, Chutes, Qwen, LongCat, etc.) appear in both
343322
Confidence thresholds:
344-
- score &gt;= 0.65 (after boosts) -&gt; linked (confident). Treat as changelog-referenced.
345-
- 0.45 &lt;= score &lt; 0.65 OR multiple candidates within 0.05 -&gt; ambiguous (needs review)
346-
- score &lt; 0.45 -&gt; unlinked
323+
- score >= 0.65 (after boosts) -> linked (confident). Treat as changelog-referenced.
324+
- 0.45 <= score < 0.65 OR multiple candidates within 0.05 -> ambiguous (needs review)
325+
- score < 0.45 -> unlinked
347326
Tie-breakers: higher score; if within 0.02 then same author; then closer merge date to release date; then lowest PR number
348-
Edge case: If bullet credits exactly one username and exactly one PR in the window has that author, accept with score &gt;= 0.50 (confidence="author-boost")
327+
Edge case: If bullet credits exactly one username and exactly one PR in the window has that author, accept with score >= 0.50 (confidence="author-boost")
349328
Implementation notes:
350329
- Match only against PRs fetched for the version's date window
351330
- Persist mapping bullet_text -> { prNumber, confidenceScore, rationaleSignals[] } and use it to compute linked/ambiguous/unlinked counts
@@ -354,33 +333,24 @@ fi
354333
</step>
355334

356335
<step number="2a">
357-
<action>Supplement candidate PR set with changelog-referenced PRs not in fetched list and spawn analysis subtasks</action>
336+
<action>Supplement candidate PR set with changelog-referenced PRs not in fetched list</action>
358337
<details>
359338
- Identify referenced PR numbers from step 2 that are missing from .roo/tmp/release-notes/temp_pr_analysis_v[version].md
360-
- For each missing PR, fetch details and create a new investigation subtask (same pattern as pr_processing) to add analysis to temp_pr_analysis_v[version].md without overwriting existing content
339+
- For each missing PR, fetch details and analyze inline (same process as pr_processing phase)
361340
- Mark these as out_of_range if their mergedAt is outside the computed date window
362-
- Wait for all spawned subtasks to complete before proceeding
341+
- Append analysis to the tracking file
363342
</details>
364-
<commands>
365-
<fetch><![CDATA[
366-
# For each referenced PR number N not present in .roo/tmp/release-notes/temp_pr_analysis_v[version].md:
367-
gh pr view N --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labels,files
368-
]]></fetch>
369-
<spawn_subtask><![CDATA[
370-
<new_task>
371-
<mode>release-notes-writer</mode>
372-
<message>Investigate PR #[NUMBER] (changelog-referenced, possibly out of original range) for release notes v[version]. Follow standard analysis and add to .roo/tmp/release-notes/temp_pr_analysis_v[version].md without overwriting existing content.</message>
373-
<todos>
374-
[ ] Fetch PR #[NUMBER] details using gh pr view --repo RooCodeInc/Roo-Code
375-
[ ] Extract linked issues from PR body
376-
[ ] Get issue details for each linked issue
377-
[ ] Categorize the change (Feature/QOL/Bug Fix/Provider Update)
378-
[ ] Identify documentation needs
379-
[ ] Write analysis to .roo/tmp/release-notes/temp_pr_analysis_v[version].md
380-
</todos>
381-
</new_task>
382-
]]></spawn_subtask>
383-
</commands>
343+
<inline_analysis>
344+
<for_each>Missing PR number referenced in changelog</for_each>
345+
<command>gh pr view [NUMBER] --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labels,body,url</command>
346+
<process>
347+
- Fetch PR details
348+
- Extract linked issues
349+
- Categorize change
350+
- Identify documentation needs
351+
- Append to .roo/tmp/release-notes/temp_pr_analysis_v[version].md
352+
</process>
353+
</inline_analysis>
384354
</step>
385355

386356
<step number="2b">
@@ -459,7 +429,6 @@ gh pr view N --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labe
459429
</inputs>
460430
<precondition>
461431
- Inclusion policy required: If .roo/tmp/release-notes/temp_pr_inclusion_v[version].json does not exist, you MUST execute the changelog_alignment phase now to obtain an inclusion decision, then retry this step.
462-
- Subtask provenance required: All PR analysis entries MUST contain the marker '&lt;!-- generated-by-subtask: true --&gt;'. If any entries are missing this marker, HALT and re-run PR analysis via per-PR subtasks before proceeding.
463432
</precondition>
464433
<filtering>
465434
Include only PRs listed in "included" from .roo/tmp/release-notes/temp_pr_inclusion_v[version].json. Do not fall back to using all analyzed PRs without an explicit inclusion policy.
@@ -484,7 +453,7 @@ gh pr view N --repo RooCodeInc/Roo-Code --json number,title,author,mergedAt,labe
484453
<checks>
485454
<check>Each bullet must answer: what changed, where the user sees it, why it matters.</check>
486455
<check>Replace internal terms (e.g., "protocol selector") with the on-screen wording users see.</check>
487-
<check>For fixes, start with Fixes an issue where … or Resolves a problem where … instead of echoing PR titles.</check>
456+
<check>For fixes, start with "Fixes an issue where …" or "Resolves a problem where …" instead of echoing PR titles.</check>
488457
</checks>
489458
</user_facing_rewrite>
490459
</step>
@@ -556,10 +525,38 @@ Which features should I highlight with expanded sections in the release notes?
556525
</step>
557526

558527
<step number="6">
559-
<action>Create documentation update task</action>
560-
<when>If any documentation flags were identified</when>
561-
<tool>new_task with mode="documentation-writer"</tool>
528+
<action>Summarize documentation update needs</action>
529+
<when>If any documentation flags were identified during PR analysis</when>
530+
<output>
531+
Present a summary of documentation needs to the user:
532+
- List items flagged as docs-new (new features needing new pages)
533+
- List items flagged as docs-update (existing pages needing updates)
534+
- List items flagged as docs-example (new examples needed)
535+
- List items flagged as docs-migration (migration guides needed)
536+
537+
The user can then follow up with documentation-writer mode separately if desired.
538+
</output>
539+
<template><![CDATA[
540+
**Documentation Update Summary:**
541+
542+
The following items may need documentation updates:
543+
544+
**New Documentation Needed:**
545+
- [Feature name]: [Brief description of what needs documenting]
546+
547+
**Existing Docs Updates:**
548+
- [Page/feature]: [What needs updating]
549+
550+
**Examples Needed:**
551+
- [Feature]: [Example scenarios to add]
552+
553+
**Migration Guides:**
554+
- [Breaking change]: [Migration path to document]
555+
556+
To create these documentation updates, you can start a new task with documentation-writer mode.
557+
]]></template>
562558
</step>
559+
563560
<step number="7">
564561
<action>Cleanup temporary files</action>
565562
<details>Delete .roo/tmp/release-notes/* (temp_pr_analysis_v[version].md, temp_pr_list_v[version].md, temp_pr_inclusion_v[version].json) after notes are finalized.</details>
@@ -700,20 +697,13 @@ gh pr list --repo RooCodeInc/Roo-Code --state merged --base main --limit 1000 \
700697
Date format is YYYY-MM-DD (ISO 8601) where MM is month (01-12)
701698
</rule>
702699
<rule priority="CRITICAL">
703-
Parent task creates temp files, subtasks only add entries (never overwrite)
704-
</rule>
705-
<rule priority="CRITICAL">
706-
For each PR, the parent MUST create a subtask via new_task. The parent MUST NOT write PR analysis entries; only subtasks may add entries to .roo/tmp/release-notes/temp_pr_analysis_v[version].md without overwriting existing content. Do not proceed to changelog_alignment or compilation until all PR subtasks complete.
707-
Even when the parent already has the PR number, title, description, or a user‑provided
708-
summary list, it MUST still create and wait on the per‑PR subtask. These summaries are
709-
insufficient for functional understanding of the change, discovery of linked issues, and
710-
correct contributor attribution (PR authors and issue reporters).
700+
All PR analysis happens inline within this task - do not spawn subtasks
711701
</rule>
712702
<rule priority="CRITICAL">
713703
Use the simplified PR extraction command for consistent results
714704
</rule>
715705
<rule priority="HIGH">
716-
Acknowledge PR author AND issue reporter, unless the username is on the release-notes thank you exclusion list.
706+
Acknowledge PR author AND issue reporter, unless the username is on the release-notes "thank you" exclusion list.
717707
If all candidate acknowledgements are excluded, omit the thanks parenthetical entirely.
718708
</rule>
719709
<rule priority="HIGH">

0 commit comments

Comments
 (0)