Skip to content

Commit d315183

Browse files
committed
feat: add writing style and Docusaurus conventions guides; update documentation writer mode
1 parent 1128146 commit d315183

File tree

4 files changed

+304
-102
lines changed

4 files changed

+304
-102
lines changed

.roo/rules-docs/2_docusaurus_conventions.xml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.roo/rules-docs/1_writing_style.xml renamed to .roo/rules-documentation-writer/1_writing_style.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
</steps>
1313
</discovery_principle>
1414

15+
<content_validation_principle>
16+
<rule>Before making any documentation changes, validate that the content is not redundant and maintains cohesion with existing documentation.</rule>
17+
<redundancy_check>
18+
<step>Use codebase_search to find similar content across all documentation</step>
19+
<step>Search for key terms and concepts from the requested changes</step>
20+
<step>Identify if the information already exists elsewhere</step>
21+
<step>If similar content exists, determine if this is an update, consolidation, or truly new content</step>
22+
</redundancy_check>
23+
<cohesion_validation>
24+
<step>Check for contradictions with existing documentation</step>
25+
<step>Verify that new content aligns with established terminology and concepts</step>
26+
<step>Ensure cross-references are accurate and bidirectional where appropriate</step>
27+
<step>Validate that the change enhances rather than fragments the documentation flow</step>
28+
</cohesion_validation>
29+
</content_validation_principle>
30+
1531
<core_principles>
1632
<principle name="directness">
1733
<rule>Start with the most important information. No filler introductions.</rule>
@@ -73,5 +89,47 @@
7389
<item>Have I read similar documents to understand the established style?</item>
7490
<item>Have I identified the patterns for paths, links, and references?</item>
7591
<item>Am I following discovered patterns rather than making assumptions?</item>
92+
<item>Have I searched for existing content that might overlap with my changes?</item>
93+
<item>Have I verified that my changes don't contradict existing documentation?</item>
94+
<item>Have I checked that cross-references will remain valid?</item>
7695
</before_writing_checklist>
96+
97+
<content_change_workflow>
98+
<phase name="analysis">
99+
<description>Analyze the requested change and its impact</description>
100+
<steps>
101+
<step>Identify the scope and purpose of the requested change</step>
102+
<step>List key concepts, terms, and topics involved</step>
103+
<step>Determine which documents might be affected</step>
104+
</steps>
105+
</phase>
106+
<phase name="discovery">
107+
<description>Search for existing related content</description>
108+
<steps>
109+
<step>Use codebase_search with key terms from the request</step>
110+
<step>Read all potentially related documentation sections</step>
111+
<step>Create a mental map of where information currently lives</step>
112+
<step>Identify any gaps, overlaps, or contradictions</step>
113+
</steps>
114+
</phase>
115+
<phase name="validation">
116+
<description>Validate the change against existing content</description>
117+
<questions>
118+
<question>Does this information already exist elsewhere?</question>
119+
<question>If yes, should we update the existing location or consolidate?</question>
120+
<question>Will this change create any contradictions?</question>
121+
<question>Are all cross-references still valid?</question>
122+
<question>Does this enhance the documentation flow or fragment it?</question>
123+
</questions>
124+
</phase>
125+
<phase name="implementation">
126+
<description>Apply changes with cohesion in mind</description>
127+
<steps>
128+
<step>If updating existing content, preserve valuable context</step>
129+
<step>If adding new content, ensure it links appropriately to related topics</step>
130+
<step>Update any affected cross-references in other documents</step>
131+
<step>Maintain consistent terminology throughout</step>
132+
</steps>
133+
</phase>
134+
</content_change_workflow>
77135
</writing_style_guide>
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
<docusaurus_conventions>
2+
<overview>
3+
This guide covers Docusaurus-specific formatting rules for Roo Code documentation. Before applying these conventions, always explore the project structure to understand the actual directory layout.
4+
</overview>
5+
6+
<discovery_first>
7+
<principle>Always use list_files to discover the actual project structure before making assumptions about paths</principle>
8+
<principle>Check for existing patterns in similar files before creating new content</principle>
9+
<principle>Verify directory existence before referencing specific paths</principle>
10+
</discovery_first>
11+
12+
<linking>
13+
<rule name="internal_links">
14+
<description>Use paths relative to the documentation root. Do not include the `.md` extension. Discover the documentation structure first.</description>
15+
<discovery_steps>
16+
<step>Use list_files to find the documentation root directory</step>
17+
<step>Identify the path structure used in existing documentation</step>
18+
<step>Follow the established pattern</step>
19+
</discovery_steps>
20+
<good>[Link to Guide](/intro/)</good>
21+
<bad>[Link to Guide](../intro.md)</bad>
22+
</rule>
23+
<rule name="site_alias">
24+
<description>Use `@site` for code imports or asset references from the project root. Do not use it for Markdown links.</description>
25+
<good>import Header from '@site/src/components/Header';</good>
26+
<bad>[Link](@site/docs/intro.md)</bad>
27+
</rule>
28+
</linking>
29+
30+
<media>
31+
<rule name="images">
32+
<description>Discover the image storage location in the project before placing images. Look for existing image references to understand the pattern.</description>
33+
<discovery_steps>
34+
<step>Use list_files to find where images are stored (commonly in static/img or similar)</step>
35+
<step>Check existing documentation for image reference patterns</step>
36+
<step>Follow the established convention</step>
37+
</discovery_steps>
38+
<example>
39+
<![CDATA[
40+
<!-- First discover the actual image path structure, then use it -->
41+
<img src="/img/installing/installing-2.png" alt="VS Code's Install from VSIX dialog" width="600" />
42+
]]>
43+
</example>
44+
</rule>
45+
</media>
46+
47+
<versioning>
48+
<rule name="no_version_numbers">
49+
<description>Do not include version numbers or phrases like "as of version X.Y" in general documentation. First discover where version information is stored in the project.</description>
50+
<discovery_steps>
51+
<step>Use list_files to find version-related documentation directories</step>
52+
<step>Check for patterns like update-notes, changelog, or release directories</step>
53+
<step>Place version-specific information in the appropriate location</step>
54+
</discovery_steps>
55+
</rule>
56+
</versioning>
57+
58+
<frontmatter>
59+
<rule name="metadata">
60+
<description>Check existing documentation files for frontmatter patterns before adding new ones. The required fields may vary by project.</description>
61+
<discovery_steps>
62+
<step>Read several existing documentation files to understand the frontmatter pattern</step>
63+
<step>Identify which fields are consistently used</step>
64+
<step>Follow the established pattern</step>
65+
</discovery_steps>
66+
<example>
67+
<![CDATA[
68+
---
69+
description: A concise summary of the page content.
70+
keywords:
71+
- relevant
72+
- keywords
73+
- for
74+
- search
75+
image: /img/social-share.jpg
76+
---
77+
]]>
78+
</example>
79+
</rule>
80+
</frontmatter>
81+
82+
<general_discovery_workflow>
83+
<step number="1">Use list_files to explore the project structure</step>
84+
<step number="2">Read existing files similar to what you're creating/editing</step>
85+
<step number="3">Identify patterns in paths, formatting, and conventions</step>
86+
<step number="4">Follow the established patterns rather than assuming standard locations</step>
87+
<step number="5">When in doubt, ask for clarification rather than making assumptions</step>
88+
</general_discovery_workflow>
89+
90+
<redundancy_prevention_workflow>
91+
<overview>
92+
Before making any documentation changes, follow this workflow to prevent redundancy and ensure cohesion.
93+
</overview>
94+
95+
<step number="1">
96+
<title>Content Discovery</title>
97+
<actions>
98+
<action>Use codebase_search to find all mentions of the topic or feature</action>
99+
<action>Search for variations of key terms (e.g., "configuration", "config", "setup")</action>
100+
<action>Note all locations where related information exists</action>
101+
</actions>
102+
<example>
103+
<![CDATA[
104+
<!-- Search for existing content about a feature -->
105+
<codebase_search>
106+
<query>authentication setup configuration</query>
107+
<path>docs</path>
108+
</codebase_search>
109+
]]>
110+
</example>
111+
</step>
112+
113+
<step number="2">
114+
<title>Duplication Analysis</title>
115+
<actions>
116+
<action>Read all discovered related content thoroughly</action>
117+
<action>Identify if the requested change would duplicate existing information</action>
118+
<action>Determine if consolidation is needed instead of addition</action>
119+
</actions>
120+
<decision_matrix>
121+
<scenario condition="Content exists and is complete">
122+
<action>Inform user and suggest updating existing location</action>
123+
</scenario>
124+
<scenario condition="Content exists but is incomplete">
125+
<action>Enhance existing content rather than creating new</action>
126+
</scenario>
127+
<scenario condition="Content is scattered across multiple files">
128+
<action>Consider consolidation into a single authoritative location</action>
129+
</scenario>
130+
<scenario condition="Content doesn't exist">
131+
<action>Proceed with creating new content</action>
132+
</scenario>
133+
</decision_matrix>
134+
</step>
135+
136+
<step number="3">
137+
<title>Cross-Reference Validation</title>
138+
<actions>
139+
<action>Check all internal links that might be affected</action>
140+
<action>Verify that moving or changing content won't break existing references</action>
141+
<action>Update docusaurus.config.ts redirects if moving content</action>
142+
</actions>
143+
</step>
144+
145+
<step number="4">
146+
<title>Terminology Consistency</title>
147+
<actions>
148+
<action>Ensure consistent use of technical terms across all documentation</action>
149+
<action>Check glossary or terminology guide if one exists</action>
150+
<action>Maintain consistent naming for features, tools, and concepts</action>
151+
</actions>
152+
</step>
153+
</redundancy_prevention_workflow>
154+
155+
<cohesion_guidelines>
156+
<guideline name="information_architecture">
157+
<description>Maintain logical information hierarchy and flow</description>
158+
<checks>
159+
<check>Does this content belong in the current section?</check>
160+
<check>Would users expect to find this information here?</check>
161+
<check>Does it follow the progression from basic to advanced?</check>
162+
</checks>
163+
</guideline>
164+
165+
<guideline name="single_source_of_truth">
166+
<description>Each piece of information should have one authoritative location</description>
167+
<implementation>
168+
<step>Core information lives in one place</step>
169+
<step>Other locations reference the authoritative source</step>
170+
<step>Use includes or references rather than duplication</step>
171+
</implementation>
172+
</guideline>
173+
174+
<guideline name="contextual_linking">
175+
<description>Connect related content through meaningful links</description>
176+
<best_practices>
177+
<practice>Link to prerequisites before advanced topics</practice>
178+
<practice>Provide "See also" sections for related content</practice>
179+
<practice>Ensure bidirectional linking where appropriate</practice>
180+
</best_practices>
181+
</guideline>
182+
</cohesion_guidelines>
183+
<documentation_update_protocol>
184+
<overview>
185+
When updating existing documentation, follow this protocol to maintain quality and prevent issues.
186+
</overview>
187+
188+
<pre_update_validation>
189+
<step>Identify all documents that reference the content being updated</step>
190+
<step>Check for dependent examples or tutorials that might need updating</step>
191+
<step>Verify that the update won't invalidate existing instructions</step>
192+
<step>Consider backward compatibility if documenting changed features</step>
193+
</pre_update_validation>
194+
195+
<update_impact_assessment>
196+
<question>Will this update require changes to other documents?</question>
197+
<question>Are there code examples that need to be updated?</question>
198+
<question>Do any quickstart guides or tutorials reference this content?</question>
199+
<question>Will this change affect the logical flow of the documentation?</question>
200+
</update_impact_assessment>
201+
202+
<post_update_checklist>
203+
<item>All cross-references have been updated</item>
204+
<item>No broken links have been introduced</item>
205+
<item>Terminology remains consistent across all affected documents</item>
206+
<item>The update enhances rather than contradicts existing content</item>
207+
<item>Version-specific information is properly handled</item>
208+
</post_update_checklist>
209+
</documentation_update_protocol>
210+
211+
<ask_before_proceeding>
212+
<description>Use ask_followup_question when uncertainty exists about redundancy or impact</description>
213+
<scenarios>
214+
<scenario>When similar content exists in multiple locations</scenario>
215+
<scenario>When the requested change might contradict existing documentation</scenario>
216+
<scenario>When consolidation might be better than addition</scenario>
217+
<scenario>When the impact on other documents is unclear</scenario>
218+
</scenarios>
219+
<example>
220+
<![CDATA[
221+
<ask_followup_question>
222+
<question>I found existing content about this topic in three different locations. How would you like me to proceed?</question>
223+
<follow_up>
224+
<suggest>Update the main guide and add cross-references from the other locations</suggest>
225+
<suggest>Consolidate all information into a single comprehensive guide</suggest>
226+
<suggest>Keep them separate but ensure they're consistent and cross-linked</suggest>
227+
<suggest>Show me the existing locations first so I can decide</suggest>
228+
</follow_up>
229+
</ask_followup_question>
230+
]]>
231+
</example>
232+
</ask_before_proceeding>
233+
</docusaurus_conventions>

0 commit comments

Comments
 (0)