[{"data":1,"prerenderedAt":62},["Reactive",2],{"blog-post-markdown-content-organization-project-structure-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":37,"related":38},"markdown-content-organization-project-structure-complete-guide","Markdown Content Organization and Project Structure: Complete Guide for Scalable Documentation Systems","Master advanced Markdown content organization strategies for large-scale documentation projects, including hierarchical structures, content categorization, automated organization systems, and scalable project architectures that grow with your needs.","Effective Markdown content organization and project structure design enables scalable documentation systems that maintain clarity, findability, and maintainability across large content…","2025-10-19","Tutorial","Matthew Rathbone","markdown content organization, documentation structure, content management markdown, project structure documentation, scalable markdown, content categorization, documentation architecture, markdown organization systems",18,"\u003Cp>Effective Markdown content organization and project structure design enables scalable documentation systems that maintain clarity, findability, and maintainability across large content repositories. By implementing strategic organizational frameworks, automated categorization systems, and thoughtful hierarchical structures, technical teams can build documentation architectures that support growth, facilitate collaboration, and provide intuitive navigation experiences for both content creators and consumers.\u003C/p>\n\u003Ch2 id=\"why-master-content-organization-and-project-structure\">Why Master Content Organization and Project Structure?\u003C/h2>\n\u003Cp>Professional content organization provides essential benefits for documentation management:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Scalability\u003C/strong>: Build documentation systems that grow efficiently without becoming unwieldy or hard to navigate\u003C/li>\n\u003Cli>\u003Cstrong>Findability\u003C/strong>: Ensure users can quickly locate relevant information through logical organization patterns\u003C/li>\n\u003Cli>\u003Cstrong>Maintainability\u003C/strong>: Reduce overhead in content updates, reorganization, and quality management\u003C/li>\n\u003Cli>\u003Cstrong>Collaboration\u003C/strong>: Enable multiple contributors to work effectively within consistent organizational frameworks\u003C/li>\n\u003Cli>\u003Cstrong>Automation\u003C/strong>: Support automated processes for content generation, validation, and publishing workflows\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"foundation-organization-principles\">Foundation Organization Principles\u003C/h2>\n\u003Ch3 id=\"hierarchical-structure-design\">Hierarchical Structure Design\u003C/h3>\n\u003Cp>Building logical content hierarchies that serve both human users and automated systems:\u003C/p>\n\u003Cpre>\u003Ccode>project-docs/\n├── README.md\n├── content/\n│   ├── guides/\n│   │   ├── getting-started/\n│   │   │   ├── index.md\n│   │   │   ├── installation.md\n│   │   │   ├── quick-start.md\n│   │   │   └── first-project.md\n│   │   ├── advanced/\n│   │   │   ├── index.md\n│   │   │   ├── performance-optimization.md\n│   │   │   ├── security-practices.md\n│   │   │   └── scaling-strategies.md\n│   │   └── tutorials/\n│   │       ├── index.md\n│   │       ├── basic-workflows/\n│   │       ├── integration-patterns/\n│   │       └── troubleshooting/\n│   ├── reference/\n│   │   ├── api/\n│   │   │   ├── index.md\n│   │   │   ├── authentication.md\n│   │   │   ├── endpoints/\n│   │   │   └── examples/\n│   │   ├── cli/\n│   │   │   ├── index.md\n│   │   │   ├── commands/\n│   │   │   └── configuration/\n│   │   └── configuration/\n│   │       ├── index.md\n│   │       ├── environment-variables.md\n│   │       └── config-files/\n│   ├── concepts/\n│   │   ├── index.md\n│   │   ├── architecture/\n│   │   ├── data-models/\n│   │   └── workflows/\n│   └── resources/\n│       ├── index.md\n│       ├── glossary.md\n│       ├── faq.md\n│       └── troubleshooting/\n├── templates/\n│   ├── guide-template.md\n│   ├── api-doc-template.md\n│   └── tutorial-template.md\n├── assets/\n│   ├── images/\n│   ├── diagrams/\n│   └── downloads/\n└── config/\n    ├── content-structure.yaml\n    ├── navigation.yaml\n    └── organization-rules.json\n\u003C/code>\u003C/pre>\u003Ch3 id=\"content-classification-system\">Content Classification System\u003C/h3>\n\u003Cp>Implementing comprehensive categorization and tagging strategies:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># content-classification.yaml - Content taxonomy definition\u003C/span>\n\u003Cspan class=\"hljs-attr\">content_taxonomy:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">primary_categories:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">guides\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">reference\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">tutorials\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">concepts\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">resources\u003C/span>\n    \n  \u003Cspan class=\"hljs-attr\">secondary_categories:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">guides:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">getting-started\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">advanced\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">best-practices\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">troubleshooting\u003C/span>\n    \n    \u003Cspan class=\"hljs-attr\">reference:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">api\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">cli\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">configuration\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">schemas\u003C/span>\n    \n    \u003Cspan class=\"hljs-attr\">tutorials:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">beginner\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">intermediate\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">advanced\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">integration\u003C/span>\n    \n    \u003Cspan class=\"hljs-attr\">concepts:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">architecture\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">data-models\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">workflows\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">security\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">content_types:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">overview\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">step-by-step\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">reference\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">example\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">specification\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">changelog\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">migration-guide\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">audience_levels:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">beginner\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">intermediate\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">advanced\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">expert\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">tags:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">technical:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">api\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">cli\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">configuration\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">deployment\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">security\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">performance\u003C/span>\n    \n    \u003Cspan class=\"hljs-attr\">functional:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">user-management\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">data-processing\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">integration\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">reporting\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">monitoring\u003C/span>\n    \n    \u003Cspan class=\"hljs-attr\">platform:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">web\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">mobile\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">desktop\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">cloud\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">on-premise\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">frontmatter_schema:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">required:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">title\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">description\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">category\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">content_type\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">audience_level\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">last_updated\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">optional:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">tags\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">related_pages\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">prerequisites\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">estimated_time\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">difficulty\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">version\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">author\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"automated-organization-system\">Automated Organization System\u003C/h3>\n\u003Cp>Creating systems that maintain organization consistency and support content management:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// content-organizer.js - Advanced content organization 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> yaml = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;js-yaml&#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\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">ContentOrganizationManager\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\">rootPath\u003C/span> = options.\u003Cspan class=\"hljs-property\">rootPath\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./content&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">configPath\u003C/span> = options.\u003Cspan class=\"hljs-property\">configPath\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./config/organization-rules.json&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">taxonomyPath\u003C/span> = options.\u003Cspan class=\"hljs-property\">taxonomyPath\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./config/content-taxonomy.yaml&#x27;\u003C/span>;\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">organizationRules\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\">taxonomy\u003C/span> = {};\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\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\">relationshipGraph\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">autoOrganize\u003C/span> = options.\u003Cspan class=\"hljs-property\">autoOrganize\u003C/span> !== \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validateStructure\u003C/span> = options.\u003Cspan class=\"hljs-property\">validateStructure\u003C/span> !== \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">init\u003C/span>();\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">init\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadConfiguration\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadTaxonomy\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">scanContent\u003C/span>();\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">loadConfiguration\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> configData = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readFile\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">configPath\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;utf8&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> config = \u003Cspan class=\"hljs-title class_\">JSON\u003C/span>.\u003Cspan class=\"hljs-title function_\">parse\u003C/span>(configData);\n            \n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> rule \u003Cspan class=\"hljs-keyword\">of\u003C/span> config.\u003Cspan class=\"hljs-property\">organization_rules\u003C/span> || []) {\n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">organizationRules\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(rule.\u003Cspan class=\"hljs-property\">name\u003C/span>, rule);\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>.organizationRules.size}\u003C/span> organization rules`\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;No organization config found, using defaults&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadDefaultRules\u003C/span>();\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">loadDefaultRules\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">organizationRules\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;category_structure&#x27;\u003C/span>, {\n            \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;category_structure&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Organize content by primary category&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">pattern\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;{category}/{subcategory}/{filename}&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">conditions\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span>]\n        });\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">organizationRules\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;content_type_grouping&#x27;\u003C/span>, {\n            \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;content_type_grouping&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Group similar content types together&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">pattern\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;{category}/{content_type}/{filename}&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">conditions\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;content_type&#x27;\u003C/span>]\n        });\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">loadTaxonomy\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> taxonomyData = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readFile\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">taxonomyPath\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;utf8&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span> = yaml.\u003Cspan class=\"hljs-title function_\">load\u003C/span>(taxonomyData);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Loaded content taxonomy&#x27;\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;No taxonomy file found, using minimal taxonomy&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span> = {\n                \u003Cspan class=\"hljs-attr\">content_taxonomy\u003C/span>: {\n                    \u003Cspan class=\"hljs-attr\">primary_categories\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;guides&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;reference&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;tutorials&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;concepts&#x27;\u003C/span>]\n                }\n            };\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">scanContent\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;Scanning content directory...&#x27;\u003C/span>);\n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">scanDirectory\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rootPath\u003C/span>);\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Indexed \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.contentIndex.size}\u003C/span> content files`\u003C/span>);\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">scanDirectory\u003C/span>(\u003Cspan class=\"hljs-params\">dirPath\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>(dirPath, { \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>(dirPath, 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-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">scanDirectory\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>(\u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>)) {\n                    \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">indexContentFile\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 scan directory \u003Cspan class=\"hljs-subst\">${dirPath}\u003C/span>: \u003Cspan class=\"hljs-subst\">${error.message}\u003C/span>`\u003C/span>);\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">indexContentFile\u003C/span>(\u003Cspan class=\"hljs-params\">filePath\u003C/span>) {\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-keyword\">const\u003C/span> fileInfo = {\n                \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                \u003Cspan class=\"hljs-attr\">relativePath\u003C/span>: path.\u003Cspan class=\"hljs-title function_\">relative\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rootPath\u003C/span>, filePath),\n                frontmatter,\n                \u003Cspan class=\"hljs-attr\">content\u003C/span>: body,\n                \u003Cspan class=\"hljs-attr\">stats\u003C/span>: {\n                    \u003Cspan class=\"hljs-attr\">wordCount\u003C/span>: body.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\s+/\u003C/span>).\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">headingCount\u003C/span>: (body.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s/gm\u003C/span>) || []).\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">lastModified\u003C/span>: (\u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">stat\u003C/span>(filePath)).\u003Cspan class=\"hljs-property\">mtime\u003C/span>\n                },\n                \u003Cspan class=\"hljs-attr\">relationships\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">extractRelationships\u003C/span>(frontmatter, body),\n                \u003Cspan class=\"hljs-attr\">suggestedLocation\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">calculateOptimalLocation\u003C/span>(frontmatter)\n            };\n            \n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(filePath, fileInfo);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">updateRelationshipGraph\u003C/span>(fileInfo);\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 indexing \u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>: \u003Cspan class=\"hljs-subst\">${error.message}\u003C/span>`\u003C/span>);\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">extractRelationships\u003C/span>(\u003Cspan class=\"hljs-params\">frontmatter, content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> relationships = {\n            \u003Cspan class=\"hljs-attr\">explicit\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">implicit\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">prerequisites\u003C/span>: frontmatter.\u003Cspan class=\"hljs-property\">prerequisites\u003C/span> || [],\n            \u003Cspan class=\"hljs-attr\">related\u003C/span>: frontmatter.\u003Cspan class=\"hljs-property\">related_pages\u003C/span> || []\n        };\n        \n        \u003Cspan class=\"hljs-comment\">// Extract explicit links\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> linkPattern = \u003Cspan class=\"hljs-regexp\">/\\[([^\\]]+)\\]\\(([^)]+)\\)/g\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> match;\n        \u003Cspan class=\"hljs-keyword\">while\u003C/span> ((match = linkPattern.\u003Cspan class=\"hljs-title function_\">exec\u003C/span>(content)) !== \u003Cspan class=\"hljs-literal\">null\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (match[\u003Cspan class=\"hljs-number\">2\u003C/span>].\u003Cspan class=\"hljs-title function_\">endsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>) || match[\u003Cspan class=\"hljs-number\">2\u003C/span>].\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;./&#x27;\u003C/span>) || match[\u003Cspan class=\"hljs-number\">2\u003C/span>].\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;../&#x27;\u003C/span>)) {\n                relationships.\u003Cspan class=\"hljs-property\">explicit\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">text\u003C/span>: match[\u003Cspan class=\"hljs-number\">1\u003C/span>],\n                    \u003Cspan class=\"hljs-attr\">target\u003C/span>: match[\u003Cspan class=\"hljs-number\">2\u003C/span>],\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;link&#x27;\u003C/span>\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Extract topic similarities based on headings and keywords\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> keywords = frontmatter.\u003Cspan class=\"hljs-property\">tags\u003C/span> || [];\n        \n        relationships.\u003Cspan class=\"hljs-property\">implicit\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">headings\u003C/span>: headings.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">h\u003C/span> =&gt;\u003C/span> h.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s+/\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>)),\n            keywords,\n            \u003Cspan class=\"hljs-attr\">category\u003C/span>: frontmatter.\u003Cspan class=\"hljs-property\">category\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">content_type\u003C/span>: frontmatter.\u003Cspan class=\"hljs-property\">content_type\u003C/span>\n        };\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> relationships;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">calculateOptimalLocation\u003C/span>(\u003Cspan class=\"hljs-params\">frontmatter\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> category = frontmatter.\u003Cspan class=\"hljs-property\">category\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;uncategorized&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> contentType = frontmatter.\u003Cspan class=\"hljs-property\">content_type\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;general&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> subcategory = frontmatter.\u003Cspan class=\"hljs-property\">subcategory\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> suggestedPath = category;\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (subcategory &amp;&amp; \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">isValidSubcategory\u003C/span>(category, subcategory)) {\n            suggestedPath = path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(category, subcategory);\n        } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (contentType !== \u003Cspan class=\"hljs-string\">&#x27;general&#x27;\u003C/span>) {\n            suggestedPath = path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(category, contentType);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestedPath;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">isValidSubcategory\u003C/span>(\u003Cspan class=\"hljs-params\">category, subcategory\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> validSubcategories = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span>.\u003Cspan class=\"hljs-property\">content_taxonomy\u003C/span>?.\u003Cspan class=\"hljs-property\">secondary_categories\u003C/span>?.[category];\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> validSubcategories &amp;&amp; validSubcategories.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(subcategory);\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">updateRelationshipGraph\u003C/span>(\u003Cspan class=\"hljs-params\">fileInfo\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> filePath = fileInfo.\u003Cspan class=\"hljs-property\">path\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(filePath)) {\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(filePath, {\n                \u003Cspan class=\"hljs-attr\">inbound\u003C/span>: [],\n                \u003Cspan class=\"hljs-attr\">outbound\u003C/span>: []\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Process explicit relationships\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> rel \u003Cspan class=\"hljs-keyword\">of\u003C/span> fileInfo.\u003Cspan class=\"hljs-property\">relationships\u003C/span>.\u003Cspan class=\"hljs-property\">explicit\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> targetPath = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">resolveRelativePath\u003C/span>(filePath, rel.\u003Cspan class=\"hljs-property\">target\u003C/span>);\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (targetPath) {\n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(filePath).\u003Cspan class=\"hljs-property\">outbound\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">target\u003C/span>: targetPath,\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: rel.\u003Cspan class=\"hljs-property\">type\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">strength\u003C/span>: \u003Cspan class=\"hljs-number\">1.0\u003C/span>\n                });\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(targetPath)) {\n                    \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(targetPath, { \u003Cspan class=\"hljs-attr\">inbound\u003C/span>: [], \u003Cspan class=\"hljs-attr\">outbound\u003C/span>: [] });\n                }\n                \n                \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(targetPath).\u003Cspan class=\"hljs-property\">inbound\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">source\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: rel.\u003Cspan class=\"hljs-property\">type\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">strength\u003C/span>: \u003Cspan class=\"hljs-number\">1.0\u003C/span>\n                });\n            }\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">resolveRelativePath\u003C/span>(\u003Cspan class=\"hljs-params\">basePath, relativePath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (relativePath.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;./&#x27;\u003C/span>) || relativePath.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;../&#x27;\u003C/span>)) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> resolved = path.\u003Cspan class=\"hljs-title function_\">resolve\u003C/span>(path.\u003Cspan class=\"hljs-title function_\">dirname\u003C/span>(basePath), relativePath);\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">access\u003C/span>(resolved).\u003Cspan class=\"hljs-title function_\">then\u003C/span>(\u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> resolved).\u003Cspan class=\"hljs-title function_\">catch\u003C/span>(\u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> \u003Cspan class=\"hljs-literal\">null\u003C/span>);\n        }\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">null\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">analyzeOrganizationHealth\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;Analyzing content organization health...&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> analysis = {\n            \u003Cspan class=\"hljs-attr\">structure\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">analyzeStructureConsistency\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">relationships\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">analyzeRelationshipPatterns\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">taxonomy\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">analyzeTaxonomyUsage\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">suggestions\u003C/span>: []\n        };\n        \n        \u003Cspan class=\"hljs-comment\">// Generate improvement suggestions\u003C/span>\n        analysis.\u003Cspan class=\"hljs-property\">suggestions\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateOrganizationSuggestions\u003C/span>(analysis);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> analysis;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">analyzeStructureConsistency\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> pathPatterns = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> categoryDistribution = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> category = fileInfo.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">category\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;uncategorized&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> pathSegments = fileInfo.\u003Cspan class=\"hljs-property\">relativePath\u003C/span>.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/&#x27;\u003C/span>).\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>, -\u003Cspan class=\"hljs-number\">1\u003C/span>);\n            \n            \u003Cspan class=\"hljs-comment\">// Track category distribution\u003C/span>\n            categoryDistribution.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(category, (categoryDistribution.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(category) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            \n            \u003Cspan class=\"hljs-comment\">// Track path patterns\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> pattern = pathSegments.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!pathPatterns.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(pattern)) {\n                pathPatterns.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(pattern, []);\n            }\n            pathPatterns.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(pattern).\u003Cspan class=\"hljs-title function_\">push\u003C/span>(fileInfo);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">totalFiles\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>.\u003Cspan class=\"hljs-property\">size\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">uniquePathPatterns\u003C/span>: pathPatterns.\u003Cspan class=\"hljs-property\">size\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">categoryDistribution\u003C/span>: \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">fromEntries\u003C/span>(categoryDistribution),\n            \u003Cspan class=\"hljs-attr\">pathPatterns\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">summarizePathPatterns\u003C/span>(pathPatterns),\n            \u003Cspan class=\"hljs-attr\">consistencyScore\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">calculateConsistencyScore\u003C/span>(pathPatterns, categoryDistribution)\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">summarizePathPatterns\u003C/span>(\u003Cspan class=\"hljs-params\">pathPatterns\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> summary = {};\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [pattern, files] \u003Cspan class=\"hljs-keyword\">of\u003C/span> pathPatterns) {\n            summary[pattern] = {\n                \u003Cspan class=\"hljs-attr\">fileCount\u003C/span>: files.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">categories\u003C/span>: [...\u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(files.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">category\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;uncategorized&#x27;\u003C/span>))],\n                \u003Cspan class=\"hljs-attr\">contentTypes\u003C/span>: [...\u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(files.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">content_type\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;general&#x27;\u003C/span>))]\n            };\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> summary;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">calculateConsistencyScore\u003C/span>(\u003Cspan class=\"hljs-params\">pathPatterns, categoryDistribution\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> consistencyScore = \u003Cspan class=\"hljs-number\">0\u003C/span>;\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> totalFiles = \u003Cspan class=\"hljs-number\">0\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [pattern, files] \u003Cspan class=\"hljs-keyword\">of\u003C/span> pathPatterns) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> categories = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(files.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">category\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;uncategorized&#x27;\u003C/span>));\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (categories.\u003Cspan class=\"hljs-property\">size\u003C/span> === \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n                \u003Cspan class=\"hljs-comment\">// All files in this path have the same category - good consistency\u003C/span>\n                consistencyScore += files.\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n                \u003Cspan class=\"hljs-comment\">// Mixed categories in the same path - consistency issue\u003C/span>\n                consistencyScore += files.\u003Cspan class=\"hljs-property\">length\u003C/span> * \u003Cspan class=\"hljs-number\">0.3\u003C/span>;\n            }\n            \n            totalFiles += files.\u003Cspan class=\"hljs-property\">length\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> totalFiles &gt; \u003Cspan class=\"hljs-number\">0\u003C/span> ? (consistencyScore / totalFiles) * \u003Cspan class=\"hljs-number\">100\u003C/span> : \u003Cspan class=\"hljs-number\">0\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">analyzeRelationshipPatterns\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> patterns = {\n            \u003Cspan class=\"hljs-attr\">totalRelationships\u003C/span>: \u003Cspan class=\"hljs-number\">0\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">stronglyConnectedComponents\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">orphanedContent\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">hubPages\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">relationshipTypes\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>()\n        };\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, relationships] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> totalRels = relationships.\u003Cspan class=\"hljs-property\">inbound\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> + relationships.\u003Cspan class=\"hljs-property\">outbound\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            patterns.\u003Cspan class=\"hljs-property\">totalRelationships\u003C/span> += totalRels;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (totalRels === \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                patterns.\u003Cspan class=\"hljs-property\">orphanedContent\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(filePath);\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (totalRels &gt;= \u003Cspan class=\"hljs-number\">10\u003C/span>) {\n                patterns.\u003Cspan class=\"hljs-property\">hubPages\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">inbound\u003C/span>: relationships.\u003Cspan class=\"hljs-property\">inbound\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">outbound\u003C/span>: relationships.\u003Cspan class=\"hljs-property\">outbound\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>\n                });\n            }\n            \n            \u003Cspan class=\"hljs-comment\">// Track relationship types\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> rel \u003Cspan class=\"hljs-keyword\">of\u003C/span> [...relationships.\u003Cspan class=\"hljs-property\">inbound\u003C/span>, ...relationships.\u003Cspan class=\"hljs-property\">outbound\u003C/span>]) {\n                patterns.\u003Cspan class=\"hljs-property\">relationshipTypes\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(\n                    rel.\u003Cspan class=\"hljs-property\">type\u003C/span>,\n                    (patterns.\u003Cspan class=\"hljs-property\">relationshipTypes\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(rel.\u003Cspan class=\"hljs-property\">type\u003C/span>) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>\n                );\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> patterns;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">analyzeTaxonomyUsage\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> usage = {\n            \u003Cspan class=\"hljs-attr\">categories\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">contentTypes\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">tags\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">missingTaxonomy\u003C/span>: []\n        };\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> fm = fileInfo.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>;\n            \n            \u003Cspan class=\"hljs-comment\">// Track category usage\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> category = fm.\u003Cspan class=\"hljs-property\">category\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;uncategorized&#x27;\u003C/span>;\n            usage.\u003Cspan class=\"hljs-property\">categories\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(category, (usage.\u003Cspan class=\"hljs-property\">categories\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(category) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            \n            \u003Cspan class=\"hljs-comment\">// Track content type usage\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> contentType = fm.\u003Cspan class=\"hljs-property\">content_type\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;unspecified&#x27;\u003C/span>;\n            usage.\u003Cspan class=\"hljs-property\">contentTypes\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(contentType, (usage.\u003Cspan class=\"hljs-property\">contentTypes\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(contentType) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            \n            \u003Cspan class=\"hljs-comment\">// Track tag usage\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> tags = fm.\u003Cspan class=\"hljs-property\">tags\u003C/span> || [];\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> tag \u003Cspan class=\"hljs-keyword\">of\u003C/span> tags) {\n                usage.\u003Cspan class=\"hljs-property\">tags\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(tag, (usage.\u003Cspan class=\"hljs-property\">tags\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(tag) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            }\n            \n            \u003Cspan class=\"hljs-comment\">// Identify missing taxonomy information\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!fm.\u003Cspan class=\"hljs-property\">category\u003C/span> || !fm.\u003Cspan class=\"hljs-property\">content_type\u003C/span>) {\n                usage.\u003Cspan class=\"hljs-property\">missingTaxonomy\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">missing\u003C/span>: {\n                        \u003Cspan class=\"hljs-attr\">category\u003C/span>: !fm.\u003Cspan class=\"hljs-property\">category\u003C/span>,\n                        \u003Cspan class=\"hljs-attr\">content_type\u003C/span>: !fm.\u003Cspan class=\"hljs-property\">content_type\u003C/span>,\n                        \u003Cspan class=\"hljs-attr\">audience_level\u003C/span>: !fm.\u003Cspan class=\"hljs-property\">audience_level\u003C/span>\n                    }\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">categories\u003C/span>: \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">fromEntries\u003C/span>(usage.\u003Cspan class=\"hljs-property\">categories\u003C/span>),\n            \u003Cspan class=\"hljs-attr\">contentTypes\u003C/span>: \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">fromEntries\u003C/span>(usage.\u003Cspan class=\"hljs-property\">contentTypes\u003C/span>),\n            \u003Cspan class=\"hljs-attr\">tags\u003C/span>: \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">fromEntries\u003C/span>(usage.\u003Cspan class=\"hljs-property\">tags\u003C/span>),\n            \u003Cspan class=\"hljs-attr\">missingTaxonomy\u003C/span>: usage.\u003Cspan class=\"hljs-property\">missingTaxonomy\u003C/span>\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateOrganizationSuggestions\u003C/span>(\u003Cspan class=\"hljs-params\">analysis\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> suggestions = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Structure suggestions\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (analysis.\u003Cspan class=\"hljs-property\">structure\u003C/span>.\u003Cspan class=\"hljs-property\">consistencyScore\u003C/span> &lt; \u003Cspan class=\"hljs-number\">70\u003C/span>) {\n            suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;structure&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Improve Structure Consistency&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">`Current consistency score: \u003Cspan class=\"hljs-subst\">${analysis.structure.consistencyScore.toFixed(\u003Cspan class=\"hljs-number\">1\u003C/span>)}\u003C/span>%`\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">actions\u003C/span>: [\n                    \u003Cspan class=\"hljs-string\">&#x27;Review files with mixed categories in same directories&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Consider reorganizing content to match category structure&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Implement automated organization rules&#x27;\u003C/span>\n                ]\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Relationship suggestions\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (analysis.\u003Cspan class=\"hljs-property\">relationships\u003C/span>.\u003Cspan class=\"hljs-property\">orphanedContent\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;relationships&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Connect Orphaned Content&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${analysis.relationships.orphanedContent.length}\u003C/span> files have no relationships`\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">actions\u003C/span>: [\n                    \u003Cspan class=\"hljs-string\">&#x27;Add related_pages frontmatter to connect content&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Create index pages to link related content&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Review content for natural linking opportunities&#x27;\u003C/span>\n                ]\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Taxonomy suggestions\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (analysis.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span>.\u003Cspan class=\"hljs-property\">missingTaxonomy\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;taxonomy&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Complete Missing Taxonomy&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${analysis.taxonomy.missingTaxonomy.length}\u003C/span> files missing taxonomy information`\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">actions\u003C/span>: [\n                    \u003Cspan class=\"hljs-string\">&#x27;Add category frontmatter to all content files&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Specify content_type for better organization&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;Define audience_level for user targeting&#x27;\u003C/span>\n                ]\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestions;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">reorganizeContent\u003C/span>(\u003Cspan class=\"hljs-params\">dryRun = \u003Cspan class=\"hljs-literal\">true\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(dryRun ? \u003Cspan class=\"hljs-string\">&#x27;Simulating content reorganization...&#x27;\u003C/span> : \u003Cspan class=\"hljs-string\">&#x27;Reorganizing content...&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> reorganizationPlan = [];\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> currentLocation = path.\u003Cspan class=\"hljs-title function_\">dirname\u003C/span>(fileInfo.\u003Cspan class=\"hljs-property\">relativePath\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> suggestedLocation = fileInfo.\u003Cspan class=\"hljs-property\">suggestedLocation\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (currentLocation !== suggestedLocation) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> newPath = path.\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rootPath\u003C/span>, suggestedLocation, path.\u003Cspan class=\"hljs-title function_\">basename\u003C/span>(filePath));\n                \n                reorganizationPlan.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">current\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">suggested\u003C/span>: newPath,\n                    \u003Cspan class=\"hljs-attr\">reason\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Better category alignment&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">impact\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">assessReorganizationImpact\u003C/span>(filePath, newPath)\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!dryRun) {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">executeReorganizationPlan\u003C/span>(reorganizationPlan);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> reorganizationPlan;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">assessReorganizationImpact\u003C/span>(\u003Cspan class=\"hljs-params\">currentPath, newPath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> relationships = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">relationshipGraph\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(currentPath) || { \u003Cspan class=\"hljs-attr\">inbound\u003C/span>: [], \u003Cspan class=\"hljs-attr\">outbound\u003C/span>: [] };\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">affectedLinks\u003C/span>: relationships.\u003Cspan class=\"hljs-property\">inbound\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">brokenReferences\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">findPotentialBrokenReferences\u003C/span>(currentPath, newPath),\n            \u003Cspan class=\"hljs-attr\">seoImpact\u003C/span>: currentPath.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;index.md&#x27;\u003C/span>) ? \u003Cspan class=\"hljs-string\">&#x27;high&#x27;\u003C/span> : \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">findPotentialBrokenReferences\u003C/span>(\u003Cspan class=\"hljs-params\">oldPath, newPath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> brokenRefs = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check for hardcoded paths that might break\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> content = fileInfo.\u003Cspan class=\"hljs-property\">content\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> relativePath = path.\u003Cspan class=\"hljs-title function_\">relative\u003C/span>(path.\u003Cspan class=\"hljs-title function_\">dirname\u003C/span>(oldPath), oldPath);\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (content.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(relativePath)) {\n                brokenRefs.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">file\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">reference\u003C/span>: relativePath,\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;relative_link&#x27;\u003C/span>\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> brokenRefs;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">generateNavigationStructure\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;Generating navigation structure...&#x27;\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> navigation = {\n            \u003Cspan class=\"hljs-attr\">primary\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">secondary\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">breadcrumbs\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">siteMap\u003C/span>: []\n        };\n        \n        \u003Cspan class=\"hljs-comment\">// Build primary navigation from categories\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> categories = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> category = fileInfo.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">category\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (category) {\n                categories.\u003Cspan class=\"hljs-title function_\">add\u003C/span>(category);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> category \u003Cspan class=\"hljs-keyword\">of\u003C/span> [...categories].\u003Cspan class=\"hljs-title function_\">sort\u003C/span>()) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> categoryFiles = \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">from\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>.\u003Cspan class=\"hljs-title function_\">values\u003C/span>())\n                .\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">category\u003C/span> === category);\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> primaryNavItem = {\n                \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">formatCategoryName\u003C/span>(category),\n                \u003Cspan class=\"hljs-attr\">path\u003C/span>: \u003Cspan class=\"hljs-string\">`/\u003Cspan class=\"hljs-subst\">${category}\u003C/span>/`\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">children\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">buildCategoryNavigation\u003C/span>(categoryFiles, category)\n            };\n            \n            navigation.\u003Cspan class=\"hljs-property\">primary\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(primaryNavItem);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> navigation;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">formatCategoryName\u003C/span>(\u003Cspan class=\"hljs-params\">category\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> category.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;-&#x27;\u003C/span>)\n            .\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">word\u003C/span> =&gt;\u003C/span> word.\u003Cspan class=\"hljs-title function_\">charAt\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>).\u003Cspan class=\"hljs-title function_\">toUpperCase\u003C/span>() + word.\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(\u003Cspan class=\"hljs-number\">1\u003C/span>))\n            .\u003Cspan class=\"hljs-title function_\">join\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27; &#x27;\u003C/span>);\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">buildCategoryNavigation\u003C/span>(\u003Cspan class=\"hljs-params\">files, category\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> subcategories = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\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> files) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> subcategory = file.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">subcategory\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;general&#x27;\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!subcategories.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(subcategory)) {\n                subcategories.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(subcategory, []);\n            }\n            \n            subcategories.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(subcategory).\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">title\u003C/span>: file.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">title\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">path\u003C/span>: file.\u003Cspan class=\"hljs-property\">relativePath\u003C/span>.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;.md&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;.html&#x27;\u003C/span>),\n                \u003Cspan class=\"hljs-attr\">description\u003C/span>: file.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">description\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">order\u003C/span>: file.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">order\u003C/span> || \u003Cspan class=\"hljs-number\">999\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> navigation = [];\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [subcategory, subFiles] \u003Cspan class=\"hljs-keyword\">of\u003C/span> subcategories) {\n            navigation.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">formatCategoryName\u003C/span>(subcategory),\n                \u003Cspan class=\"hljs-attr\">files\u003C/span>: subFiles.\u003Cspan class=\"hljs-title function_\">sort\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">a, b\u003C/span>) =&gt;\u003C/span> a.\u003Cspan class=\"hljs-property\">order\u003C/span> - b.\u003Cspan class=\"hljs-property\">order\u003C/span>)\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> navigation;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">generateOrganizationReport\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> analysis = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">analyzeOrganizationHealth\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> reorganizationPlan = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">reorganizeContent\u003C/span>(\u003Cspan class=\"hljs-literal\">true\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> report = {\n            \u003Cspan class=\"hljs-attr\">summary\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">totalFiles\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>.\u003Cspan class=\"hljs-property\">size\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">categories\u003C/span>: \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">keys\u003C/span>(analysis.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span>.\u003Cspan class=\"hljs-property\">categories\u003C/span>).\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">consistencyScore\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">structure\u003C/span>.\u003Cspan class=\"hljs-property\">consistencyScore\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">orphanedContent\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">relationships\u003C/span>.\u003Cspan class=\"hljs-property\">orphanedContent\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">suggestedMoves\u003C/span>: reorganizationPlan.\u003Cspan class=\"hljs-property\">length\u003C/span>\n            },\n            \u003Cspan class=\"hljs-attr\">structure\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">structure\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">relationships\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">relationships\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">taxonomy\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">taxonomy\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">suggestions\u003C/span>: analysis.\u003Cspan class=\"hljs-property\">suggestions\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">reorganizationPlan\u003C/span>: reorganizationPlan.\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>, \u003Cspan class=\"hljs-number\">10\u003C/span>), \u003Cspan class=\"hljs-comment\">// Top 10 suggestions\u003C/span>\n            \u003Cspan class=\"hljs-attr\">navigation\u003C/span>: \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateNavigationStructure\u003C/span>()\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_\">exportOrganizationData\u003C/span>(\u003Cspan class=\"hljs-params\">outputPath = \u003Cspan class=\"hljs-string\">&#x27;./organization-report.json&#x27;\u003C/span>\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> report = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateOrganizationReport\u003C/span>();\n        \n        \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">writeFile\u003C/span>(outputPath, \u003Cspan class=\"hljs-title class_\">JSON\u003C/span>.\u003Cspan class=\"hljs-title function_\">stringify\u003C/span>(report, \u003Cspan class=\"hljs-literal\">null\u003C/span>, \u003Cspan class=\"hljs-number\">2\u003C/span>));\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Organization report exported to \u003Cspan class=\"hljs-subst\">${outputPath}\u003C/span>`\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> report;\n    }\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = \u003Cspan class=\"hljs-title class_\">ContentOrganizationManager\u003C/span>;\n\u003C/code>\u003C/pre>\u003Ch2 id=\"scalable-project-architectures\">Scalable Project Architectures\u003C/h2>\n\u003Ch3 id=\"multi-repository-content-management\">Multi-Repository Content Management\u003C/h3>\n\u003Cp>Managing content across multiple repositories and projects:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># multi-repo-structure.yaml - Configuration for distributed content\u003C/span>\n\u003Cspan class=\"hljs-attr\">content_repositories:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">primary:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;main-docs&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">url:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;https://github.com/org/main-docs.git&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">path:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./content/main&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">structure:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">guides/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">reference/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">tutorials/\u003C/span>\n    \n  \u003Cspan class=\"hljs-attr\">product_docs:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;product-documentation&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">url:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;https://github.com/org/product-docs.git&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">path:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./content/products&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">structure:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">api/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">sdk/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">integrations/\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">community:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;community-content&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">url:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;https://github.com/org/community.git&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">path:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./content/community&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">structure:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">contributions/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">examples/\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">discussions/\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">synchronization:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">strategy:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;pull-based&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">frequency:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;hourly&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">conflict_resolution:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;timestamp&quot;\u003C/span>\n  \n\u003Cspan class=\"hljs-attr\">content_federation:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">cross_references:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">enabled:\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>\n    \u003Cspan class=\"hljs-attr\">auto_link:\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>\n    \u003Cspan class=\"hljs-attr\">validation:\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">shared_assets:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">images:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./assets/shared/images&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">templates:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./assets/shared/templates&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">styles:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;./assets/shared/styles&quot;\u003C/span>\n  \n  \u003Cspan class=\"hljs-attr\">content_types:\u003C/span>\n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">type:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;api_reference&quot;\u003C/span>\n      \u003Cspan class=\"hljs-attr\">sources:\u003C/span> [\u003Cspan class=\"hljs-string\">&quot;primary&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;product_docs&quot;\u003C/span>]\n      \u003Cspan class=\"hljs-attr\">merge_strategy:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;latest&quot;\u003C/span>\n    \n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">type:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;tutorials&quot;\u003C/span>\n      \u003Cspan class=\"hljs-attr\">sources:\u003C/span> [\u003Cspan class=\"hljs-string\">&quot;primary&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;community&quot;\u003C/span>]\n      \u003Cspan class=\"hljs-attr\">merge_strategy:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;aggregate&quot;\u003C/span>\n    \n    \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">type:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;examples&quot;\u003C/span>\n      \u003Cspan class=\"hljs-attr\">sources:\u003C/span> [\u003Cspan class=\"hljs-string\">&quot;product_docs&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;community&quot;\u003C/span>]\n      \u003Cspan class=\"hljs-attr\">merge_strategy:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;category_based&quot;\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"content-lifecycle-management\">Content Lifecycle Management\u003C/h3>\n\u003Cp>Implementing comprehensive content lifecycle tracking and management:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// content-lifecycle-manager.js - Content lifecycle and versioning system\u003C/span>\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">ContentLifecycleManager\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">constructor\u003C/span>(\u003Cspan class=\"hljs-params\">organizationManager\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">orgManager\u003C/span> = organizationManager;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">lifecycleStates\u003C/span> = [\n            \u003Cspan class=\"hljs-string\">&#x27;draft&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;review&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;approved&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;published&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;updated&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;deprecated&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-string\">&#x27;archived&#x27;\u003C/span>\n        ];\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">lifecycleConfig\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">retention_periods\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">draft\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;30 days&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">deprecated\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;1 year&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">archived\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;5 years&#x27;\u003C/span>\n            },\n            \u003Cspan class=\"hljs-attr\">approval_required\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;published&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;updated&#x27;\u003C/span>],\n            \u003Cspan class=\"hljs-attr\">auto_transitions\u003C/span>: {\n                \u003Cspan class=\"hljs-string\">&#x27;draft_to_review&#x27;\u003C/span>: { \u003Cspan class=\"hljs-attr\">condition\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;content_complete&#x27;\u003C/span>, \u003Cspan class=\"hljs-attr\">delay\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;1 day&#x27;\u003C/span> },\n                \u003Cspan class=\"hljs-string\">&#x27;published_to_deprecated&#x27;\u003C/span>: { \u003Cspan class=\"hljs-attr\">condition\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;age &gt; 2 years&#x27;\u003C/span>, \u003Cspan class=\"hljs-attr\">delay\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;0&#x27;\u003C/span> }\n            }\n        };\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">analyzeContentLifecycle\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> analysis = {\n            \u003Cspan class=\"hljs-attr\">state_distribution\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>(),\n            \u003Cspan class=\"hljs-attr\">aging_content\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">lifecycle_violations\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">recommendations\u003C/span>: []\n        };\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">orgManager\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> lifecycle = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">extractLifecycleInfo\u003C/span>(fileInfo);\n            \n            \u003Cspan class=\"hljs-comment\">// Track state distribution\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> state = lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;unknown&#x27;\u003C/span>;\n            analysis.\u003Cspan class=\"hljs-property\">state_distribution\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(state, \n                (analysis.\u003Cspan class=\"hljs-property\">state_distribution\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(state) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            \n            \u003Cspan class=\"hljs-comment\">// Identify aging content\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> age = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">calculateContentAge\u003C/span>(fileInfo);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (age.\u003Cspan class=\"hljs-property\">years\u003C/span> &gt;= \u003Cspan class=\"hljs-number\">2\u003C/span> &amp;&amp; lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> === \u003Cspan class=\"hljs-string\">&#x27;published&#x27;\u003C/span>) {\n                analysis.\u003Cspan class=\"hljs-property\">aging_content\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                    \u003Cspan class=\"hljs-attr\">age\u003C/span>: age,\n                    \u003Cspan class=\"hljs-attr\">last_updated\u003C/span>: lifecycle.\u003Cspan class=\"hljs-property\">last_updated\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">suggested_action\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;review_for_deprecation&#x27;\u003C/span>\n                });\n            }\n            \n            \u003Cspan class=\"hljs-comment\">// Check for lifecycle violations\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> violations = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">checkLifecycleCompliance\u003C/span>(fileInfo, lifecycle);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (violations.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                analysis.\u003Cspan class=\"hljs-property\">lifecycle_violations\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath,\n                    violations\n                });\n            }\n        }\n        \n        analysis.\u003Cspan class=\"hljs-property\">recommendations\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateLifecycleRecommendations\u003C/span>(analysis);\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> analysis;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">extractLifecycleInfo\u003C/span>(\u003Cspan class=\"hljs-params\">fileInfo\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> fm = fileInfo.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">current_state\u003C/span>: fm.\u003Cspan class=\"hljs-property\">status\u003C/span> || fm.\u003Cspan class=\"hljs-property\">lifecycle_state\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;unknown&#x27;\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">created_date\u003C/span>: fm.\u003Cspan class=\"hljs-property\">date\u003C/span> || fm.\u003Cspan class=\"hljs-property\">created\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">last_updated\u003C/span>: fm.\u003Cspan class=\"hljs-property\">last_updated\u003C/span> || fm.\u003Cspan class=\"hljs-property\">modified\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">version\u003C/span>: fm.\u003Cspan class=\"hljs-property\">version\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">author\u003C/span>: fm.\u003Cspan class=\"hljs-property\">author\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">reviewers\u003C/span>: fm.\u003Cspan class=\"hljs-property\">reviewers\u003C/span> || [],\n            \u003Cspan class=\"hljs-attr\">expiry_date\u003C/span>: fm.\u003Cspan class=\"hljs-property\">expires\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">approval_date\u003C/span>: fm.\u003Cspan class=\"hljs-property\">approved_date\u003C/span>,\n            \u003Cspan class=\"hljs-attr\">deprecation_notice\u003C/span>: fm.\u003Cspan class=\"hljs-property\">deprecated\u003C/span>\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">calculateContentAge\u003C/span>(\u003Cspan class=\"hljs-params\">fileInfo\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> createdDate = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>(fileInfo.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>.\u003Cspan class=\"hljs-property\">date\u003C/span> || fileInfo.\u003Cspan class=\"hljs-property\">stats\u003C/span>.\u003Cspan class=\"hljs-property\">lastModified\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\">const\u003C/span> diffTime = \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">abs\u003C/span>(now - createdDate);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">days\u003C/span>: \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">ceil\u003C/span>(diffTime / (\u003Cspan class=\"hljs-number\">1000\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">24\u003C/span>)),\n            \u003Cspan class=\"hljs-attr\">months\u003C/span>: \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">ceil\u003C/span>(diffTime / (\u003Cspan class=\"hljs-number\">1000\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">24\u003C/span> * \u003Cspan class=\"hljs-number\">30\u003C/span>)),\n            \u003Cspan class=\"hljs-attr\">years\u003C/span>: \u003Cspan class=\"hljs-title class_\">Math\u003C/span>.\u003Cspan class=\"hljs-title function_\">ceil\u003C/span>(diffTime / (\u003Cspan class=\"hljs-number\">1000\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">60\u003C/span> * \u003Cspan class=\"hljs-number\">24\u003C/span> * \u003Cspan class=\"hljs-number\">365\u003C/span>))\n        };\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">checkLifecycleCompliance\u003C/span>(\u003Cspan class=\"hljs-params\">fileInfo, lifecycle\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> violations = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check for missing required lifecycle information\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> || lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> === \u003Cspan class=\"hljs-string\">&#x27;unknown&#x27;\u003C/span>) {\n            violations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;missing_state&#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;Content missing lifecycle state information&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for stale content without updates\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> age = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">calculateContentAge\u003C/span>(fileInfo);\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (age.\u003Cspan class=\"hljs-property\">months\u003C/span> &gt; \u003Cspan class=\"hljs-number\">6\u003C/span> &amp;&amp; !lifecycle.\u003Cspan class=\"hljs-property\">last_updated\u003C/span>) {\n            violations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;stale_content&#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\">`Content is \u003Cspan class=\"hljs-subst\">${age.months}\u003C/span> months old without documented updates`\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check approval requirements\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> === \u003Cspan class=\"hljs-string\">&#x27;published&#x27;\u003C/span> &amp;&amp; \n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">lifecycleConfig\u003C/span>.\u003Cspan class=\"hljs-property\">approval_required\u003C/span>.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;published&#x27;\u003C/span>) &amp;&amp;\n            !lifecycle.\u003Cspan class=\"hljs-property\">approval_date\u003C/span>) {\n            violations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;missing_approval&#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\">&#x27;Published content missing approval documentation&#x27;\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> violations;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">suggestContentReorganization\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> suggestions = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Analyze content by lifecycle state\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> stateGroups = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Map\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [filePath, fileInfo] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">orgManager\u003C/span>.\u003Cspan class=\"hljs-property\">contentIndex\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> lifecycle = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">extractLifecycleInfo\u003C/span>(fileInfo);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> state = lifecycle.\u003Cspan class=\"hljs-property\">current_state\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;unknown&#x27;\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!stateGroups.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(state)) {\n                stateGroups.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(state, []);\n            }\n            stateGroups.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(state).\u003Cspan class=\"hljs-title function_\">push\u003C/span>({ \u003Cspan class=\"hljs-attr\">path\u003C/span>: filePath, \u003Cspan class=\"hljs-attr\">info\u003C/span>: fileInfo, lifecycle });\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Suggest organizational improvements based on lifecycle\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [state, files] \u003Cspan class=\"hljs-keyword\">of\u003C/span> stateGroups) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (state === \u003Cspan class=\"hljs-string\">&#x27;draft&#x27;\u003C/span> &amp;&amp; files.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">10\u003C/span>) {\n                suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;lifecycle_organization&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;medium&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Organize Draft Content&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${files.length}\u003C/span> draft files could be organized in drafts/ directory`\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">action\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;create_drafts_directory&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">affected_files\u003C/span>: files.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">path\u003C/span>)\n                });\n            }\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (state === \u003Cspan class=\"hljs-string\">&#x27;deprecated&#x27;\u003C/span> &amp;&amp; files.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">5\u003C/span>) {\n                suggestions.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                    \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;lifecycle_organization&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">priority\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;low&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Archive Deprecated Content&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${files.length}\u003C/span> deprecated files should be moved to archive`\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">action\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;move_to_archive&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">affected_files\u003C/span>: files.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">f\u003C/span> =&gt;\u003C/span> f.\u003Cspan class=\"hljs-property\">path\u003C/span>)\n                });\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestions;\n    }\n}\n\u003C/code>\u003C/pre>\u003Ch2 id=\"integration-with-documentation-systems\">Integration with Documentation Systems\u003C/h2>\n\u003Cp>Content organization strategies integrate seamlessly with modern documentation workflows. When combined with \u003Ca href=\"/blog/markdown-workflow-automation-and-productivity-complete-guide\">workflow automation and productivity systems\u003C/a>, effective organization enables automated content management processes that maintain structure consistency, support bulk operations, and provide intelligent content suggestions based on organizational patterns.\u003C/p>\n\u003Cp>For comprehensive content management, organization frameworks work effectively with \u003Ca href=\"/blog/markdown-collaborative-editing-real-time-synchronization-complete-guide\">collaborative editing and real-time synchronization systems\u003C/a> by providing clear content boundaries, consistent naming conventions, and structured pathways that facilitate multi-user collaboration while maintaining organizational integrity across concurrent editing sessions.\u003C/p>\n\u003Cp>When building scalable documentation platforms, content organization complements \u003Ca href=\"/blog/markdown-dynamic-content-generation-complete-guide\">dynamic content generation systems\u003C/a> by providing structured templates, consistent categorization patterns, and logical hierarchies that support automated content creation while ensuring generated content follows established organizational standards and integrates seamlessly with existing content architectures.\u003C/p>\n\u003Ch2 id=\"advanced-organization-strategies\">Advanced Organization Strategies\u003C/h2>\n\u003Ch3 id=\"semantic-content-clustering\">Semantic Content Clustering\u003C/h3>\n\u003Cp>Implementing AI-driven content organization based on semantic relationships:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-python\">\u003Cspan class=\"hljs-comment\"># semantic_organizer.py - AI-powered content clustering and organization\u003C/span>\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> numpy \u003Cspan class=\"hljs-keyword\">as\u003C/span> np\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> sklearn.feature_extraction.text \u003Cspan class=\"hljs-keyword\">import\u003C/span> TfidfVectorizer\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> sklearn.cluster \u003Cspan class=\"hljs-keyword\">import\u003C/span> KMeans\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> sklearn.metrics.pairwise \u003Cspan class=\"hljs-keyword\">import\u003C/span> cosine_similarity\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> networkx \u003Cspan class=\"hljs-keyword\">as\u003C/span> nx\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> typing \u003Cspan class=\"hljs-keyword\">import\u003C/span> \u003Cspan class=\"hljs-type\">List\u003C/span>, \u003Cspan class=\"hljs-type\">Dict\u003C/span>, \u003Cspan class=\"hljs-type\">Tuple\u003C/span>\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> re\n\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">SemanticContentOrganizer\u003C/span>:\n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">__init__\u003C/span>(\u003Cspan class=\"hljs-params\">self, organization_manager\u003C/span>):\n        self.org_manager = organization_manager\n        self.vectorizer = TfidfVectorizer(\n            max_features=\u003Cspan class=\"hljs-number\">5000\u003C/span>,\n            stop_words=\u003Cspan class=\"hljs-string\">&#x27;english&#x27;\u003C/span>,\n            ngram_range=(\u003Cspan class=\"hljs-number\">1\u003C/span>, \u003Cspan class=\"hljs-number\">2\u003C/span>)\n        )\n        self.content_vectors = \u003Cspan class=\"hljs-literal\">None\u003C/span>\n        self.similarity_matrix = \u003Cspan class=\"hljs-literal\">None\u003C/span>\n        self.clusters = {}\n        \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">extract_content_features\u003C/span>(\u003Cspan class=\"hljs-params\">self, file_info\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Extract textual features from content for analysis&quot;&quot;&quot;\u003C/span>\n        features = []\n        \n        \u003Cspan class=\"hljs-comment\"># Title and headings\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> file_info.frontmatter:\n            features.append(file_info.frontmatter[\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>])\n        \n        headings = re.findall(\u003Cspan class=\"hljs-string\">r&#x27;^#+\\s+(.+)$&#x27;\u003C/span>, file_info.content, re.MULTILINE)\n        features.extend(headings)\n        \n        \u003Cspan class=\"hljs-comment\"># Description and keywords\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> file_info.frontmatter:\n            features.append(file_info.frontmatter[\u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span>])\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;keywords&#x27;\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> file_info.frontmatter:\n            keywords = file_info.frontmatter[\u003Cspan class=\"hljs-string\">&#x27;keywords&#x27;\u003C/span>]\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-built_in\">isinstance\u003C/span>(keywords, \u003Cspan class=\"hljs-built_in\">list\u003C/span>):\n                features.extend(keywords)\n            \u003Cspan class=\"hljs-keyword\">else\u003C/span>:\n                features.append(keywords)\n        \n        \u003Cspan class=\"hljs-comment\"># Clean content (remove code blocks and links)\u003C/span>\n        clean_content = self.clean_content_for_analysis(file_info.content)\n        features.append(clean_content[:\u003Cspan class=\"hljs-number\">1000\u003C/span>])  \u003Cspan class=\"hljs-comment\"># First 1000 chars\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-string\">&#x27; &#x27;\u003C/span>.join(features)\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">clean_content_for_analysis\u003C/span>(\u003Cspan class=\"hljs-params\">self, content\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Clean content for semantic analysis&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-comment\"># Remove code blocks\u003C/span>\n        content = re.sub(\u003Cspan class=\"hljs-string\">r&#x27;```.*?```&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>, content, flags=re.DOTALL)\n        \u003Cspan class=\"hljs-comment\"># Remove inline code\u003C/span>\n        content = re.sub(\u003Cspan class=\"hljs-string\">r&#x27;`[^`]+`&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>, content)\n        \u003Cspan class=\"hljs-comment\"># Remove links but keep text\u003C/span>\n        content = re.sub(\u003Cspan class=\"hljs-string\">r&#x27;\\[([^\\]]+)\\]\\([^)]+\\)&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">r&#x27;\\1&#x27;\u003C/span>, content)\n        \u003Cspan class=\"hljs-comment\"># Remove markdown formatting\u003C/span>\n        content = re.sub(\u003Cspan class=\"hljs-string\">r&#x27;[*_#+\\-]&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>, content)\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> content\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">build_content_vectors\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Build TF-IDF vectors for all content&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-built_in\">print\u003C/span>(\u003Cspan class=\"hljs-string\">&quot;Building content vectors for semantic analysis...&quot;\u003C/span>)\n        \n        documents = []\n        file_paths = []\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> file_path, file_info \u003Cspan class=\"hljs-keyword\">in\u003C/span> self.org_manager.contentIndex.items():\n            content_features = self.extract_content_features(file_info)\n            documents.append(content_features)\n            file_paths.append(file_path)\n        \n        self.content_vectors = self.vectorizer.fit_transform(documents)\n        self.file_paths = file_paths\n        \n        \u003Cspan class=\"hljs-built_in\">print\u003C/span>(\u003Cspan class=\"hljs-string\">f&quot;Created vectors for \u003Cspan class=\"hljs-subst\">{\u003Cspan class=\"hljs-built_in\">len\u003C/span>(documents)}\u003C/span> documents&quot;\u003C/span>)\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> self.content_vectors\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">calculate_similarity_matrix\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Calculate cosine similarity between all documents&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> self.content_vectors \u003Cspan class=\"hljs-keyword\">is\u003C/span> \u003Cspan class=\"hljs-literal\">None\u003C/span>:\n            self.build_content_vectors()\n        \n        \u003Cspan class=\"hljs-built_in\">print\u003C/span>(\u003Cspan class=\"hljs-string\">&quot;Calculating content similarity matrix...&quot;\u003C/span>)\n        self.similarity_matrix = cosine_similarity(self.content_vectors)\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> self.similarity_matrix\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">find_semantic_clusters\u003C/span>(\u003Cspan class=\"hljs-params\">self, n_clusters=\u003Cspan class=\"hljs-literal\">None\u003C/span>\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Identify semantic clusters in content&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> self.content_vectors \u003Cspan class=\"hljs-keyword\">is\u003C/span> \u003Cspan class=\"hljs-literal\">None\u003C/span>:\n            self.build_content_vectors()\n        \n        \u003Cspan class=\"hljs-comment\"># Auto-determine number of clusters if not specified\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> n_clusters \u003Cspan class=\"hljs-keyword\">is\u003C/span> \u003Cspan class=\"hljs-literal\">None\u003C/span>:\n            n_clusters = \u003Cspan class=\"hljs-built_in\">min\u003C/span>(\u003Cspan class=\"hljs-number\">10\u003C/span>, \u003Cspan class=\"hljs-built_in\">max\u003C/span>(\u003Cspan class=\"hljs-number\">3\u003C/span>, \u003Cspan class=\"hljs-built_in\">len\u003C/span>(self.file_paths) // \u003Cspan class=\"hljs-number\">20\u003C/span>))\n        \n        \u003Cspan class=\"hljs-built_in\">print\u003C/span>(\u003Cspan class=\"hljs-string\">f&quot;Finding \u003Cspan class=\"hljs-subst\">{n_clusters}\u003C/span> semantic clusters...&quot;\u003C/span>)\n        \n        kmeans = KMeans(n_clusters=n_clusters, random_state=\u003Cspan class=\"hljs-number\">42\u003C/span>)\n        cluster_labels = kmeans.fit_predict(self.content_vectors.toarray())\n        \n        \u003Cspan class=\"hljs-comment\"># Organize results by cluster\u003C/span>\n        self.clusters = {}\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> i, file_path \u003Cspan class=\"hljs-keyword\">in\u003C/span> \u003Cspan class=\"hljs-built_in\">enumerate\u003C/span>(self.file_paths):\n            cluster_id = cluster_labels[i]\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> cluster_id \u003Cspan class=\"hljs-keyword\">not\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> self.clusters:\n                self.clusters[cluster_id] = []\n            \n            file_info = self.org_manager.contentIndex[file_path]\n            self.clusters[cluster_id].append({\n                \u003Cspan class=\"hljs-string\">&#x27;path&#x27;\u003C/span>: file_path,\n                \u003Cspan class=\"hljs-string\">&#x27;info&#x27;\u003C/span>: file_info,\n                \u003Cspan class=\"hljs-string\">&#x27;similarity_to_centroid&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">float\u003C/span>(kmeans.transform(\n                    self.content_vectors[i].reshape(\u003Cspan class=\"hljs-number\">1\u003C/span>, -\u003Cspan class=\"hljs-number\">1\u003C/span>)\n                )[\u003Cspan class=\"hljs-number\">0\u003C/span>][cluster_id])\n            })\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> self.clusters\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">analyze_cluster_characteristics\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Analyze characteristics of each cluster&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-keyword\">not\u003C/span> self.clusters:\n            self.find_semantic_clusters()\n        \n        cluster_analysis = {}\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> cluster_id, files \u003Cspan class=\"hljs-keyword\">in\u003C/span> self.clusters.items():\n            \u003Cspan class=\"hljs-comment\"># Extract common terms\u003C/span>\n            cluster_content = []\n            categories = []\n            content_types = []\n            \n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> file_data \u003Cspan class=\"hljs-keyword\">in\u003C/span> files:\n                file_info = file_data[\u003Cspan class=\"hljs-string\">&#x27;info&#x27;\u003C/span>]\n                cluster_content.append(self.extract_content_features(file_info))\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> file_info.frontmatter:\n                    categories.append(file_info.frontmatter[\u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span>])\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;content_type&#x27;\u003C/span> \u003Cspan class=\"hljs-keyword\">in\u003C/span> file_info.frontmatter:\n                    content_types.append(file_info.frontmatter[\u003Cspan class=\"hljs-string\">&#x27;content_type&#x27;\u003C/span>])\n            \n            \u003Cspan class=\"hljs-comment\"># Analyze common terms in cluster\u003C/span>\n            cluster_vectorizer = TfidfVectorizer(\n                max_features=\u003Cspan class=\"hljs-number\">20\u003C/span>,\n                stop_words=\u003Cspan class=\"hljs-string\">&#x27;english&#x27;\u003C/span>\n            )\n            cluster_vectors = cluster_vectorizer.fit_transform(cluster_content)\n            \n            feature_names = cluster_vectorizer.get_feature_names_out()\n            cluster_terms = feature_names[np.argsort(\n                cluster_vectors.mean(axis=\u003Cspan class=\"hljs-number\">0\u003C/span>).A1\n            )[::-\u003Cspan class=\"hljs-number\">1\u003C/span>][:\u003Cspan class=\"hljs-number\">10\u003C/span>]]\n            \n            cluster_analysis[cluster_id] = {\n                \u003Cspan class=\"hljs-string\">&#x27;size&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">len\u003C/span>(files),\n                \u003Cspan class=\"hljs-string\">&#x27;common_terms&#x27;\u003C/span>: cluster_terms.tolist(),\n                \u003Cspan class=\"hljs-string\">&#x27;categories&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">list\u003C/span>(\u003Cspan class=\"hljs-built_in\">set\u003C/span>(categories)),\n                \u003Cspan class=\"hljs-string\">&#x27;content_types&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">list\u003C/span>(\u003Cspan class=\"hljs-built_in\">set\u003C/span>(content_types)),\n                \u003Cspan class=\"hljs-string\">&#x27;files&#x27;\u003C/span>: files,\n                \u003Cspan class=\"hljs-string\">&#x27;suggested_organization&#x27;\u003C/span>: self.suggest_cluster_organization(\n                    cluster_terms, categories, content_types\n                )\n            }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> cluster_analysis\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">suggest_cluster_organization\u003C/span>(\u003Cspan class=\"hljs-params\">self, terms, categories, content_types\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Suggest organization structure for a cluster&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-comment\"># Determine primary theme from common terms\u003C/span>\n        theme_keywords = {\n            \u003Cspan class=\"hljs-string\">&#x27;api&#x27;\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;api&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;endpoint&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;request&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;response&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;authentication&#x27;\u003C/span>],\n            \u003Cspan class=\"hljs-string\">&#x27;tutorial&#x27;\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;tutorial&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;guide&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;step&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;example&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;how&#x27;\u003C/span>],\n            \u003Cspan class=\"hljs-string\">&#x27;configuration&#x27;\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;config&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;setting&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;parameter&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;option&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;variable&#x27;\u003C/span>],\n            \u003Cspan class=\"hljs-string\">&#x27;troubleshooting&#x27;\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;error&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;problem&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;issue&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;debug&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;troubleshoot&#x27;\u003C/span>],\n            \u003Cspan class=\"hljs-string\">&#x27;integration&#x27;\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;integration&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;connect&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;webhook&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;plugin&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;extension&#x27;\u003C/span>]\n        }\n        \n        cluster_theme = \u003Cspan class=\"hljs-string\">&#x27;general&#x27;\u003C/span>\n        max_theme_score = \u003Cspan class=\"hljs-number\">0\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> theme, keywords \u003Cspan class=\"hljs-keyword\">in\u003C/span> theme_keywords.items():\n            score = \u003Cspan class=\"hljs-built_in\">sum\u003C/span>(\u003Cspan class=\"hljs-number\">1\u003C/span> \u003Cspan class=\"hljs-keyword\">for\u003C/span> term \u003Cspan class=\"hljs-keyword\">in\u003C/span> terms \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-built_in\">any\u003C/span>(kw \u003Cspan class=\"hljs-keyword\">in\u003C/span> term.lower() \u003Cspan class=\"hljs-keyword\">for\u003C/span> kw \u003Cspan class=\"hljs-keyword\">in\u003C/span> keywords))\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> score &gt; max_theme_score:\n                max_theme_score = score\n                cluster_theme = theme\n        \n        \u003Cspan class=\"hljs-comment\"># Suggest directory structure\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> \u003Cspan class=\"hljs-built_in\">len\u003C/span>(categories) == \u003Cspan class=\"hljs-number\">1\u003C/span>:\n            \u003Cspan class=\"hljs-comment\"># Single category cluster\u003C/span>\n            suggested_path = \u003Cspan class=\"hljs-string\">f&quot;\u003Cspan class=\"hljs-subst\">{categories[\u003Cspan class=\"hljs-number\">0\u003C/span>]}\u003C/span>/\u003Cspan class=\"hljs-subst\">{cluster_theme}\u003C/span>&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">elif\u003C/span> \u003Cspan class=\"hljs-built_in\">len\u003C/span>(content_types) == \u003Cspan class=\"hljs-number\">1\u003C/span>:\n            \u003Cspan class=\"hljs-comment\"># Single content type cluster\u003C/span>\n            suggested_path = \u003Cspan class=\"hljs-string\">f&quot;\u003Cspan class=\"hljs-subst\">{cluster_theme}\u003C/span>/\u003Cspan class=\"hljs-subst\">{content_types[\u003Cspan class=\"hljs-number\">0\u003C/span>]}\u003C/span>&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">else\u003C/span>:\n            \u003Cspan class=\"hljs-comment\"># Mixed cluster\u003C/span>\n            suggested_path = \u003Cspan class=\"hljs-string\">f&quot;\u003Cspan class=\"hljs-subst\">{cluster_theme}\u003C/span>&quot;\u003C/span>\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-string\">&#x27;theme&#x27;\u003C/span>: cluster_theme,\n            \u003Cspan class=\"hljs-string\">&#x27;suggested_path&#x27;\u003C/span>: suggested_path,\n            \u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>: max_theme_score / \u003Cspan class=\"hljs-built_in\">len\u003C/span>(terms) \u003Cspan class=\"hljs-keyword\">if\u003C/span> terms \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-number\">0\u003C/span>\n        }\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">build_content_relationship_graph\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Build a graph of content relationships based on similarity&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> self.similarity_matrix \u003Cspan class=\"hljs-keyword\">is\u003C/span> \u003Cspan class=\"hljs-literal\">None\u003C/span>:\n            self.calculate_similarity_matrix()\n        \n        G = nx.Graph()\n        \n        \u003Cspan class=\"hljs-comment\"># Add nodes\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> i, file_path \u003Cspan class=\"hljs-keyword\">in\u003C/span> \u003Cspan class=\"hljs-built_in\">enumerate\u003C/span>(self.file_paths):\n            file_info = self.org_manager.contentIndex[file_path]\n            G.add_node(file_path, \n                      title=file_info.frontmatter.get(\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>),\n                      category=file_info.frontmatter.get(\u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>))\n        \n        \u003Cspan class=\"hljs-comment\"># Add edges for high similarity\u003C/span>\n        similarity_threshold = \u003Cspan class=\"hljs-number\">0.3\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> i \u003Cspan class=\"hljs-keyword\">in\u003C/span> \u003Cspan class=\"hljs-built_in\">range\u003C/span>(\u003Cspan class=\"hljs-built_in\">len\u003C/span>(self.file_paths)):\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> j \u003Cspan class=\"hljs-keyword\">in\u003C/span> \u003Cspan class=\"hljs-built_in\">range\u003C/span>(i+\u003Cspan class=\"hljs-number\">1\u003C/span>, \u003Cspan class=\"hljs-built_in\">len\u003C/span>(self.file_paths)):\n                similarity = self.similarity_matrix[i][j]\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> similarity &gt; similarity_threshold:\n                    G.add_edge(self.file_paths[i], self.file_paths[j], \n                              weight=similarity)\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> G\n    \n    \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">suggest_semantic_reorganization\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Suggest content reorganization based on semantic analysis&quot;&quot;&quot;\u003C/span>\n        cluster_analysis = self.analyze_cluster_characteristics()\n        suggestions = []\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> cluster_id, analysis \u003Cspan class=\"hljs-keyword\">in\u003C/span> cluster_analysis.items():\n            organization = analysis[\u003Cspan class=\"hljs-string\">&#x27;suggested_organization&#x27;\u003C/span>]\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> organization[\u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>] &gt; \u003Cspan class=\"hljs-number\">0.3\u003C/span>:  \u003Cspan class=\"hljs-comment\"># High confidence suggestion\u003C/span>\n                files_to_move = []\n                \n                \u003Cspan class=\"hljs-keyword\">for\u003C/span> file_data \u003Cspan class=\"hljs-keyword\">in\u003C/span> analysis[\u003Cspan class=\"hljs-string\">&#x27;files&#x27;\u003C/span>]:\n                    current_path = file_data[\u003Cspan class=\"hljs-string\">&#x27;path&#x27;\u003C/span>]\n                    file_info = file_data[\u003Cspan class=\"hljs-string\">&#x27;info&#x27;\u003C/span>]\n                    current_location = \u003Cspan class=\"hljs-string\">&#x27;/&#x27;\u003C/span>.join(file_info.relativePath.split(\u003Cspan class=\"hljs-string\">&#x27;/&#x27;\u003C/span>)[:-\u003Cspan class=\"hljs-number\">1\u003C/span>])\n                    \n                    \u003Cspan class=\"hljs-keyword\">if\u003C/span> current_location != organization[\u003Cspan class=\"hljs-string\">&#x27;suggested_path&#x27;\u003C/span>]:\n                        files_to_move.append({\n                            \u003Cspan class=\"hljs-string\">&#x27;current&#x27;\u003C/span>: current_path,\n                            \u003Cspan class=\"hljs-string\">&#x27;suggested&#x27;\u003C/span>: organization[\u003Cspan class=\"hljs-string\">&#x27;suggested_path&#x27;\u003C/span>],\n                            \u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>: organization[\u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>]\n                        })\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> files_to_move:\n                    suggestions.append({\n                        \u003Cspan class=\"hljs-string\">&#x27;type&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;semantic_reorganization&#x27;\u003C/span>,\n                        \u003Cspan class=\"hljs-string\">&#x27;cluster_id&#x27;\u003C/span>: cluster_id,\n                        \u003Cspan class=\"hljs-string\">&#x27;theme&#x27;\u003C/span>: organization[\u003Cspan class=\"hljs-string\">&#x27;theme&#x27;\u003C/span>],\n                        \u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>: organization[\u003Cspan class=\"hljs-string\">&#x27;confidence&#x27;\u003C/span>],\n                        \u003Cspan class=\"hljs-string\">&#x27;files_to_move&#x27;\u003C/span>: files_to_move,\n                        \u003Cspan class=\"hljs-string\">&#x27;rationale&#x27;\u003C/span>: \u003Cspan class=\"hljs-string\">f&quot;Semantic analysis suggests these \u003Cspan class=\"hljs-subst\">{\u003Cspan class=\"hljs-built_in\">len\u003C/span>(files_to_move)}\u003C/span> files belong together based on content similarity&quot;\u003C/span>\n                    })\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> suggestions\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-keyword\">def\u003C/span> \u003Cspan class=\"hljs-title function_\">generate_semantic_report\u003C/span>(\u003Cspan class=\"hljs-params\">self\u003C/span>):\n        \u003Cspan class=\"hljs-string\">&quot;&quot;&quot;Generate comprehensive semantic analysis report&quot;&quot;&quot;\u003C/span>\n        \u003Cspan class=\"hljs-built_in\">print\u003C/span>(\u003Cspan class=\"hljs-string\">&quot;Generating semantic content analysis report...&quot;\u003C/span>)\n        \n        \u003Cspan class=\"hljs-comment\"># Run all analyses\u003C/span>\n        self.find_semantic_clusters()\n        cluster_analysis = self.analyze_cluster_characteristics()\n        relationship_graph = self.build_content_relationship_graph()\n        reorganization_suggestions = self.suggest_semantic_reorganization()\n        \n        report = {\n            \u003Cspan class=\"hljs-string\">&#x27;summary&#x27;\u003C/span>: {\n                \u003Cspan class=\"hljs-string\">&#x27;total_content&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">len\u003C/span>(self.file_paths),\n                \u003Cspan class=\"hljs-string\">&#x27;clusters_identified&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">len\u003C/span>(self.clusters),\n                \u003Cspan class=\"hljs-string\">&#x27;avg_cluster_size&#x27;\u003C/span>: np.mean([\u003Cspan class=\"hljs-built_in\">len\u003C/span>(files) \u003Cspan class=\"hljs-keyword\">for\u003C/span> files \u003Cspan class=\"hljs-keyword\">in\u003C/span> self.clusters.values()]),\n                \u003Cspan class=\"hljs-string\">&#x27;reorganization_suggestions&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">len\u003C/span>(reorganization_suggestions)\n            },\n            \u003Cspan class=\"hljs-string\">&#x27;clusters&#x27;\u003C/span>: cluster_analysis,\n            \u003Cspan class=\"hljs-string\">&#x27;relationship_metrics&#x27;\u003C/span>: {\n                \u003Cspan class=\"hljs-string\">&#x27;total_relationships&#x27;\u003C/span>: relationship_graph.number_of_edges(),\n                \u003Cspan class=\"hljs-string\">&#x27;avg_connections_per_file&#x27;\u003C/span>: relationship_graph.number_of_edges() / relationship_graph.number_of_nodes(),\n                \u003Cspan class=\"hljs-string\">&#x27;most_connected&#x27;\u003C/span>: \u003Cspan class=\"hljs-built_in\">sorted\u003C/span>(\n                    relationship_graph.degree(),\n                    key=\u003Cspan class=\"hljs-keyword\">lambda\u003C/span> x: x[\u003Cspan class=\"hljs-number\">1\u003C/span>],\n                    reverse=\u003Cspan class=\"hljs-literal\">True\u003C/span>\n                )[:\u003Cspan class=\"hljs-number\">5\u003C/span>]\n            },\n            \u003Cspan class=\"hljs-string\">&#x27;reorganization_suggestions&#x27;\u003C/span>: reorganization_suggestions,\n            \u003Cspan class=\"hljs-string\">&#x27;generated_at&#x27;\u003C/span>: datetime.now().isoformat()\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> report\n\u003C/code>\u003C/pre>\u003Ch2 id=\"troubleshooting-organization-issues\">Troubleshooting Organization Issues\u003C/h2>\n\u003Ch3 id=\"common-structure-problems\">Common Structure Problems\u003C/h3>\n\u003Cp>\u003Cstrong>Problem\u003C/strong>: Inconsistent directory structures across content categories\u003C/p>\n\u003Cp>\u003Cstrong>Solutions\u003C/strong>:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># organization-validator.sh - Validate content organization\u003C/span>\n\u003Cspan class=\"hljs-comment\">#!/bin/bash\u003C/span>\n\n\u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Validating content organization structure...&quot;\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># Check for consistent category directories\u003C/span>\nCONTENT_DIR=\u003Cspan class=\"hljs-string\">&quot;./content&quot;\u003C/span>\nREQUIRED_CATEGORIES=(\u003Cspan class=\"hljs-string\">&quot;guides&quot;\u003C/span> \u003Cspan class=\"hljs-string\">&quot;reference&quot;\u003C/span> \u003Cspan class=\"hljs-string\">&quot;tutorials&quot;\u003C/span> \u003Cspan class=\"hljs-string\">&quot;concepts&quot;\u003C/span>)\n\n\u003Cspan class=\"hljs-keyword\">for\u003C/span> category \u003Cspan class=\"hljs-keyword\">in\u003C/span> \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">${REQUIRED_CATEGORIES[@]}\u003C/span>&quot;\u003C/span>; \u003Cspan class=\"hljs-keyword\">do\u003C/span>\n    \u003Cspan class=\"hljs-keyword\">if\u003C/span> [ ! -d \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$CONTENT_DIR\u003C/span>/\u003Cspan class=\"hljs-variable\">$category\u003C/span>&quot;\u003C/span> ]; \u003Cspan class=\"hljs-keyword\">then\u003C/span>\n        \u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;❌ Missing required category directory: \u003Cspan class=\"hljs-variable\">$category\u003C/span>&quot;\u003C/span>\n    \u003Cspan class=\"hljs-keyword\">else\u003C/span>\n        \u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;✅ Found category directory: \u003Cspan class=\"hljs-variable\">$category\u003C/span>&quot;\u003C/span>\n        \n        \u003Cspan class=\"hljs-comment\"># Check for index files\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> [ ! -f \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$CONTENT_DIR\u003C/span>/\u003Cspan class=\"hljs-variable\">$category\u003C/span>/index.md&quot;\u003C/span> ]; \u003Cspan class=\"hljs-keyword\">then\u003C/span>\n            \u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;⚠️  Missing index.md in \u003Cspan class=\"hljs-variable\">$category\u003C/span> directory&quot;\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">fi\u003C/span>\n    \u003Cspan class=\"hljs-keyword\">fi\u003C/span>\n\u003Cspan class=\"hljs-keyword\">done\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># Check frontmatter consistency\u003C/span>\n\u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Checking frontmatter consistency...&quot;\u003C/span>\nfind \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$CONTENT_DIR\u003C/span>&quot;\u003C/span> -name \u003Cspan class=\"hljs-string\">&quot;*.md&quot;\u003C/span> -\u003Cspan class=\"hljs-built_in\">exec\u003C/span> grep -L \u003Cspan class=\"hljs-string\">&quot;^category:&quot;\u003C/span> {} \\; | \u003Cspan class=\"hljs-keyword\">while\u003C/span> \u003Cspan class=\"hljs-built_in\">read\u003C/span> file; \u003Cspan class=\"hljs-keyword\">do\u003C/span>\n    \u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;⚠️  Missing category in frontmatter: \u003Cspan class=\"hljs-variable\">$file\u003C/span>&quot;\u003C/span>\n\u003Cspan class=\"hljs-keyword\">done\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># Check for orphaned files (no inbound links)\u003C/span>\n\u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Checking for orphaned content...&quot;\u003C/span>\npython3 scripts/find-orphaned-content.py \u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$CONTENT_DIR\u003C/span>&quot;\u003C/span>\n\n\u003Cspan class=\"hljs-built_in\">echo\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Organization validation complete.&quot;\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"performance-optimization\">Performance Optimization\u003C/h3>\n\u003Cp>\u003Cstrong>Problem\u003C/strong>: Slow content discovery and indexing in large repositories\u003C/p>\n\u003Cp>\u003Cstrong>Solutions\u003C/strong>:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// performance-optimized-organizer.js - Optimized content organization\u003C/span>\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">OptimizedContentOrganizer\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">constructor\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentCache\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\">indexingQueue\u003C/span> = [];\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">batchSize\u003C/span> = \u003Cspan class=\"hljs-number\">50\u003C/span>;\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">processContentInBatches\u003C/span>(\u003Cspan class=\"hljs-params\">files\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> batches = [];\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">let\u003C/span> i = \u003Cspan class=\"hljs-number\">0\u003C/span>; i &lt; files.\u003Cspan class=\"hljs-property\">length\u003C/span>; i += \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">batchSize\u003C/span>) {\n            batches.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(files.\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(i, i + \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">batchSize\u003C/span>));\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> results = [];\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> batch \u003Cspan class=\"hljs-keyword\">of\u003C/span> batches) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> batchResults = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title class_\">Promise\u003C/span>.\u003Cspan class=\"hljs-title function_\">all\u003C/span>(\n                batch.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">file\u003C/span> =&gt;\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">processFile\u003C/span>(file))\n            );\n            results.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...batchResults);\n            \n            \u003Cspan class=\"hljs-comment\">// Yield control to prevent blocking\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Promise\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">resolve\u003C/span> =&gt;\u003C/span> \u003Cspan class=\"hljs-title function_\">setImmediate\u003C/span>(resolve));\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> results;\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-comment\">// Check cache first\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> stats = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">stat\u003C/span>(filePath);\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> cacheKey = \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${filePath}\u003C/span>_\u003Cspan class=\"hljs-subst\">${stats.mtime.getTime()}\u003C/span>`\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentCache\u003C/span>.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(cacheKey)) {\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentCache\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(cacheKey);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Process file\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">analyzeFile\u003C/span>(filePath);\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">contentCache\u003C/span>.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(cacheKey, result);\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> result;\n    }\n}\n\u003C/code>\u003C/pre>\u003Ch2 id=\"conclusion\">Conclusion\u003C/h2>\n\u003Cp>Advanced Markdown content organization and project structure design form the foundation of scalable documentation systems that maintain clarity, efficiency, and usability as content repositories grow. By implementing strategic organizational frameworks, automated classification systems, and semantic analysis tools, technical teams can create documentation architectures that support sustainable growth while providing excellent user experiences for both content creators and consumers.\u003C/p>\n\u003Cp>The key to successful content organization lies in balancing structure with flexibility, ensuring that organizational systems support current needs while adapting to future requirements. Whether you&#39;re managing small team documentation or enterprise-scale content repositories, the strategies and tools covered in this guide provide the foundation for building maintainable, discoverable, and professionally organized documentation systems.\u003C/p>\n\u003Cp>Remember to regularly audit your organizational structures, implement automated tools to maintain consistency, and continuously gather feedback from users to refine your organizational strategies. With proper implementation of advanced content organization techniques, your Markdown-based documentation can scale effectively while maintaining the simplicity and accessibility that makes Markdown such a powerful documentation format for teams of all sizes.\u003C/p>\n",[15,19,22,25,28,31,34],{"id":16,"text":17,"level":18},"why-master-content-organization-and-project-structure","Why Master Content Organization and Project Structure?",2,{"id":20,"text":21,"level":18},"foundation-organization-principles","Foundation Organization Principles",{"id":23,"text":24,"level":18},"scalable-project-architectures","Scalable Project Architectures",{"id":26,"text":27,"level":18},"integration-with-documentation-systems","Integration with Documentation Systems",{"id":29,"text":30,"level":18},"advanced-organization-strategies","Advanced Organization Strategies",{"id":32,"text":33,"level":18},"troubleshooting-organization-issues","Troubleshooting Organization Issues",{"id":35,"text":36,"level":18},"conclusion","Conclusion",[],[39,47,55],{"slug":40,"title":41,"description":42,"excerpt":43,"date":44,"category":9,"author":10,"keywords":45,"readingMinutes":46},"markdown-file-organization-project-structure-complete-guide","Markdown File Organization and Project Structure: Complete Guide for Scalable Documentation Systems","Master Markdown file organization strategies for large projects, teams, and documentation systems. Learn directory structures, naming conventions, content management patterns, and scalable organization principles.","Effective Markdown file organization forms the foundation of maintainable, scalable documentation systems that serve teams, users, and automated processes efficiently over time. Strategic…","2025-12-05","markdown file organization, markdown project structure, documentation organization, markdown directory structure, content management markdown, markdown naming conventions, documentation architecture",19,{"slug":48,"title":49,"description":50,"excerpt":51,"date":52,"category":9,"author":10,"keywords":53,"readingMinutes":54},"markdown-heading-hierarchy-navigation-complete-guide","Markdown Heading Hierarchy and Navigation: Complete Guide for Documentation Structure and Content Organization","Master advanced Markdown heading management techniques for creating structured documentation hierarchies, automated navigation systems, and consistent content organization. Learn heading best practices, anchor link generation, and navigation automation.","Advanced Markdown heading hierarchy and navigation systems enable sophisticated documentation architectures that provide clear content structure, intuitive navigation experiences, and scalable…","2025-10-18","markdown headings, markdown navigation, heading hierarchy, markdown table of contents, heading structure, markdown document organization, heading anchor links, markdown navigation systems",28,{"slug":56,"title":57,"description":58,"excerpt":59,"date":60,"category":9,"author":10,"keywords":61,"readingMinutes":46},"markdown-link-management-cross-referencing-complete-guide","Markdown Link Management and Cross-Referencing: Complete Guide for Documentation Systems and Content Organization","Master advanced Markdown link management techniques for documentation systems, cross-referencing content, and maintaining link integrity across large content repositories. Learn automated link validation, reference management, and organization strategies.","Advanced Markdown link management and cross-referencing systems enable sophisticated documentation architectures that maintain content relationships, ensure link integrity, and provide seamless…","2025-09-27","markdown link management, markdown cross references, documentation links, markdown references, link validation markdown, markdown link organization, content cross-referencing, markdown documentation systems",1792184943421]