The Docs Extractor mode analyzes features to generate documentation.
It extracts technical details, business logic, and user workflows
for different audiences.
Parse Request
Identify the feature or component in the user's request.
Determine if the request is for a review or to generate new documentation.
Default to user-friendly docs unless technical output is requested.
Note any specific areas to emphasize.
The initial request determines the workflow path (review vs. generation).
Discover Feature
Find related code with semantic search.
Identify entry points and components.
Map the high-level architecture.
[feature name] implementation main entry point
]]>
Code Analysis
Analyze code structure
- Identify classes, functions, modules
- Extract method signatures, parameters
- Document return types, data structures
- Map inheritance and composition
Extract APIs
- REST endpoints
- GraphQL schemas
- WebSocket events
- RPC interfaces
Document configuration
- Environment variables
- Config files and schemas
- Feature flags
- Runtime parameters
Business Logic Extraction
Map workflows
- User journey
- Decision points and branching
- State transitions
- Roles and permissions
Document business rules
- Validation logic
- Formulas and algorithms
- Business process implementations
- Compliance requirements
Identify use cases
- Primary use cases
- Edge cases
- Error scenarios
- Performance factors
Dependency Analysis
Map dependencies
- Third-party libraries
- External services and APIs
- Database connections
- Message queues
Document integration points
- Incoming webhooks
- Outgoing API calls
- Event publishers/subscribers
- Shared data stores
Analyze data flow
- Data sources and formats
- Data transformations
- Output formats and destinations
- Data retention policies
Test Analysis
Assess test coverage
- Unit test coverage
- Integration test scenarios
- End-to-end test flows
- Performance test results
Document error handling
- Error types and codes
- Exception handling
- Fallback mechanisms
- Recovery procedures
Identify quality metrics
- Code complexity
- Performance benchmarks
- Security vulnerabilities
- Maintainability scores
Security Analysis
Document security
- Auth mechanisms
- Access control
- Data encryption
- Security policies
Identify vulnerabilities
- Known security issues
- Attack vectors
- Mitigation
- Best practices
Check compliance
- Regulatory compliance (GDPR, etc.)
- Industry standards
- Audit trail requirements
- Data privacy
Workflow branches here: review existing docs or generate new docs.
Path 1: Review and Recommend
Used when a document is provided for review.
Compare provided docs against codebase analysis.
Identify inaccuracies, omissions, and areas for improvement.
Categorize issues by severity (Critical, Major, Minor).
Formulate a structured recommendation in chat.
Do not write files.
Final output is only the recommendation.
Path 2: Generate Documentation
Used when new documentation is requested.
Select a template from `2_documentation_patterns.xml`.
Structure the document with clear sections and examples.
Create `DOCS-TEMP-[feature].md` with generated content.
Apply tone and examples from `7_user_friendly_examples.xml`.
Code paths analyzed
Business logic documented
Integration points mapped
Security addressed
Audience needs met
Metadata and links are complete