Skip to content

Commit 4dd1977

Browse files
committed
feat: enhance documentation workflow with detailed review processes and user feedback mechanisms
1 parent 5f073ee commit 4dd1977

File tree

4 files changed

+106
-44
lines changed

4 files changed

+106
-44
lines changed

.roo/rules-docs-extractor/1_extraction_workflow.xml

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
<step number="1">
1111
<title>Understand Documentation Request</title>
1212
<actions>
13-
<action>Parse the user's request to identify the feature or component</action>
14-
<action>Default to user-friendly documentation unless technical docs are specifically requested</action>
15-
<action>Focus on practical benefits and real-world usage</action>
16-
<action>Note any specific aspects the user wants emphasized</action>
13+
<action>Parse the user's request to identify the feature or component.</action>
14+
<action>Determine if the user has provided a documentation section for review or is requesting new documentation.</action>
15+
<action>Default to user-friendly documentation unless technical docs are specifically requested.</action>
16+
<action>Focus on practical benefits and real-world usage.</action>
17+
<action>Note any specific aspects the user wants emphasized.</action>
1718
</actions>
18-
<note>The user will specify what they want documented in their initial message - no need to ask</note>
19+
<note>The user will specify what they want documented in their initial message. The workflow branches based on whether a review is requested or new documentation is to be generated.</note>
1920
</step>
2021

2122
<step number="2">
@@ -201,47 +202,26 @@
201202
</analysis_phases>
202203

203204
<documentation_generation>
205+
<note>This phase has two paths: Reviewing existing docs or Generating new docs. The path taken is determined in the initialization phase.</note>
204206
<step number="1">
205-
<title>Choose Documentation Style</title>
207+
<title>Path 1: Review and Recommend Improvements</title>
208+
<note>This path is followed if the user provided a documentation section for review.</note>
206209
<actions>
207-
<action>Default to user-focused template for end-user features</action>
208-
<action>Use comprehensive template only for developer APIs or complex systems</action>
209-
<action>Prioritize clarity and practical examples over exhaustive detail</action>
210+
<action>Compare the provided documentation against the analysis of the codebase.</action>
211+
<action>Identify inaccuracies (technical, logical), omissions, and areas for improvement.</action>
212+
<action>Categorize inaccuracies by severity (e.g., Critical, Major, Minor, Suggestion).</action>
213+
<action>Formulate a structured recommendation in the chat, suitable for being copied to the docs team.</action>
214+
<action>Do not write any files or make changes yourself.</action>
210215
</actions>
211-
<decision_criteria>
212-
<criterion>If feature is user-facing → Use user_focused_template</criterion>
213-
<criterion>If feature is developer API → Consider comprehensive_template</criterion>
214-
<criterion>If unclear → Ask user for preference</criterion>
215-
</decision_criteria>
216216
</step>
217-
218217
<step number="2">
219-
<title>Structure Documentation</title>
220-
<actions>
221-
<action>Start with clear problem statement and benefits</action>
222-
<action>Use before/after examples when applicable</action>
223-
<action>Keep technical details minimal unless essential</action>
224-
<action>Focus on common use cases and questions</action>
225-
</actions>
226-
</step>
227-
228-
<step number="3">
229-
<title>Generate Markdown Output</title>
230-
<actions>
231-
<action>Create DOCS-TEMP-[feature].md file</action>
232-
<action>Use conversational tone and active voice</action>
233-
<action>Include visual separators (---) between sections</action>
234-
<action>Add practical examples and troubleshooting tips</action>
235-
</actions>
236-
</step>
237-
238-
<step number="4">
239-
<title>Add User-Friendly Elements</title>
218+
<title>Path 2: Generate New Documentation</title>
219+
<note>This path is followed if the user requested new documentation.</note>
240220
<actions>
241-
<action>Include "Why This Matters" section with real scenarios</action>
242-
<action>Add "Common Questions" in Q&A format</action>
243-
<action>Provide clear troubleshooting steps</action>
244-
<action>End with "Need Help?" section pointing to resources</action>
221+
<action>Choose a documentation style (e.g., user-focused or comprehensive) from `2_documentation_patterns.xml`.</action>
222+
<action>Structure the documentation with clear sections, examples, and user-friendly elements.</action>
223+
<action>Create a `DOCS-TEMP-[feature].md` file with the generated content.</action>
224+
<action>Use a conversational tone and practical examples from `7_user_friendly_examples.xml`.</action>
245225
</actions>
246226
</step>
247227
</documentation_generation>

.roo/rules-docs-extractor/4_tool_usage_guide.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@
120120

