Skip to content

Commit db9850c

Browse files
committed
feat: add Discord-only workflow and related tests for generating formatted release notes
1 parent 6ff4147 commit db9850c

File tree

7 files changed

+535
-129
lines changed

7 files changed

+535
-129
lines changed
Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
<discord_only_workflow_instructions>
2+
<overview>
3+
Specialized workflow for generating Discord-formatted release notes from existing release files.
4+
This allows users to quickly get Discord-ready announcements without creating release notes from scratch.
5+
</overview>
6+
7+
<entry_patterns>
8+
<description>
9+
User messages that trigger the Discord-only workflow
10+
</description>
11+
<patterns>
12+
<pattern>Discord release notes for X.Y.Z</pattern>
13+
<pattern>Generate Discord format for vX.Y.Z</pattern>
14+
<pattern>Discord announcement for X.Y.Z, A.B.C, D.E.F</pattern>
15+
<pattern>Discord notes for v3.23.14</pattern>
16+
<pattern>Discord release notes for 3.23.14, 3.23.15</pattern>
17+
</patterns>
18+
</entry_patterns>
19+
20+
<workflow_steps>
21+
<step number="1">
22+
<title>Parse Version Numbers</title>
23+
<action>Extract version numbers from user request</action>
24+
<details>
25+
Support multiple formats:
26+
- Single version: "3.23.14" or "v3.23.14"
27+
- Multiple versions: "3.23.14, 3.23.15, 3.23.16"
28+
- Mixed formats: "v3.23.14, 3.23.15, v3.23.16"
29+
</details>
30+
<parsing_rules>
31+
<rule>Strip 'v' prefix if present</rule>
32+
<rule>Split by commas for multiple versions</rule>
33+
<rule>Trim whitespace</rule>
34+
<rule>Validate version format (X.Y.Z)</rule>
35+
</parsing_rules>
36+
</step>
37+
38+
<step number="2">
39+
<title>Check File Existence</title>
40+
<action>Verify release notes files exist</action>
41+
<tool>list_files</tool>
42+
<details>
43+
Check docs/update-notes/ for each requested version file (vX.Y.Z.mdx)
44+
</details>
45+
<error_handling>
46+
<missing_files>
47+
<action>Report which versions are missing</action>
48+
<example><![CDATA[
49+
<ask_followup_question>
50+
<question>I couldn't find release notes for the following versions: v3.23.16, v3.23.17. Would you like me to:</question>
51+
<follow_up>
52+
<suggest>Generate Discord notes for the versions that exist (3.23.14, 3.23.15)</suggest>
53+
<suggest mode="release-notes-writer">Create release notes for v3.23.16 first</suggest>
54+
<suggest>Cancel this request</suggest>
55+
</follow_up>
56+
</ask_followup_question>
57+
]]></example>
58+
</missing_files>
59+
</error_handling>
60+
</step>
61+
62+
<step number="3">
63+
<title>Process Each Version</title>
64+
<action>Generate Discord format for each existing version</action>
65+
<substeps>
66+
<substep number="1">
67+
<action>Read release notes file</action>
68+
<tool>read_file</tool>
69+
<file>docs/update-notes/vX.Y.Z.mdx</file>
70+
</substep>
71+
<substep number="2">
72+
<action>Apply Discord transformations</action>
73+
<transformations>
74+
<transform>Remove frontmatter</transform>
75+
<transform>Strip PR links and numbers</transform>
76+
<transform>Convert internal links to full URLs</transform>
77+
<transform>Preserve emoji and formatting</transform>
78+
<transform>Add version-specific footer</transform>
79+
</transformations>
80+
</substep>
81+
<substep number="3">
82+
<action>Handle special requests</action>
83+
<options>
84+
<option name="compression">
85+
<trigger>User mentions "compress" or "summarize"</trigger>
86+
<action>Compress minor sections into summary</action>
87+
</option>
88+
<option name="highlights_only">
89+
<trigger>User mentions "highlights" or "major features"</trigger>
90+
<action>Include only major features and important fixes</action>
91+
</option>
92+
</options>
93+
</substep>
94+
</substeps>
95+
</step>
96+
97+
<step number="4">
98+
<title>Format Output</title>
99+
<action>Present Discord-ready text</action>
100+
<single_version_format><![CDATA[
101+
# Roo Code X.Y.Z Release Notes
102+
103+
[Summary sentence from original]
104+
105+
## [Major Feature Name]
106+
107+
[Feature description without PR links]
108+
109+
## Bug Fixes
110+
111+
* **[Fix Name]**: [Description] (thanks [contributors]!)
112+
* **[Another Fix]**: [Description] (thanks [contributors]!)
113+
114+
[Full X.Y.Z Release Notes](https://docs.roocode.com/update-notes/vX.Y.Z)
115+
]]></single_version_format>
116+
<multiple_versions_format><![CDATA[
117+
# Roo Code Release Notes
118+
119+
## Version X.Y.Z
120+
121+
[Summary and key changes]
122+
123+
## Version A.B.C
124+
125+
[Summary and key changes]
126+
127+
---
128+
Full release notes:
129+
- [X.Y.Z Release Notes](https://docs.roocode.com/update-notes/vX.Y.Z)
130+
- [A.B.C Release Notes](https://docs.roocode.com/update-notes/vA.B.C)
131+
]]></multiple_versions_format>
132+
</step>
133+
134+
<step number="5">
135+
<title>Provide Copy Instructions</title>
136+
<action>Give user the formatted text with copy guidance</action>
137+
<completion_message>
138+
Here's the Discord-formatted release notes. You can copy and paste this directly into Discord.
139+
140+
[Include formatted text in a code block for easy copying]
141+
</completion_message>
142+
</step>
143+
</workflow_steps>
144+
145+
<implementation_details>
146+
<detail name="no_file_creation">
147+
<description>This workflow does not create or modify any files</description>
148+
<reason>It only reads existing files and outputs formatted text</reason>
149+
</detail>
150+
<detail name="no_github_api">
151+
<description>No GitHub API calls are needed</description>
152+
<reason>All information comes from existing release note files</reason>
153+
</detail>
154+
<detail name="immediate_response">
155+
<description>Workflow completes quickly without subtasks</description>
156+
<reason>Simple file reading and text transformation</reason>
157+
</detail>
158+
</implementation_details>
159+
160+
<examples>
161+
<example name="single_version">
162+
<user_request>Discord release notes for 3.23.14</user_request>
163+
<workflow>
164+
1. Parse version: 3.23.14
165+
2. Check file exists: docs/update-notes/v3.23.14.mdx ✓
166+
3. Read file and transform
167+
4. Output Discord-formatted text
168+
</workflow>
169+
</example>
170+
171+
<example name="multiple_versions">
172+
<user_request>Generate Discord announcement for v3.23.14, v3.23.15, v3.23.16</user_request>
173+
<workflow>
174+
1. Parse versions: 3.23.14, 3.23.15, 3.23.16
175+
2. Check files: v3.23.14.mdx ✓, v3.23.15.mdx ✓, v3.23.16.mdx ✗
176+
3. Ask user how to proceed with missing v3.23.16
177+
4. Process existing versions
178+
5. Output combined Discord announcement
179+
</workflow>
180+
</example>
181+
182+
<example name="with_compression">
183+
<user_request>Discord notes for 3.23.14, compress the minor fixes</user_request>
184+
<workflow>
185+
1. Parse version and compression request
186+
2. Check file exists
187+
3. Read and transform with compression
188+
4. Output condensed Discord format
189+
</workflow>
190+
</example>
191+
</examples>
192+
193+
<error_scenarios>
194+
<scenario name="no_versions_found">
195+
<trigger>User provides version numbers but no files exist</trigger>
196+
<response>Explain that no release notes exist and offer to create them</response>
197+
</scenario>
198+
<scenario name="invalid_version_format">
199+
<trigger>User provides invalid version format (e.g., "3.23" without patch)</trigger>
200+
<response>Ask for clarification on the full version number</response>
201+
</scenario>
202+
<scenario name="ambiguous_request">
203+
<trigger>Unclear if user wants Discord format or full release notes</trigger>
204+
<response>Ask for clarification with suggested options</response>
205+
</scenario>
206+
</error_scenarios>
207+
</discord_only_workflow_instructions>
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<discord_workflow_test_scenarios>
2+
<overview>
3+
Test scenarios to validate the Discord-only workflow functionality.
4+
These tests ensure the mode correctly handles various user requests for Discord formatting.
5+
</overview>
6+
7+
<test_scenarios>
8+
<scenario id="1">
9+
<name>Single existing version</name>
10+
<user_input>Discord release notes for 3.23.14</user_input>
11+
<expected_behavior>
12+
1. Detect Discord-only workflow pattern
13+
2. Parse version: 3.23.14
14+
3. Check if docs/update-notes/v3.23.14.mdx exists
15+
4. Read file and apply Discord transformations
16+
5. Output formatted text with footer link
17+
</expected_behavior>
18+
<validation>
19+
- No GitHub API calls made
20+
- No files created or modified
21+
- PR links removed from output
22+
- Internal links converted to full URLs
23+
</validation>
24+
</scenario>
25+
26+
<scenario id="2">
27+
<name>Multiple existing versions</name>
28+
<user_input>Generate Discord format for v3.23.14, v3.23.15, v3.23.16</user_input>
29+
<expected_behavior>
30+
1. Detect Discord-only workflow pattern
31+
2. Parse versions: 3.23.14, 3.23.15, 3.23.16
32+
3. Check existence of all three files
33+
4. Process each existing file
34+
5. Output combined Discord announcement
35+
</expected_behavior>
36+
<validation>
37+
- Each version gets its own section
38+
- Footer includes links to all versions
39+
- Consistent formatting across versions
40+
</validation>
41+
</scenario>
42+
43+
<scenario id="3">
44+
<name>Mixed existing and missing versions</name>
45+
<user_input>Discord announcement for 3.23.14, 3.23.99</user_input>
46+
<expected_behavior>
47+
1. Parse versions: 3.23.14, 3.23.99
48+
2. Check files: v3.23.14.mdx exists, v3.23.99.mdx missing
49+
3. Ask user how to proceed with missing version
50+
4. Based on response, either:
51+
- Process only existing version
52+
- Offer to create missing release notes first
53+
</expected_behavior>
54+
<validation>
55+
- Clear error message about missing version
56+
- Actionable suggestions provided
57+
- Graceful handling of partial success
58+
</validation>
59+
</scenario>
60+
61+
<scenario id="4">
62+
<name>With compression request</name>
63+
<user_input>Discord notes for 3.23.14, compress the bug fixes</user_input>
64+
<expected_behavior>
65+
1. Detect Discord-only workflow and compression flag
66+
2. Process version with compression
67+
3. Summarize bug fixes section
68+
4. Output condensed format
69+
</expected_behavior>
70+
<validation>
71+
- Bug fixes compressed into summary
72+
- Major features remain expanded
73+
- Contributor list preserved in summary
74+
</validation>
75+
</scenario>
76+
77+
<scenario id="5">
78+
<name>Invalid version format</name>
79+
<user_input>Discord release notes for 3.23</user_input>
80+
<expected_behavior>
81+
1. Detect incomplete version number
82+
2. Ask for clarification
83+
3. Suggest checking available versions
84+
</expected_behavior>
85+
<validation>
86+
- Clear error about version format
87+
- Helpful suggestions provided
88+
</validation>
89+
</scenario>
90+
91+
<scenario id="6">
92+
<name>Ambiguous request (not Discord-specific)</name>
93+
<user_input>Release notes for 3.23.14</user_input>
94+
<expected_behavior>
95+
1. Detect main workflow pattern (not Discord-only)
96+
2. Proceed with full release notes creation
97+
3. Fetch PRs from GitHub
98+
</expected_behavior>
99+
<validation>
100+
- Does NOT trigger Discord-only workflow
101+
- Follows standard release notes creation
102+
</validation>
103+
</scenario>
104+
105+
<scenario id="7">
106+
<name>Discord with date range</name>
107+
<user_input>Discord release notes for all versions from 3.23.10 to 3.23.14</user_input>
108+
<expected_behavior>
109+
1. Recognize range request
110+
2. List files in update-notes directory
111+
3. Find all versions in range
112+
4. Process each found version
113+
</expected_behavior>
114+
<validation>
115+
- Correctly identifies versions in range
116+
- Processes in version order
117+
- Combined output for all versions
118+
</validation>
119+
</scenario>
120+
</test_scenarios>
121+
122+
<edge_cases>
123+
<case name="empty_version_list">
124+
<input>Discord release notes for</input>
125+
<expected>Ask user to specify version numbers</expected>
126+
</case>
127+
128+
<case name="typo_in_command">
129+
<input>Discrod release notes for 3.23.14</input>
130+
<expected>May not trigger Discord workflow - handle gracefully</expected>
131+
</case>
132+
133+
<case name="very_long_version_list">
134+
<input>Discord format for v3.23.1, v3.23.2, v3.23.3, ... (20+ versions)</input>
135+
<expected>Process all but suggest breaking into smaller groups</expected>
136+
</case>
137+
</edge_cases>
138+
139+
<integration_tests>
140+
<test name="workflow_switching">
141+
<description>Ensure smooth transition between workflows</description>
142+
<steps>
143+
1. Start with Discord-only request
144+
2. If version missing, offer to create it
145+
3. If user accepts, switch to main workflow
146+
4. After creation, return to Discord formatting
147+
</steps>
148+
</test>
149+
150+
<test name="pattern_priority">
151+
<description>Verify correct pattern matching priority</description>
152+
<cases>
153+
<case>
154+
<input>Generate Discord-formatted release notes for version 3.23.14</input>
155+
<should_match>subtask_discord (not discord_only)</should_match>
156+
</case>
157+
<case>
158+
<input>Discord release notes for 3.23.14</input>
159+
<should_match>discord_only</should_match>
160+
</case>
161+
</cases>
162+
</test>
163+
</integration_tests>
164+
165+
<performance_considerations>
166+
<consideration>
167+
<aspect>File reading efficiency</aspect>
168+
<note>When processing multiple versions, read files sequentially to avoid memory issues</note>
169+
</consideration>
170+
<consideration>
171+
<aspect>Output size</aspect>
172+
<note>Discord has message length limits - warn if output exceeds 2000 characters</note>
173+
</consideration>
174+
</performance_considerations>
175+
</discord_workflow_test_scenarios>

0 commit comments

Comments
 (0)