|
@@ -1,55 +1,40 @@
|
|
|
<analysis_techniques>
|
|
<analysis_techniques>
|
|
|
<overview>
|
|
<overview>
|
|
|
- Techniques for analyzing code to extract documentation.
|
|
|
|
|
|
|
+ Heuristics for analyzing a codebase to extract reliable, user-facing documentation.
|
|
|
|
|
+ This file contains technique checklists only—no tool instructions or invocations.
|
|
|
</overview>
|
|
</overview>
|
|
|
|
|
|
|
|
<ui_ux_analysis_techniques>
|
|
<ui_ux_analysis_techniques>
|
|
|
<technique name="component_discovery">
|
|
<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>
|
|
|
|
|
|
|
+ <description>Find and analyze UI components and their interactions</description>
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Start from feature or route directories and enumerate components related to the requested topic.</rule>
|
|
|
|
|
+ <rule>Differentiate container vs presentational components; note composition patterns.</rule>
|
|
|
|
|
+ <rule>Trace inputs/outputs: props, state, context, events, and side effects.</rule>
|
|
|
|
|
+ <rule>Record conditional rendering that affects user-visible states.</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Primary components and responsibilities.</item>
|
|
|
|
|
+ <item>Props/state/context that change behavior.</item>
|
|
|
|
|
+ <item>High-level dependency/composition map.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
|
|
+ </technique>
|
|
|
|
|
|
|
|
-<!-- Search for style definitions -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>src</path>
|
|
|
|
|
-<regex>className=|style=|styled\.|makeStyles|@apply</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
- ]]></example>
|
|
|
|
|
- </method>
|
|
|
|
|
- </discovery_methods>
|
|
|
|
|
|
|
+ <technique name="style_analysis">
|
|
|
|
|
+ <description>Analyze styling and visual elements</description>
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Identify design tokens and utility classes used to drive layout and state.</rule>
|
|
|
|
|
+ <rule>Capture responsive behavior and breakpoint rules that materially change UX.</rule>
|
|
|
|
|
+ <rule>Document visual affordances tied to state (loading, error, disabled).</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Key classes/selectors influencing layout/state.</item>
|
|
|
|
|
+ <item>Responsive behavior summary and breakpoints.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="user_flow_mapping">
|
|
<technique name="user_flow_mapping">
|
|
|
- <description>
|
|
|
|
|
- Map user interactions and navigation flows
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Map user interactions and navigation flows</description>
|
|
|
<analysis_areas>
|
|
<analysis_areas>
|
|
|
<area>Route definitions and navigation</area>
|
|
<area>Route definitions and navigation</area>
|
|
|
<area>Form submissions and validations</area>
|
|
<area>Form submissions and validations</area>
|
|
@@ -57,31 +42,20 @@
|
|
|
<area>State changes and UI updates</area>
|
|
<area>State changes and UI updates</area>
|
|
|
<area>Loading and error states</area>
|
|
<area>Loading and error states</area>
|
|
|
</analysis_areas>
|
|
</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>
|
|
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Outline entry points and expected outcomes for each primary flow.</rule>
|
|
|
|
|
+ <rule>Summarize validation rules and failure states the user can encounter.</rule>
|
|
|
|
|
+ <rule>Record redirects and deep-link behavior relevant to the feature.</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Flow diagrams or bullet sequences for main tasks.</item>
|
|
|
|
|
+ <item>Validation conditions and error messages.</item>
|
|
|
|
|
+ <item>Navigation transitions and guards.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="user_feedback_analysis">
|
|
<technique name="user_feedback_analysis">
|
|
|
- <description>
|
|
|
|
|
- Analyze how the system communicates with users
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Analyze how the system communicates with users</description>
|
|
|
<elements_to_find>
|
|
<elements_to_find>
|
|
|
<element>Error messages and alerts</element>
|
|
<element>Error messages and alerts</element>
|
|
|
<element>Success notifications</element>
|
|
<element>Success notifications</element>
|
|
@@ -90,31 +64,19 @@
|
|
|
<element>Confirmation dialogs</element>
|
|
<element>Confirmation dialogs</element>
|
|
|
<element>Progress indicators</element>
|
|
<element>Progress indicators</element>
|
|
|
</elements_to_find>
|
|
</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>
|
|
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Map message triggers to the user actions that cause them.</rule>
|
|
|
|
|
+ <rule>Capture severity, persistence, and dismissal behavior.</rule>
|
|
|
|
|
+ <rule>Note localization or accessibility considerations in messages.</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Catalog of messages with purpose and conditions.</item>
|
|
|
|
|
+ <item>Loading/progress patterns and timeouts.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="accessibility_analysis">
|
|
<technique name="accessibility_analysis">
|
|
|
- <description>
|
|
|
|
|
- Check for accessibility features and compliance
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Check for accessibility features and compliance</description>
|
|
|
<accessibility_checks>
|
|
<accessibility_checks>
|
|
|
<check>ARIA labels and roles</check>
|
|
<check>ARIA labels and roles</check>
|
|
|
<check>Keyboard navigation support</check>
|
|
<check>Keyboard navigation support</check>
|
|
@@ -122,25 +84,17 @@
|
|
|
<check>Focus management</check>
|
|
<check>Focus management</check>
|
|
|
<check>Color contrast considerations</check>
|
|
<check>Color contrast considerations</check>
|
|
|
</accessibility_checks>
|
|
</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>
|
|
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Confirm interactive elements have clear focus and labels.</rule>
|
|
|
|
|
+ <rule>Describe keyboard-only navigation paths for core flows.</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Accessibility gaps affecting task completion.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="responsive_design_analysis">
|
|
<technique name="responsive_design_analysis">
|
|
|
- <description>
|
|
|
|
|
- Analyze responsive design and mobile experience
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Analyze responsive design and mobile experience</description>
|
|
|
<analysis_points>
|
|
<analysis_points>
|
|
|
<point>Breakpoint definitions</point>
|
|
<point>Breakpoint definitions</point>
|
|
|
<point>Mobile-specific components</point>
|
|
<point>Mobile-specific components</point>
|
|
@@ -148,230 +102,88 @@
|
|
|
<point>Viewport configurations</point>
|
|
<point>Viewport configurations</point>
|
|
|
<point>Media queries</point>
|
|
<point>Media queries</point>
|
|
|
</analysis_points>
|
|
</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>
|
|
|
|
|
|
|
+ <heuristics>
|
|
|
|
|
+ <rule>Summarize layout changes across breakpoints that alter workflow.</rule>
|
|
|
|
|
+ <rule>Note touch targets and gestures required on mobile.</rule>
|
|
|
|
|
+ </heuristics>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Table of key differences per breakpoint.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
</ui_ux_analysis_techniques>
|
|
</ui_ux_analysis_techniques>
|
|
|
|
|
|
|
|
<code_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">
|
|
<technique name="entry_point_analysis">
|
|
|
- <description>
|
|
|
|
|
- Analyze entry points to understand feature flow.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Understand feature entry points and control flow</description>
|
|
|
<steps>
|
|
<steps>
|
|
|
- <step>Find main functions, controllers, or route handlers.</step>
|
|
|
|
|
- <step>Trace execution flow.</step>
|
|
|
|
|
- <step>Map decision branches.</step>
|
|
|
|
|
- <step>Document input validation.</step>
|
|
|
|
|
|
|
+ <step>Identify main functions, controllers, or route handlers.</step>
|
|
|
|
|
+ <step>Trace execution and decision branches.</step>
|
|
|
|
|
+ <step>Document input validation and preconditions.</step>
|
|
|
</steps>
|
|
</steps>
|
|
|
- <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>
|
|
|
|
|
- ]]></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>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Entry points list and short purpose statements.</item>
|
|
|
|
|
+ <item>Decision matrix or flow sketch.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="api_extraction">
|
|
<technique name="api_extraction">
|
|
|
- <description>
|
|
|
|
|
- Extract API specifications from code.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Extract API specifications from code</description>
|
|
|
<patterns>
|
|
<patterns>
|
|
|
<pattern type="rest">
|
|
<pattern type="rest">
|
|
|
- <search_regex><['"`]
|
|
|
|
|
- ]]></search_regex>
|
|
|
|
|
<extraction>
|
|
<extraction>
|
|
|
- - HTTP method
|
|
|
|
|
- - Route path
|
|
|
|
|
- - Path/query parameters
|
|
|
|
|
- - Request/response schemas
|
|
|
|
|
- - Status codes
|
|
|
|
|
|
|
+ <item>HTTP method and route path</item>
|
|
|
|
|
+ <item>Path/query parameters</item>
|
|
|
|
|
+ <item>Request/response schemas</item>
|
|
|
|
|
+ <item>Status codes and error bodies</item>
|
|
|
</extraction>
|
|
</extraction>
|
|
|
</pattern>
|
|
</pattern>
|
|
|
<pattern type="graphql">
|
|
<pattern type="graphql">
|
|
|
- <search_regex><![CDATA[
|
|
|
|
|
-type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|
|
|
|
- ]]></search_regex>
|
|
|
|
|
<extraction>
|
|
<extraction>
|
|
|
- - Schema and input types
|
|
|
|
|
- - Resolvers
|
|
|
|
|
- - Return types
|
|
|
|
|
- - Field arguments
|
|
|
|
|
|
|
+ <item>Schema and input types</item>
|
|
|
|
|
+ <item>Resolvers and return types</item>
|
|
|
|
|
+ <item>Field arguments and constraints</item>
|
|
|
</extraction>
|
|
</extraction>
|
|
|
</pattern>
|
|
</pattern>
|
|
|
</patterns>
|
|
</patterns>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="dependency_mapping">
|
|
<technique name="dependency_mapping">
|
|
|
- <description>
|
|
|
|
|
- Map dependencies and integration points.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Map dependencies and integration points</description>
|
|
|
<analysis_points>
|
|
<analysis_points>
|
|
|
- <point>Import/require statements</point>
|
|
|
|
|
- <point>package.json dependencies</point>
|
|
|
|
|
- <point>External API calls</point>
|
|
|
|
|
- <point>DB connections</point>
|
|
|
|
|
- <point>Message queue integrations</point>
|
|
|
|
|
- <point>Filesystem operations</point>
|
|
|
|
|
|
|
+ <point>Imports and module boundaries</point>
|
|
|
|
|
+ <point>Package and runtime dependencies</point>
|
|
|
|
|
+ <point>External API/SDK usage</point>
|
|
|
|
|
+ <point>DB connections and migrations</point>
|
|
|
|
|
+ <point>Messaging/queue/event streams</point>
|
|
|
|
|
+ <point>Filesystem or network side effects</point>
|
|
|
</analysis_points>
|
|
</analysis_points>
|
|
|
- <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>
|
|
|
|
|
- ]]></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>
|
|
|
|
|
- ]]></example>
|
|
|
|
|
- </approach>
|
|
|
|
|
- </analysis_approaches>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Dependency graph summary and hot spots.</item>
|
|
|
|
|
+ <item>List of external integrations and auth methods.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="data_model_extraction">
|
|
<technique name="data_model_extraction">
|
|
|
- <description>
|
|
|
|
|
- Extract data models, schemas, and type definitions.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Extract data models, schemas, and type definitions</description>
|
|
|
<sources>
|
|
<sources>
|
|
|
<source type="typescript">
|
|
<source type="typescript">
|
|
|
- <patterns>
|
|
|
|
|
- - interfaces, types, classes, enums
|
|
|
|
|
- </patterns>
|
|
|
|
|
|
|
+ <patterns>- interfaces, types, classes, enums</patterns>
|
|
|
</source>
|
|
</source>
|
|
|
<source type="database">
|
|
<source type="database">
|
|
|
- <patterns>
|
|
|
|
|
- - Schema definitions, migration files, ORM models
|
|
|
|
|
- </patterns>
|
|
|
|
|
|
|
+ <patterns>- Schema definitions, migration files, ORM models</patterns>
|
|
|
</source>
|
|
</source>
|
|
|
<source type="validation">
|
|
<source type="validation">
|
|
|
- <patterns>
|
|
|
|
|
- - JSON Schema, Joi/Yup/Zod schemas, validation decorators
|
|
|
|
|
- </patterns>
|
|
|
|
|
|
|
+ <patterns>- JSON Schema, Joi/Yup/Zod schemas, validation decorators</patterns>
|
|
|
</source>
|
|
</source>
|
|
|
</sources>
|
|
</sources>
|
|
|
- <extraction_example><![CDATA[
|
|
|
|
|
-<!-- Find TypeScript interfaces -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>src</path>
|
|
|
|
|
-<regex>^export\s+(interface|type|class|enum)\s+(\w+)</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
-
|
|
|
|
|
-<!-- Find database models -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>src/models</path>
|
|
|
|
|
-<regex>@(Entity|Table|Model)|class\s+\w+\s+extends\s+(Model|BaseEntity)</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
- ]]></extraction_example>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Canonical definitions and field constraints.</item>
|
|
|
|
|
+ <item>Entity relationships and ownership.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="business_logic_extraction">
|
|
<technique name="business_logic_extraction">
|
|
|
- <description>
|
|
|
|
|
- Identify and document business rules.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Identify and document business rules</description>
|
|
|
<indicators>
|
|
<indicators>
|
|
|
<indicator>Complex conditionals</indicator>
|
|
<indicator>Complex conditionals</indicator>
|
|
|
<indicator>Calculation functions</indicator>
|
|
<indicator>Calculation functions</indicator>
|
|
@@ -380,79 +192,49 @@ type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|
|
<indicator>Domain-specific constants and algorithms</indicator>
|
|
<indicator>Domain-specific constants and algorithms</indicator>
|
|
|
</indicators>
|
|
</indicators>
|
|
|
<documentation_focus>
|
|
<documentation_focus>
|
|
|
- <focus>Why logic exists (business need)</focus>
|
|
|
|
|
- <focus>When logic applies (conditions)</focus>
|
|
|
|
|
- <focus>What logic does (transformation)</focus>
|
|
|
|
|
- <focus>Edge cases</focus>
|
|
|
|
|
|
|
+ <focus>Why the logic exists (business need)</focus>
|
|
|
|
|
+ <focus>When the logic applies (conditions)</focus>
|
|
|
|
|
+ <focus>What the logic does (transformation)</focus>
|
|
|
|
|
+ <focus>Edge cases and invariants</focus>
|
|
|
<focus>Impact of changes</focus>
|
|
<focus>Impact of changes</focus>
|
|
|
</documentation_focus>
|
|
</documentation_focus>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="error_handling_analysis">
|
|
<technique name="error_handling_analysis">
|
|
|
- <description>
|
|
|
|
|
- Document error handling and recovery.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Document error handling and recovery</description>
|
|
|
<analysis_areas>
|
|
<analysis_areas>
|
|
|
- <area>try/catch blocks, error boundaries</area>
|
|
|
|
|
- <area>Custom error classes</area>
|
|
|
|
|
- <area>Error codes and messages</area>
|
|
|
|
|
|
|
+ <area>try/catch blocks and error boundaries</area>
|
|
|
|
|
+ <area>Custom error classes and codes</area>
|
|
|
<area>Logging, fallbacks, retries, circuit breakers</area>
|
|
<area>Logging, fallbacks, retries, circuit breakers</area>
|
|
|
</analysis_areas>
|
|
</analysis_areas>
|
|
|
- <search_patterns><![CDATA[
|
|
|
|
|
-<!-- Find error handling -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>src</path>
|
|
|
|
|
-<regex>try\s*{|catch\s*\(|throw\s+new|class\s+\w*Error\s+extends</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
-
|
|
|
|
|
-<!-- Find error constants -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>src</path>
|
|
|
|
|
-<regex>ERROR_|_ERROR|ErrorCode|errorCode</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
- ]]></search_patterns>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Error taxonomy and user-facing messages.</item>
|
|
|
|
|
+ <item>Recovery/rollback strategies and timeouts.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="security_analysis">
|
|
<technique name="security_analysis">
|
|
|
- <description>
|
|
|
|
|
- Identify security measures and vulnerabilities.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Identify security measures and vulnerabilities</description>
|
|
|
<security_checks>
|
|
<security_checks>
|
|
|
- <check category="authentication">
|
|
|
|
|
- <patterns>
|
|
|
|
|
- - JWT, sessions, OAuth, API keys
|
|
|
|
|
- </patterns>
|
|
|
|
|
- </check>
|
|
|
|
|
- <check category="authorization">
|
|
|
|
|
- <patterns>
|
|
|
|
|
- - RBAC, permission checks, ownership validation
|
|
|
|
|
- </patterns>
|
|
|
|
|
- </check>
|
|
|
|
|
- <check category="data_protection">
|
|
|
|
|
- <patterns>
|
|
|
|
|
- - Encryption, hashing, sensitive data handling
|
|
|
|
|
- </patterns>
|
|
|
|
|
- </check>
|
|
|
|
|
- <check category="input_validation">
|
|
|
|
|
- <patterns>
|
|
|
|
|
- - Sanitization, SQLi/XSS/CSRF prevention
|
|
|
|
|
- </parents>
|
|
|
|
|
- </check>
|
|
|
|
|
|
|
+ <check category="authentication">JWT, sessions, OAuth, API keys</check>
|
|
|
|
|
+ <check category="authorization">RBAC, permission checks, ownership validation</check>
|
|
|
|
|
+ <check category="data_protection">Encryption, hashing, sensitive data handling</check>
|
|
|
|
|
+ <check category="input_validation">Sanitization and injection prevention</check>
|
|
|
</security_checks>
|
|
</security_checks>
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Threat surfaces and mitigations relevant to the feature.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="performance_analysis">
|
|
<technique name="performance_analysis">
|
|
|
- <description>
|
|
|
|
|
- Identify performance factors and optimization opportunities.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Identify performance factors and optimization opportunities</description>
|
|
|
<analysis_points>
|
|
<analysis_points>
|
|
|
- <point>DB query patterns (N+1)</point>
|
|
|
|
|
|
|
+ <point>Expensive loops/algorithms</point>
|
|
|
|
|
+ <point>DB query patterns (e.g., N+1)</point>
|
|
|
<point>Caching strategies</point>
|
|
<point>Caching strategies</point>
|
|
|
- <point>Async usage</point>
|
|
|
|
|
- <point>Batch processing</point>
|
|
|
|
|
- <point>Resource pooling</point>
|
|
|
|
|
- <point>Memory management</point>
|
|
|
|
|
- <point>Algorithm complexity</point>
|
|
|
|
|
|
|
+ <point>Concurrency and async usage</point>
|
|
|
|
|
+ <point>Batching and resource pooling</point>
|
|
|
|
|
+ <point>Memory management and object lifetimes</point>
|
|
|
</analysis_points>
|
|
</analysis_points>
|
|
|
<metrics_to_document>
|
|
<metrics_to_document>
|
|
|
<metric>Time/space complexity</metric>
|
|
<metric>Time/space complexity</metric>
|
|
@@ -464,51 +246,32 @@ type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="test_coverage_analysis">
|
|
<technique name="test_coverage_analysis">
|
|
|
- <description>
|
|
|
|
|
- Analyze test coverage.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Assess test coverage at a useful granularity</description>
|
|
|
<test_types>
|
|
<test_types>
|
|
|
<type name="unit">
|
|
<type name="unit">
|
|
|
- <location>__tests__, *.test.ts, *.spec.ts</location>
|
|
|
|
|
- <analysis>Function coverage</analysis>
|
|
|
|
|
|
|
+ <analysis>Function-level coverage and edge cases</analysis>
|
|
|
</type>
|
|
</type>
|
|
|
<type name="integration">
|
|
<type name="integration">
|
|
|
- <location>integration/, e2e/</location>
|
|
|
|
|
- <analysis>Workflow coverage</analysis>
|
|
|
|
|
|
|
+ <analysis>Workflow coverage and contract boundaries</analysis>
|
|
|
</type>
|
|
</type>
|
|
|
<type name="api">
|
|
<type name="api">
|
|
|
- <location>api-tests/, *.api.test.ts</location>
|
|
|
|
|
- <analysis>Endpoint coverage</analysis>
|
|
|
|
|
|
|
+ <analysis>Endpoint success/failure paths and schemas</analysis>
|
|
|
</type>
|
|
</type>
|
|
|
</test_types>
|
|
</test_types>
|
|
|
- <coverage_analysis><['"`]</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
- ]]></coverage_analysis>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>List of critical behaviors missing tests.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="configuration_extraction">
|
|
<technique name="configuration_extraction">
|
|
|
- <description>
|
|
|
|
|
- Extract configuration options and their impacts.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Extract configuration options and their impacts</description>
|
|
|
<configuration_sources>
|
|
<configuration_sources>
|
|
|
<source>.env files, config files, CLI args, feature flags</source>
|
|
<source>.env files, config files, CLI args, feature flags</source>
|
|
|
</configuration_sources>
|
|
</configuration_sources>
|
|
|
<documentation_requirements>
|
|
<documentation_requirements>
|
|
|
- <requirement>Default values</requirement>
|
|
|
|
|
- <requirement>Valid values</requirement>
|
|
|
|
|
- <requirement>Behavior impact</requirement>
|
|
|
|
|
- <requirement>Config dependencies</requirement>
|
|
|
|
|
|
|
+ <requirement>Default values and valid ranges</requirement>
|
|
|
|
|
+ <requirement>Behavioral impact of each option</requirement>
|
|
|
|
|
+ <requirement>Dependencies between options</requirement>
|
|
|
<requirement>Security implications</requirement>
|
|
<requirement>Security implications</requirement>
|
|
|
</documentation_requirements>
|
|
</documentation_requirements>
|
|
|
</technique>
|
|
</technique>
|
|
@@ -516,54 +279,49 @@ type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|
|
|
|
|
|
|
<workflow_analysis>
|
|
<workflow_analysis>
|
|
|
<technique name="user_journey_mapping">
|
|
<technique name="user_journey_mapping">
|
|
|
- <description>
|
|
|
|
|
- Map user workflows through the feature.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Map user workflows through the feature</description>
|
|
|
<steps>
|
|
<steps>
|
|
|
- <step>Identify entry points (UI, API, CLI).</step>
|
|
|
|
|
- <step>Trace user actions.</step>
|
|
|
|
|
- <step>Document decision points.</step>
|
|
|
|
|
- <step>Map data transformations.</step>
|
|
|
|
|
- <step>Identify outcomes.</step>
|
|
|
|
|
|
|
+ <step>Identify entry points (UI, API, CLI)</step>
|
|
|
|
|
+ <step>Trace user actions and decision points</step>
|
|
|
|
|
+ <step>Map data transformations</step>
|
|
|
|
|
+ <step>Identify outcomes and completion criteria</step>
|
|
|
</steps>
|
|
</steps>
|
|
|
<deliverables>
|
|
<deliverables>
|
|
|
- <deliverable>Flow diagrams, procedures, decision trees, state diagrams.</deliverable>
|
|
|
|
|
|
|
+ <deliverable>Flow diagrams, procedures, decision trees, state diagrams</deliverable>
|
|
|
</deliverables>
|
|
</deliverables>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="integration_flow_analysis">
|
|
<technique name="integration_flow_analysis">
|
|
|
- <description>
|
|
|
|
|
- Document integration with other systems.
|
|
|
|
|
- </description>
|
|
|
|
|
|
|
+ <description>Document integration with other systems</description>
|
|
|
<integration_types>
|
|
<integration_types>
|
|
|
- <type>Sync API calls, async messaging, events, batch processing, streaming.</type>
|
|
|
|
|
|
|
+ <type>Sync API calls, async messaging, events, batch processing, streaming</type>
|
|
|
</integration_types>
|
|
</integration_types>
|
|
|
<documentation_focus>
|
|
<documentation_focus>
|
|
|
- <focus>Protocols, auth, error handling, data transforms, SLAs.</focus>
|
|
|
|
|
|
|
+ <focus>Protocols, auth, error handling, data transforms, SLAs</focus>
|
|
|
</documentation_focus>
|
|
</documentation_focus>
|
|
|
</technique>
|
|
</technique>
|
|
|
</workflow_analysis>
|
|
</workflow_analysis>
|
|
|
|
|
|
|
|
<metadata_extraction>
|
|
<metadata_extraction>
|
|
|
<technique name="version_compatibility">
|
|
<technique name="version_compatibility">
|
|
|
|
|
+ <description>Summarize version constraints and compatibility</description>
|
|
|
<sources>
|
|
<sources>
|
|
|
- <source>package.json, READMEs, migration guides, breaking changes docs.</source>
|
|
|
|
|
|
|
+ <source>package manifests, READMEs, migration guides, breaking changes docs</source>
|
|
|
</sources>
|
|
</sources>
|
|
|
- <extraction_pattern><![CDATA[
|
|
|
|
|
-<!-- Find version requirements -->
|
|
|
|
|
-<search_files>
|
|
|
|
|
-<path>.</path>
|
|
|
|
|
-<regex>"engines":|"peerDependencies":|requires?\s+\w+\s+version|compatible\s+with</regex>
|
|
|
|
|
-</search_files>
|
|
|
|
|
- ]]></extraction_pattern>
|
|
|
|
|
|
|
+ <evidence_to_collect>
|
|
|
|
|
+ <item>Minimum/recommended versions and notable constraints.</item>
|
|
|
|
|
+ </evidence_to_collect>
|
|
|
</technique>
|
|
</technique>
|
|
|
|
|
|
|
|
<technique name="deprecation_tracking">
|
|
<technique name="deprecation_tracking">
|
|
|
|
|
+ <description>Track deprecations and migrations</description>
|
|
|
<indicators>
|
|
<indicators>
|
|
|
- <indicator>@deprecated, TODO comments, legacy code markers.</indicator>
|
|
|
|
|
|
|
+ <indicator>Explicit deprecation notices and TODO markers</indicator>
|
|
|
|
|
+ <indicator>Legacy code paths and adapters</indicator>
|
|
|
</indicators>
|
|
</indicators>
|
|
|
<documentation_requirements>
|
|
<documentation_requirements>
|
|
|
- <requirement>Deprecation date, removal timeline, migration path, alternatives.</requirement>
|
|
|
|
|
|
|
+ <requirement>Deprecation date and removal timeline</requirement>
|
|
|
|
|
+ <requirement>Migration path and alternatives</requirement>
|
|
|
</documentation_requirements>
|
|
</documentation_requirements>
|
|
|
</technique>
|
|
</technique>
|
|
|
</metadata_extraction>
|
|
</metadata_extraction>
|
|
@@ -571,17 +329,20 @@ type\s+(Query|Mutation|Subscription)\s*{[^}]+}|@(Query|Mutation|Resolver)
|
|
|
<quality_indicators>
|
|
<quality_indicators>
|
|
|
<indicator name="documentation_completeness">
|
|
<indicator name="documentation_completeness">
|
|
|
<checks>
|
|
<checks>
|
|
|
- <check>Public APIs documented.</check>
|
|
|
|
|
- <check>Examples for complex features.</check>
|
|
|
|
|
- <check>Error scenarios covered.</check>
|
|
|
|
|
- <check>Config options explained.</check>
|
|
|
|
|
- <check>Security addressed.</check>
|
|
|
|
|
|
|
+ <check>Public APIs documented with inputs/outputs and errors</check>
|
|
|
|
|
+ <check>Examples for complex features</check>
|
|
|
|
|
+ <check>Error scenarios covered with recovery guidance</check>
|
|
|
|
|
+ <check>Config options explained with defaults and impacts</check>
|
|
|
|
|
+ <check>Security considerations addressed</check>
|
|
|
</checks>
|
|
</checks>
|
|
|
</indicator>
|
|
</indicator>
|
|
|
-
|
|
|
|
|
<indicator name="code_quality_metrics">
|
|
<indicator name="code_quality_metrics">
|
|
|
<metrics>
|
|
<metrics>
|
|
|
- <metric>Cyclomatic complexity, code duplication, test coverage, doc coverage, tech debt.</metric>
|
|
|
|
|
|
|
+ <metric>Cyclomatic complexity</metric>
|
|
|
|
|
+ <metric>Code duplication</metric>
|
|
|
|
|
+ <metric>Test coverage and gaps</metric>
|
|
|
|
|
+ <metric>Documentation coverage for user-visible behaviors</metric>
|
|
|
|
|
+ <metric>Known technical debt affecting UX</metric>
|
|
|
</metrics>
|
|
</metrics>
|
|
|
</indicator>
|
|
</indicator>
|
|
|
</quality_indicators>
|
|
</quality_indicators>
|