Based on the test report (tests/reports/feature/openrouter-mcp/doc-command_report_2025-03-12T16-57-15-257Z.md
), the following issues were identified with the doc
command:
- The command fails when run on empty or nearly empty repositories
- No specific logic exists to detect and handle this edge case gracefully
- Users receive technical errors rather than helpful messages
- The command does not properly support the
--format
parameter - No validation or clear documentation for supported formats
- Performance issues when processing large repositories
- Potential timeout or memory problems without proper handling
- No progress indicators or partial results for large repos
- Issues when combining multiple command parameters
- Possible parameter conflicts or unexpected behavior
- Lack of validation for parameter combinations
- Add detection for empty or nearly empty repositories
- Provide meaningful documentation even for minimal codebases
- Return helpful messages instead of errors
- Example: "Repository contains minimal code. Basic structure documentation generated."
- Add support for different output formats (markdown, JSON, HTML)
- Validate format parameter values
- Document supported formats in help text
- Implement chunking for large repositories
- Add progress indicators for long-running operations
- Provide partial results if complete processing fails
- Consider adding a
--max-size
parameter to limit processing
- Add validation for parameter combinations
- Document expected behavior for parameter interactions
- Handle potential conflicts gracefully
- Add comprehensive error handling throughout the command
- Improve retry logic with better user feedback
- Enhance documentation of command options
- Add unit tests for edge cases
- Empty Repository Handling - High Priority (Common edge case)
- Format Parameter Support - Medium Priority
- Multiple Parameters Support - Medium Priority
- Large Repository Performance - Low Priority (Requires more extensive changes)
After implementing fixes:
-
Run the test scenarios again using:
pnpm dev test tests/feature-behaviors/doc/doc-command.md
-
Add additional test cases for edge conditions
-
Manually verify fixes with real-world repositories of varying sizes and complexities