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>
Implement comprehensive heading text capture functionality that allows schemas to
enforce specific heading text requirements through enum constraints:
• New CLI option: --capture-heading-text flag for exact text constraints
• Schema generation with heading text as enum constraints (not just structure)
• Advanced validation engine that enforces heading text requirements
• Metaschema extension: x-markitect-heading-text-capture marker
• Full integration with Issue #51 outline mode capabilities
• Comprehensive error reporting for heading text mismatches
• Complete backward compatibility with existing schema generation
Technical implementation:
- Extended SchemaGenerator with capture_heading_text parameter
- Enhanced validation system to check enum constraints on heading content
- Added _validate_heading_text_constraints_with_errors for detailed reporting
- Integrated with existing metaschema validation from Issue #50
- Preserved document order of headings in enum constraints
Key features:
- Schemas can now specify required heading text via enum constraints
- Validation rejects documents with incorrect heading text
- Detailed error messages show expected vs actual heading text
- Works seamlessly with outline mode depth controls
- Maintains 100% compatibility with 513 existing tests
Usage examples:
markitect schema-generate --capture-heading-text document.md
markitect schema-generate --mode outline --capture-heading-text --depth 2 document.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement comprehensive outline mode functionality for schema generation with:
• New CLI options: --mode outline, --depth parameter, --outfile alias
• Schema title format: "Schema from file.md" instead of "Schema for file.md"
• Metaschema extensions: x-markitect-outline-mode, x-markitect-outline-depth
• Depth control with validation (--depth must be >= 1)
• Parameter conflict detection and error handling
• Full backward compatibility with existing --max-depth option
• Comprehensive test coverage (10 new tests, all passing)
• Enhanced CLI help documentation with examples
Technical implementation:
- Extended SchemaGenerator.generate_schema_from_file() with mode/outline_depth parameters
- Updated CLI command with new options and parameter validation
- Maintained 100% compatibility with existing 493 tests
- Integrated with Issue #50 metaschema validation
Usage examples:
markitect schema-generate --mode outline document.md
markitect schema-generate --mode outline --depth 3 --outfile schema.json document.md
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>