7de4c831e6
- Extracted prompt formatting logic into reusable `formatPromptContent()` utility function with configurable render phases. - Removed 166 lines of duplicate formatting code from scripts and config modules by centralizing regex patterns and helper functions. - Updated prompt template rendering to use unified `formatPromptContent()` instead of inline `optimizePromptLayout()` implementation. - Added comprehensive test coverage for prompt formatting with pre-render and post-render mode validation.