121121
<documentation_generation_tools>
122122
<tool name="write_to_file">
123-
<purpose>Create the final documentation file</purpose>
123+
<purpose>Create the final documentation file when generating new documentation from scratch.</purpose>
124+
<note>This tool is NOT used when reviewing a user-provided document section. In that scenario, feedback is provided directly in the chat.</note>
124125
<file_naming>DOCS-TEMP-[feature-name].md</file_naming>
125126
<best_practices>
126127
<practice>Use descriptive feature names in filename</practice>

.roo/rules-docs-extractor/5_complete_extraction_examples.xml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,10 +821,58 @@ DEBUG=auth:* npm start
821821
</step>
822822
</workflow>
823823
</example>
824+
<example name="documentation_review_example">
825+
<scenario>
826+
Review a user-provided documentation section for accuracy against the codebase
827+
and provide recommendations for improvement in the chat.
828+
</scenario>
829+
<workflow>
830+
<step number="1">
831+
<description>User provides documentation for review</description>
832+
<user_input>
833+
"Here's our current draft for the JWT_SECRET setting. Can you check it for accuracy? 'The `JWT_SECRET` is an optional key for enhancing security.'"
834+
</user_input>
835+
</step>
836+
<step number="2">
837+
<description>Analyze relevant code</description>
838+
<tool_use><![CDATA[
839+
<codebase_search>
840+
<query>JWT_SECRET configuration implementation</query>
841+
</codebase_search>
842+
]]></tool_use>
843+
<expected_findings>
844+
- Code where `JWT_SECRET` is read (e.g., `process.env.JWT_SECRET`)
845+
- Logic that fails if the secret is missing
846+
- Default values or error handling related to the secret
847+
</expected_findings>
848+
</step>
849+
<step number="3">
850+
<description>Formulate and provide feedback in chat</description>
851+
<tool_use><![CDATA[
852+
<attempt_completion>
853+
<result>
854+
I have reviewed the documentation section provided for the `JWT_SECRET` setting. Here are my recommendations for improvement:
855+
856+
**Overall Assessment**: The current draft is critically inaccurate and could lead to security vulnerabilities if followed.
857+
858+
**Recommendations for Improvement**:
824859
825-
<best_practices>
826-
<practice name="comprehensive_coverage">
827-
<description>Ensure all aspects are documented</description>
860+
* **Critical Inaccuracy**:
861+
* The documentation states that `JWT_SECRET` is optional. However, the application will fail to start if it is not provided. It is a **required** setting for the application to function securely.
862+
* **Suggestion**: "The `JWT_SECRET` is a **required** environment variable used to sign and verify JSON Web Tokens. The application will not run without it."
863+
864+
This feedback can be copied and pasted for your documentation team.
865+
</result>
866+
</attempt_completion>
867+
]]></tool_use>
868+
<note>No file is written. The feedback is provided directly to the user in the chat interface.</note>
869+
</step>
870+
</workflow>
871+
</example>
872+
873+
<best_practices>
874+
<practice name="comprehensive_coverage">
875+
<description>Ensure all aspects are documented</description>
828876
<checklist>
829877
<item>Technical implementation details</item>
830878
<item>Business logic and rules</item>

.roo/rules-docs-extractor/6_communication_guidelines.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,29 @@
6464
Warn about intricate dependency chains affecting the feature
6565
</discovery>
6666
</important_discoveries>
67+
<review_findings>
68+
<template><![CDATA[
69+
I have reviewed the documentation section provided. Here are my recommendations for improvement:
70+
71+
**Overall Assessment**: [Brief summary of the document's quality]
72+
73+
**Recommendations for Improvement**:
74+
75+
* **Critical Inaccuracies**:
76+
* [Inaccuracy 1]: The documentation states [X], but the code implements [Y].
77+
* [Inaccuracy 2]: ...
78+
79+
* **Major Omissions**:
80+
* The documentation is missing information about [Missing Feature/Concept].
81+
* ...
82+
83+
* **Suggestions for Clarity**:
84+
* The section on [Topic] could be clarified by [Suggestion].
85+
* ...
86+
87+
This feedback can be copied and pasted for your documentation team.
88+
]]></template>
89+
</review_findings>
6790
</findings_communication>
6891
</user_interaction>
6992

@@ -244,6 +267,16 @@ I've completed the comprehensive documentation extraction for the authentication
244267
245268
The documentation is structured for multiple audiences and includes all requested metadata, version information, and cross-references.
246269
]]></example>
270+
<example_review><![CDATA[
271+
I have completed the review of the provided documentation section.
272+
273+
**Action Taken**:
274+
- Analyzed the provided text against the current codebase for accuracy.
275+
- Identified several areas for improvement and outlined them as a recommendation.
276+
277+
**Next Steps**:
278+
- The detailed feedback has been provided in the chat. You can copy and paste it to your documentation team. No files were created.
279+
]]></example_review>
247280
</completion_message>
248281

249282
<error_handling>

0 commit comments

Comments
 (0)