markitect-main/tests
tegwick e6840fe696 feat(prompts): implement Phase 2 - Templates & Macros (FR-2)
Implement PromptTemplate models with ContentMacro parsing and analysis.

Core Features:
- PromptTemplate extending Artifact for template-specific operations
- ContentMacro model supporting REQUIRED, OPTIONAL, GENERATE kinds
- MacroParser for extracting macros from template content
- TemplateAnalyzer for dependency extraction and validation
- TemplateService for high-level template operations
- Template metadata for model hints and expected inputs

Macro Syntax:
- {{require:artifact-name}} - Required dependency
- {{optional:artifact-name}} - Optional dependency
- {{generate:template-name|param=value}} - Nested generation

Tests (38 passing):
- 18 template model tests (macros, templates, metadata)
- 20 parser tests (parsing, validation, parameters, aliases)

Implements:
- FR-2.1: PromptTemplate as content artifact with macros
- FR-2.2: ContentMacro detection and extraction
- FR-2.3: Required/Optional/Generate macro kinds

Files Created:
- markitect/prompts/templates/models.py
- markitect/prompts/templates/parser.py
- markitect/prompts/templates/analyzer.py
- markitect/prompts/services/template_service.py
- tests/unit/prompts/test_template_models.py
- tests/unit/prompts/test_macro_parser.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 22:34:22 +01:00
..
.issues feat: Integrate Requirements Engineering Agent and fix Issue #59 test failures 2025-10-02 00:45:06 +02:00
e2e feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
fixtures feat: Complete Issue #41 - Add TOML frontmatter support 2025-10-02 09:32:16 +02:00
integration feat(spaces): implement Phase 2 Event System 2026-02-08 07:41:47 +01:00
unit feat(prompts): implement Phase 2 - Templates & Macros (FR-2) 2026-02-08 22:34:22 +01:00
utils fix: eliminate all test suite warnings - Issue #129 2025-10-06 02:11:28 +02:00
conftest.py fix: resolve test failures and modernize test expectations 2025-11-09 09:22:26 +01:00
requirements-test.txt feat: Implement comprehensive Testing Architecture Enhancement 2025-09-26 22:36:35 +02:00
test_cli_integration.py feat: Complete Issue #65 Template Engine Foundation + Fix CLI Regression 2025-10-02 15:33:32 +02:00
test_contentmatter_commands.py feat: Complete Issue #38 - Full MarkdownMatters CLI implementation with TDD8 methodology 2025-10-02 09:14:24 +02:00
test_datamodel_optimizer.py.skip fix: resolve test failures and modernize test expectations 2025-11-09 09:22:26 +01:00
test_db_commands_output_formatting.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_example.py feat: implement tddai Python library for TDD workspace management 2025-09-22 02:04:19 +02:00
test_frontmatter_commands.py feat: Complete Issue #38 - Full MarkdownMatters CLI implementation with TDD8 methodology 2025-10-02 09:14:24 +02:00
test_issue_5_schema_generation.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_issue_6_cli_integration.py feat: Complete Issue #6 - Generate Markdown Stub from Schema 2025-09-30 03:31:48 +02:00
test_issue_6_stub_generation.py feat: Complete Issue #6 - Generate Markdown Stub from Schema 2025-09-30 03:31:48 +02:00
test_issue_7_schema_validation.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_issue_8_validation_errors.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_issue_11_complete.py feat: implement tddai Python library for TDD workspace management 2025-09-22 02:04:19 +02:00
test_issue_17_batch_processing.py feat: implement batch processing and recursive operations (issue #17) 2025-10-03 10:45:43 +02:00
test_issue_18_config_management.py feat: implement configuration and environment management CLI (issue #18) 2025-10-03 10:53:44 +02:00
test_issue_37_configuration_integration.py fix: resolve ConfigurationManager API method calls in Issue #37 tests 2025-10-06 18:04:05 +02:00
test_issue_37_emoji_flag_basic.py feat: implement --emoji flag and MARKITECT_EMOJI environment variable - Issue #37 2025-10-06 17:46:54 +02:00
test_issue_37_environment_variable.py feat: implement --emoji flag and MARKITECT_EMOJI environment variable - Issue #37 2025-10-06 17:46:54 +02:00
test_issue_38_command_restructuring.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_issue_39_db_command_reorganization.py refactor: Remove deprecated query and schema commands and update all tests 2025-09-30 23:33:43 +02:00
test_issue_40_associated_files.py feat: Complete Issue #40 - Associated Files Management with Interactive vs Automation Mode System 2025-09-30 13:09:37 +02:00
test_issue_40_cli_integration.py fix: Update tests to match schema reference metadata feature 2025-10-01 12:48:48 +02:00
test_issue_51_outline_mode.py feat: Complete Issue #51 - Add outline mode to schema generation 2025-10-01 02:59:40 +02:00
test_issue_52_heading_text_capture.py feat: Complete Issue #52 - Capture actual heading text in schemas 2025-10-01 08:03:11 +02:00
test_issue_65_template_integration.py feat: Complete Issue #65 Template Engine Foundation + Fix CLI Regression 2025-10-02 15:33:32 +02:00
test_issue_65_template_parser.py feat: Complete Issue #65 Template Engine Foundation + Fix CLI Regression 2025-10-02 15:33:32 +02:00
test_issue_65_template_substitution.py feat: Complete Issue #65 Template Engine Foundation + Fix CLI Regression 2025-10-02 15:33:32 +02:00
test_issue_132_cli_integration.py feat: implement sophisticated layered theme system for md-render 2025-10-27 21:31:08 +01:00
test_issue_133_browser_compatibility.py feat: implement instant markdown editing support - Issue #133 2025-10-07 01:22:09 +02:00
test_issue_133_javascript_editor.py fix: convert JavaScript editor tests from RED to GREEN state - Issue #133 2025-10-07 01:32:47 +02:00
test_issue_135_publication_directory.py feat: implement instant markdown base and publication directory - Issue #135 2025-10-07 12:47:59 +02:00
test_issue_136_index_generation.py feat: complete clean editor implementation with comprehensive UI framework 2025-10-28 03:50:21 +01:00
test_issue_138_cli_integration.py feat: complete TDD8 implementation of markdown file explosion - Issue #138 2025-10-07 15:44:30 +02:00
test_issue_138_directory_creation.py feat: complete TDD8 implementation of markdown file explosion - Issue #138 2025-10-07 15:44:30 +02:00
test_issue_138_filename_generation.py feat: complete TDD8 implementation of markdown file explosion - Issue #138 2025-10-07 15:44:30 +02:00
test_issue_138_markdown_parsing.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_139_cli_integration.py feat: complete Issue #139 md-implode command implementation 2025-10-07 22:47:05 +02:00
test_issue_139_content_aggregation.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_139_directory_analysis.py feat: complete Issue #139 md-implode command implementation 2025-10-07 22:47:05 +02:00
test_issue_139_end_to_end.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_139_filename_decoding.py feat: complete Issue #139 md-implode command implementation 2025-10-07 22:47:05 +02:00
test_issue_140_roundtrip_simplified.py feat: complete Issue #140 roundtrip compatibility analysis 2025-10-07 23:11:33 +02:00
test_issue_142_asset_deduplicator.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_142_asset_manager.py.skip fix: resolve test failures and modernize test expectations 2025-11-09 09:22:26 +01:00
test_issue_142_asset_registry.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_142_markdown_packager.py feat: comprehensive asset management system and testing improvements 2025-10-12 19:57:31 +02:00
test_issue_143_cli_commands.py fix: handle Click testing framework I/O issue in test_asset_stats_command 2025-10-14 19:29:08 +02:00
test_issue_144_asset_optimization.py.skip fix: resolve test failures and modernize test expectations 2025-11-09 09:22:26 +01:00
test_issue_144_auto_discovery_workspace.py refactor: delegate version management to release-management capability 2025-11-09 10:41:28 +01:00
test_issue_144_batch_import.py refactor: delegate version management to release-management capability 2025-11-09 10:41:28 +01:00
test_issue_144_database_performance.py feat: complete core asset management system with database integration 2025-10-14 23:42:42 +02:00
test_issue_144_integration_workflow.py feat: complete Issue #146 final integration testing 2025-10-15 00:19:52 +02:00
test_issue_145_cross_platform_validator.py fix: resolve all errors in Issue #145 production readiness test suite 2025-10-15 20:00:25 +02:00
test_issue_145_deployment_validator.py fix: resolve all errors in Issue #145 production readiness test suite 2025-10-15 20:00:25 +02:00
test_issue_145_performance_benchmark.py fix: resolve all errors in Issue #145 production readiness test suite 2025-10-15 20:00:25 +02:00
test_issue_145_production_configuration.py fix: resolve all errors in Issue #145 production readiness test suite 2025-10-15 20:00:25 +02:00
test_issue_145_production_error_handler.py fix: resolve pytest warnings for test_workspace functions 2025-12-17 12:10:25 +01:00
test_issue_146_final_integration.py refactor: Still trying to reorganize edit mode to be more robust 2025-11-04 21:59:22 +01:00
test_issue_148_core_infrastructure.py feat: implement Issue #148 core infrastructure for explode-implode variants 2025-10-12 20:17:41 +02:00
test_issue_149_explode_implode_variants.py feat: complete Issue #149 - Phase 2: Implement Explode-Implode Variants 2025-10-12 22:30:06 +02:00
test_issue_149_roundtrip_validation.py feat: implement comprehensive front matter preservation and unicode handling 2025-10-13 20:26:08 +02:00
test_issue_150_mdz_format.py feat: complete Issue #150 - Advanced Packaging Features (.mdz, .mdt) 2025-10-13 23:09:18 +02:00
test_issue_150_packaging_base.py feat: complete Issue #150 - Advanced Packaging Features (.mdz, .mdt) 2025-10-13 23:09:18 +02:00
test_issue_150_transclusion_engine.py feat: complete Issue #150 - Advanced Packaging Features (.mdz, .mdt) 2025-10-13 23:09:18 +02:00
test_issue_152_153_edge_cases.py fix: resolve flaky test in test_issue_152_153_edge_cases.py 2025-10-14 07:53:38 +02:00
test_issue_165_chatgpt_theme.py feat: implement ChatGPT document theme for compact interactive reading (Issue #165) 2025-11-10 11:04:51 +01:00
test_issue_166_substack_theme.py feat: complete issue-facade capability enhancement and project cleanup 2025-11-10 10:53:37 +01:00
test_l2_application_feature_workflows.py feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
test_l3_domain_performance_validation.py.skip refactor: delegate version management to release-management capability 2025-11-09 10:41:28 +01:00
test_l3_domain_project_models.py feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
test_l4_service_ast_analysis.py refactor: Remove deprecated query and schema commands and update all tests 2025-09-30 23:33:43 +02:00
test_l4_service_document_management.py feat: implement plugin-based architecture with md- command prefixes - Issue #44 2025-10-06 16:46:26 +02:00
test_l4_service_document_modification.py feat: implement comprehensive front matter preservation and unicode handling 2025-10-13 20:26:08 +02:00
test_l4_service_output_formatting.py refactor: Remove deprecated query and schema commands and update all tests 2025-09-30 23:33:43 +02:00
test_l4_service_schema_generation.py refactor: Remove circular test dependencies and meta-testing anti-patterns 2025-10-01 21:05:36 +02:00
test_l5_infrastructure_ast_processing.py feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
test_l5_infrastructure_cache_management.py fix: resolve all test failures and improve test infrastructure 2025-10-03 05:37:17 +02:00
test_l5_infrastructure_cache_monitoring.py feat: Establish CLI subsystem *-stats command naming convention 2025-09-30 22:13:07 +02:00
test_l5_infrastructure_database_queries.py refactor: Remove deprecated query and schema commands and update all tests 2025-09-30 23:33:43 +02:00
test_l5_infrastructure_test_framework.py.skip refactor: delegate version management to release-management capability 2025-11-09 10:41:28 +01:00
test_l7_foundation_database_core.py feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
test_l7_foundation_markdown_parsing.py feat: Revolutionary Test Architecture - 7-Layer Organization with Advanced Testing Capabilities 2025-09-29 12:18:25 +02:00
test_md_render_asset_shipping.py feat: implement comprehensive asset shipping for md-render command 2025-10-29 23:12:44 +01:00
test_modular_theme_system.py feat: implement modular theme system with file-based theme organization 2025-11-10 11:43:25 +01:00
test_profile_cli_commands.py feat: implement comprehensive User Profile Management System (issue #107) 2025-10-04 01:53:31 +02:00
test_profile_manager.py feat: implement comprehensive User Profile Management System (issue #107) 2025-10-04 01:53:31 +02:00
test_roundtrip_consolidated.py feat: implement comprehensive front matter preservation and unicode handling 2025-10-13 20:26:08 +02:00
test_schema_analyzer.py test: add comprehensive tests for Phase 2 schema tools 2026-01-04 21:33:37 +01:00
test_schema_loader.py feat: implement Phase 2 - Markdown Schema Loader 2026-01-05 00:02:15 +01:00
test_schema_metaschema.py feat: implement Phase 3 - Schema-for-Schemas Metaschema 2026-01-05 03:10:49 +01:00
test_schema_naming.py feat: implement schema filename validation (Phase 1 complete) 2026-01-04 23:51:29 +01:00
test_schema_refiner.py test: add comprehensive tests for Phase 2 schema tools 2026-01-04 21:33:37 +01:00
test_schema_visualization.py fix: resolve all test failures and improve test infrastructure 2025-10-03 05:37:17 +02:00
test_semantic_validator.py feat: add LinkValidator for semantic link validation (Phase 3) 2026-01-06 03:41:03 +01:00
test_utils.py fix: resolve pytest warnings for test_workspace functions 2025-12-17 12:10:25 +01:00