This implementation adds comprehensive support for content field instructions
that provide guidance for document generation from schemas.
## Key Features Added:
### CLI Options
- `--include-content-instructions` flag to enable content instruction fields
- `--instruction-type` parameter with options: description, example, constraint, template
- Full integration with existing outline mode and heading text capture features
### Schema Generation Enhancements
- Content instruction fields (x-markitect-content-instructions) with contextual guidance text
- Instruction type metadata (x-markitect-instruction-type) for type specification
- Metaschema extension (x-markitect-content-instructions-enabled) for feature detection
- Support for headings, paragraphs, and lists content instructions
### Error Handling
- InvalidInstructionTypeError for robust validation of instruction type parameters
- Comprehensive input validation with clear error messages
### Integration and Compatibility
- Seamless integration with outline mode and heading text capture
- Full backward compatibility - existing behavior unchanged when feature disabled
- Works with all existing CLI options and modes
### Documentation
- Updated CLI help with examples and detailed feature descriptions
- Clear documentation of all instruction types and their purposes
## Technical Implementation:
- Enhanced SchemaGenerator with content instruction generation logic
- Added `_generate_content_instruction` method for contextual instruction text
- Extended schema structure to include instruction metadata
- Maintained clean separation of concerns and existing code patterns
## Testing and Validation:
- Comprehensive test coverage following TDD8 methodology
- All existing functionality preserved and tested
- Integration tests for all feature combinations
- Error handling and edge case validation
This completes Issue #54 with full feature implementation, documentation,
and comprehensive testing coverage.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Major Features:
- Implement comprehensive validation error reporting system (Issue #8)
- Add direct CLI access with 'markitect' command
- Create extensive makefile targets for CLI usage
- Enhance schema validation with detailed error collection
Components Added:
- markitect/validation_error.py: ValidationError system with 8 error types
- Enhanced markitect/schema_validator.py: Detailed error reporting methods
- markitect/cli.py: Enhanced with --detailed-errors and --error-format options
- visualize_schema.py: Schema visualization with ASCII and colorful modes
- Comprehensive test suite for validation error reporting
CLI Enhancements:
- Direct 'markitect' command access for all operations
- Makefile targets for typical CLI usage (cli-help, cli-ingest, etc.)
- Support for text, JSON, and markdown error output formats
- Backward compatibility with existing validation functionality
Testing:
- 11 comprehensive tests for Issue #8 validation error reporting
- Tests for schema validation, visualization, and CLI integration
- 100% test coverage for validation error scenarios
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Comprehensive error handling improvements addressing inconsistent patterns:
• Created markitect/exceptions.py with complete domain-specific exception hierarchy
- MarkitectError base class with context and cause chaining support
- Specific exceptions for Document, AST, Cache, Database, Schema operations
- Built-in logging and context preservation
• Fixed overly broad exception handling in tddai modules:
- issue_fetcher.py: Replace generic Exception with specific Gitea errors
- project_manager.py: Proper error translation with context preservation
- coverage_analyzer.py: Replace silent suppression with logging
• Enhanced cache_service.py error handling:
- Specific OSError/PermissionError handling for file operations
- Logging integration for unexpected errors
- Preserved error collection and reporting
• Implemented proper exception chaining patterns:
- All error translations use `raise ... from e` for debugging
- Preserved original exception context and stack traces
- Added docstring declarations of raised exceptions
• Benefits:
- Eliminates silent error suppression and debugging black holes
- Provides specific, actionable error messages
- Preserves full error context for troubleshooting
- Establishes consistent patterns for future development
Resolves issue #21: Error handling standardization
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>