[{"data":1,"prerenderedAt":71},["Reactive",2],{"blog-post-markdown-workflow-automation-and-productivity-complete-guide":3},{"slug":4,"title":5,"description":6,"excerpt":7,"date":8,"category":9,"author":10,"keywords":11,"readingMinutes":12,"html":13,"headings":14,"tools":45,"related":46},"markdown-workflow-automation-and-productivity-complete-guide","Markdown Workflow Automation and Productivity: Complete Guide for Streamlined Content Creation and Management","Master advanced Markdown workflow automation techniques for enhanced productivity, streamlined content creation, and efficient document management. Learn automation tools, template systems, and productivity optimization strategies.","Advanced Markdown workflow automation transforms manual content creation into streamlined, efficient processes that maximize productivity while maintaining quality standards. By implementing…","2025-10-14","Tutorial","Matthew Rathbone","markdown workflow automation, markdown productivity, content automation, markdown templates, document workflow, markdown efficiency, automated markdown, productivity tools markdown",21,"\u003Cp>Advanced Markdown workflow automation transforms manual content creation into streamlined, efficient processes that maximize productivity while maintaining quality standards. By implementing sophisticated automation systems, template frameworks, and productivity optimization techniques, content creators can eliminate repetitive tasks, ensure consistency across documents, and focus on high-value creative work while automated systems handle routine formatting, validation, and publishing workflows.\u003C/p>\n\u003Ch2 id=\"why-master-markdown-workflow-automation\">Why Master Markdown Workflow Automation?\u003C/h2>\n\u003Cp>Professional workflow automation provides essential benefits for content creation teams:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Productivity Enhancement\u003C/strong>: Eliminate manual formatting tasks and reduce content creation time by 60-80%\u003C/li>\n\u003Cli>\u003Cstrong>Consistency Assurance\u003C/strong>: Maintain uniform document structure and formatting across all content\u003C/li>\n\u003Cli>\u003Cstrong>Quality Control\u003C/strong>: Implement automated validation, spell-checking, and quality assurance processes\u003C/li>\n\u003Cli>\u003Cstrong>Scalability\u003C/strong>: Handle large-scale content production without proportional increases in manual effort\u003C/li>\n\u003Cli>\u003Cstrong>Error Reduction\u003C/strong>: Minimize human errors through automated formatting and validation systems\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"foundation-automation-framework\">Foundation Automation Framework\u003C/h2>\n\u003Ch3 id=\"core-automation-architecture\">Core Automation Architecture\u003C/h3>\n\u003Cp>Building robust automation systems for Markdown content workflows:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// markdown-automation-framework.js - Comprehensive automation system\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> fs = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;fs&#x27;\u003C/span>).\u003Cspan class=\"hljs-property\">promises\u003C/span>;\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> path = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;path&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> matter = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;gray-matter&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> chokidar = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;chokidar&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> { execSync } = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;child_process&#x27;\u003C/span>);\n\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">MarkdownWorkflowAutomation\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">constructor\u003C/span>(\u003Cspan class=\"hljs-params\">options = {}\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">contentDirectory\u003C/span>: options.\u003Cspan class=\"hljs-property\">contentDirectory\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./content&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">templatesDirectory\u003C/span>: options.\u003Cspan class=\"hljs-property\">templatesDirectory\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./templates&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">outputDirectory\u003C/span>: options.\u003Cspan class=\"hljs-property\">outputDirectory\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./output&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">watchMode\u003C/span>: options.\u003Cspan class=\"hljs-property\">watchMode\u003C/span> || \u003Cspan class=\"hljs-literal\">false\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">autoCommit\u003C/span>: options.\u003Cspan class=\"hljs-property\">autoCommit\u003C/span> || \u003Cspan class=\"hljs-literal\">false\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">validationRules\u003C/span>: options.\u003Cspan class=\"hljs-property\">validationRules\u003C/span> || {},\n            ...options\n        };\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">templates\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">workflows\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">fileWatcher\u003C/span> = \u003Cspan class=\"hljs-literal\">null\u003C/span>;\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">processedFiles\u003C/span>: \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">errorsEncountered\u003C/span>: \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">automationsSaved\u003C/span>: \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">lastRunTime\u003C/span>: \u003Cspan class=\"hljs-literal\">null\u003C/span>\n        };\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">initializeDefaultWorkflows\u003C/span>();\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">initialize\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Initializing Markdown workflow automation...&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-comment\">// Load templates\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadTemplates\u003C/span>();\n        \n        \u003Cspan class=\"hljs-comment\">// Load validation rules\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadValidationRules\u003C/span>();\n        \n        \u003Cspan class=\"hljs-comment\">// Setup file watching if enabled\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">watchMode\u003C/span>) {\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">setupFileWatcher\u003C/span>();\n        }\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Workflow automation initialized successfully&#x27;\u003C/span>);\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">loadTemplates\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> templateFiles = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">findFiles\u003C/span>(\n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">templatesDirectory\u003C/span>, \n                \u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>\n            );\n            \n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> templateFile \u003Cspan class=\"hljs-keyword\">of\u003C/span> templateFiles) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> content = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readFile\u003C/span>(templateFile, \u003Cspan class=\"hljs-string\">&#x27;utf8&#x27;\u003C/span>);\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> { \u003Cspan class=\"hljs-attr\">data\u003C/span>: frontmatter, \u003Cspan class=\"hljs-attr\">content\u003C/span>: body } = \u003Cspan class=\"hljs-title function_\">matter\u003C/span>(content);\n                \n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> templateName = path.\u003Cspan class=\"hljs-title function_\">basename\u003C/span>(templateFile, \u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>);\n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">templates\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(templateName, {\n                    frontmatter,\n                    \u003Cspan class=\"hljs-attr\">content\u003C/span>: body,\n                    \u003Cspan class=\"hljs-attr\">path\u003C/span>: templateFile,\n                    \u003Cspan class=\"hljs-attr\">variables\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">extractVariables\u003C/span>(body)\n                });\n            }\n            \n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Loaded \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.templates.size}\u003C/span> templates`\u003C/span>);\n        } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Error loading templates:&#x27;\u003C/span>, error);\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">extractVariables\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> variablePattern = \u003Cspan class=\"hljs-regexp\">/\\{\\{\\s*(\\w+(?:\\.\\w+)*)\\s*\\}\\}/g\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> variables = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> match;\n        \n        \u003Cspan class=\"hljs-keyword\">while\u003C/span> ((match = variablePattern.\u003Cspan class=\"hljs-title function_\">exec\u003C/span>(content)) !== \u003Cspan class=\"hljs-literal\">null\u003C/span>) {\n            variables.\u003Cspan class=\"hljs-title function_\">add\u003C/span>(match[\u003Cspan class=\"hljs-number\">1\u003C/span>]);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">from\u003C/span>(variables);\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">createFromTemplate\u003C/span>(\u003Cspan class=\"hljs-params\">templateName, outputPath, variables = {}\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> template = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">templates\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(templateName);\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!template) {\n            \u003Cspan class=\"hljs-keyword\">throw\u003C/span> \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Error\u003C/span>(\u003Cspan class=\"hljs-string\">`Template &#x27;\u003Cspan class=\"hljs-subst\">${templateName}\u003C/span>&#x27; not found`\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Process template variables\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> processedContent = template.\u003Cspan class=\"hljs-property\">content\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> processedFrontmatter = { ...template.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span> };\n        \n        \u003Cspan class=\"hljs-comment\">// Replace variables in content\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [key, value] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(variables)) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(\u003Cspan class=\"hljs-string\">`\\\\{\\\\{\\\\s*\u003Cspan class=\"hljs-subst\">${key}\u003C/span>\\\\s*\\\\}\\\\}`\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;g&#x27;\u003C/span>);\n            processedContent = processedContent.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(regex, value);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Replace variables in frontmatter\u003C/span>\n        processedFrontmatter = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processObjectVariables\u003C/span>(processedFrontmatter, variables);\n        \n        \u003Cspan class=\"hljs-comment\">// Add default values\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> defaultValues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateDefaultValues\u003C/span>();\n        processedFrontmatter = { ...defaultValues, ...processedFrontmatter };\n        \n        \u003Cspan class=\"hljs-comment\">// Create the new document\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> finalContent = matter.\u003Cspan class=\"hljs-title function_\">stringify\u003C/span>(processedContent, processedFrontmatter);\n        \n        \u003Cspan class=\"hljs-comment\">// Ensure output directory exists\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">mkdir\u003C/span>(path.\u003Cspan class=\"hljs-title function_\">dirname\u003C/span>(outputPath), { \u003Cspan class=\"hljs-attr\">recursive\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span> });\n        \n        \u003Cspan class=\"hljs-comment\">// Write the file\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">writeFile\u003C/span>(outputPath, finalContent);\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Created document from template: \u003Cspan class=\"hljs-subst\">${outputPath}\u003C/span>`\u003C/span>);\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">processedFiles\u003C/span>++;\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> outputPath;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">processObjectVariables\u003C/span>(\u003Cspan class=\"hljs-params\">obj, variables\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-keyword\">typeof\u003C/span> obj === \u003Cspan class=\"hljs-string\">&#x27;string&#x27;\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">let\u003C/span> processed = obj;\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [key, value] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(variables)) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(\u003Cspan class=\"hljs-string\">`\\\\{\\\\{\\\\s*\u003Cspan class=\"hljs-subst\">${key}\u003C/span>\\\\s*\\\\}\\\\}`\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;g&#x27;\u003C/span>);\n                processed = processed.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(regex, value);\n            }\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> processed;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">isArray\u003C/span>(obj)) {\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> obj.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">item\u003C/span> =&gt;\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processObjectVariables\u003C/span>(item, variables));\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-keyword\">typeof\u003C/span> obj === \u003Cspan class=\"hljs-string\">&#x27;object&#x27;\u003C/span> &amp;&amp; obj !== \u003Cspan class=\"hljs-literal\">null\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> processed = {};\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [key, value] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(obj)) {\n                processed[key] = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processObjectVariables\u003C/span>(value, variables);\n            }\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> processed;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> obj;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateDefaultValues\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> now = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">date\u003C/span>: now.\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>().\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;T&#x27;\u003C/span>)[\u003Cspan class=\"hljs-number\">0\u003C/span>],\n            \u003Cspan class=\"hljs-attr\">author\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">defaultAuthor\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;Content Team&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">created_at\u003C/span>: now.\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">last_modified\u003C/span>: now.\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>()\n        };\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(\u003Cspan class=\"hljs-params\">filePath\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Processing file: \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>`\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> content = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readFile\u003C/span>(filePath, \u003Cspan class=\"hljs-string\">&#x27;utf8&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> { \u003Cspan class=\"hljs-attr\">data\u003C/span>: frontmatter, \u003Cspan class=\"hljs-attr\">content\u003C/span>: body } = \u003Cspan class=\"hljs-title function_\">matter\u003C/span>(content);\n            \n            \u003Cspan class=\"hljs-comment\">// Run validation\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> validationResult = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateDocument\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                frontmatter,\n                \u003Cspan class=\"hljs-attr\">content\u003C/span>: body\n            });\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!validationResult.\u003Cspan class=\"hljs-property\">passed\u003C/span>) {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">warn\u003C/span>(\u003Cspan class=\"hljs-string\">`Validation failed for \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>:`\u003C/span>, validationResult.\u003Cspan class=\"hljs-property\">errors\u003C/span>);\n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">errorsEncountered\u003C/span>++;\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n            }\n            \n            \u003Cspan class=\"hljs-comment\">// Apply automated fixes\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> processed = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">applyAutomaticFixes\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                frontmatter,\n                \u003Cspan class=\"hljs-attr\">content\u003C/span>: body\n            });\n            \n            \u003Cspan class=\"hljs-comment\">// Write back if changes were made\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (processed.\u003Cspan class=\"hljs-property\">modified\u003C/span>) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> finalContent = matter.\u003Cspan class=\"hljs-title function_\">stringify\u003C/span>(processed.\u003Cspan class=\"hljs-property\">content\u003C/span>, processed.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>);\n                \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">writeFile\u003C/span>(filePath, finalContent);\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Applied automatic fixes to: \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>`\u003C/span>);\n            }\n            \n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">processedFiles\u003C/span>++;\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n            \n        } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(\u003Cspan class=\"hljs-string\">`Error processing \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>:`\u003C/span>, error);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">errorsEncountered\u003C/span>++;\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">validateDocument\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> errors = [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> warnings = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check required frontmatter fields\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> requiredFields = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span>.\u003Cspan class=\"hljs-property\">requiredFields\u003C/span> || [];\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> field \u003Cspan class=\"hljs-keyword\">of\u003C/span> requiredFields) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>[field]) {\n                errors.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Missing required frontmatter field: \u003Cspan class=\"hljs-subst\">${field}\u003C/span>`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Validate title length\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">title\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> titleLength = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">title\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (titleLength &gt; \u003Cspan class=\"hljs-number\">100\u003C/span>) {\n                warnings.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Title is \u003Cspan class=\"hljs-subst\">${titleLength}\u003C/span> characters (recommended: 60-100)`\u003C/span>);\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (titleLength &lt; \u003Cspan class=\"hljs-number\">20\u003C/span>) {\n                warnings.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Title is \u003Cspan class=\"hljs-subst\">${titleLength}\u003C/span> characters (recommended: 20-100)`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Validate description\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">description\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> descLength = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">description\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (descLength &gt; \u003Cspan class=\"hljs-number\">160\u003C/span>) {\n                warnings.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Description is \u003Cspan class=\"hljs-subst\">${descLength}\u003C/span> characters (recommended: 120-160)`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for proper heading hierarchy\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headingErrors = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateHeadingHierarchy\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>);\n        errors.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...headingErrors);\n        \n        \u003Cspan class=\"hljs-comment\">// Check for broken internal links\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> linkErrors = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateInternalLinks\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>);\n        errors.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...linkErrors);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">passed\u003C/span>: errors.\u003Cspan class=\"hljs-property\">length\u003C/span> === \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            errors,\n            warnings\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateHeadingHierarchy\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s.+$/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> errors = [];\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> lastLevel = \u003Cspan class=\"hljs-number\">0\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> heading \u003Cspan class=\"hljs-keyword\">of\u003C/span> headings) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> level = heading.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+/\u003C/span>)[\u003Cspan class=\"hljs-number\">0\u003C/span>].\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (level &gt; lastLevel + \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n                errors.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Heading level jump detected: \u003Cspan class=\"hljs-subst\">${heading}\u003C/span> (from h\u003Cspan class=\"hljs-subst\">${lastLevel}\u003C/span> to h\u003Cspan class=\"hljs-subst\">${level}\u003C/span>)`\u003C/span>);\n            }\n            \n            lastLevel = level;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> errors;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">validateInternalLinks\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> linkPattern = \u003Cspan class=\"hljs-regexp\">/\\[([^\\]]+)\\]\\(([^)]+)\\)/g\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> errors = [];\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> match;\n        \n        \u003Cspan class=\"hljs-keyword\">while\u003C/span> ((match = linkPattern.\u003Cspan class=\"hljs-title function_\">exec\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>)) !== \u003Cspan class=\"hljs-literal\">null\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> linkUrl = match[\u003Cspan class=\"hljs-number\">2\u003C/span>];\n            \n            \u003Cspan class=\"hljs-comment\">// Check internal links (relative paths)\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!linkUrl.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;http&#x27;\u003C/span>) &amp;&amp; !linkUrl.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;#&#x27;\u003C/span>)) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> basePath = path.\u003Cspan class=\"hljs-title function_\">dirname\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">path\u003C/span>);\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> targetPath = path.\u003Cspan class=\"hljs-title function_\">resolve\u003C/span>(basePath, linkUrl);\n                \n                \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n                    \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">access\u003C/span>(targetPath);\n                } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> {\n                    errors.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Broken internal link: \u003Cspan class=\"hljs-subst\">${linkUrl}\u003C/span> in \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.path}\u003C/span>`\u003C/span>);\n                }\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> errors;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">applyAutomaticFixes\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> modified = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> frontmatter = { ...\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span> };\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> content = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Auto-update last modified date\u003C/span>\n        frontmatter.\u003Cspan class=\"hljs-property\">last_modified\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>().\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>();\n        modified = \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Auto-generate description if missing\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!frontmatter.\u003Cspan class=\"hljs-property\">description\u003C/span> &amp;&amp; content.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">100\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> firstParagraph = content\n                .\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;\\n&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">find\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">line\u003C/span> =&gt;\u003C/span> line.\u003Cspan class=\"hljs-title function_\">trim\u003C/span>() &amp;&amp; !line.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;#&#x27;\u003C/span>));\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (firstParagraph) {\n                frontmatter.\u003Cspan class=\"hljs-property\">description\u003C/span> = firstParagraph\n                    .\u003Cspan class=\"hljs-title function_\">substring\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>, \u003Cspan class=\"hljs-number\">150\u003C/span>)\n                    .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\[([^\\]]+)\\]\\([^)]+\\)/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;$1&#x27;\u003C/span>) \u003Cspan class=\"hljs-comment\">// Remove markdown links\u003C/span>\n                    .\u003Cspan class=\"hljs-title function_\">trim\u003C/span>() + \u003Cspan class=\"hljs-string\">&#x27;...&#x27;\u003C/span>;\n                modified = \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Fix common markdown issues\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> fixedContent = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">fixCommonMarkdownIssues\u003C/span>(content);\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (fixedContent !== content) {\n            content = fixedContent;\n            modified = \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Auto-generate table of contents if marker exists\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (content.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;&lt;!-- TOC --&gt;&#x27;\u003C/span>)) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> toc = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateTableOfContents\u003C/span>(content);\n            content = content.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;&lt;!-- TOC --&gt;&#x27;\u003C/span>, toc);\n            modified = \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            frontmatter,\n            content,\n            modified\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">fixCommonMarkdownIssues\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> fixed = content;\n        \n        \u003Cspan class=\"hljs-comment\">// Fix spacing around headings\u003C/span>\n        fixed = fixed.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^(#+\\s.+)$/gm\u003C/span>, \u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">match, heading\u003C/span>) =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-string\">`\\n\u003Cspan class=\"hljs-subst\">${heading}\u003C/span>\\n`\u003C/span>;\n        });\n        \n        \u003Cspan class=\"hljs-comment\">// Fix multiple consecutive blank lines\u003C/span>\n        fixed = fixed.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\n{3,}/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;\\n\\n&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-comment\">// Fix trailing spaces\u003C/span>\n        fixed = fixed.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/[ \\t]+$/gm\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-comment\">// Fix missing space after list markers\u003C/span>\n        fixed = fixed.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^(\\s*[-*+])([^\\s])/gm\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;$1 $2&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> fixed;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateTableOfContents\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^(#{2,6})\\s(.+)$/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> toc = [\u003Cspan class=\"hljs-string\">&#x27;## Table of Contents\\n&#x27;\u003C/span>];\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> heading \u003Cspan class=\"hljs-keyword\">of\u003C/span> headings) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> level = heading.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+/\u003C/span>)[\u003Cspan class=\"hljs-number\">0\u003C/span>].\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> text = heading.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s/\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> anchor = text.\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C/span>()\n                .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/[^a-z0-9\\s-]/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\s+/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;-&#x27;\u003C/span>);\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> indent = \u003Cspan class=\"hljs-string\">&#x27;  &#x27;\u003C/span>.\u003Cspan class=\"hljs-title function_\">repeat\u003C/span>(level - \u003Cspan class=\"hljs-number\">2\u003C/span>);\n            toc.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${indent}\u003C/span>- [\u003Cspan class=\"hljs-subst\">${text}\u003C/span>](#\u003Cspan class=\"hljs-subst\">${anchor}\u003C/span>)`\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> toc.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;\\n&#x27;\u003C/span>) + \u003Cspan class=\"hljs-string\">&#x27;\\n&#x27;\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">setupFileWatcher\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Setting up file watcher...&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">fileWatcher\u003C/span> = chokidar.\u003Cspan class=\"hljs-title function_\">watch\u003C/span>(\n            path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">contentDirectory\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;**/*.md&#x27;\u003C/span>),\n            {\n                \u003Cspan class=\"hljs-attr\">ignored\u003C/span>: \u003Cspan class=\"hljs-regexp\">/node_modules|\\.git/\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">persistent\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            }\n        );\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">fileWatcher\u003C/span>\n            .\u003Cspan class=\"hljs-title function_\">on\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;change&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> (filePath) =&gt; {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`File changed: \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>`\u003C/span>);\n                \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(filePath);\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">autoCommit\u003C/span>) {\n                    \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">autoCommitChanges\u003C/span>(filePath);\n                }\n            })\n            .\u003Cspan class=\"hljs-title function_\">on\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;add&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> (filePath) =&gt; {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`New file added: \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>`\u003C/span>);\n                \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(filePath);\n            });\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">autoCommitChanges\u003C/span>(\u003Cspan class=\"hljs-params\">filePath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-title function_\">execSync\u003C/span>(\u003Cspan class=\"hljs-string\">`git add &quot;\u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>&quot;`\u003C/span>, { \u003Cspan class=\"hljs-attr\">cwd\u003C/span>: process.\u003Cspan class=\"hljs-title function_\">cwd\u003C/span>() });\n            \u003Cspan class=\"hljs-title function_\">execSync\u003C/span>(\u003Cspan class=\"hljs-string\">`git commit -m &quot;Auto: Updated \u003Cspan class=\"hljs-subst\">${path.basename(filePath)}\u003C/span>&quot;`\u003C/span>, {\n                \u003Cspan class=\"hljs-attr\">cwd\u003C/span>: process.\u003Cspan class=\"hljs-title function_\">cwd\u003C/span>()\n            });\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Auto-committed changes to: \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>`\u003C/span>);\n        } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">warn\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Auto-commit failed:&#x27;\u003C/span>, error.\u003Cspan class=\"hljs-property\">message\u003C/span>);\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">batchProcess\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Starting batch processing...&#x27;\u003C/span>);\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">lastRunTime\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>().\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>();\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> markdownFiles = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">findFiles\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">contentDirectory\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> file \u003Cspan class=\"hljs-keyword\">of\u003C/span> markdownFiles) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(file);\n        }\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Batch processing completed. Processed: \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.stats.processedFiles}\u003C/span>, Errors: \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.stats.errorsEncountered}\u003C/span>`\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">findFiles\u003C/span>(\u003Cspan class=\"hljs-params\">directory, extension\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> files = [];\n        \n        \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-keyword\">function\u003C/span> \u003Cspan class=\"hljs-title function_\">scan\u003C/span>(\u003Cspan class=\"hljs-params\">dir\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> entries = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readdir\u003C/span>(dir, { \u003Cspan class=\"hljs-attr\">withFileTypes\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span> });\n                \n                \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> entry \u003Cspan class=\"hljs-keyword\">of\u003C/span> entries) {\n                    \u003Cspan class=\"hljs-keyword\">const\u003C/span> fullPath = path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(dir, entry.\u003Cspan class=\"hljs-property\">name\u003C/span>);\n                    \n                    \u003Cspan class=\"hljs-keyword\">if\u003C/span> (entry.\u003Cspan class=\"hljs-title function_\">isDirectory\u003C/span>() &amp;&amp; !entry.\u003Cspan class=\"hljs-property\">name\u003C/span>.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;.&#x27;\u003C/span>)) {\n                        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">scan\u003C/span>(fullPath);\n                    } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (entry.\u003Cspan class=\"hljs-title function_\">isFile\u003C/span>() &amp;&amp; entry.\u003Cspan class=\"hljs-property\">name\u003C/span>.\u003Cspan class=\"hljs-title function_\">endsWith\u003C/span>(extension)) {\n                        files.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(fullPath);\n                    }\n                }\n            } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">warn\u003C/span>(\u003Cspan class=\"hljs-string\">`Cannot access directory \u003Cspan class=\"hljs-subst\">${dir}\u003C/span>: \u003Cspan class=\"hljs-subst\">${error.message}\u003C/span>`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">scan\u003C/span>(directory);\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> files;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">initializeDefaultWorkflows\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-comment\">// Blog post workflow\u003C/span>\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">workflows\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;blog-post&#x27;\u003C/span>, {\n            \u003Cspan class=\"hljs-attr\">template\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;blog-post&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">rules\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">requiredFields\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;date&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;author&#x27;\u003C/span>],\n                \u003Cspan class=\"hljs-attr\">autoSlug\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">autoTags\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            }\n        });\n        \n        \u003Cspan class=\"hljs-comment\">// Documentation workflow\u003C/span>\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">workflows\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;documentation&#x27;\u003C/span>, {\n            \u003Cspan class=\"hljs-attr\">template\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;documentation&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">rules\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">requiredFields\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span>],\n                \u003Cspan class=\"hljs-attr\">generateTOC\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">validateLinks\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            }\n        });\n        \n        \u003Cspan class=\"hljs-comment\">// Tutorial workflow\u003C/span>\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">workflows\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;tutorial&#x27;\u003C/span>, {\n            \u003Cspan class=\"hljs-attr\">template\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;tutorial&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">rules\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">requiredFields\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;difficulty&#x27;\u003C/span>],\n                \u003Cspan class=\"hljs-attr\">generateSteps\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">includeCodeExamples\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            }\n        });\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">runWorkflow\u003C/span>(\u003Cspan class=\"hljs-params\">workflowName, inputData\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> workflow = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">workflows\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(workflowName);\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!workflow) {\n            \u003Cspan class=\"hljs-keyword\">throw\u003C/span> \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Error\u003C/span>(\u003Cspan class=\"hljs-string\">`Workflow &#x27;\u003Cspan class=\"hljs-subst\">${workflowName}\u003C/span>&#x27; not found`\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Running workflow: \u003Cspan class=\"hljs-subst\">${workflowName}\u003C/span>`\u003C/span>);\n        \n        \u003Cspan class=\"hljs-comment\">// Generate output path\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> outputPath = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateOutputPath\u003C/span>(workflowName, inputData);\n        \n        \u003Cspan class=\"hljs-comment\">// Create from template\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">createFromTemplate\u003C/span>(workflow.\u003Cspan class=\"hljs-property\">template\u003C/span>, outputPath, inputData);\n        \n        \u003Cspan class=\"hljs-comment\">// Apply workflow-specific rules\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (workflow.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">autoSlug\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateSlug\u003C/span>(outputPath, inputData.\u003Cspan class=\"hljs-property\">title\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (workflow.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">generateTOC\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">addTableOfContents\u003C/span>(outputPath);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (workflow.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">validateLinks\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(outputPath);\n        }\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Workflow &#x27;\u003Cspan class=\"hljs-subst\">${workflowName}\u003C/span>&#x27; completed: \u003Cspan class=\"hljs-subst\">${outputPath}\u003C/span>`\u003C/span>);\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> outputPath;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateOutputPath\u003C/span>(\u003Cspan class=\"hljs-params\">workflowName, inputData\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> date = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> dateStr = date.\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>().\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;T&#x27;\u003C/span>)[\u003Cspan class=\"hljs-number\">0\u003C/span>];\n        \n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> filename;\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (workflowName === \u003Cspan class=\"hljs-string\">&#x27;blog-post&#x27;\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> slug = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">createSlug\u003C/span>(inputData.\u003Cspan class=\"hljs-property\">title\u003C/span>);\n            filename = \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${dateStr}\u003C/span>-\u003Cspan class=\"hljs-subst\">${slug}\u003C/span>.md`\u003C/span>;\n        } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> slug = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">createSlug\u003C/span>(inputData.\u003Cspan class=\"hljs-property\">title\u003C/span>);\n            filename = \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${slug}\u003C/span>.md`\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">config\u003C/span>.\u003Cspan class=\"hljs-property\">outputDirectory\u003C/span>, filename);\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">createSlug\u003C/span>(\u003Cspan class=\"hljs-params\">title\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> title\n            .\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C/span>()\n            .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/[^a-z0-9\\s-]/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>)\n            .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\s+/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;-&#x27;\u003C/span>)\n            .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/-+/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;-&#x27;\u003C/span>)\n            .\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^-|-$/g\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>);\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">generateProductivityReport\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> report = {\n            \u003Cspan class=\"hljs-attr\">summary\u003C/span>: { ...\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span> },\n            \u003Cspan class=\"hljs-attr\">templateUsage\u003C/span>: {},\n            \u003Cspan class=\"hljs-attr\">workflowMetrics\u003C/span>: {},\n            \u003Cspan class=\"hljs-attr\">recommendations\u003C/span>: []\n        };\n        \n        \u003Cspan class=\"hljs-comment\">// Analyze template usage\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [name, template] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">templates\u003C/span>) {\n            report.\u003Cspan class=\"hljs-property\">templateUsage\u003C/span>[name] = {\n                \u003Cspan class=\"hljs-attr\">variableCount\u003C/span>: template.\u003Cspan class=\"hljs-property\">variables\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">lastUsed\u003C/span>: template.\u003Cspan class=\"hljs-property\">lastUsed\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;Never&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">timesUsed\u003C/span>: template.\u003Cspan class=\"hljs-property\">timesUsed\u003C/span> || \u003Cspan class=\"hljs-number\">0\u003C/span>\n            };\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Generate productivity recommendations\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">errorsEncountered\u003C/span> &gt; \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">processedFiles\u003C/span> * \u003Cspan class=\"hljs-number\">0.1\u003C/span>) {\n            report.\u003Cspan class=\"hljs-property\">recommendations\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;quality&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;High error rate detected. Consider reviewing validation rules and templates.&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">keys\u003C/span>(report.\u003Cspan class=\"hljs-property\">templateUsage\u003C/span>).\u003Cspan class=\"hljs-property\">length\u003C/span> &lt; \u003Cspan class=\"hljs-number\">3\u003C/span>) {\n            report.\u003Cspan class=\"hljs-property\">recommendations\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;templates&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Consider creating more templates to improve productivity.&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> report;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">cleanup\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">fileWatcher\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">fileWatcher\u003C/span>.\u003Cspan class=\"hljs-title function_\">close\u003C/span>();\n        }\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Workflow automation cleaned up&#x27;\u003C/span>);\n    }\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = \u003Cspan class=\"hljs-title class_\">MarkdownWorkflowAutomation\u003C/span>;\n\u003C/code>\u003C/pre>\u003Ch3 id=\"template-system-implementation\">Template System Implementation\u003C/h3>\n\u003Cp>Advanced template system for consistent content creation:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-markdown\">\u003Cspan class=\"hljs-section\">&lt;!-- blog-post-template.md --&gt;\n---\u003C/span>\ntitle: &quot;{{ title }}&quot;\ndescription: &quot;{{ description }}&quot;\nkeywords: &quot;{{ keywords }}&quot;\nlayout: post\ndate: {{ date }}\nauthor: {{ author }}\ncategory: {{ category }}\ntags: {{ tags }}\nimage:\n\u003Cspan class=\"hljs-section\">  asset: {{ image\u003Cspan class=\"hljs-emphasis\">_asset }}\n---\n\n{{ introduction }}\n\n## Why {{ main_\u003C/span>topic }}?\n\n{{ value\u003Cspan class=\"hljs-emphasis\">_proposition }}\n\n## Foundation Concepts\n\n### Understanding {{ core_\u003C/span>concept }}\n\n{{ core\u003Cspan class=\"hljs-emphasis\">_explanation }}\n\n```{{ primary_\u003C/span>language }}\n// {{ code\u003Cspan class=\"hljs-emphasis\">_example_\u003C/span>title }}\n{{ code\u003Cspan class=\"hljs-emphasis\">_example }}\u003C/span>\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"advanced-techniques\">Advanced Techniques\u003C/h3>\n\u003Cp>{{ advanced_content }}\u003C/p>\n\u003Ch2 id=\"practical-implementation\">Practical Implementation\u003C/h2>\n\u003Ch3 id=\"step-by-step-guide\">Step-by-Step Guide\u003C/h3>\n\u003Cp>{{ implementation_steps }}\u003C/p>\n\u003Ch2 id=\"best-practices\">Best Practices\u003C/h2>\n\u003Cp>{{ best_practices }}\u003C/p>\n\u003Ch2 id=\"integration-with-other-tools\">Integration with Other Tools\u003C/h2>\n\u003Cp>{{ integration_notes }}\u003C/p>\n\u003Ch2 id=\"troubleshooting-common-issues\">Troubleshooting Common Issues\u003C/h2>\n\u003Cp>{{ troubleshooting }}\u003C/p>\n\u003Ch2 id=\"conclusion\">Conclusion\u003C/h2>\n\u003Cp>{{ conclusion }}\u003C/p>\n\u003Cp>{{ call_to_action }}\u003C/p>\n\u003Cpre>\u003Ccode>\n\n### Productivity Enhancement Tools\n\nAutomated productivity optimization and workflow management:\n\n```python\n# markdown_productivity_optimizer.py - Advanced productivity optimization\nimport re\nimport os\nimport time\nimport json\nimport asyncio\nfrom datetime import datetime, timedelta\nfrom typing import Dict, List, Optional, Tuple\nfrom dataclasses import dataclass, asdict\nfrom pathlib import Path\n\n@dataclass\nclass ProductivityMetrics:\n    words_written: int = 0\n    documents_created: int = 0\n    time_spent_writing: float = 0.0\n    automation_time_saved: float = 0.0\n    errors_prevented: int = 0\n    templates_used: int = 0\n\n@dataclass\nclass WorkSession:\n    start_time: datetime\n    end_time: Optional[datetime] = None\n    documents_modified: List[str] = None\n    words_added: int = 0\n    productivity_score: float = 0.0\n\nclass MarkdownProductivityOptimizer:\n    def __init__(self, workspace_path: str):\n        self.workspace_path = Path(workspace_path)\n        self.metrics = ProductivityMetrics()\n        self.sessions = []\n        self.current_session = None\n        \n        self.shortcuts = {}\n        self.snippets = {}\n        self.auto_corrections = {}\n        \n        self.productivity_rules = {\n            &#39;optimal_session_length&#39;: 25,  # minutes (Pomodoro)\n            &#39;break_reminder_interval&#39;: 30,\n            &#39;word_count_targets&#39;: {\n                &#39;blog_post&#39;: 1500,\n                &#39;tutorial&#39;: 2000,\n                &#39;documentation&#39;: 1000\n            },\n            &#39;quality_thresholds&#39;: {\n                &#39;min_readability_score&#39;: 60,\n                &#39;max_complexity_score&#39;: 15,\n                &#39;min_paragraph_length&#39;: 50\n            }\n        }\n        \n        self.load_configuration()\n    \n    def load_configuration(self):\n        &quot;&quot;&quot;Load user configuration and customizations&quot;&quot;&quot;\n        config_file = self.workspace_path / &#39;.productivity_config.json&#39;\n        \n        if config_file.exists():\n            with open(config_file, &#39;r&#39;) as f:\n                config = json.load(f)\n                \n            self.shortcuts.update(config.get(&#39;shortcuts&#39;, {}))\n            self.snippets.update(config.get(&#39;snippets&#39;, {}))\n            self.auto_corrections.update(config.get(&#39;auto_corrections&#39;, {}))\n            self.productivity_rules.update(config.get(&#39;rules&#39;, {}))\n    \n    def start_work_session(self):\n        &quot;&quot;&quot;Start a new productivity tracking session&quot;&quot;&quot;\n        if self.current_session:\n            self.end_work_session()\n        \n        self.current_session = WorkSession(\n            start_time=datetime.now(),\n            documents_modified=[]\n        )\n        \n        print(f&quot;📝 Work session started at {self.current_session.start_time.strftime(&#39;%H:%M&#39;)}&quot;)\n        return self.current_session\n    \n    def end_work_session(self):\n        &quot;&quot;&quot;End current work session and calculate metrics&quot;&quot;&quot;\n        if not self.current_session:\n            return None\n        \n        self.current_session.end_time = datetime.now()\n        duration = (self.current_session.end_time - self.current_session.start_time).total_seconds() / 60\n        \n        # Calculate productivity score\n        self.current_session.productivity_score = self.calculate_productivity_score(\n            self.current_session.words_added,\n            duration,\n            len(self.current_session.documents_modified)\n        )\n        \n        # Update overall metrics\n        self.metrics.time_spent_writing += duration\n        self.metrics.words_written += self.current_session.words_added\n        self.metrics.documents_created += len(self.current_session.documents_modified)\n        \n        # Store session\n        self.sessions.append(self.current_session)\n        \n        print(f&quot;✅ Session completed: {duration:.1f} minutes, {self.current_session.words_added} words&quot;)\n        print(f&quot;📊 Productivity score: {self.current_session.productivity_score:.1f}/100&quot;)\n        \n        session = self.current_session\n        self.current_session = None\n        return session\n    \n    def calculate_productivity_score(self, words_written: int, time_spent: float, docs_modified: int) -&gt; float:\n        &quot;&quot;&quot;Calculate productivity score based on multiple factors&quot;&quot;&quot;\n        if time_spent == 0:\n            return 0.0\n        \n        # Words per minute component (target: 30-50 WPM for technical writing)\n        wpm = words_written / time_spent\n        wpm_score = min(100, (wpm / 40) * 50)  # 50 points max for WPM\n        \n        # Focus component (fewer document switches = better focus)\n        focus_score = max(0, 30 - (docs_modified * 5))  # 30 points max\n        \n        # Consistency component (consistent writing pace)\n        consistency_score = 20  # Simplified for this example\n        \n        return wpm_score + focus_score + consistency_score\n    \n    def process_document(self, file_path: str, content: str) -&gt; Dict:\n        &quot;&quot;&quot;Process document for productivity optimization&quot;&quot;&quot;\n        analysis = {\n            &#39;word_count&#39;: len(content.split()),\n            &#39;character_count&#39;: len(content),\n            &#39;readability_score&#39;: self.calculate_readability(content),\n            &#39;complexity_score&#39;: self.calculate_complexity(content),\n            &#39;suggestions&#39;: [],\n            &#39;auto_fixes_applied&#39;: []\n        }\n        \n        # Apply auto-corrections\n        corrected_content, corrections = self.apply_auto_corrections(content)\n        if corrections:\n            analysis[&#39;auto_fixes_applied&#39;] = corrections\n        \n        # Generate productivity suggestions\n        analysis[&#39;suggestions&#39;] = self.generate_suggestions(analysis, file_path)\n        \n        # Update session metrics if active\n        if self.current_session:\n            original_words = len(self.current_session.documents_modified)\n            if file_path not in self.current_session.documents_modified:\n                self.current_session.documents_modified.append(file_path)\n            \n            # Estimate words added (simplified calculation)\n            self.current_session.words_added += max(0, analysis[&#39;word_count&#39;] - 100)\n        \n        return analysis\n    \n    def calculate_readability(self, content: str) -&gt; float:\n        &quot;&quot;&quot;Calculate simplified readability score&quot;&quot;&quot;\n        sentences = len(re.findall(r&#39;[.!?]+&#39;, content))\n        words = len(content.split())\n        \n        if sentences == 0:\n            return 0\n        \n        avg_sentence_length = words / sentences\n        \n        # Simplified Flesch Reading Ease approximation\n        # Higher score = more readable\n        score = 206.835 - (1.015 * avg_sentence_length) - (84.6 * self.avg_syllables(content))\n        return max(0, min(100, score))\n    \n    def avg_syllables(self, content: str) -&gt; float:\n        &quot;&quot;&quot;Estimate average syllables per word&quot;&quot;&quot;\n        words = re.findall(r&#39;\\b[a-zA-Z]+\\b&#39;, content.lower())\n        if not words:\n            return 0\n        \n        total_syllables = sum(self.count_syllables(word) for word in words)\n        return total_syllables / len(words)\n    \n    def count_syllables(self, word: str) -&gt; int:\n        &quot;&quot;&quot;Estimate syllables in a word&quot;&quot;&quot;\n        vowels = &#39;aeiouy&#39;\n        count = 0\n        prev_was_vowel = False\n        \n        for char in word:\n            is_vowel = char in vowels\n            if is_vowel and not prev_was_vowel:\n                count += 1\n            prev_was_vowel = is_vowel\n        \n        # Handle silent &#39;e&#39;\n        if word.endswith(&#39;e&#39;) and count &gt; 1:\n            count -= 1\n        \n        return max(1, count)\n    \n    def calculate_complexity(self, content: str) -&gt; float:\n        &quot;&quot;&quot;Calculate content complexity score&quot;&quot;&quot;\n        # Count complex patterns\n        complex_sentences = len(re.findall(r&#39;[,;:]&#39;, content))\n        long_words = len(re.findall(r&#39;\\b\\w{7,}\\b&#39;, content))\n        technical_terms = len(re.findall(r&#39;\\b[A-Z]{2,}\\b&#39;, content))\n        \n        total_words = len(content.split())\n        if total_words == 0:\n            return 0\n        \n        complexity = ((complex_sentences + long_words + technical_terms) / total_words) * 100\n        return min(25, complexity)  # Cap at 25\n    \n    def apply_auto_corrections(self, content: str) -&gt; Tuple[str, List[str]]:\n        &quot;&quot;&quot;Apply automatic corrections and formatting fixes&quot;&quot;&quot;\n        corrected = content\n        corrections = []\n        \n        # Fix common typography issues\n        typography_fixes = {\n            r&#39;\\s+&#39;: &#39; &#39;,  # Multiple spaces\n            r&#39;\\n{3,}&#39;: &#39;\\n\\n&#39;,  # Multiple line breaks\n            r&#39;\\.{3,}&#39;: &#39;...&#39;,  # Multiple periods\n            r&#39;\\s+([.!?])&#39;: r&#39;\\1&#39;,  # Space before punctuation\n            r&#39;([.!?])([A-Z])&#39;: r&#39;\\1 \\2&#39;,  # Missing space after punctuation\n        }\n        \n        for pattern, replacement in typography_fixes.items():\n            new_content = re.sub(pattern, replacement, corrected)\n            if new_content != corrected:\n                corrections.append(f&quot;Fixed typography: {pattern}&quot;)\n                corrected = new_content\n        \n        # Apply custom auto-corrections\n        for mistake, correction in self.auto_corrections.items():\n            if mistake in corrected:\n                corrected = corrected.replace(mistake, correction)\n                corrections.append(f&quot;Auto-corrected: {mistake} → {correction}&quot;)\n        \n        return corrected, corrections\n    \n    def generate_suggestions(self, analysis: Dict, file_path: str) -&gt; List[Dict]:\n        &quot;&quot;&quot;Generate productivity and quality suggestions&quot;&quot;&quot;\n        suggestions = []\n        \n        # Word count suggestions\n        doc_type = self.detect_document_type(file_path)\n        target_words = self.productivity_rules[&#39;word_count_targets&#39;].get(doc_type, 1000)\n        \n        current_words = analysis[&#39;word_count&#39;]\n        if current_words &lt; target_words * 0.7:\n            suggestions.append({\n                &#39;type&#39;: &#39;length&#39;,\n                &#39;priority&#39;: &#39;medium&#39;,\n                &#39;message&#39;: f&quot;Document is {current_words} words, target is {target_words}. Consider expanding key sections.&quot;\n            })\n        elif current_words &gt; target_words * 1.5:\n            suggestions.append({\n                &#39;type&#39;: &#39;length&#39;,\n                &#39;priority&#39;: &#39;low&#39;,\n                &#39;message&#39;: f&quot;Document is {current_words} words, target is {target_words}. Consider condensing or splitting.&quot;\n            })\n        \n        # Readability suggestions\n        readability = analysis[&#39;readability_score&#39;]\n        min_readability = self.productivity_rules[&#39;quality_thresholds&#39;][&#39;min_readability_score&#39;]\n        \n        if readability &lt; min_readability:\n            suggestions.append({\n                &#39;type&#39;: &#39;readability&#39;,\n                &#39;priority&#39;: &#39;high&#39;,\n                &#39;message&#39;: f&quot;Readability score is {readability:.1f} (target: {min_readability}+). Consider shorter sentences and simpler words.&quot;\n            })\n        \n        # Complexity suggestions\n        complexity = analysis[&#39;complexity_score&#39;]\n        max_complexity = self.productivity_rules[&#39;quality_thresholds&#39;][&#39;max_complexity_score&#39;]\n        \n        if complexity &gt; max_complexity:\n            suggestions.append({\n                &#39;type&#39;: &#39;complexity&#39;,\n                &#39;priority&#39;: &#39;medium&#39;,\n                &#39;message&#39;: f&quot;Complexity score is {complexity:.1f} (target: &lt;{max_complexity}). Consider simplifying technical language.&quot;\n            })\n        \n        return suggestions\n    \n    def detect_document_type(self, file_path: str) -&gt; str:\n        &quot;&quot;&quot;Detect document type based on file path and content&quot;&quot;&quot;\n        path_lower = file_path.lower()\n        \n        if &#39;blog&#39; in path_lower or &#39;post&#39; in path_lower:\n            return &#39;blog_post&#39;\n        elif &#39;tutorial&#39; in path_lower or &#39;guide&#39; in path_lower:\n            return &#39;tutorial&#39;\n        elif &#39;doc&#39; in path_lower or &#39;readme&#39; in path_lower:\n            return &#39;documentation&#39;\n        else:\n            return &#39;general&#39;\n    \n    def expand_snippet(self, text: str) -&gt; str:\n        &quot;&quot;&quot;Expand text shortcuts and snippets&quot;&quot;&quot;\n        expanded = text\n        \n        # Apply shortcuts\n        for shortcut, expansion in self.shortcuts.items():\n            if shortcut in expanded:\n                expanded = expanded.replace(shortcut, expansion)\n                self.metrics.automation_time_saved += 0.5  # Estimated time saved\n        \n        # Apply snippets\n        for trigger, snippet in self.snippets.items():\n            if trigger in expanded:\n                expanded = expanded.replace(trigger, snippet)\n                self.metrics.automation_time_saved += 2.0  # More time saved for snippets\n        \n        return expanded\n    \n    def suggest_next_action(self) -&gt; Dict:\n        &quot;&quot;&quot;Suggest next productive action based on current state&quot;&quot;&quot;\n        now = datetime.now()\n        \n        # Check if user should take a break\n        if self.current_session:\n            session_duration = (now - self.current_session.start_time).total_seconds() / 60\n            \n            if session_duration &gt;= self.productivity_rules[&#39;optimal_session_length&#39;]:\n                return {\n                    &#39;action&#39;: &#39;take_break&#39;,\n                    &#39;message&#39;: f&quot;You&#39;ve been working for {session_duration:.1f} minutes. Consider taking a 5-minute break.&quot;,\n                    &#39;priority&#39;: &#39;high&#39;\n                }\n        \n        # Analyze recent productivity\n        recent_sessions = [s for s in self.sessions[-5:] if s.end_time]\n        if recent_sessions:\n            avg_score = sum(s.productivity_score for s in recent_sessions) / len(recent_sessions)\n            \n            if avg_score &lt; 50:\n                return {\n                    &#39;action&#39;: &#39;review_workflow&#39;,\n                    &#39;message&#39;: &quot;Productivity has been lower recently. Consider reviewing your workflow and eliminating distractions.&quot;,\n                    &#39;priority&#39;: &#39;medium&#39;\n                }\n        \n        # Default suggestion\n        return {\n            &#39;action&#39;: &#39;continue_writing&#39;,\n            &#39;message&#39;: &quot;You&#39;re doing great! Keep up the productive writing.&quot;,\n            &#39;priority&#39;: &#39;low&#39;\n        }\n    \n    def generate_productivity_report(self, days: int = 7) -&gt; Dict:\n        &quot;&quot;&quot;Generate comprehensive productivity report&quot;&quot;&quot;\n        cutoff_date = datetime.now() - timedelta(days=days)\n        recent_sessions = [s for s in self.sessions if s.start_time &gt;= cutoff_date]\n        \n        if not recent_sessions:\n            return {&#39;error&#39;: &#39;No recent data available&#39;}\n        \n        # Calculate statistics\n        total_time = sum(\n            (s.end_time - s.start_time).total_seconds() / 60\n            for s in recent_sessions if s.end_time\n        )\n        total_words = sum(s.words_added for s in recent_sessions)\n        avg_wpm = (total_words / total_time) if total_time &gt; 0 else 0\n        avg_productivity = sum(s.productivity_score for s in recent_sessions) / len(recent_sessions)\n        \n        # Daily breakdown\n        daily_stats = {}\n        for session in recent_sessions:\n            date_key = session.start_time.strftime(&#39;%Y-%m-%d&#39;)\n            if date_key not in daily_stats:\n                daily_stats[date_key] = {\n                    &#39;sessions&#39;: 0,\n                    &#39;words&#39;: 0,\n                    &#39;time&#39;: 0,\n                    &#39;avg_score&#39;: 0\n                }\n            \n            daily_stats[date_key][&#39;sessions&#39;] += 1\n            daily_stats[date_key][&#39;words&#39;] += session.words_added\n            if session.end_time:\n                daily_stats[date_key][&#39;time&#39;] += (session.end_time - session.start_time).total_seconds() / 60\n            daily_stats[date_key][&#39;avg_score&#39;] += session.productivity_score\n        \n        # Calculate daily averages\n        for day_data in daily_stats.values():\n            if day_data[&#39;sessions&#39;] &gt; 0:\n                day_data[&#39;avg_score&#39;] /= day_data[&#39;sessions&#39;]\n        \n        return {\n            &#39;period&#39;: f&quot;{days} days&quot;,\n            &#39;summary&#39;: {\n                &#39;total_sessions&#39;: len(recent_sessions),\n                &#39;total_time_minutes&#39;: total_time,\n                &#39;total_words&#39;: total_words,\n                &#39;average_wpm&#39;: avg_wpm,\n                &#39;average_productivity_score&#39;: avg_productivity,\n                &#39;automation_time_saved&#39;: self.metrics.automation_time_saved\n            },\n            &#39;daily_breakdown&#39;: daily_stats,\n            &#39;recommendations&#39;: self.generate_productivity_recommendations(recent_sessions)\n        }\n    \n    def generate_productivity_recommendations(self, sessions: List[WorkSession]) -&gt; List[Dict]:\n        &quot;&quot;&quot;Generate personalized productivity recommendations&quot;&quot;&quot;\n        recommendations = []\n        \n        if not sessions:\n            return recommendations\n        \n        # Analyze session patterns\n        session_lengths = [\n            (s.end_time - s.start_time).total_seconds() / 60\n            for s in sessions if s.end_time\n        ]\n        \n        if session_lengths:\n            avg_length = sum(session_lengths) / len(session_lengths)\n            optimal_length = self.productivity_rules[&#39;optimal_session_length&#39;]\n            \n            if avg_length &gt; optimal_length * 1.5:\n                recommendations.append({\n                    &#39;type&#39;: &#39;session_length&#39;,\n                    &#39;priority&#39;: &#39;medium&#39;,\n                    &#39;message&#39;: f&quot;Your average session is {avg_length:.1f} minutes. Consider shorter, more focused sessions around {optimal_length} minutes.&quot;\n                })\n        \n        # Analyze productivity scores\n        scores = [s.productivity_score for s in sessions]\n        if scores:\n            avg_score = sum(scores) / len(scores)\n            \n            if avg_score &lt; 60:\n                recommendations.append({\n                    &#39;type&#39;: &#39;productivity&#39;,\n                    &#39;priority&#39;: &#39;high&#39;,\n                    &#39;message&#39;: &quot;Consider reducing distractions and focusing on one document at a time to improve productivity.&quot;\n                })\n        \n        # Template usage recommendation\n        if self.metrics.templates_used &lt; len(sessions) * 0.3:\n            recommendations.append({\n                &#39;type&#39;: &#39;templates&#39;,\n                &#39;priority&#39;: &#39;low&#39;,\n                &#39;message&#39;: &quot;Using templates more frequently could speed up your writing process.&quot;\n            })\n        \n        return recommendations\n    \n    def save_configuration(self):\n        &quot;&quot;&quot;Save current configuration and customizations&quot;&quot;&quot;\n        config = {\n            &#39;shortcuts&#39;: self.shortcuts,\n            &#39;snippets&#39;: self.snippets,\n            &#39;auto_corrections&#39;: self.auto_corrections,\n            &#39;rules&#39;: self.productivity_rules\n        }\n        \n        config_file = self.workspace_path / &#39;.productivity_config.json&#39;\n        with open(config_file, &#39;w&#39;) as f:\n            json.dump(config, f, indent=2)\n\n# Usage example and CLI interface\ndef main():\n    import argparse\n    \n    parser = argparse.ArgumentParser(description=&#39;Markdown Productivity Optimizer&#39;)\n    parser.add_argument(&#39;workspace&#39;, help=&#39;Workspace directory path&#39;)\n    parser.add_argument(&#39;--start-session&#39;, action=&#39;store_true&#39;, help=&#39;Start a new work session&#39;)\n    parser.add_argument(&#39;--end-session&#39;, action=&#39;store_true&#39;, help=&#39;End current work session&#39;)\n    parser.add_argument(&#39;--report&#39;, type=int, default=7, help=&#39;Generate productivity report for N days&#39;)\n    parser.add_argument(&#39;--analyze&#39;, help=&#39;Analyze specific file&#39;)\n    \n    args = parser.parse_args()\n    \n    optimizer = MarkdownProductivityOptimizer(args.workspace)\n    \n    if args.start_session:\n        optimizer.start_work_session()\n    \n    elif args.end_session:\n        session = optimizer.end_work_session()\n        if session:\n            print(f&quot;Session summary: {session.words_added} words in {session.productivity_score:.1f}/100 productivity score&quot;)\n    \n    elif args.analyze:\n        with open(args.analyze, &#39;r&#39;) as f:\n            content = f.read()\n        \n        analysis = optimizer.process_document(args.analyze, content)\n        print(f&quot;Document analysis for {args.analyze}:&quot;)\n        print(f&quot;Words: {analysis[&#39;word_count&#39;]}&quot;)\n        print(f&quot;Readability: {analysis[&#39;readability_score&#39;]:.1f}&quot;)\n        print(f&quot;Complexity: {analysis[&#39;complexity_score&#39;]:.1f}&quot;)\n        \n        if analysis[&#39;suggestions&#39;]:\n            print(&quot;\\nSuggestions:&quot;)\n            for suggestion in analysis[&#39;suggestions&#39;]:\n                print(f&quot;- {suggestion[&#39;message&#39;]}&quot;)\n    \n    else:\n        report = optimizer.generate_productivity_report(args.report)\n        print(f&quot;Productivity Report ({args.report} days):&quot;)\n        print(f&quot;Sessions: {report[&#39;summary&#39;][&#39;total_sessions&#39;]}&quot;)\n        print(f&quot;Words written: {report[&#39;summary&#39;][&#39;total_words&#39;]}&quot;)\n        print(f&quot;Average WPM: {report[&#39;summary&#39;][&#39;average_wpm&#39;]:.1f}&quot;)\n        print(f&quot;Productivity score: {report[&#39;summary&#39;][&#39;average_productivity_score&#39;]:.1f}/100&quot;)\n\nif __name__ == &quot;__main__&quot;:\n    main()\n\u003C/code>\u003C/pre>\u003Ch2 id=\"integration-with-development-workflows\">Integration with Development Workflows\u003C/h2>\n\u003Cp>Workflow automation systems integrate seamlessly with modern development practices. When combined with \u003Ca href=\"/blog/markdown-version-control-git-integration-complete-guide\">version control and Git integration systems\u003C/a>, automated workflows enable continuous content integration that maintains quality standards while supporting collaborative development processes and automated deployment pipelines.\u003C/p>\n\u003Cp>For comprehensive content management, automation complements \u003Ca href=\"/blog/markdown-custom-css-classes-styling-complete-guide\">advanced formatting and styling techniques\u003C/a> by automatically applying consistent styling, formatting standards, and visual presentation rules across all generated content, ensuring brand consistency and professional appearance without manual intervention.\u003C/p>\n\u003Cp>When building sophisticated content architectures, workflow automation works effectively with \u003Ca href=\"/blog/markdown-progressive-web-app-documentation-complete-guide\">Progressive Web App documentation systems\u003C/a> to automatically update service workers, refresh cached content, and maintain synchronized offline experiences as content is updated through automated publishing workflows.\u003C/p>\n\u003Ch2 id=\"advanced-automation-techniques\">Advanced Automation Techniques\u003C/h2>\n\u003Ch3 id=\"ai-powered-content-enhancement\">AI-Powered Content Enhancement\u003C/h3>\n\u003Cpre>\u003Ccode class=\"hljs language-python\">\u003Cspan class=\"hljs-comment\"># ai_content_enhancer.py - AI-powered writing assistance\u003C/span>\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> openai\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> re\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> typing \u003Cspan class=\"hljs-keyword\">import\u003C/span> \u003Cspan class=\"hljs-type\">Dict\u003C/span>, \u003Cspan class=\"hljs-type\">List\u003C/span>, \u003Cspan class=\"hljs-type\">Optional\u003C/span>\n\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">AIContentEnhancer\u003C/span>:\n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">__init__\u003C/span>(\u003Cspan class=\"hljs-params\">self, api_key: \u003Cspan class=\"hljs-built_in\">str\u003C/span>\u003C/span>):\n        openai.api_key = api_key\n        self.enhancement_prompts = {\n            \u003Cspan class=\"hljs-string\">&#x27;improve_clarity&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;Improve the clarity and readability of this text while maintaining its technical accuracy:&quot;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;expand_content&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;Expand this section with more detailed explanations and examples:&quot;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;create_summary&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;Create a concise summary of the following content:&quot;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;generate_examples&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;Generate practical code examples for this concept:&quot;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;improve_seo&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;Optimize this content for SEO while maintaining readability:&quot;\u003C/span>\n        }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">enhance_content\u003C/span>(\u003Cspan class=\"hljs-params\">self, content: \u003Cspan class=\"hljs-built_in\">str\u003C/span>, enhancement_type: \u003Cspan class=\"hljs-built_in\">str\u003C/span> = \u003Cspan class=\"hljs-string\">&#x27;improve_clarity&#x27;\u003C/span>\u003C/span>) -&gt; \u003Cspan class=\"hljs-type\">Dict\u003C/span>:\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Use AI to enhance content quality and effectiveness&quot;&quot;&quot;\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> enhancement_type \u003Cspan class=\"hljs-keyword\">not\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> self.enhancement_prompts:\n            \u003Cspan class=\"hljs-keyword\">raise\u003C/span> ValueError(\u003Cspan class=\"hljs-string\">f&quot;Unknown enhancement type: \u003Cspan class=\"hljs-subst\">{enhancement_type}\u003C/span>&quot;\u003C/span>)\n        \n        prompt = \u003Cspan class=\"hljs-string\">f&quot;\u003Cspan class=\"hljs-subst\">{self.enhancement_prompts[enhancement_type]}\u003C/span>\\n\\n\u003Cspan class=\"hljs-subst\">{content}\u003C/span>&quot;\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">try\u003C/span>:\n            response = \u003Cspan class=\"hljs-keyword\">await\u003C/span> openai.ChatCompletion.acreate(\n                model=\u003Cspan class=\"hljs-string\">&quot;gpt-4&quot;\u003C/span>,\n                messages=[\n                    {\u003Cspan class=\"hljs-string\">&quot;role&quot;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;system&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;content&quot;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;You are a technical writing assistant focused on improving Markdown content.&quot;\u003C/span>},\n                    {\u003Cspan class=\"hljs-string\">&quot;role&quot;\u003C/span>: \u003Cspan class=\"hljs-string\">&quot;user&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;content&quot;\u003C/span>: prompt}\n                ],\n                max_tokens=\u003Cspan class=\"hljs-number\">2000\u003C/span>,\n                temperature=\u003Cspan class=\"hljs-number\">0.7\u003C/span>\n            )\n            \n            enhanced_content = response.choices[\u003Cspan class=\"hljs-number\">0\u003C/span>].message.content.strip()\n            \n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n                \u003Cspan class=\"hljs-string\">&#x27;original&#x27;\u003C/span>: content,\n                \u003Cspan class=\"hljs-string\">&#x27;enhanced&#x27;\u003C/span>: enhanced_content,\n                \u003Cspan class=\"hljs-string\">&#x27;improvement_type&#x27;\u003C/span>: enhancement_type,\n                \u003Cspan class=\"hljs-string\">&#x27;word_count_change&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">len\u003C/span>(enhanced_content.split()) - \u003Cspan class=\"hljs-built_in\">len\u003C/span>(content.split()),\n                \u003Cspan class=\"hljs-string\">&#x27;confidence_score&#x27;\u003C/span>: self.calculate_improvement_confidence(content, enhanced_content)\n            }\n            \n        \u003Cspan class=\"hljs-keyword\">except\u003C/span> Exception \u003Cspan class=\"hljs-keyword\">as\u003C/span> e:\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n                \u003Cspan class=\"hljs-string\">&#x27;error&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">str\u003C/span>(e),\n                \u003Cspan class=\"hljs-string\">&#x27;original&#x27;\u003C/span>: content,\n                \u003Cspan class=\"hljs-string\">&#x27;enhanced&#x27;\u003C/span>: content,\n                \u003Cspan class=\"hljs-string\">&#x27;improvement_type&#x27;\u003C/span>: enhancement_type\n            }\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">calculate_improvement_confidence\u003C/span>(\u003Cspan class=\"hljs-params\">self, original: \u003Cspan class=\"hljs-built_in\">str\u003C/span>, enhanced: \u003Cspan class=\"hljs-built_in\">str\u003C/span>\u003C/span>) -&gt; \u003Cspan class=\"hljs-built_in\">float\u003C/span>:\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Calculate confidence score for content improvement&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-comment\"># Simple heuristics for improvement assessment\u003C/span>\n        orig_words = \u003Cspan class=\"hljs-built_in\">len\u003C/span>(original.split())\n        enhanced_words = \u003Cspan class=\"hljs-built_in\">len\u003C/span>(enhanced.split())\n        \n        \u003Cspan class=\"hljs-comment\"># Penalize extreme length changes\u003C/span>\n        length_ratio = enhanced_words / orig_words \u003Cspan class=\"hljs-keyword\">if\u003C/span> orig_words &gt; \u003Cspan class=\"hljs-number\">0\u003C/span> \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-number\">1\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> length_ratio &lt; \u003Cspan class=\"hljs-number\">0.5\u003C/span> \u003Cspan class=\"hljs-keyword\">or\u003C/span> length_ratio &gt; \u003Cspan class=\"hljs-number\">2.0\u003C/span>:\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-number\">0.3\u003C/span>\n        \n        \u003Cspan class=\"hljs-comment\"># Reward moderate expansion for clarity\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-number\">1.1\u003C/span> &lt;= length_ratio &lt;= \u003Cspan class=\"hljs-number\">1.5\u003C/span>:\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-number\">0.9\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">elif\u003C/span> \u003Cspan class=\"hljs-number\">0.8\u003C/span> &lt;= length_ratio &lt;= \u003Cspan class=\"hljs-number\">1.1\u003C/span>:\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-number\">0.8\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">else\u003C/span>:\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-number\">0.6\u003C/span>\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">suggest_improvements\u003C/span>(\u003Cspan class=\"hljs-params\">self, document_content: \u003Cspan class=\"hljs-built_in\">str\u003C/span>\u003C/span>) -&gt; \u003Cspan class=\"hljs-type\">List\u003C/span>[\u003Cspan class=\"hljs-type\">Dict\u003C/span>]:\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Generate AI-powered improvement suggestions&quot;&quot;&quot;\u003C/span>\n        suggestions = []\n        \n        \u003Cspan class=\"hljs-comment\"># Analyze different sections\u003C/span>\n        sections = self.split_into_sections(document_content)\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> section \u003Cspan class=\"hljs-keyword\">in\u003C/span> sections[:\u003Cspan class=\"hljs-number\">3\u003C/span>]:  \u003Cspan class=\"hljs-comment\"># Limit to first 3 sections\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-built_in\">len\u003C/span>(section.strip()) &gt; \u003Cspan class=\"hljs-number\">100\u003C/span>:  \u003Cspan class=\"hljs-comment\"># Only analyze substantial sections\u003C/span>\n                enhancement = \u003Cspan class=\"hljs-keyword\">await\u003C/span> self.enhance_content(section, \u003Cspan class=\"hljs-string\">&#x27;improve_clarity&#x27;\u003C/span>)\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-keyword\">not\u003C/span> enhancement.get(\u003Cspan class=\"hljs-string\">&#x27;error&#x27;\u003C/span>) \u003Cspan class=\"hljs-keyword\">and\u003C/span> enhancement[\u003Cspan class=\"hljs-string\">&#x27;confidence_score&#x27;\u003C/span>] &gt; \u003Cspan class=\"hljs-number\">0.7\u003C/span>:\n                    suggestions.append({\n                        \u003Cspan class=\"hljs-string\">&#x27;section&#x27;\u003C/span>: section[:\u003Cspan class=\"hljs-number\">100\u003C/span>] + \u003Cspan class=\"hljs-string\">&#x27;...&#x27;\u003C/span>,\n                        \u003Cspan class=\"hljs-string\">&#x27;suggestion&#x27;\u003C/span>: enhancement[\u003Cspan class=\"hljs-string\">&#x27;enhanced&#x27;\u003C/span>][:\u003Cspan class=\"hljs-number\">200\u003C/span>] + \u003Cspan class=\"hljs-string\">&#x27;...&#x27;\u003C/span>,\n                        \u003Cspan class=\"hljs-string\">&#x27;type&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;clarity_improvement&#x27;\u003C/span>,\n                        \u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>: enhancement[\u003Cspan class=\"hljs-string\">&#x27;confidence_score&#x27;\u003C/span>]\n                    })\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestions\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">split_into_sections\u003C/span>(\u003Cspan class=\"hljs-params\">self, content: \u003Cspan class=\"hljs-built_in\">str\u003C/span>\u003C/span>) -&gt; \u003Cspan class=\"hljs-type\">List\u003C/span>[\u003Cspan class=\"hljs-built_in\">str\u003C/span>]:\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Split content into logical sections&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-comment\"># Split by headings\u003C/span>\n        sections = re.split(\u003Cspan class=\"hljs-string\">r&#x27;\\n#+\\s&#x27;\u003C/span>, content)\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> [section.strip() \u003Cspan class=\"hljs-keyword\">for\u003C/span> section \u003Cspan class=\"hljs-keyword\">in\u003C/span> sections \u003Cspan class=\"hljs-keyword\">if\u003C/span> section.strip()]\n\u003C/code>\u003C/pre>\u003Ch3 id=\"automated-quality-assurance\">Automated Quality Assurance\u003C/h3>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// quality-assurance-automation.js - Comprehensive QA automation\u003C/span>\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">AutomatedQualityAssurance\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">constructor\u003C/span>(\u003Cspan class=\"hljs-params\">options = {}\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rules\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">grammar\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">spelling\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">consistency\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">accessibility\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">seo\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            ...options.\u003Cspan class=\"hljs-property\">rules\u003C/span>\n        };\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">thresholds\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">minReadabilityScore\u003C/span>: \u003Cspan class=\"hljs-number\">60\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">maxComplexityScore\u003C/span>: \u003Cspan class=\"hljs-number\">15\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">minWordsPerParagraph\u003C/span>: \u003Cspan class=\"hljs-number\">20\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">maxWordsPerSentence\u003C/span>: \u003Cspan class=\"hljs-number\">25\u003C/span>,\n            ...options.\u003Cspan class=\"hljs-property\">thresholds\u003C/span>\n        };\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">customDictionary\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(options.\u003Cspan class=\"hljs-property\">customDictionary\u003C/span> || []);\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">styleGuide\u003C/span> = options.\u003Cspan class=\"hljs-property\">styleGuide\u003C/span> || {};\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">runQualityCheck\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> results = {\n            \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">score\u003C/span>: \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">issues\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">suggestions\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">metrics\u003C/span>: {}\n        };\n        \n        \u003Cspan class=\"hljs-comment\">// Grammar and spelling check\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">grammar\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> grammarIssues = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">checkGrammar\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>);\n            results.\u003Cspan class=\"hljs-property\">issues\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...grammarIssues);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Consistency check\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">consistency\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> consistencyIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">checkConsistency\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>);\n            results.\u003Cspan class=\"hljs-property\">issues\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...consistencyIssues);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Accessibility check\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">accessibility\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> accessibilityIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">checkAccessibility\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>);\n            results.\u003Cspan class=\"hljs-property\">issues\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...accessibilityIssues);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// SEO optimization check\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rules\u003C/span>.\u003Cspan class=\"hljs-property\">seo\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> seoIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">checkSEO\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>);\n            results.\u003Cspan class=\"hljs-property\">issues\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...seoIssues);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Calculate overall score\u003C/span>\n        results.\u003Cspan class=\"hljs-property\">score\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">calculateQualityScore\u003C/span>(results.\u003Cspan class=\"hljs-property\">issues\u003C/span>, \u003Cspan class=\"hljs-variable language_\">document\u003C/span>);\n        results.\u003Cspan class=\"hljs-property\">passed\u003C/span> = results.\u003Cspan class=\"hljs-property\">score\u003C/span> &gt;= \u003Cspan class=\"hljs-number\">80\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Generate improvement suggestions\u003C/span>\n        results.\u003Cspan class=\"hljs-property\">suggestions\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateImprovementSuggestions\u003C/span>(results.\u003Cspan class=\"hljs-property\">issues\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> results;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">checkConsistency\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> content = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Check heading capitalization consistency\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s.+$/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> capitalizations = headings.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">h\u003C/span> =&gt;\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">getCapitalizationStyle\u003C/span>(h));\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(capitalizations).\u003Cspan class=\"hljs-property\">size\u003C/span> &gt; \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n            issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;consistency&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Inconsistent heading capitalization found&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Use consistent capitalization style for all headings&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check list marker consistency\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> listMarkers = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^[\\s]*[-*+]/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> uniqueMarkers = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(listMarkers.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">m\u003C/span> =&gt;\u003C/span> m.\u003Cspan class=\"hljs-title function_\">trim\u003C/span>()[\u003Cspan class=\"hljs-number\">0\u003C/span>]));\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (uniqueMarkers.\u003Cspan class=\"hljs-property\">size\u003C/span> &gt; \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n            issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;consistency&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Mixed list markers detected&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Use consistent list markers throughout the document&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">checkAccessibility\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check for alt text on images\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> images = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/!\\[([^\\]]*)\\]\\([^)]+\\)/g\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> imagesWithoutAlt = images.\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">img\u003C/span> =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> altMatch = img.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/!\\[([^\\]]*)\\]/\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> !altMatch || !altMatch[\u003Cspan class=\"hljs-number\">1\u003C/span>].\u003Cspan class=\"hljs-title function_\">trim\u003C/span>();\n        });\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (imagesWithoutAlt.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;accessibility&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${imagesWithoutAlt.length}\u003C/span> images missing alt text`\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Add descriptive alt text to all images for screen reader users&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check heading hierarchy\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^(#+)\\s/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> lastLevel = \u003Cspan class=\"hljs-number\">0\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> heading \u003Cspan class=\"hljs-keyword\">of\u003C/span> headings) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> level = heading.\u003Cspan class=\"hljs-property\">length\u003C/span> - \u003Cspan class=\"hljs-number\">1\u003C/span>; \u003Cspan class=\"hljs-comment\">// Remove the space\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (level &gt; lastLevel + \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;accessibility&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Heading level skip detected&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Maintain proper heading hierarchy (don\\&#x27;t skip levels)&#x27;\u003C/span>\n                });\n                \u003Cspan class=\"hljs-keyword\">break\u003C/span>;\n            }\n            lastLevel = level;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">checkSEO\u003C/span>(\u003Cspan class=\"hljs-params\">\u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check title length\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> title = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">title\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (title) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (title.\u003Cspan class=\"hljs-property\">length\u003C/span> &lt; \u003Cspan class=\"hljs-number\">30\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;seo&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Title is too short for optimal SEO&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Expand title to 30-60 characters for better search visibility&#x27;\u003C/span>\n                });\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (title.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">60\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;seo&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Title is too long and may be truncated in search results&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Shorten title to 60 characters or less&#x27;\u003C/span>\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check description length\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> description = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">description\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (description) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (description.\u003Cspan class=\"hljs-property\">length\u003C/span> &lt; \u003Cspan class=\"hljs-number\">120\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;seo&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Description is shorter than recommended&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Expand description to 120-160 characters&#x27;\u003C/span>\n                });\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (description.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">160\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;seo&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Description is too long and may be truncated&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Shorten description to 160 characters or less&#x27;\u003C/span>\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for keywords usage\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">keywords\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> keywords = \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">isArray\u003C/span>(\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">keywords\u003C/span>) \n                ? \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">keywords\u003C/span> \n                : \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">keywords\u003C/span>.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;,&#x27;\u003C/span>).\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">k\u003C/span> =&gt;\u003C/span> k.\u003Cspan class=\"hljs-title function_\">trim\u003C/span>());\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> content = \u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>.\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C/span>();\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> missingKeywords = keywords.\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">keyword\u003C/span> =&gt;\u003C/span> \n                !content.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(keyword.\u003Cspan class=\"hljs-title function_\">toLowerCase\u003C/span>())\n            );\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (missingKeywords.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;seo&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">severity\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">`Keywords not found in content: \u003Cspan class=\"hljs-subst\">${missingKeywords.join(\u003Cspan class=\"hljs-string\">&#x27;, &#x27;\u003C/span>)}\u003C/span>`\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggestion\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Include target keywords naturally in the content&#x27;\u003C/span>\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">calculateQualityScore\u003C/span>(\u003Cspan class=\"hljs-params\">issues, \u003Cspan class=\"hljs-variable language_\">document\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> score = \u003Cspan class=\"hljs-number\">100\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Deduct points for issues\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> issue \u003Cspan class=\"hljs-keyword\">of\u003C/span> issues) {\n            \u003Cspan class=\"hljs-keyword\">switch\u003C/span> (issue.\u003Cspan class=\"hljs-property\">severity\u003C/span>) {\n                \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span>:\n                    score -= \u003Cspan class=\"hljs-number\">15\u003C/span>;\n                    \u003Cspan class=\"hljs-keyword\">break\u003C/span>;\n                \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>:\n                    score -= \u003Cspan class=\"hljs-number\">8\u003C/span>;\n                    \u003Cspan class=\"hljs-keyword\">break\u003C/span>;\n                \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>:\n                    score -= \u003Cspan class=\"hljs-number\">3\u003C/span>;\n                    \u003Cspan class=\"hljs-keyword\">break\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Bonus points for good practices\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">description\u003C/span>) score += \u003Cspan class=\"hljs-number\">5\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">keywords\u003C/span>) score += \u003Cspan class=\"hljs-number\">5\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">document\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;## &#x27;\u003C/span>)) score += \u003Cspan class=\"hljs-number\">5\u003C/span>; \u003Cspan class=\"hljs-comment\">// Has sections\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">max\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>, \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">min\u003C/span>(\u003Cspan class=\"hljs-number\">100\u003C/span>, score));\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateImprovementSuggestions\u003C/span>(\u003Cspan class=\"hljs-params\">issues\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> suggestions = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Group issues by type\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issuesByType = issues.\u003Cspan class=\"hljs-title function_\">reduce\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">acc, issue\u003C/span>) =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!acc[issue.\u003Cspan class=\"hljs-property\">type\u003C/span>]) acc[issue.\u003Cspan class=\"hljs-property\">type\u003C/span>] = [];\n            acc[issue.\u003Cspan class=\"hljs-property\">type\u003C/span>].\u003Cspan class=\"hljs-title function_\">push\u003C/span>(issue);\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> acc;\n        }, {});\n        \n        \u003Cspan class=\"hljs-comment\">// Generate high-level suggestions\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [type, typeIssues] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(issuesByType)) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> highSeverityCount = typeIssues.\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">i\u003C/span> =&gt;\u003C/span> i.\u003Cspan class=\"hljs-property\">severity\u003C/span> === \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span>).\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (highSeverityCount &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">category\u003C/span>: type,\n                    \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">`Address \u003Cspan class=\"hljs-subst\">${highSeverityCount}\u003C/span> high-priority \u003Cspan class=\"hljs-subst\">${type}\u003C/span> issues first`\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">automated\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">canAutoFix\u003C/span>(type)\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestions;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">canAutoFix\u003C/span>(\u003Cspan class=\"hljs-params\">issueType\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> autoFixable = [\u003Cspan class=\"hljs-string\">&#x27;consistency&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;formatting&#x27;\u003C/span>];\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> autoFixable.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(issueType);\n    }\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = \u003Cspan class=\"hljs-title class_\">AutomatedQualityAssurance\u003C/span>;\n\u003C/code>\u003C/pre>\u003Ch2 id=\"conclusion-1\">Conclusion\u003C/h2>\n\u003Cp>Advanced Markdown workflow automation represents a paradigm shift from manual content creation to intelligent, streamlined processes that maximize productivity while maintaining exceptional quality standards. By implementing comprehensive automation frameworks, AI-powered enhancement tools, and sophisticated quality assurance systems, content creators can eliminate repetitive tasks, ensure consistency, and focus on high-value creative work while automated systems handle routine formatting, validation, and optimization processes.\u003C/p>\n\u003Cp>The key to successful workflow automation lies in balancing automated efficiency with human creativity, ensuring that technology serves content quality rather than replacing editorial judgment. Whether you&#39;re managing individual content creation or coordinating large-scale documentation projects, the automation techniques covered in this guide provide the foundation for building productive, scalable, and maintainable content workflows.\u003C/p>\n\u003Cp>Remember to start with simple automation and gradually build complexity based on your team&#39;s needs, regularly measure productivity improvements to validate automation investments, and continuously refine your workflows based on real-world usage patterns. With proper implementation of advanced workflow automation, your Markdown content creation can achieve unprecedented levels of efficiency and quality while maintaining the flexibility and simplicity that makes Markdown such an effective content creation format.\u003C/p>\n",[15,19,22,25,28,31,34,37,40,43],{"id":16,"text":17,"level":18},"why-master-markdown-workflow-automation","Why Master Markdown Workflow Automation?",2,{"id":20,"text":21,"level":18},"foundation-automation-framework","Foundation Automation Framework",{"id":23,"text":24,"level":18},"practical-implementation","Practical Implementation",{"id":26,"text":27,"level":18},"best-practices","Best Practices",{"id":29,"text":30,"level":18},"integration-with-other-tools","Integration with Other Tools",{"id":32,"text":33,"level":18},"troubleshooting-common-issues","Troubleshooting Common Issues",{"id":35,"text":36,"level":18},"conclusion","Conclusion",{"id":38,"text":39,"level":18},"integration-with-development-workflows","Integration with Development Workflows",{"id":41,"text":42,"level":18},"advanced-automation-techniques","Advanced Automation Techniques",{"id":44,"text":36,"level":18},"conclusion-1",[],[47,55,63],{"slug":48,"title":49,"description":50,"excerpt":51,"date":52,"category":9,"author":10,"keywords":53,"readingMinutes":54},"markdown-document-templates-automation-complete-guide","Markdown Document Templates and Automation: Complete Guide for Streamlined Content Creation and Workflow Optimization","Master Markdown document templates and automation techniques to streamline content creation workflows. Learn template design patterns, variable substitution, automated generation, and integration with modern development tools for efficient documentation systems.","Markdown document templates and automation systems transform repetitive content creation tasks into efficient, standardized workflows that ensure consistency, reduce errors, and dramatically…","2025-11-30","markdown templates, markdown automation, document templates markdown, markdown workflow automation, markdown templating systems, automated markdown generation, markdown content management",20,{"slug":56,"title":57,"description":58,"excerpt":59,"date":60,"category":9,"author":10,"keywords":61,"readingMinutes":62},"markdown-email-newsletter-automation-complete-guide","Markdown Email Newsletter Creation and Automation: Complete Guide for Content-Driven Marketing and Communication Systems","Master email newsletter creation and automation using Markdown for content-driven marketing campaigns. Learn template systems, automation workflows, subscriber management, and integration with email service providers.","Email newsletter creation and automation using Markdown provides powerful content-driven marketing capabilities that streamline publishing workflows while maintaining professional design standards…","2025-09-24","markdown email newsletter, automated newsletters markdown, email marketing markdown, newsletter templates, markdown email automation, email campaign markdown, newsletter workflow automation, markdown email content",19,{"slug":64,"title":65,"description":66,"excerpt":67,"date":68,"category":9,"author":10,"keywords":69,"readingMinutes":70},"markdown-dynamic-content-generation-automation-workflows-complete-guide","Markdown Dynamic Content Generation and Automation Workflows: Complete Guide for Automated Documentation, Template Systems, and Content Pipeline Management","Master dynamic content generation in Markdown with comprehensive automation workflows, template engines, data-driven documentation systems, and intelligent content pipeline management for scalable technical writing.","Advanced Markdown dynamic content generation and automation workflows enable systematic creation of data-driven documentation, template-based content systems, and intelligent content pipelines…","2025-12-22","markdown automation, dynamic content generation markdown, markdown templates, automated documentation markdown, content pipeline markdown, markdown workflows, data driven documentation, template engines markdown",37,1792184943213]