mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
docs: update docs extractor mode configuration and rules (#6373)
This commit is contained in:
parent
b117c0fe52
commit
82a3212180
6 changed files with 1325 additions and 958 deletions
|
|
@ -1,8 +1,10 @@
|
|||
<extraction_workflow>
|
||||
<mode_overview>
|
||||
The Docs Extractor mode analyzes features to generate documentation.
|
||||
It extracts technical details, business logic, and user workflows
|
||||
for different audiences.
|
||||
The Docs Extractor mode has two primary functions:
|
||||
1. Extract technical and non-technical details about features to provide to documentation teams
|
||||
2. Verify existing documentation for factual accuracy against the codebase
|
||||
|
||||
This mode does not generate final documentation but provides detailed analysis and verification.
|
||||
</mode_overview>
|
||||
|
||||
<initialization_phase>
|
||||
|
|
@ -10,25 +12,23 @@
|
|||
<title>Parse Request</title>
|
||||
<actions>
|
||||
<action>Identify the feature or component in the user's request.</action>
|
||||
<action>Determine if the request is for a review or to generate new documentation.</action>
|
||||
<action>Default to user-friendly docs unless technical output is requested.</action>
|
||||
<action>Note any specific areas to emphasize.</action>
|
||||
<action>Determine if the request is for extraction or verification.</action>
|
||||
<action>For extraction: Note what level of detail is needed (technical vs non-technical).</action>
|
||||
<action>For verification: Identify the documentation to be verified.</action>
|
||||
<action>Note any specific areas to emphasize or check.</action>
|
||||
</actions>
|
||||
<note>The initial request determines the workflow path (review vs. generation).</note>
|
||||
<note>The mode branches into extraction or verification based on the request.</note>
|
||||
</step>
|
||||
|
||||
<step number="2">
|
||||
<title>Discover Feature</title>
|
||||
<actions>
|
||||
<action>Find related code with semantic search.</action>
|
||||
<action>Locate relevant code using appropriate search methods.</action>
|
||||
<action>Identify entry points and components.</action>
|
||||
<action>Map the high-level architecture.</action>
|
||||
<action>Use any combination of tools to understand the feature.</action>
|
||||
</actions>
|
||||
<tool_use><![CDATA[
|
||||
<codebase_search>
|
||||
<query>[feature name] implementation main entry point</query>
|
||||
</codebase_search>
|
||||
]]></tool_use>
|
||||
<note>Use the most effective discovery method for the situation - file exploration, search, or direct navigation.</note>
|
||||
</step>
|
||||
</initialization_phase>
|
||||
|
||||
|
|
@ -66,22 +66,68 @@
|
|||
</steps>
|
||||
</phase>
|
||||
|
||||
<phase name="ui_ux_analysis">
|
||||
<title>UI/UX and User Experience Analysis</title>
|
||||
<steps>
|
||||
<step>
|
||||
<action>Analyze user interface components</action>
|
||||
<details>
|
||||
- UI components and their interactions
|
||||
- Forms, buttons, navigation elements
|
||||
- Visual feedback and loading states
|
||||
- Responsive design considerations
|
||||
- Accessibility features
|
||||
</details>
|
||||
</step>
|
||||
<step>
|
||||
<action>Map user journeys and interactions</action>
|
||||
<details>
|
||||
- Step-by-step user workflows
|
||||
- Click paths and navigation flows
|
||||
- User decision points
|
||||
- Input validation and error messaging
|
||||
- Success and failure scenarios
|
||||
</details>
|
||||
</step>
|
||||
<step>
|
||||
<action>Document user experience elements</action>
|
||||
<details>
|
||||
- Page layouts and information architecture
|
||||
- Interactive elements and their behaviors
|
||||
- Tooltips, help text, and guidance
|
||||
- Confirmation dialogs and warnings
|
||||
- Progress indicators and status updates
|
||||
</details>
|
||||
</step>
|
||||
<step>
|
||||
<action>Capture visual and behavioral patterns</action>
|
||||
<details>
|
||||
- Color schemes and theming
|
||||
- Animation and transitions
|
||||
- Keyboard shortcuts and accessibility
|
||||
- Mobile vs desktop experiences
|
||||
- Browser-specific considerations
|
||||
</details>
|
||||
</step>
|
||||
</steps>
|
||||
</phase>
|
||||
|
||||
<phase name="business_logic_analysis">
|
||||
<title>Business Logic Extraction</title>
|
||||
<steps>
|
||||
<step>
|
||||
<action>Map workflows</action>
|
||||
<action>Map workflows from user perspective</action>
|
||||
<details>
|
||||
- User journey
|
||||
- User journey through the feature
|
||||
- Decision points and branching
|
||||
- State transitions
|
||||
- Roles and permissions
|
||||
- State transitions visible to users
|
||||
- Roles and permissions affecting UI
|
||||
</details>
|
||||
</step>
|
||||
<step>
|
||||
<action>Document business rules</action>
|
||||
<details>
|
||||
- Validation logic
|
||||
- Validation logic and user feedback
|
||||
- Formulas and algorithms
|
||||
- Business process implementations
|
||||
- Compliance requirements
|
||||
|
|
@ -92,8 +138,8 @@
|
|||
<details>
|
||||
- Primary use cases
|
||||
- Edge cases
|
||||
- Error scenarios
|
||||
- Performance factors
|
||||
- Error scenarios and user recovery
|
||||
- Performance factors affecting UX
|
||||
</details>
|
||||
</step>
|
||||
</steps>
|
||||
|
|
@ -199,38 +245,117 @@
|
|||
</phase>
|
||||
</analysis_phases>
|
||||
|
||||
<documentation_generation>
|
||||
<note>Workflow branches here: review existing docs or generate new docs.</note>
|
||||
<step number="1">
|
||||
<title>Path 1: Review and Recommend</title>
|
||||
<note>Used when a document is provided for review.</note>
|
||||
<actions>
|
||||
<action>Compare provided docs against codebase analysis.</action>
|
||||
<action>Identify inaccuracies, omissions, and areas for improvement.</action>
|
||||
<action>Categorize issues by severity (Critical, Major, Minor).</action>
|
||||
<action>Formulate a structured recommendation in chat.</action>
|
||||
<action>Do not write files.</action>
|
||||
<action>Final output is only the recommendation.</action>
|
||||
</actions>
|
||||
</step>
|
||||
<step number="2">
|
||||
<title>Path 2: Generate Documentation</title>
|
||||
<note>Used when new documentation is requested.</note>
|
||||
<actions>
|
||||
<action>Select a template from `2_documentation_patterns.xml`.</action>
|
||||
<action>Structure the document with clear sections and examples.</action>
|
||||
<action>Create `DOCS-TEMP-[feature].md` with generated content.</action>
|
||||
<action>Apply tone and examples from `7_user_friendly_examples.xml`.</action>
|
||||
</actions>
|
||||
</step>
|
||||
</documentation_generation>
|
||||
<workflow_paths>
|
||||
<path name="extraction">
|
||||
<title>Extract Feature Details</title>
|
||||
<description>Analyze and extract comprehensive details for documentation team</description>
|
||||
<steps>
|
||||
<step number="1">
|
||||
<title>Compile Technical Details</title>
|
||||
<actions>
|
||||
<action>List all technical components and their relationships</action>
|
||||
<action>Document APIs, data structures, and algorithms</action>
|
||||
<action>Extract configuration options and their impacts</action>
|
||||
<action>Identify error handling and edge cases</action>
|
||||
<action>Note performance characteristics and limitations</action>
|
||||
</actions>
|
||||
</step>
|
||||
<step number="2">
|
||||
<title>Extract Non-Technical Information</title>
|
||||
<actions>
|
||||
<action>Describe complete user experience and workflows</action>
|
||||
<action>Document UI interactions and visual elements</action>
|
||||
<action>Explain business logic in plain language</action>
|
||||
<action>Identify user benefits and use cases</action>
|
||||
<action>Document common scenarios with UI context</action>
|
||||
<action>Note prerequisites and user-facing dependencies</action>
|
||||
<action>Capture error messages and user guidance</action>
|
||||
</actions>
|
||||
</step>
|
||||
<step number="3">
|
||||
<title>Create Extraction Report</title>
|
||||
<actions>
|
||||
<action>Organize findings into clear categories</action>
|
||||
<action>Separate technical and non-technical information</action>
|
||||
<action>Include code snippets and examples where helpful</action>
|
||||
<action>Create `EXTRACTION-[feature].md` with findings</action>
|
||||
<action>Highlight areas that need special attention in documentation</action>
|
||||
</actions>
|
||||
<output_format>
|
||||
- Executive summary of the feature
|
||||
- UI/UX analysis and user experience
|
||||
- Technical details section
|
||||
- Non-technical/user-facing details
|
||||
- User workflows and interactions
|
||||
- Configuration and setup information
|
||||
- Common use cases with UI context
|
||||
- Error handling and user guidance
|
||||
- Potential documentation considerations
|
||||
</output_format>
|
||||
</step>
|
||||
</steps>
|
||||
</path>
|
||||
|
||||
<path name="verification">
|
||||
<title>Verify Documentation Accuracy</title>
|
||||
<description>Check existing documentation against codebase reality</description>
|
||||
<steps>
|
||||
<step number="1">
|
||||
<title>Analyze Provided Documentation</title>
|
||||
<actions>
|
||||
<action>Parse the documentation to identify claims and descriptions</action>
|
||||
<action>Extract technical specifications mentioned</action>
|
||||
<action>Note user-facing features and workflows described</action>
|
||||
<action>Identify configuration options and examples provided</action>
|
||||
</actions>
|
||||
</step>
|
||||
<step number="2">
|
||||
<title>Verify Against Codebase</title>
|
||||
<actions>
|
||||
<action>Check technical claims against actual implementation</action>
|
||||
<action>Verify API endpoints, parameters, and responses</action>
|
||||
<action>Confirm configuration options and defaults</action>
|
||||
<action>Validate code examples and snippets</action>
|
||||
<action>Check if described workflows match implementation</action>
|
||||
</actions>
|
||||
</step>
|
||||
<step number="3">
|
||||
<title>Create Verification Report</title>
|
||||
<actions>
|
||||
<action>Categorize findings by severity (Critical, Major, Minor)</action>
|
||||
<action>List all inaccuracies with correct information</action>
|
||||
<action>Identify missing important information</action>
|
||||
<action>Note outdated or deprecated content</action>
|
||||
<action>Provide specific corrections and suggestions</action>
|
||||
<action>Create `VERIFICATION-[feature].md` with findings</action>
|
||||
</actions>
|
||||
<output_format>
|
||||
- Verification summary (Accurate/Needs Updates)
|
||||
- Critical inaccuracies that could mislead users
|
||||
- Technical corrections needed
|
||||
- Missing information that should be added
|
||||
- Suggestions for clarity improvements
|
||||
- Overall recommendations
|
||||
</output_format>
|
||||
</step>
|
||||
</steps>
|
||||
</path>
|
||||
</workflow_paths>
|
||||
|
||||
<completion_criteria>
|
||||
<criterion>Code paths analyzed</criterion>
|
||||
<criterion>Business logic documented</criterion>
|
||||
<criterion>Integration points mapped</criterion>
|
||||
<criterion>Security addressed</criterion>
|
||||
<criterion>Audience needs met</criterion>
|
||||
<criterion>Metadata and links are complete</criterion>
|
||||
<for_extraction>
|
||||
<criterion>All code paths analyzed</criterion>
|
||||
<criterion>Technical details comprehensively extracted</criterion>
|
||||
<criterion>Non-technical information clearly explained</criterion>
|
||||
<criterion>Use cases and examples provided</criterion>
|
||||
<criterion>Report organized for documentation team use</criterion>
|
||||
</for_extraction>
|
||||
<for_verification>
|
||||
<criterion>All documentation claims verified</criterion>
|
||||
<criterion>Inaccuracies identified and corrected</criterion>
|
||||
<criterion>Missing information noted</criterion>
|
||||
<criterion>Suggestions for improvement provided</criterion>
|
||||
<criterion>Clear verification report created</criterion>
|
||||
</for_verification>
|
||||
</completion_criteria>
|
||||
</extraction_workflow>
|
||||
|
|
@ -3,7 +3,191 @@
|
|||
Techniques for analyzing code to extract documentation.
|
||||
</overview>
|
||||
|
||||
<ui_ux_analysis_techniques>
|
||||
<technique name="component_discovery">
|
||||
<description>
|
||||
Find and analyze UI components and their interactions
|
||||
</description>
|
||||
<discovery_methods>
|
||||
<method name="component_search">
|
||||
<description>Search for UI component files</description>
|
||||
<example><![CDATA[
|
||||
<!-- Find React/Vue/Angular components -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>\.(tsx|jsx|vue)$|@Component|export.*component</regex>
|
||||
<file_pattern>*.tsx</file_pattern>
|
||||
</search_files>
|
||||
|
||||
<!-- Find component usage -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex><Button|<Form|<Modal|<Dialog|<Input</regex>
|
||||
</search_files>
|
||||
]]></example>
|
||||
</method>
|
||||
|
||||
<method name="style_analysis">
|
||||
<description>Analyze styling and visual elements</description>
|
||||
<example><![CDATA[
|
||||
<!-- Find stylesheets -->
|
||||
<list_files>
|
||||
<path>src/styles</path>
|
||||
<recursive>true</recursive>
|
||||
</list_files>
|
||||
|
||||
<!-- Search for style definitions -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>className=|style=|styled\.|makeStyles|@apply</regex>
|
||||
</search_files>
|
||||
]]></example>
|
||||
</method>
|
||||
</discovery_methods>
|
||||
</technique>
|
||||
|
||||
<technique name="user_flow_mapping">
|
||||
<description>
|
||||
Map user interactions and navigation flows
|
||||
</description>
|
||||
<analysis_areas>
|
||||
<area>Route definitions and navigation</area>
|
||||
<area>Form submissions and validations</area>
|
||||
<area>Button clicks and event handlers</area>
|
||||
<area>State changes and UI updates</area>
|
||||
<area>Loading and error states</area>
|
||||
</analysis_areas>
|
||||
<search_patterns><![CDATA[
|
||||
<!-- Find route definitions -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>Route.*path=|router\.push|navigate\(|Link.*to=</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find event handlers -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>onClick=|onSubmit=|onChange=|handleClick|handleSubmit</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find form validations -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>validate|validation|required|pattern=|minLength|maxLength</regex>
|
||||
</search_files>
|
||||
]]></search_patterns>
|
||||
</technique>
|
||||
|
||||
<technique name="user_feedback_analysis">
|
||||
<description>
|
||||
Analyze how the system communicates with users
|
||||
</description>
|
||||
<elements_to_find>
|
||||
<element>Error messages and alerts</element>
|
||||
<element>Success notifications</element>
|
||||
<element>Loading indicators</element>
|
||||
<element>Tooltips and help text</element>
|
||||
<element>Confirmation dialogs</element>
|
||||
<element>Progress indicators</element>
|
||||
</elements_to_find>
|
||||
<search_patterns><![CDATA[
|
||||
<!-- Find user messages -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>toast|notification|alert|message|error.*message|success.*message</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find loading states -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>loading|isLoading|pending|spinner|skeleton|placeholder</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find dialogs and modals -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>modal|dialog|confirm|popup|overlay</regex>
|
||||
</search_files>
|
||||
]]></search_patterns>
|
||||
</technique>
|
||||
|
||||
<technique name="accessibility_analysis">
|
||||
<description>
|
||||
Check for accessibility features and compliance
|
||||
</description>
|
||||
<accessibility_checks>
|
||||
<check>ARIA labels and roles</check>
|
||||
<check>Keyboard navigation support</check>
|
||||
<check>Screen reader compatibility</check>
|
||||
<check>Focus management</check>
|
||||
<check>Color contrast considerations</check>
|
||||
</accessibility_checks>
|
||||
<search_patterns><![CDATA[
|
||||
<!-- Find accessibility attributes -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>aria-|role=|tabIndex|alt=|title=|accessibilityLabel</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find focus management -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>focus\(|blur\(|onFocus|onBlur|autoFocus|focusable</regex>
|
||||
</search_files>
|
||||
]]></search_patterns>
|
||||
</technique>
|
||||
|
||||
<technique name="responsive_design_analysis">
|
||||
<description>
|
||||
Analyze responsive design and mobile experience
|
||||
</description>
|
||||
<analysis_points>
|
||||
<point>Breakpoint definitions</point>
|
||||
<point>Mobile-specific components</point>
|
||||
<point>Touch event handlers</point>
|
||||
<point>Viewport configurations</point>
|
||||
<point>Media queries</point>
|
||||
</analysis_points>
|
||||
<search_patterns><![CDATA[
|
||||
<!-- Find responsive utilities -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>@media|breakpoint|mobile|tablet|desktop|responsive</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find touch events -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>onTouch|swipe|gesture|tap|press</regex>
|
||||
</search_files>
|
||||
]]></search_patterns>
|
||||
</technique>
|
||||
</ui_ux_analysis_techniques>
|
||||
|
||||
<code_analysis_techniques>
|
||||
<technique name="semantic_search_analysis">
|
||||
<description>
|
||||
Use semantic search to find conceptually related code when available.
|
||||
</description>
|
||||
<when_to_use>
|
||||
<scenario>Finding code by concept rather than keywords</scenario>
|
||||
<scenario>Discovering implementations across different naming conventions</scenario>
|
||||
<scenario>When pattern-based search isn't finding expected results</scenario>
|
||||
</when_to_use>
|
||||
<example><![CDATA[
|
||||
<!-- Optional: Find authentication-related code semantically -->
|
||||
<codebase_search>
|
||||
<query>user authentication login security JWT token validation</query>
|
||||
</codebase_search>
|
||||
|
||||
<!-- Optional: Find payment processing logic -->
|
||||
<codebase_search>
|
||||
<query>payment processing transaction billing invoice checkout</query>
|
||||
</codebase_search>
|
||||
]]></example>
|
||||
<note>This is an optional tool - use when semantic understanding would help find related code that keyword search might miss</note>
|
||||
</technique>
|
||||
|
||||
<technique name="entry_point_analysis">
|
||||
<description>
|
||||
Analyze entry points to understand feature flow.
|
||||
|
|
@ -14,23 +198,60 @@
|
|||
<step>Map decision branches.</step>
|
||||
<step>Document input validation.</step>
|
||||
</steps>
|
||||
<tools><![CDATA[
|
||||
<!-- Find entry points -->
|
||||
<codebase_search>
|
||||
<query>main function app.listen server.start router controller handler</query>
|
||||
</codebase_search>
|
||||
|
||||
<!-- Analyze specific entry point -->
|
||||
<read_file>
|
||||
<path>src/controllers/feature.controller.ts</path>
|
||||
</read_file>
|
||||
<discovery_methods>
|
||||
<method name="directory_based">
|
||||
<description>Start by exploring directory structure</description>
|
||||
<example><![CDATA[
|
||||
<!-- List main directories -->
|
||||
<list_files>
|
||||
<path>src</path>
|
||||
<recursive>false</recursive>
|
||||
</list_files>
|
||||
|
||||
<!-- Explore feature directory -->
|
||||
<list_files>
|
||||
<path>src/controllers</path>
|
||||
<recursive>true</recursive>
|
||||
</list_files>
|
||||
]]></example>
|
||||
</method>
|
||||
|
||||
<method name="pattern_based">
|
||||
<description>Search for specific patterns</description>
|
||||
<example><![CDATA[
|
||||
<!-- Find all routes -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>(app\.(get|post|put|delete)|@(Get|Post|Put|Delete)|router\.(get|post|put|delete))</regex>
|
||||
</search_files>
|
||||
]]></tools>
|
||||
]]></example>
|
||||
</method>
|
||||
|
||||
<method name="file_based">
|
||||
<description>Read known entry points directly</description>
|
||||
<example><![CDATA[
|
||||
<!-- Read main application file -->
|
||||
<read_file>
|
||||
<path>src/app.ts</path>
|
||||
</read_file>
|
||||
|
||||
<!-- Read specific controller -->
|
||||
<read_file>
|
||||
<path>src/controllers/feature.controller.ts</path>
|
||||
</read_file>
|
||||
]]></example>
|
||||
</method>
|
||||
|
||||
<method name="semantic_based">
|
||||
<description>Use semantic search as an alternative discovery method</description>
|
||||
<example><![CDATA[
|
||||
<!-- Optional: Find entry points semantically -->
|
||||
<codebase_search>
|
||||
<query>main entry point application startup initialization bootstrap</query>
|
||||
</codebase_search>
|
||||
]]></example>
|
||||
</method>
|
||||
</discovery_methods>
|
||||
</technique>
|
||||
|
||||
<technique name="api_extraction">
|
||||
|
|
@ -76,24 +297,39 @@ type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|||
<point>Message queue integrations</point>
|
||||
<point>Filesystem operations</point>
|
||||
</analysis_points>
|
||||
<tools><![CDATA[
|
||||
<analysis_approaches>
|
||||
<approach name="package_analysis">
|
||||
<description>Start with package.json to understand dependencies</description>
|
||||
<example><![CDATA[
|
||||
<!-- Analyze package dependencies -->
|
||||
<read_file>
|
||||
<path>package.json</path>
|
||||
</read_file>
|
||||
]]></example>
|
||||
</approach>
|
||||
|
||||
<approach name="import_tracking">
|
||||
<description>Follow import chains to map dependencies</description>
|
||||
<example><['"]|require\s*\(\s*['"]([^'"]+)['"]\s*\)</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Analyze package dependencies -->
|
||||
<read_file>
|
||||
<path>package.json</path>
|
||||
</read_file>
|
||||
|
||||
]]></example>
|
||||
</approach>
|
||||
|
||||
<approach name="api_discovery">
|
||||
<description>Find external API integrations</description>
|
||||
<example><![CDATA[
|
||||
<!-- Find external API calls -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>(fetch|axios|http\.request|request\(|\.get\(|\.post\()</regex>
|
||||
</search_files>
|
||||
]]></tools>
|
||||
]]></example>
|
||||
</approach>
|
||||
</analysis_approaches>
|
||||
</technique>
|
||||
|
||||
<technique name="data_model_extraction">
|
||||
|
|
|
|||
|
|
@ -3,125 +3,117 @@
|
|||
Guidance on using tools for documentation extraction.
|
||||
</overview>
|
||||
|
||||
<tool_sequence>
|
||||
<priority level="1">
|
||||
<tool>codebase_search</tool>
|
||||
<purpose>Initial code discovery.</purpose>
|
||||
<usage_patterns>
|
||||
<pattern>
|
||||
<scenario>Find feature entry points</scenario>
|
||||
<example><![CDATA[
|
||||
<codebase_search>
|
||||
<query>authentication login user session JWT token</query>
|
||||
</codebase_search>
|
||||
]]></example>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<scenario>Find business logic</scenario>
|
||||
<example><![CDATA[
|
||||
<codebase_search>
|
||||
<query>calculate pricing discount tax invoice billing</query>
|
||||
</codebase_search>
|
||||
]]></example>
|
||||
</pattern>
|
||||
<pattern>
|
||||
<scenario>Find configuration</scenario>
|
||||
<example><![CDATA[
|
||||
<codebase_search>
|
||||
<query>config settings environment variables .env process.env</query>
|
||||
</codebase_search>
|
||||
]]></example>
|
||||
</pattern>
|
||||
</usage_patterns>
|
||||
</priority>
|
||||
<discovery_approaches>
|
||||
<approach name="flexible_discovery">
|
||||
<description>Use the most appropriate tools for the situation</description>
|
||||
<principles>
|
||||
<principle>Start with what you know - file names, directory structure, or keywords</principle>
|
||||
<principle>Use multiple discovery methods to build understanding</principle>
|
||||
<principle>Adapt your approach based on the codebase structure</principle>
|
||||
</principles>
|
||||
</approach>
|
||||
|
||||
<priority level="2">
|
||||
<tool>list_code_definition_names</tool>
|
||||
<purpose>Understand code structure.</purpose>
|
||||
<best_practices>
|
||||
<practice>Use on core feature directories.</practice>
|
||||
<practice>Analyze implementation and test directories.</practice>
|
||||
<practice>Look for naming patterns.</practice>
|
||||
</best_practices>
|
||||
<example><![CDATA[
|
||||
<list_code_definition_names>
|
||||
<path>src/features/authentication</path>
|
||||
</list_code_definition_names>
|
||||
]]></example>
|
||||
</priority>
|
||||
<common_tools>
|
||||
<tool name="list_files">
|
||||
<purpose>Explore directory structure and find relevant files</purpose>
|
||||
<when_to_use>
|
||||
- Starting exploration of a feature area
|
||||
- Understanding project organization
|
||||
- Finding configuration or test files
|
||||
</when_to_use>
|
||||
</tool>
|
||||
|
||||
<priority level="3">
|
||||
<tool>read_file</tool>
|
||||
<purpose>Analyze specific implementations.</purpose>
|
||||
<strategy>
|
||||
<step>Read main feature files.</step>
|
||||
<step>Follow imports to find dependencies.</step>
|
||||
<step>Read test files for expected behavior.</step>
|
||||
<step>Examine config and type definition files.</step>
|
||||
</strategy>
|
||||
<batch_reading><![CDATA[
|
||||
<read_file>
|
||||
<args>
|
||||
<file>
|
||||
<path>src/controllers/auth.controller.ts</path>
|
||||
</file>
|
||||
<file>
|
||||
<path>src/services/auth.service.ts</path>
|
||||
</file>
|
||||
<file>
|
||||
<path>src/models/user.model.ts</path>
|
||||
</file>
|
||||
<file>
|
||||
<path>src/types/auth.types.ts</path>
|
||||
</file>
|
||||
<file>
|
||||
<path>src/__tests__/auth.test.ts</path>
|
||||
</file>
|
||||
</args>
|
||||
</read_file>
|
||||
]]></batch_reading>
|
||||
</priority>
|
||||
<tool name="read_file">
|
||||
<purpose>Examine specific files in detail</purpose>
|
||||
<when_to_use>
|
||||
- Analyzing implementation details
|
||||
- Understanding configuration
|
||||
- Reading documentation or comments
|
||||
</when_to_use>
|
||||
<tip>Read multiple related files together for better context</tip>
|
||||
</tool>
|
||||
|
||||
<priority level="4">
|
||||
<tool>search_files</tool>
|
||||
<purpose>Find specific patterns.</purpose>
|
||||
<use_cases>
|
||||
<use_case>
|
||||
<description>Find API endpoints</description>
|
||||
<example><['"]|router\.(get|post|put|delete|patch)\(['"]([^'"]+)['"]</regex>
|
||||
</search_files>
|
||||
]]></example>
|
||||
</use_case>
|
||||
<use_case>
|
||||
<description>Find error handling</description>
|
||||
<example><![CDATA[
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>throw new \w+Error|catch \(|\.catch\(|try \{</regex>
|
||||
</search_files>
|
||||
]]></example>
|
||||
</use_case>
|
||||
<use_case>
|
||||
<description>Find config usage</description>
|
||||
<example><['"]|getConfig\(\)</regex>
|
||||
</search_files>
|
||||
]]></example>
|
||||
</use_case>
|
||||
</use_cases>
|
||||
</priority>
|
||||
</tool_sequence>
|
||||
<tool name="search_files">
|
||||
<purpose>Find specific patterns or text</purpose>
|
||||
<when_to_use>
|
||||
- Locating API endpoints
|
||||
- Finding configuration usage
|
||||
- Tracking down error handling
|
||||
- Discovering cross-references
|
||||
</when_to_use>
|
||||
</tool>
|
||||
|
||||
<tool name="list_code_definition_names">
|
||||
<purpose>Get overview of code structure</purpose>
|
||||
<when_to_use>
|
||||
- Understanding module organization
|
||||
- Identifying main components
|
||||
- Finding test coverage
|
||||
</when_to_use>
|
||||
</tool>
|
||||
|
||||
<tool name="codebase_search">
|
||||
<purpose>Semantic search when available</purpose>
|
||||
<when_to_use>
|
||||
- Finding conceptually related code
|
||||
- Discovering implementations by functionality
|
||||
- When keyword search isn't sufficient
|
||||
</when_to_use>
|
||||
<note>Optional - use when semantic understanding is needed</note>
|
||||
</tool>
|
||||
</common_tools>
|
||||
|
||||
<discovery_patterns>
|
||||
<pattern name="top_down">
|
||||
<description>Start from high-level structure and drill down</description>
|
||||
<steps>
|
||||
<step>List files in feature directory</step>
|
||||
<step>Identify main entry points</step>
|
||||
<step>Follow imports and dependencies</step>
|
||||
<step>Examine implementation details</step>
|
||||
</steps>
|
||||
</pattern>
|
||||
|
||||
<pattern name="test_driven">
|
||||
<description>Use tests to understand expected behavior</description>
|
||||
<steps>
|
||||
<step>Find test files for the feature</step>
|
||||
<step>Read test descriptions and scenarios</step>
|
||||
<step>Trace back to implementation</step>
|
||||
<step>Verify behavior matches tests</step>
|
||||
</steps>
|
||||
</pattern>
|
||||
|
||||
<pattern name="configuration_first">
|
||||
<description>Start with configuration to understand setup</description>
|
||||
<steps>
|
||||
<step>Find configuration files</step>
|
||||
<step>Identify feature flags and settings</step>
|
||||
<step>Trace usage in code</step>
|
||||
<step>Document impacts of each setting</step>
|
||||
</steps>
|
||||
</pattern>
|
||||
|
||||
<pattern name="api_focused">
|
||||
<description>Map external interfaces first</description>
|
||||
<steps>
|
||||
<step>Search for route definitions</step>
|
||||
<step>Find API controllers or handlers</step>
|
||||
<step>Trace to business logic</step>
|
||||
<step>Document request/response flow</step>
|
||||
</steps>
|
||||
</pattern>
|
||||
</discovery_patterns>
|
||||
</discovery_approaches>
|
||||
|
||||
<documentation_generation_tools>
|
||||
<tool name="write_to_file">
|
||||
<purpose>Create documentation file for new docs.</purpose>
|
||||
<note>Not used for reviews. Feedback for reviews is provided in chat.</note>
|
||||
<file_naming>DOCS-TEMP-[feature-name].md</file_naming>
|
||||
<purpose>Create extraction or verification report files.</purpose>
|
||||
<note>Generates reports for documentation teams, not final documentation.</note>
|
||||
<file_naming>
|
||||
- For extraction: EXTRACTION-[feature-name].md
|
||||
- For verification: VERIFICATION-[feature-name].md
|
||||
</file_naming>
|
||||
<best_practices>
|
||||
<practice>Use descriptive feature name in filename.</practice>
|
||||
<practice>Include table of contents.</practice>
|
||||
|
|
@ -130,7 +122,7 @@
|
|||
</best_practices>
|
||||
<example><![CDATA[
|
||||
<write_to_file>
|
||||
<path>DOCS-TEMP-authentication-system.md</path>
|
||||
<path>EXTRACTION-authentication-system.md</path>
|
||||
<content>
|
||||
# Authentication System Documentation
|
||||
|
||||
|
|
@ -184,47 +176,72 @@ The authentication system provides secure user authentication using JWT tokens..
|
|||
<analysis_strategies>
|
||||
<strategy name="file_discovery">
|
||||
<description>
|
||||
Find all files related to a feature.
|
||||
Find all files related to a feature using various methods.
|
||||
</description>
|
||||
<steps>
|
||||
<step>
|
||||
<action>Start with semantic search.</action>
|
||||
<tool_use><![CDATA[
|
||||
<codebase_search>
|
||||
<query>feature implementation main logic</query>
|
||||
</codebase_search>
|
||||
]]></tool_use>
|
||||
</step>
|
||||
<step>
|
||||
<action>List directory structure.</action>
|
||||
<methods>
|
||||
<method name="directory_exploration">
|
||||
<description>Start by exploring likely directories</description>
|
||||
<tool_use><![CDATA[
|
||||
<list_files>
|
||||
<path>src/features</path>
|
||||
<path>src</path>
|
||||
<recursive>false</recursive>
|
||||
</list_files>
|
||||
|
||||
<!-- Then drill into feature directory -->
|
||||
<list_files>
|
||||
<path>src/features/[feature-name]</path>
|
||||
<recursive>true</recursive>
|
||||
</list_files>
|
||||
]]></tool_use>
|
||||
</step>
|
||||
<step>
|
||||
<action>Find related tests.</action>
|
||||
</method>
|
||||
|
||||
<method name="pattern_search">
|
||||
<description>Search for feature-related patterns</description>
|
||||
<tool_use><![CDATA[
|
||||
<!-- Find files with feature name -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>feature-name|FeatureName</regex>
|
||||
</search_files>
|
||||
|
||||
<!-- Find related tests -->
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>describe\(['"].*Feature.*['"]|test\(['"].*feature.*['"]</regex>
|
||||
<file_pattern>*.test.ts</file_pattern>
|
||||
</search_files>
|
||||
]]></tool_use>
|
||||
</step>
|
||||
<step>
|
||||
<action>Find config files.</action>
|
||||
</method>
|
||||
|
||||
<method name="configuration_discovery">
|
||||
<description>Find configuration files</description>
|
||||
<tool_use><![CDATA[
|
||||
<!-- Look for config files -->
|
||||
<list_files>
|
||||
<path>config</path>
|
||||
<recursive>true</recursive>
|
||||
</list_files>
|
||||
|
||||
<!-- Search for feature config -->
|
||||
<search_files>
|
||||
<path>.</path>
|
||||
<regex>feature.*config|settings.*feature</regex>
|
||||
<file_pattern>*.json</file_pattern>
|
||||
</search_files>
|
||||
]]></tool_use>
|
||||
</step>
|
||||
</steps>
|
||||
</method>
|
||||
|
||||
<method name="semantic_search_optional">
|
||||
<description>Use semantic search if available and helpful</description>
|
||||
<tool_use><![CDATA[
|
||||
<!-- Optional: Use when concept-based search is needed -->
|
||||
<codebase_search>
|
||||
<query>feature implementation main logic</query>
|
||||
</codebase_search>
|
||||
]]></tool_use>
|
||||
<note>This is optional - use when other methods aren't sufficient</note>
|
||||
</method>
|
||||
</methods>
|
||||
</strategy>
|
||||
|
||||
<strategy name="dependency_chain_analysis">
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -61,29 +61,48 @@
|
|||
Warn about complex dependency chains.
|
||||
</discovery>
|
||||
</important_findings>
|
||||
<review_findings>
|
||||
<template><![CDATA[
|
||||
Review of the provided documentation section is complete.
|
||||
<extraction_findings>
|
||||
<template><![CDATA[
|
||||
Feature extraction complete for [feature name].
|
||||
|
||||
**Assessment**: [Summary of document quality]
|
||||
**Extraction Report**: `EXTRACTION-[feature].md`
|
||||
|
||||
**Recommendations**:
|
||||
**Key Findings**:
|
||||
- Technical Components: [X] classes, [Y] APIs, [Z] configurations
|
||||
- User Workflows: [number] primary use cases identified
|
||||
- Business Logic: [summary of core functionality]
|
||||
- Integration Points: [list of external dependencies]
|
||||
|
||||
* **Critical Inaccuracies**:
|
||||
* [Inaccuracy 1]: Docs state [X], but code implements [Y].
|
||||
* ...
|
||||
**Documentation Considerations**:
|
||||
- [Important aspect that needs clear explanation]
|
||||
- [Complex area that may need diagrams]
|
||||
- [Edge cases that should be documented]
|
||||
|
||||
* **Omissions**:
|
||||
* Missing info about [Missing Feature].
|
||||
* ...
|
||||
The extraction report provides comprehensive details for your documentation team.
|
||||
]]></template>
|
||||
</extraction_findings>
|
||||
<verification_findings>
|
||||
<template><![CDATA[
|
||||
Documentation verification complete.
|
||||
|
||||
* **Clarity Suggestions**:
|
||||
* The section on [Topic] can be clarified by [Suggestion].
|
||||
* ...
|
||||
**Verification Report**: `VERIFICATION-[feature].md`
|
||||
|
||||
Copy this feedback for your documentation team.
|
||||
]]></template>
|
||||
</review_findings>
|
||||
**Overall Assessment**: [Accurate/Needs Updates/Contains Critical Errors]
|
||||
|
||||
**Summary of Findings**:
|
||||
- Critical Inaccuracies: [number]
|
||||
- Technical Corrections Needed: [number]
|
||||
- Missing Information: [number]
|
||||
- Clarity Improvements: [number]
|
||||
|
||||
**Most Important Issues**:
|
||||
1. [Critical issue that could mislead users]
|
||||
2. [Important technical inaccuracy]
|
||||
3. [Key missing information]
|
||||
|
||||
See the full verification report for detailed corrections and suggestions.
|
||||
]]></template>
|
||||
</verification_findings>
|
||||
</findings_communication>
|
||||
</user_interaction>
|
||||
|
||||
|
|
@ -204,43 +223,55 @@ Status: Stable
|
|||
|
||||
<completion_message>
|
||||
<structure>
|
||||
<element>Summary of documented feature.</element>
|
||||
<element>Key findings.</element>
|
||||
<element>File location.</element>
|
||||
<element>Next step suggestions (if applicable).</element>
|
||||
<element>Summary of analysis performed.</element>
|
||||
<element>Key findings or issues identified.</element>
|
||||
<element>Report file location.</element>
|
||||
<element>Recommended next steps.</element>
|
||||
</structure>
|
||||
|
||||
<example><![CDATA[
|
||||
Documentation extracted for the authentication system.
|
||||
<extraction_example><![CDATA[
|
||||
Feature extraction complete for the authentication system.
|
||||
|
||||
**Generated File**: `DOCS-TEMP-authentication-system.md`
|
||||
**Extraction Report**: `EXTRACTION-authentication-system.md`
|
||||
|
||||
**Key Findings**:
|
||||
- System uses JWT with refresh token rotation.
|
||||
- 5 API endpoints found.
|
||||
- 12 configuration options identified.
|
||||
- Security measures (bcrypt, rate limiting) documented.
|
||||
- Troubleshooting for 3 common issues included.
|
||||
**Technical Summary**:
|
||||
- JWT-based authentication with refresh tokens
|
||||
- 5 API endpoints (login, logout, refresh, register, profile)
|
||||
- 12 configuration options
|
||||
- bcrypt password hashing, rate limiting
|
||||
|
||||
**Coverage**:
|
||||
- ✅ Technical details
|
||||
- ✅ API reference
|
||||
- ✅ Configuration guide
|
||||
- ✅ Security guide
|
||||
- ✅ User and developer guides
|
||||
- ✅ Troubleshooting
|
||||
]]></example>
|
||||
<example_review><![CDATA[
|
||||
Review of the documentation section is complete.
|
||||
**Non-Technical Summary**:
|
||||
- Users can register, login, and manage sessions
|
||||
- Supports "remember me" functionality
|
||||
- Automatic session refresh for seamless experience
|
||||
- Account lockout after failed attempts
|
||||
|
||||
**Action**:
|
||||
- Analyzed text against codebase.
|
||||
- Identified inaccuracies and omissions.
|
||||
- Formulated recommendations.
|
||||
**Documentation Considerations**:
|
||||
- Token expiration times need clear explanation
|
||||
- Password requirements should be prominently displayed
|
||||
- Error messages need user-friendly translations
|
||||
|
||||
**Next Steps**:
|
||||
- Feedback is in the chat. No files were created.
|
||||
]]></example_review>
|
||||
The extraction report contains all details needed for comprehensive documentation.
|
||||
]]></extraction_example>
|
||||
|
||||
<verification_example><![CDATA[
|
||||
Documentation verification complete for the authentication system.
|
||||
|
||||
**Verification Report**: `VERIFICATION-authentication-system.md`
|
||||
|
||||
**Overall Assessment**: Needs Updates
|
||||
|
||||
**Critical Issues Found**:
|
||||
1. JWT_SECRET documented as optional, but it's required
|
||||
2. Token expiration listed as 30m, actual is 15m
|
||||
3. Missing documentation for rate limiting feature
|
||||
|
||||
**Technical Corrections**: 7 items
|
||||
**Missing Information**: 4 sections
|
||||
**Clarity Improvements**: 3 suggestions
|
||||
|
||||
Please review the verification report for specific corrections needed.
|
||||
]]></verification_example>
|
||||
</completion_message>
|
||||
|
||||
<error_handling>
|
||||
|
|
|
|||
15
.roomodes
15
.roomodes
|
|
@ -90,9 +90,18 @@ customModes:
|
|||
source: project
|
||||
- slug: docs-extractor
|
||||
name: 📚 Docs Extractor
|
||||
roleDefinition: You are Roo, a comprehensive documentation extraction specialist focused on analyzing and documenting all technical and non-technical information about features and components within codebases.
|
||||
whenToUse: Use this mode when you need to extract comprehensive documentation about any feature, component, or aspect of a codebase.
|
||||
description: Extract comprehensive documentation.
|
||||
roleDefinition: |-
|
||||
You are Roo, a documentation analysis specialist with two primary functions:
|
||||
1. Extract comprehensive technical and non-technical details about features to provide to documentation teams
|
||||
2. Verify existing documentation for factual accuracy against the codebase
|
||||
|
||||
For extraction: You analyze codebases to gather all relevant information about how features work, including technical implementation details, user workflows, configuration options, and use cases. You organize this information clearly for documentation teams to use.
|
||||
|
||||
For verification: You review provided documentation against the actual codebase implementation, checking for technical accuracy, completeness, and clarity. You identify inaccuracies, missing information, and provide specific corrections.
|
||||
|
||||
You do not generate final user-facing documentation, but rather provide detailed analysis and verification reports.
|
||||
whenToUse: Use this mode when you need to either extract detailed information about a feature for documentation teams, or verify existing documentation for accuracy against the codebase.
|
||||
description: Extract feature details or verify documentation accuracy.
|
||||
groups:
|
||||
- read
|
||||
- - edit
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue