[{"data":1,"prerenderedAt":112},["Reactive",2],{"blog-post-markdown-documentation-templates-and-standardization-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":86,"related":87},"markdown-documentation-templates-and-standardization-complete-guide","Markdown Documentation Templates and Standardization: Complete Guide for Consistent Technical Writing and Team Collaboration","Master Markdown documentation templates and standardization techniques for consistent technical writing workflows. Learn template design, style guides, automated validation, and team collaboration strategies for scalable documentation systems.","Advanced Markdown documentation templates and standardization systems enable consistent, high-quality technical writing across teams and organizations by establishing structured content…","2026-01-07","Tutorial","Matthew Rathbone","markdown templates, documentation standards, markdown style guide, technical writing templates, documentation automation, markdown consistency, team collaboration documentation, standardized markdown workflows",21,"\u003Cp>Advanced Markdown documentation templates and standardization systems enable consistent, high-quality technical writing across teams and organizations by establishing structured content frameworks, automated validation processes, and collaborative workflows. By implementing comprehensive template systems, style guides, and standardization tools, technical teams can ensure documentation consistency, reduce onboarding time, and maintain quality standards while scaling content creation across multiple contributors and documentation types.\u003C/p>\n\u003Ch2 id=\"why-master-markdown-documentation-templates\">Why Master Markdown Documentation Templates?\u003C/h2>\n\u003Cp>Professional documentation standardization provides essential benefits for technical teams:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Cstrong>Consistency Across Teams\u003C/strong>: Ensure uniform documentation structure and style regardless of author\u003C/li>\n\u003Cli>\u003Cstrong>Reduced Onboarding Time\u003C/strong>: New team members can quickly understand and follow established patterns\u003C/li>\n\u003Cli>\u003Cstrong>Quality Assurance\u003C/strong>: Automated validation ensures adherence to documentation standards\u003C/li>\n\u003Cli>\u003Cstrong>Content Discoverability\u003C/strong>: Standardized structures improve navigation and information architecture\u003C/li>\n\u003Cli>\u003Cstrong>Maintenance Efficiency\u003C/strong>: Consistent templates make documentation updates and maintenance more manageable\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"foundation-template-architecture\">Foundation Template Architecture\u003C/h2>\n\u003Ch3 id=\"basic-documentation-template-structure\">Basic Documentation Template Structure\u003C/h3>\n\u003Cp>Creating comprehensive base templates for different documentation types:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-markdown\">\u003Cspan class=\"hljs-section\"># Universal Documentation Template Structure\u003C/span>\n\n\u003Cspan class=\"hljs-section\">## API Documentation Template\u003C/span>\n\n\u003Cspan class=\"hljs-section\">```markdown\n---\u003C/span>\ntitle: &quot;[API Name] API Reference&quot;\ndescription: &quot;Complete API reference documentation for [API Name] including endpoints, authentication, and examples&quot;\nversion: &quot;1.0.0&quot;\napi\u003Cspan class=\"hljs-emphasis\">_version: &quot;v1&quot;\nkeywords: [api, reference, endpoints, authentication]\nlayout: api-documentation\ndate: YYYY-MM-DD\nauthor: [Author Name]\ncategory: API Reference\nstatus: published\nreview_\u003C/span>date: YYYY-MM-DD\n---\n\n\u003Cspan class=\"hljs-section\"># [API Name] API Reference\u003C/span>\n\nBrief description of what this API does and its primary use cases.\n\n\u003Cspan class=\"hljs-section\">## Quick Start\u003C/span>\n\n\u003Cspan class=\"hljs-code\">```bash\n# Basic authentication example\ncurl -H &quot;Authorization: Bearer YOUR_TOKEN&quot; \\\n     -H &quot;Content-Type: application/json&quot; \\\n     https://api.example.com/v1/users\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch2 id=\"authentication\">Authentication\u003C/h2>\n\u003Ch3 id=\"overview\">Overview\u003C/h3>\n\u003Cp>Describe authentication mechanism (API keys, OAuth, JWT, etc.)\u003C/p>\n\u003Ch3 id=\"getting-started\">Getting Started\u003C/h3>\n\u003Col>\n\u003Cli>\u003Ca href=\"registration-link\">Register for an account\u003C/a>\u003C/li>\n\u003Cli>Generate API credentials\u003C/li>\n\u003Cli>Include authentication header in requests\u003C/li>\n\u003C/ol>\n\u003Ch3 id=\"authentication-examples\">Authentication Examples\u003C/h3>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># API Key Authentication\u003C/span>\ncurl -H \u003Cspan class=\"hljs-string\">&quot;X-API-Key: your_api_key&quot;\u003C/span> https://api.example.com/v1/endpoint\n\n\u003Cspan class=\"hljs-comment\"># Bearer Token Authentication  \u003C/span>\ncurl -H \u003Cspan class=\"hljs-string\">&quot;Authorization: Bearer your_token&quot;\u003C/span> https://api.example.com/v1/endpoint\n\u003C/code>\u003C/pre>\u003Ch2 id=\"endpoints\">Endpoints\u003C/h2>\n\u003Ch3 id=\"users\">Users\u003C/h3>\n\u003Ch4 id=\"get-users\">GET /users\u003C/h4>\n\u003Cp>Retrieve a list of users.\u003C/p>\n\u003Cp>\u003Cstrong>Parameters:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"table-responsive\">\u003Ctable class=\"table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Parameter\u003C/th>\n\u003Cth>Type\u003C/th>\n\u003Cth>Required\u003C/th>\n\u003Cth>Description\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>limit\u003C/code>\u003C/td>\n\u003Ctd>integer\u003C/td>\n\u003Ctd>No\u003C/td>\n\u003Ctd>Number of users to return (default: 20, max: 100)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>offset\u003C/code>\u003C/td>\n\u003Ctd>integer\u003C/td>\n\u003Ctd>No\u003C/td>\n\u003Ctd>Number of users to skip (default: 0)\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>status\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>No\u003C/td>\n\u003Ctd>Filter by user status (\u003Ccode>active\u003C/code>, \u003Ccode>inactive\u003C/code>, \u003Ccode>pending\u003C/code>)\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\u003C/div>\n\u003Cp>\u003Cstrong>Request Example:\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">curl -X GET \u003Cspan class=\"hljs-string\">&quot;https://api.example.com/v1/users?limit=10&amp;status=active&quot;\u003C/span> \\\n     -H \u003Cspan class=\"hljs-string\">&quot;Authorization: Bearer YOUR_TOKEN&quot;\u003C/span>\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>Response Example:\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-json\">\u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n  \u003Cspan class=\"hljs-attr\">&quot;data&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-punctuation\">[\u003C/span>\n    \u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;id&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;user_123&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;name&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;John Doe&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;email&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;john@example.com&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;status&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;active&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;created_at&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;2023-01-15T10:30:00Z&quot;\u003C/span>\n    \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n  \u003Cspan class=\"hljs-punctuation\">]\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n  \u003Cspan class=\"hljs-attr\">&quot;pagination&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;limit&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-number\">10\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;offset&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-number\">0\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;total&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-number\">150\u003C/span>\n  \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>Response Fields:\u003C/strong>\u003C/p>\n\u003Cdiv class=\"table-responsive\">\u003Ctable class=\"table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Field\u003C/th>\n\u003Cth>Type\u003C/th>\n\u003Cth>Description\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>id\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>Unique user identifier\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>name\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>User&#39;s full name\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>email\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>User&#39;s email address\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>status\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>Account status\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>created_at\u003C/code>\u003C/td>\n\u003Ctd>string\u003C/td>\n\u003Ctd>ISO 8601 timestamp of account creation\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\u003C/div>\n\u003Ch4 id=\"post-users\">POST /users\u003C/h4>\n\u003Cp>Create a new user.\u003C/p>\n\u003Cp>[Similar structure for each endpoint...]\u003C/p>\n\u003Ch2 id=\"error-handling\">Error Handling\u003C/h2>\n\u003Ch3 id=\"error-response-format\">Error Response Format\u003C/h3>\n\u003Cp>All error responses follow this structure:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-json\">\u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n  \u003Cspan class=\"hljs-attr\">&quot;error&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;code&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;ERROR_CODE&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;message&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Human-readable error description&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;details&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n      \u003Cspan class=\"hljs-attr\">&quot;field&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;Additional context about the error&quot;\u003C/span>\n    \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n  \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"common-error-codes\">Common Error Codes\u003C/h3>\n\u003Cdiv class=\"table-responsive\">\u003Ctable class=\"table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Code\u003C/th>\n\u003Cth>HTTP Status\u003C/th>\n\u003Cth>Description\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>INVALID_TOKEN\u003C/code>\u003C/td>\n\u003Ctd>401\u003C/td>\n\u003Ctd>Authentication token is invalid or expired\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>RATE_LIMIT_EXCEEDED\u003C/code>\u003C/td>\n\u003Ctd>429\u003C/td>\n\u003Ctd>Too many requests, see rate limiting section\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>VALIDATION_ERROR\u003C/code>\u003C/td>\n\u003Ctd>422\u003C/td>\n\u003Ctd>Request validation failed\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\u003C/div>\n\u003Ch2 id=\"rate-limiting\">Rate Limiting\u003C/h2>\n\u003Cp>API requests are limited to 1000 requests per hour per API key.\u003C/p>\n\u003Cp>Rate limit headers:\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ccode>X-RateLimit-Limit\u003C/code>: Total requests allowed per hour\u003C/li>\n\u003Cli>\u003Ccode>X-RateLimit-Remaining\u003C/code>: Requests remaining in current window\u003C/li>\n\u003Cli>\u003Ccode>X-RateLimit-Reset\u003C/code>: Unix timestamp when the rate limit resets\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"sdks-and-libraries\">SDKs and Libraries\u003C/h2>\n\u003Ch3 id=\"official-sdks\">Official SDKs\u003C/h3>\n\u003Cul>\n\u003Cli>\u003Ca href=\"link-to-js-sdk\">JavaScript SDK\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"link-to-python-sdk\">Python SDK\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"link-to-go-sdk\">Go SDK\u003C/a>\u003C/li>\n\u003C/ul>\n\u003Ch3 id=\"quick-sdk-examples\">Quick SDK Examples\u003C/h3>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// JavaScript\u003C/span>\n\u003Cspan class=\"hljs-keyword\">import\u003C/span> { \u003Cspan class=\"hljs-title class_\">ApiClient\u003C/span> } \u003Cspan class=\"hljs-keyword\">from\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;@company/api-client&#x27;\u003C/span>;\n\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> client = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">ApiClient\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;your_api_token&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> users = \u003Cspan class=\"hljs-keyword\">await\u003C/span> client.\u003Cspan class=\"hljs-property\">users\u003C/span>.\u003Cspan class=\"hljs-title function_\">list\u003C/span>({ \u003Cspan class=\"hljs-attr\">limit\u003C/span>: \u003Cspan class=\"hljs-number\">10\u003C/span> });\n\u003C/code>\u003C/pre>\u003Cpre>\u003Ccode class=\"hljs language-python\">\u003Cspan class=\"hljs-comment\"># Python\u003C/span>\n\u003Cspan class=\"hljs-keyword\">from\u003C/span> company_api \u003Cspan class=\"hljs-keyword\">import\u003C/span> ApiClient\n\nclient = ApiClient(\u003Cspan class=\"hljs-string\">&#x27;your_api_token&#x27;\u003C/span>)\nusers = client.users.\u003Cspan class=\"hljs-built_in\">list\u003C/span>(limit=\u003Cspan class=\"hljs-number\">10\u003C/span>)\n\u003C/code>\u003C/pre>\u003Ch2 id=\"support\">Support\u003C/h2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"status-link\">API Status Page\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"community-link\">Developer Community\u003C/a>  \u003C/li>\n\u003Cli>\u003Ca href=\"support-link\">Contact Support\u003C/a>\u003C/li>\n\u003C/ul>\n\u003Chr>\n\u003Cp>\u003Cstrong>Last Updated:\u003C/strong> [Current Date]\u003Cbr>\u003Cstrong>API Version:\u003C/strong> [Current Version]\u003C/p>\n\u003Cpre>\u003Ccode>\n## User Guide Template\n\n```markdown\n---\ntitle: &quot;[Product Name] User Guide&quot;\ndescription: &quot;Complete user guide for [Product Name] covering installation, configuration, and common use cases&quot;\nkeywords: [user guide, tutorial, how-to, setup]\nlayout: user-guide\ndate: YYYY-MM-DD\nauthor: [Author Name]\ncategory: User Guide\naudience: end-users\ndifficulty: beginner\nestimated_time: &quot;30 minutes&quot;\nprerequisites: []\n---\n\n# [Product Name] User Guide\n\nWelcome to [Product Name]! This guide will help you get started and make the most of all features.\n\n## What You&#39;ll Learn\n\nBy the end of this guide, you&#39;ll be able to:\n\n- [ ] Install and configure [Product Name]\n- [ ] Complete basic tasks and workflows\n- [ ] Understand key concepts and terminology\n- [ ] Troubleshoot common issues\n\n## Prerequisites\n\nBefore starting, ensure you have:\n\n- [ ] [Requirement 1]\n- [ ] [Requirement 2]\n- [ ] [Requirement 3]\n\n**Estimated Time:** 30 minutes\n\n## Getting Started\n\n### Installation\n\n#### Option 1: Quick Install (Recommended)\n\n```bash\n# Platform-specific installation command\nnpm install -g product-name\n\u003C/code>\u003C/pre>\u003Ch4 id=\"option-2-manual-installation\">Option 2: Manual Installation\u003C/h4>\n\u003Col>\n\u003Cli>Download the latest release from \u003Ca href=\"link\">releases page\u003C/a>\u003C/li>\n\u003Cli>Extract the archive to your preferred directory\u003C/li>\n\u003Cli>Add the directory to your PATH\u003C/li>\n\u003C/ol>\n\u003Ch3 id=\"initial-configuration\">Initial Configuration\u003C/h3>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Create Configuration File\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name init\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Configure Basic Settings\u003C/strong>\u003C/p>\n\u003Cp>Edit the generated configuration file:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># config.yml\u003C/span>\n\u003Cspan class=\"hljs-attr\">api_endpoint:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;https://api.example.com&quot;\u003C/span>\n\u003Cspan class=\"hljs-attr\">authentication:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">method:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;api_key&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">api_key:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;your_api_key_here&quot;\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">defaults:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">output_format:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;json&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">timeout:\u003C/span> \u003Cspan class=\"hljs-number\">30\u003C/span>\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Verify Installation\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name --version\nproduct-name status\n\u003C/code>\u003C/pre>\u003C/li>\n\u003C/ol>\n\u003Ch2 id=\"core-concepts\">Core Concepts\u003C/h2>\n\u003Ch3 id=\"key-terminology\">Key Terminology\u003C/h3>\n\u003Cdiv class=\"table-responsive\">\u003Ctable class=\"table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Term\u003C/th>\n\u003Cth>Definition\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Cstrong>Workspace\u003C/strong>\u003C/td>\n\u003Ctd>A collection of related projects and configurations\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Project\u003C/strong>\u003C/td>\n\u003Ctd>An individual unit of work within a workspace\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Cstrong>Template\u003C/strong>\u003C/td>\n\u003Ctd>Pre-configured project structure for quick setup\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\u003C/div>\n\u003Ch3 id=\"basic-workflow\">Basic Workflow\u003C/h3>\n\u003Cp>The typical workflow follows this pattern:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cstrong>Initialize\u003C/strong> - Create a new workspace or project\u003C/li>\n\u003Cli>\u003Cstrong>Configure\u003C/strong> - Set up project-specific settings\u003C/li>\n\u003Cli>\u003Cstrong>Execute\u003C/strong> - Run operations on your data/content\u003C/li>\n\u003Cli>\u003Cstrong>Review\u003C/strong> - Validate results and make adjustments\u003C/li>\n\u003Cli>\u003Cstrong>Deploy\u003C/strong> - Publish or export final results\u003C/li>\n\u003C/ol>\n\u003Ch2 id=\"common-tasks\">Common Tasks\u003C/h2>\n\u003Ch3 id=\"task-1-creating-your-first-project\">Task 1: Creating Your First Project\u003C/h3>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Initialize New Project\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name create project my-first-project\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Select Template\u003C/strong>\u003C/p>\n\u003Cp>Choose from available templates:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name templates list\nproduct-name create project my-project --template=basic\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Customize Configuration\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-built_in\">cd\u003C/span> my-first-project\nproduct-name config \u003Cspan class=\"hljs-built_in\">set\u003C/span> environment production\n\u003C/code>\u003C/pre>\u003C/li>\n\u003C/ol>\n\u003Ch3 id=\"task-2-working-with-data\">Task 2: Working with Data\u003C/h3>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Import Data\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name import --\u003Cspan class=\"hljs-built_in\">source\u003C/span>=data.csv --format=csv\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Transform Data\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name transform --operation=normalize\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Export Results\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name \u003Cspan class=\"hljs-built_in\">export\u003C/span> --format=json --output=results.json\n\u003C/code>\u003C/pre>\u003C/li>\n\u003C/ol>\n\u003Ch3 id=\"task-3-managing-multiple-projects\">Task 3: Managing Multiple Projects\u003C/h3>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>List Projects\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name projects list\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Switch Between Projects\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name projects switch my-other-project\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Project Status\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">product-name projects status --all\n\u003C/code>\u003C/pre>\u003C/li>\n\u003C/ol>\n\u003Ch2 id=\"advanced-features\">Advanced Features\u003C/h2>\n\u003Ch3 id=\"custom-templates\">Custom Templates\u003C/h3>\n\u003Cp>Create reusable project templates:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Create template from existing project\u003C/span>\nproduct-name templates create --from-project=my-project --name=my-template\n\n\u003Cspan class=\"hljs-comment\"># Use custom template\u003C/span>\nproduct-name create project new-project --template=my-template\n\u003C/code>\u003C/pre>\u003Ch3 id=\"automation-and-scripting\">Automation and Scripting\u003C/h3>\n\u003Cp>Automate common workflows:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-meta\">#!/bin/bash\u003C/span>\n\u003Cspan class=\"hljs-comment\"># automation-script.sh\u003C/span>\n\n\u003Cspan class=\"hljs-comment\"># Batch process multiple files\u003C/span>\n\u003Cspan class=\"hljs-keyword\">for\u003C/span> file \u003Cspan class=\"hljs-keyword\">in\u003C/span> *.csv; \u003Cspan class=\"hljs-keyword\">do\u003C/span>\n    product-name import --\u003Cspan class=\"hljs-built_in\">source\u003C/span>=\u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">$file\u003C/span>&quot;\u003C/span>\n    product-name transform --operation=normalize\n    product-name \u003Cspan class=\"hljs-built_in\">export\u003C/span> --output=\u003Cspan class=\"hljs-string\">&quot;\u003Cspan class=\"hljs-variable\">${file%.csv}\u003C/span>_processed.json&quot;\u003C/span>\n\u003Cspan class=\"hljs-keyword\">done\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"integration-with-other-tools\">Integration with Other Tools\u003C/h3>\n\u003Ch4 id=\"git-integration\">Git Integration\u003C/h4>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Initialize git repo with project\u003C/span>\nproduct-name create project my-project --with-git\n\n\u003Cspan class=\"hljs-comment\"># Auto-commit changes\u003C/span>\nproduct-name config \u003Cspan class=\"hljs-built_in\">set\u003C/span> git.auto_commit \u003Cspan class=\"hljs-literal\">true\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch4 id=\"cicd-integration\">CI/CD Integration\u003C/h4>\n\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># .github/workflows/process.yml\u003C/span>\n\u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">Process\u003C/span> \u003Cspan class=\"hljs-string\">Data\u003C/span>\n\u003Cspan class=\"hljs-attr\">on:\u003C/span> [\u003Cspan class=\"hljs-string\">push\u003C/span>]\n\u003Cspan class=\"hljs-attr\">jobs:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">process:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">runs-on:\u003C/span> \u003Cspan class=\"hljs-string\">ubuntu-latest\u003C/span>\n    \u003Cspan class=\"hljs-attr\">steps:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">uses:\u003C/span> \u003Cspan class=\"hljs-string\">actions/checkout@v2\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">Install\u003C/span> \u003Cspan class=\"hljs-string\">Product\u003C/span>\n        \u003Cspan class=\"hljs-attr\">run:\u003C/span> \u003Cspan class=\"hljs-string\">npm\u003C/span> \u003Cspan class=\"hljs-string\">install\u003C/span> \u003Cspan class=\"hljs-string\">-g\u003C/span> \u003Cspan class=\"hljs-string\">product-name\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-attr\">name:\u003C/span> \u003Cspan class=\"hljs-string\">Process\u003C/span> \u003Cspan class=\"hljs-string\">Data\u003C/span>\n        \u003Cspan class=\"hljs-attr\">run:\u003C/span> \u003Cspan class=\"hljs-string\">product-name\u003C/span> \u003Cspan class=\"hljs-string\">process\u003C/span> \u003Cspan class=\"hljs-string\">--config=.github/config.yml\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch2 id=\"troubleshooting\">Troubleshooting\u003C/h2>\n\u003Ch3 id=\"common-issues\">Common Issues\u003C/h3>\n\u003Ch4 id=\"issue-installation-fails\">Issue: Installation Fails\u003C/h4>\n\u003Cp>\u003Cstrong>Symptoms:\u003C/strong> Error messages during installation\u003C/p>\n\u003Cp>\u003Cstrong>Solutions:\u003C/strong>\u003C/p>\n\u003Col>\n\u003Cli>Verify system requirements are met\u003C/li>\n\u003Cli>Check internet connection\u003C/li>\n\u003Cli>Try alternative installation method\u003C/li>\n\u003C/ol>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Alternative installation\u003C/span>\ncurl -sSL https://install.example.com/install.sh | bash\n\u003C/code>\u003C/pre>\u003Ch4 id=\"issue-configuration-not-loading\">Issue: Configuration Not Loading\u003C/h4>\n\u003Cp>\u003Cstrong>Symptoms:\u003C/strong> Application uses default settings instead of your config\u003C/p>\n\u003Cp>\u003Cstrong>Solutions:\u003C/strong>\u003C/p>\n\u003Col>\n\u003Cli>Verify config file location\u003C/li>\n\u003Cli>Check config file syntax\u003C/li>\n\u003Cli>Use absolute path\u003C/li>\n\u003C/ol>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Verify config location\u003C/span>\nproduct-name config show --path\n\n\u003Cspan class=\"hljs-comment\"># Validate config syntax  \u003C/span>\nproduct-name config validate\n\u003C/code>\u003C/pre>\u003Ch4 id=\"issue-poor-performance\">Issue: Poor Performance\u003C/h4>\n\u003Cp>\u003Cstrong>Symptoms:\u003C/strong> Slow execution times, timeouts\u003C/p>\n\u003Cp>\u003Cstrong>Solutions:\u003C/strong>\u003C/p>\n\u003Col>\n\u003Cli>Increase timeout values\u003C/li>\n\u003Cli>Process data in smaller batches\u003C/li>\n\u003Cli>Use parallel processing\u003C/li>\n\u003C/ol>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># Increase timeout\u003C/span>\nproduct-name config \u003Cspan class=\"hljs-built_in\">set\u003C/span> \u003Cspan class=\"hljs-built_in\">timeout\u003C/span> 300\n\n\u003Cspan class=\"hljs-comment\"># Process in batches\u003C/span>\nproduct-name process --batch-size=100\n\n\u003Cspan class=\"hljs-comment\"># Enable parallel processing\u003C/span>\nproduct-name config \u003Cspan class=\"hljs-built_in\">set\u003C/span> parallel.enabled \u003Cspan class=\"hljs-literal\">true\u003C/span>\nproduct-name config \u003Cspan class=\"hljs-built_in\">set\u003C/span> parallel.workers 4\n\u003C/code>\u003C/pre>\u003Ch3 id=\"getting-help\">Getting Help\u003C/h3>\n\u003Cul>\n\u003Cli>\u003Cstrong>Built-in Help:\u003C/strong> \u003Ccode>product-name help [command]\u003C/code>\u003C/li>\n\u003Cli>\u003Cstrong>Documentation:\u003C/strong> \u003Ca href=\"https://docs.example.com\">docs.example.com\u003C/a>\u003C/li>\n\u003Cli>\u003Cstrong>Community:\u003C/strong> \u003Ca href=\"https://community.example.com\">community.example.com\u003C/a>\u003C/li>\n\u003Cli>\u003Cstrong>Support:\u003C/strong> \u003Ca href=\"mailto:support@example.com\">support@example.com\u003C/a>\u003C/li>\n\u003C/ul>\n\u003Ch3 id=\"diagnostic-information\">Diagnostic Information\u003C/h3>\n\u003Cp>When reporting issues, include:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">\u003Cspan class=\"hljs-comment\"># System information\u003C/span>\nproduct-name info --system\n\n\u003Cspan class=\"hljs-comment\"># Configuration dump (remove sensitive data)\u003C/span>\nproduct-name config dump --sanitized\n\n\u003Cspan class=\"hljs-comment\"># Recent logs\u003C/span>\nproduct-name logs --last=50\n\u003C/code>\u003C/pre>\u003Ch2 id=\"next-steps\">Next Steps\u003C/h2>\n\u003Cp>Now that you&#39;re familiar with the basics:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Explore Advanced Features\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ca href=\"link-to-templates\">Custom Templates Guide\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"link-to-automation\">Automation Cookbook\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"link-to-integrations\">Integration Examples\u003C/a>\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Join the Community\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ca href=\"community-link\">User Forum\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"newsletter-link\">Newsletter\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"feature-requests-link\">Feature Requests\u003C/a>\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Stay Updated\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>\u003Ca href=\"releases-link\">Release Notes\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"migration-link\">Migration Guides\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"breaking-changes-link\">Breaking Changes\u003C/a>\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003C/ol>\n\u003Ch2 id=\"appendix\">Appendix\u003C/h2>\n\u003Ch3 id=\"configuration-reference\">Configuration Reference\u003C/h3>\n\u003Cp>Complete configuration options:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># Complete config.yml example\u003C/span>\n\u003Cspan class=\"hljs-attr\">api:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">endpoint:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;https://api.example.com&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">timeout:\u003C/span> \u003Cspan class=\"hljs-number\">30\u003C/span>\n  \u003Cspan class=\"hljs-attr\">retry_attempts:\u003C/span> \u003Cspan class=\"hljs-number\">3\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">authentication:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">method:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;api_key&quot;\u003C/span>  \u003Cspan class=\"hljs-comment\"># options: api_key, oauth, basic\u003C/span>\n  \u003Cspan class=\"hljs-attr\">api_key:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;your_key&quot;\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">processing:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">batch_size:\u003C/span> \u003Cspan class=\"hljs-number\">100\u003C/span>\n  \u003Cspan class=\"hljs-attr\">parallel_workers:\u003C/span> \u003Cspan class=\"hljs-number\">4\u003C/span>\n  \u003Cspan class=\"hljs-attr\">memory_limit:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;512MB&quot;\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">output:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">default_format:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;json&quot;\u003C/span>  \u003Cspan class=\"hljs-comment\"># options: json, csv, xml\u003C/span>\n  \u003Cspan class=\"hljs-attr\">compression:\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\">logging:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">level:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;info&quot;\u003C/span>  \u003Cspan class=\"hljs-comment\"># options: debug, info, warn, error\u003C/span>\n  \u003Cspan class=\"hljs-attr\">file:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;logs/app.log&quot;\u003C/span>\n  \u003Cspan class=\"hljs-attr\">max_size:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;10MB&quot;\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"command-reference\">Command Reference\u003C/h3>\n\u003Cp>Quick reference for all commands:\u003C/p>\n\u003Cdiv class=\"table-responsive\">\u003Ctable class=\"table\">\n\u003Cthead>\n\u003Ctr>\n\u003Cth>Command\u003C/th>\n\u003Cth>Description\u003C/th>\n\u003Cth>Example\u003C/th>\n\u003C/tr>\n\u003C/thead>\n\u003Ctbody>\u003Ctr>\n\u003Ctd>\u003Ccode>init\u003C/code>\u003C/td>\n\u003Ctd>Initialize new workspace\u003C/td>\n\u003Ctd>\u003Ccode>product-name init\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>create\u003C/code>\u003C/td>\n\u003Ctd>Create new project\u003C/td>\n\u003Ctd>\u003Ccode>product-name create project my-project\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>import\u003C/code>\u003C/td>\n\u003Ctd>Import data from external source\u003C/td>\n\u003Ctd>\u003Ccode>product-name import --source=data.csv\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>export\u003C/code>\u003C/td>\n\u003Ctd>Export processed data\u003C/td>\n\u003Ctd>\u003Ccode>product-name export --format=json\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>config\u003C/code>\u003C/td>\n\u003Ctd>Manage configuration\u003C/td>\n\u003Ctd>\u003Ccode>product-name config set key value\u003C/code>\u003C/td>\n\u003C/tr>\n\u003Ctr>\n\u003Ctd>\u003Ccode>status\u003C/code>\u003C/td>\n\u003Ctd>Show current status\u003C/td>\n\u003Ctd>\u003Ccode>product-name status\u003C/code>\u003C/td>\n\u003C/tr>\n\u003C/tbody>\u003C/table>\u003C/div>\n\u003Chr>\n\u003Cp>\u003Cstrong>Last Updated:\u003C/strong> [Current Date]\u003Cbr>\u003Cstrong>Version:\u003C/strong> [Product Version]\u003C/p>\n\u003Cpre>\u003Ccode>\n## Tutorial Template\n\n```markdown\n---\ntitle: &quot;[Tutorial Topic]: Step-by-Step Guide&quot;\ndescription: &quot;Learn [specific skill/concept] with this comprehensive step-by-step tutorial including examples and best practices&quot;\nkeywords: [tutorial, how-to, step-by-step, guide]\nlayout: tutorial\ndate: YYYY-MM-DD\nauthor: [Author Name]\ncategory: Tutorial\ndifficulty: [beginner/intermediate/advanced]\nestimated_time: &quot;[X] minutes&quot;\nprerequisites: [list of requirements]\ntechnologies: [list of tech stack]\n---\n\n# [Tutorial Topic]: Step-by-Step Guide\n\nLearn how to [accomplish specific goal] with this comprehensive tutorial.\n\n## What You&#39;ll Build\n\nBy the end of this tutorial, you&#39;ll have created:\n\n- [ ] [Specific deliverable 1]\n- [ ] [Specific deliverable 2]  \n- [ ] [Specific deliverable 3]\n\n**Preview:** [Link to final result or demo]\n\n## Prerequisites\n\nBefore starting this tutorial, you should have:\n\n- [ ] [Prerequisite 1] - [Link to resource]\n- [ ] [Prerequisite 2] - [Link to resource]\n- [ ] [Prerequisite 3] - [Link to resource]\n\n**Estimated Time:** [X] minutes\n**Difficulty:** [Level]\n\n## Step 1: Initial Setup\n\n### 1.1 Create Project Structure\n\nFirst, create the basic project structure:\n\n```bash\nmkdir my-project\ncd my-project\nmkdir src tests docs\ntouch README.md\n\u003C/code>\u003C/pre>\u003Cp>Your directory should look like this:\u003C/p>\n\u003Cpre>\u003Ccode>my-project/\n├── src/\n├── tests/\n├── docs/\n└── README.md\n\u003C/code>\u003C/pre>\u003Ch3 id=\"12-initialize-dependencies\">1.2 Initialize Dependencies\u003C/h3>\n\u003Cp>Install required dependencies:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">npm init -y\nnpm install dependency1 dependency2\nnpm install --save-dev dev-dependency1 dev-dependency2\n\u003C/code>\u003C/pre>\u003Ch3 id=\"13-configuration-files\">1.3 Configuration Files\u003C/h3>\n\u003Cp>Create the main configuration file:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-json\">\u003Cspan class=\"hljs-comment\">// package.json additions\u003C/span>\n\u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n  \u003Cspan class=\"hljs-attr\">&quot;scripts&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-punctuation\">{\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;start&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;node src/index.js&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;test&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;jest&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">,\u003C/span>\n    \u003Cspan class=\"hljs-attr\">&quot;build&quot;\u003C/span>\u003Cspan class=\"hljs-punctuation\">:\u003C/span> \u003Cspan class=\"hljs-string\">&quot;webpack --mode=production&quot;\u003C/span>\n  \u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003Cspan class=\"hljs-punctuation\">}\u003C/span>\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>✅ Checkpoint:\u003C/strong> You should now have a basic project structure with dependencies installed.\u003C/p>\n\u003Ch2 id=\"step-2-core-implementation\">Step 2: Core Implementation\u003C/h2>\n\u003Ch3 id=\"21-create-main-module\">2.1 Create Main Module\u003C/h3>\n\u003Cp>Create the main application file:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// src/index.js\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> express = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;express&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> app = \u003Cspan class=\"hljs-title function_\">express\u003C/span>();\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> \u003Cspan class=\"hljs-variable constant_\">PORT\u003C/span> = process.\u003Cspan class=\"hljs-property\">env\u003C/span>.\u003Cspan class=\"hljs-property\">PORT\u003C/span> || \u003Cspan class=\"hljs-number\">3000\u003C/span>;\n\n\u003Cspan class=\"hljs-comment\">// Middleware\u003C/span>\napp.\u003Cspan class=\"hljs-title function_\">use\u003C/span>(express.\u003Cspan class=\"hljs-title function_\">json\u003C/span>());\napp.\u003Cspan class=\"hljs-title function_\">use\u003C/span>(express.\u003Cspan class=\"hljs-title function_\">static\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;public&#x27;\u003C/span>));\n\n\u003Cspan class=\"hljs-comment\">// Routes\u003C/span>\napp.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">req, res\u003C/span>) =&gt;\u003C/span> {\n    res.\u003Cspan class=\"hljs-title function_\">json\u003C/span>({ \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Hello World!&#x27;\u003C/span> });\n});\n\n\u003Cspan class=\"hljs-comment\">// Error handling middleware\u003C/span>\napp.\u003Cspan class=\"hljs-title function_\">use\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">err, req, res, next\u003C/span>) =&gt;\u003C/span> {\n    \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(err.\u003Cspan class=\"hljs-property\">stack\u003C/span>);\n    res.\u003Cspan class=\"hljs-title function_\">status\u003C/span>(\u003Cspan class=\"hljs-number\">500\u003C/span>).\u003Cspan class=\"hljs-title function_\">json\u003C/span>({ \u003Cspan class=\"hljs-attr\">error\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Something went wrong!&#x27;\u003C/span> });\n});\n\napp.\u003Cspan class=\"hljs-title function_\">listen\u003C/span>(\u003Cspan class=\"hljs-variable constant_\">PORT\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n    \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Server running on port \u003Cspan class=\"hljs-subst\">${PORT}\u003C/span>`\u003C/span>);\n});\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = app;\n\u003C/code>\u003C/pre>\u003Ch3 id=\"22-add-core-functionality\">2.2 Add Core Functionality\u003C/h3>\n\u003Cp>Implement the main features:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// src/utils.js\u003C/span>\n\u003Cspan class=\"hljs-keyword\">function\u003C/span> \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>(\u003Cspan class=\"hljs-params\">data\u003C/span>) {\n    \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!data || \u003Cspan class=\"hljs-keyword\">typeof\u003C/span> data !== \u003Cspan class=\"hljs-string\">&#x27;object&#x27;\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">throw\u003C/span> \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Error\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Invalid input: data must be an object&#x27;\u003C/span>);\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">const\u003C/span> required = [\u003Cspan class=\"hljs-string\">&#x27;name&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;email&#x27;\u003C/span>];\n    \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> field \u003Cspan class=\"hljs-keyword\">of\u003C/span> required) {\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!data[field]) {\n            \u003Cspan class=\"hljs-keyword\">throw\u003C/span> \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Error\u003C/span>(\u003Cspan class=\"hljs-string\">`Missing required field: \u003Cspan class=\"hljs-subst\">${field}\u003C/span>`\u003C/span>);\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n}\n\n\u003Cspan class=\"hljs-keyword\">function\u003C/span> \u003Cspan class=\"hljs-title function_\">processData\u003C/span>(\u003Cspan class=\"hljs-params\">data\u003C/span>) {\n    \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>(data);\n    \n    \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n        \u003Cspan class=\"hljs-attr\">id\u003C/span>: \u003Cspan class=\"hljs-title class_\">Date\u003C/span>.\u003Cspan class=\"hljs-title function_\">now\u003C/span>(),\n        ...data,\n        \u003Cspan class=\"hljs-attr\">processed_at\u003C/span>: \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Date\u003C/span>().\u003Cspan class=\"hljs-title function_\">toISOString\u003C/span>()\n    };\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = { validateInput, processData };\n\u003C/code>\u003C/pre>\u003Ch3 id=\"23-test-your-implementation\">2.3 Test Your Implementation\u003C/h3>\n\u003Cp>Create tests to verify functionality:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// tests/utils.test.js\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> { validateInput, processData } = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;../src/utils&#x27;\u003C/span>);\n\n\u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Utility Functions&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;validateInput&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should accept valid input&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> validData = { \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;John&#x27;\u003C/span>, \u003Cspan class=\"hljs-attr\">email\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;john@example.com&#x27;\u003C/span> };\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>(validData)).\u003Cspan class=\"hljs-property\">not\u003C/span>.\u003Cspan class=\"hljs-title function_\">toThrow\u003C/span>();\n        });\n        \n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should reject invalid input&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>(\u003Cspan class=\"hljs-literal\">null\u003C/span>)).\u003Cspan class=\"hljs-title function_\">toThrow\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Invalid input&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>({})).\u003Cspan class=\"hljs-title function_\">toThrow\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Missing required field&#x27;\u003C/span>);\n        });\n    });\n    \n    \u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;processData&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should process valid data correctly&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> input = { \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;John&#x27;\u003C/span>, \u003Cspan class=\"hljs-attr\">email\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;john@example.com&#x27;\u003C/span> };\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = \u003Cspan class=\"hljs-title function_\">processData\u003C/span>(input);\n            \n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(result).\u003Cspan class=\"hljs-title function_\">toHaveProperty\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;id&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(result).\u003Cspan class=\"hljs-title function_\">toHaveProperty\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;processed_at&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(result.\u003Cspan class=\"hljs-property\">name\u003C/span>).\u003Cspan class=\"hljs-title function_\">toBe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;John&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(result.\u003Cspan class=\"hljs-property\">email\u003C/span>).\u003Cspan class=\"hljs-title function_\">toBe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;john@example.com&#x27;\u003C/span>);\n        });\n    });\n});\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>✅ Checkpoint:\u003C/strong> Run \u003Ccode>npm test\u003C/code> to verify your implementation works correctly.\u003C/p>\n\u003Ch2 id=\"step-3-advanced-features\">Step 3: Advanced Features\u003C/h2>\n\u003Ch3 id=\"31-add-database-integration\">3.1 Add Database Integration\u003C/h3>\n\u003Cp>Set up database connection:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// src/database.js\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> sqlite3 = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;sqlite3&#x27;\u003C/span>).\u003Cspan class=\"hljs-title function_\">verbose\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\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">Database\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\">db\u003C/span> = \u003Cspan class=\"hljs-keyword\">new\u003C/span> sqlite3.\u003Cspan class=\"hljs-title class_\">Database\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;:memory:&#x27;\u003C/span>); \u003Cspan class=\"hljs-comment\">// Use file for persistence\u003C/span>\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">initialize\u003C/span>();\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">initialize\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> sql = \u003Cspan class=\"hljs-string\">`\n            CREATE TABLE IF NOT EXISTS users (\n                id INTEGER PRIMARY KEY AUTOINCREMENT,\n                name TEXT NOT NULL,\n                email TEXT UNIQUE NOT NULL,\n                created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n            )\n        `\u003C/span>;\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">db\u003C/span>.\u003Cspan class=\"hljs-title function_\">run\u003C/span>(sql, \u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">err\u003C/span>) =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (err) {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Database initialization error:&#x27;\u003C/span>, err);\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n                \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Database initialized successfully&#x27;\u003C/span>);\n            }\n        });\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">createUser\u003C/span>(\u003Cspan class=\"hljs-params\">userData\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\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, reject\u003C/span>) =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> sql = \u003Cspan class=\"hljs-string\">&#x27;INSERT INTO users (name, email) VALUES (?, ?)&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">db\u003C/span>.\u003Cspan class=\"hljs-title function_\">run\u003C/span>(sql, [userData.\u003Cspan class=\"hljs-property\">name\u003C/span>, userData.\u003Cspan class=\"hljs-property\">email\u003C/span>], \u003Cspan class=\"hljs-keyword\">function\u003C/span>(\u003Cspan class=\"hljs-params\">err\u003C/span>) {\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (err) {\n                    \u003Cspan class=\"hljs-title function_\">reject\u003C/span>(err);\n                } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n                    \u003Cspan class=\"hljs-title function_\">resolve\u003C/span>({ \u003Cspan class=\"hljs-attr\">id\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">lastID\u003C/span>, ...userData });\n                }\n            });\n        });\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">getUserById\u003C/span>(\u003Cspan class=\"hljs-params\">id\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\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, reject\u003C/span>) =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> sql = \u003Cspan class=\"hljs-string\">&#x27;SELECT * FROM users WHERE id = ?&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">db\u003C/span>.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(sql, [id], \u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">err, row\u003C/span>) =&gt;\u003C/span> {\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (err) {\n                    \u003Cspan class=\"hljs-title function_\">reject\u003C/span>(err);\n                } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n                    \u003Cspan class=\"hljs-title function_\">resolve\u003C/span>(row);\n                }\n            });\n        });\n    }\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = \u003Cspan class=\"hljs-title class_\">Database\u003C/span>;\n\u003C/code>\u003C/pre>\u003Ch3 id=\"32-update-main-application\">3.2 Update Main Application\u003C/h3>\n\u003Cp>Integrate database with your application:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// src/index.js (updated)\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> express = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;express&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> \u003Cspan class=\"hljs-title class_\">Database\u003C/span> = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;./database&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> { validateInput, processData } = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;./utils&#x27;\u003C/span>);\n\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> app = \u003Cspan class=\"hljs-title function_\">express\u003C/span>();\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> db = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Database\u003C/span>();\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> \u003Cspan class=\"hljs-variable constant_\">PORT\u003C/span> = process.\u003Cspan class=\"hljs-property\">env\u003C/span>.\u003Cspan class=\"hljs-property\">PORT\u003C/span> || \u003Cspan class=\"hljs-number\">3000\u003C/span>;\n\napp.\u003Cspan class=\"hljs-title function_\">use\u003C/span>(express.\u003Cspan class=\"hljs-title function_\">json\u003C/span>());\n\n\u003Cspan class=\"hljs-comment\">// Create user endpoint\u003C/span>\napp.\u003Cspan class=\"hljs-title function_\">post\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> (req, res) =&gt; {\n    \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n        \u003Cspan class=\"hljs-title function_\">validateInput\u003C/span>(req.\u003Cspan class=\"hljs-property\">body\u003C/span>);\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> user = \u003Cspan class=\"hljs-keyword\">await\u003C/span> db.\u003Cspan class=\"hljs-title function_\">createUser\u003C/span>(req.\u003Cspan class=\"hljs-property\">body\u003C/span>);\n        res.\u003Cspan class=\"hljs-title function_\">status\u003C/span>(\u003Cspan class=\"hljs-number\">201\u003C/span>).\u003Cspan class=\"hljs-title function_\">json\u003C/span>(user);\n    } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n        res.\u003Cspan class=\"hljs-title function_\">status\u003C/span>(\u003Cspan class=\"hljs-number\">400\u003C/span>).\u003Cspan class=\"hljs-title function_\">json\u003C/span>({ \u003Cspan class=\"hljs-attr\">error\u003C/span>: error.\u003Cspan class=\"hljs-property\">message\u003C/span> });\n    }\n});\n\n\u003Cspan class=\"hljs-comment\">// Get user endpoint\u003C/span>\napp.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users/:id&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> (req, res) =&gt; {\n    \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> user = \u003Cspan class=\"hljs-keyword\">await\u003C/span> db.\u003Cspan class=\"hljs-title function_\">getUserById\u003C/span>(\u003Cspan class=\"hljs-built_in\">parseInt\u003C/span>(req.\u003Cspan class=\"hljs-property\">params\u003C/span>.\u003Cspan class=\"hljs-property\">id\u003C/span>));\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!user) {\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> res.\u003Cspan class=\"hljs-title function_\">status\u003C/span>(\u003Cspan class=\"hljs-number\">404\u003C/span>).\u003Cspan class=\"hljs-title function_\">json\u003C/span>({ \u003Cspan class=\"hljs-attr\">error\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;User not found&#x27;\u003C/span> });\n        }\n        res.\u003Cspan class=\"hljs-title function_\">json\u003C/span>(user);\n    } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n        res.\u003Cspan class=\"hljs-title function_\">status\u003C/span>(\u003Cspan class=\"hljs-number\">500\u003C/span>).\u003Cspan class=\"hljs-title function_\">json\u003C/span>({ \u003Cspan class=\"hljs-attr\">error\u003C/span>: error.\u003Cspan class=\"hljs-property\">message\u003C/span> });\n    }\n});\n\n\u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-built_in\">require\u003C/span>.\u003Cspan class=\"hljs-property\">main\u003C/span> === \u003Cspan class=\"hljs-variable language_\">module\u003C/span>) {\n    app.\u003Cspan class=\"hljs-title function_\">listen\u003C/span>(\u003Cspan class=\"hljs-variable constant_\">PORT\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Server running on port \u003Cspan class=\"hljs-subst\">${PORT}\u003C/span>`\u003C/span>);\n    });\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = app;\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>✅ Checkpoint:\u003C/strong> Test your API endpoints using curl or a REST client.\u003C/p>\n\u003Ch2 id=\"step-4-testing-and-validation\">Step 4: Testing and Validation\u003C/h2>\n\u003Ch3 id=\"41-integration-tests\">4.1 Integration Tests\u003C/h3>\n\u003Cp>Create comprehensive tests:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// tests/integration.test.js\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> request = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;supertest&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> app = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;../src/index&#x27;\u003C/span>);\n\n\u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;API Integration Tests&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n    \u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;POST /users&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should create a new user&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> () =&gt; {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> userData = {\n                \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Test User&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">email\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;test@example.com&#x27;\u003C/span>\n            };\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> response = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">request\u003C/span>(app)\n                .\u003Cspan class=\"hljs-title function_\">post\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">send\u003C/span>(userData)\n                .\u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-number\">201\u003C/span>);\n            \n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(response.\u003Cspan class=\"hljs-property\">body\u003C/span>).\u003Cspan class=\"hljs-title function_\">toHaveProperty\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;id&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(response.\u003Cspan class=\"hljs-property\">body\u003C/span>.\u003Cspan class=\"hljs-property\">name\u003C/span>).\u003Cspan class=\"hljs-title function_\">toBe\u003C/span>(userData.\u003Cspan class=\"hljs-property\">name\u003C/span>);\n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(response.\u003Cspan class=\"hljs-property\">body\u003C/span>.\u003Cspan class=\"hljs-property\">email\u003C/span>).\u003Cspan class=\"hljs-title function_\">toBe\u003C/span>(userData.\u003Cspan class=\"hljs-property\">email\u003C/span>);\n        });\n        \n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should reject invalid user data&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> () =&gt; {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> invalidData = { \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Test User&#x27;\u003C/span> }; \u003Cspan class=\"hljs-comment\">// missing email\u003C/span>\n            \n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">request\u003C/span>(app)\n                .\u003Cspan class=\"hljs-title function_\">post\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">send\u003C/span>(invalidData)\n                .\u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-number\">400\u003C/span>);\n        });\n    });\n    \n    \u003Cspan class=\"hljs-title function_\">describe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;GET /users/:id&#x27;\u003C/span>, \u003Cspan class=\"hljs-function\">() =&gt;\u003C/span> {\n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should retrieve existing user&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> () =&gt; {\n            \u003Cspan class=\"hljs-comment\">// First create a user\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> createResponse = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">request\u003C/span>(app)\n                .\u003Cspan class=\"hljs-title function_\">post\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">send\u003C/span>({ \u003Cspan class=\"hljs-attr\">name\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Test User&#x27;\u003C/span>, \u003Cspan class=\"hljs-attr\">email\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;get@example.com&#x27;\u003C/span> });\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> userId = createResponse.\u003Cspan class=\"hljs-property\">body\u003C/span>.\u003Cspan class=\"hljs-property\">id\u003C/span>;\n            \n            \u003Cspan class=\"hljs-comment\">// Then retrieve it\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> getResponse = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">request\u003C/span>(app)\n                .\u003Cspan class=\"hljs-title function_\">get\u003C/span>(\u003Cspan class=\"hljs-string\">`/users/\u003Cspan class=\"hljs-subst\">${userId}\u003C/span>`\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-number\">200\u003C/span>);\n            \n            \u003Cspan class=\"hljs-title function_\">expect\u003C/span>(getResponse.\u003Cspan class=\"hljs-property\">body\u003C/span>.\u003Cspan class=\"hljs-property\">name\u003C/span>).\u003Cspan class=\"hljs-title function_\">toBe\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Test User&#x27;\u003C/span>);\n        });\n        \n        \u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;should return 404 for non-existent user&#x27;\u003C/span>, \u003Cspan class=\"hljs-keyword\">async\u003C/span> () =&gt; {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-title function_\">request\u003C/span>(app)\n                .\u003Cspan class=\"hljs-title function_\">get\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;/users/99999&#x27;\u003C/span>)\n                .\u003Cspan class=\"hljs-title function_\">expect\u003C/span>(\u003Cspan class=\"hljs-number\">404\u003C/span>);\n        });\n    });\n});\n\u003C/code>\u003C/pre>\u003Ch3 id=\"42-manual-testing\">4.2 Manual Testing\u003C/h3>\n\u003Cp>Test your application manually:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Start the server:\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">npm start\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Create a user:\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">curl -X POST http://localhost:3000/users \\\n     -H \u003Cspan class=\"hljs-string\">&quot;Content-Type: application/json&quot;\u003C/span> \\\n     -d \u003Cspan class=\"hljs-string\">&#x27;{&quot;name&quot;:&quot;John Doe&quot;,&quot;email&quot;:&quot;john@example.com&quot;}&#x27;\u003C/span>\n\u003C/code>\u003C/pre>\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Retrieve the user:\u003C/strong>\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-bash\">curl http://localhost:3000/users/1\n\u003C/code>\u003C/pre>\u003C/li>\n\u003C/ol>\n\u003Cp>\u003Cstrong>✅ Checkpoint:\u003C/strong> All tests should pass and manual testing should work correctly.\u003C/p>\n\u003Ch2 id=\"step-5-deployment-and-documentation\">Step 5: Deployment and Documentation\u003C/h2>\n\u003Ch3 id=\"51-prepare-for-production\">5.1 Prepare for Production\u003C/h3>\n\u003Cp>Create production configuration:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-dockerfile\">\u003Cspan class=\"hljs-comment\"># Dockerfile\u003C/span>\n\u003Cspan class=\"hljs-keyword\">FROM\u003C/span> node:\u003Cspan class=\"hljs-number\">18\u003C/span>-alpine\n\n\u003Cspan class=\"hljs-keyword\">WORKDIR\u003C/span>\u003Cspan class=\"language-bash\"> /app\u003C/span>\n\n\u003Cspan class=\"hljs-keyword\">COPY\u003C/span>\u003Cspan class=\"language-bash\"> package*.json ./\u003C/span>\n\u003Cspan class=\"hljs-keyword\">RUN\u003C/span>\u003Cspan class=\"language-bash\"> npm ci --only=production\u003C/span>\n\n\u003Cspan class=\"hljs-keyword\">COPY\u003C/span>\u003Cspan class=\"language-bash\"> src/ ./src/\u003C/span>\n\u003Cspan class=\"hljs-keyword\">COPY\u003C/span>\u003Cspan class=\"language-bash\"> . .\u003C/span>\n\n\u003Cspan class=\"hljs-keyword\">EXPOSE\u003C/span> \u003Cspan class=\"hljs-number\">3000\u003C/span>\n\n\u003Cspan class=\"hljs-keyword\">CMD\u003C/span>\u003Cspan class=\"language-bash\"> [\u003Cspan class=\"hljs-string\">&quot;npm&quot;\u003C/span>, \u003Cspan class=\"hljs-string\">&quot;start&quot;\u003C/span>]\u003C/span>\n\u003C/code>\u003C/pre>\u003Cpre>\u003Ccode class=\"hljs language-yaml\">\u003Cspan class=\"hljs-comment\"># docker-compose.yml\u003C/span>\n\u003Cspan class=\"hljs-attr\">version:\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;3.8&#x27;\u003C/span>\n\n\u003Cspan class=\"hljs-attr\">services:\u003C/span>\n  \u003Cspan class=\"hljs-attr\">app:\u003C/span>\n    \u003Cspan class=\"hljs-attr\">build:\u003C/span> \u003Cspan class=\"hljs-string\">.\u003C/span>\n    \u003Cspan class=\"hljs-attr\">ports:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">&quot;3000:3000&quot;\u003C/span>\n    \u003Cspan class=\"hljs-attr\">environment:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">NODE_ENV=production\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">PORT=3000\u003C/span>\n    \u003Cspan class=\"hljs-attr\">volumes:\u003C/span>\n      \u003Cspan class=\"hljs-bullet\">-\u003C/span> \u003Cspan class=\"hljs-string\">./data:/app/data\u003C/span>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"52-update-documentation\">5.2 Update Documentation\u003C/h3>\n\u003Cp>Create comprehensive documentation:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-markdown\">&lt;!-- README.md --&gt;\n\u003Cspan class=\"hljs-section\"># My Project\u003C/span>\n\nBrief description of what your project does.\n\n\u003Cspan class=\"hljs-section\">## Installation\u003C/span>\n\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`bash\nnpm install\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`\n\n\u003Cspan class=\"hljs-section\">## Usage\u003C/span>\n\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`bash\nnpm start\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`\n\n\u003Cspan class=\"hljs-section\">## API Endpoints\u003C/span>\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| POST | /users | Create a new user |\n| GET | /users/:id | Get user by ID |\n\n\u003Cspan class=\"hljs-section\">## Testing\u003C/span>\n\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`bash\nnpm test\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`\n\n\u003Cspan class=\"hljs-section\">## Deployment\u003C/span>\n\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`bash\ndocker-compose up\n\\\u003Cspan class=\"hljs-code\">`\\`\u003C/span>\\`\n\u003C/code>\u003C/pre>\u003Cp>\u003Cstrong>✅ Final Checkpoint:\u003C/strong> Your application is ready for deployment!\u003C/p>\n\u003Ch2 id=\"what-youve-accomplished\">What You&#39;ve Accomplished\u003C/h2>\n\u003Cp>Congratulations! You&#39;ve successfully:\u003C/p>\n\u003Cul>\n\u003Cli>✅ Set up a complete Node.js application\u003C/li>\n\u003Cli>✅ Implemented CRUD operations with database integration  \u003C/li>\n\u003Cli>✅ Added comprehensive testing\u003C/li>\n\u003Cli>✅ Prepared the application for deployment\u003C/li>\n\u003Cli>✅ Created thorough documentation\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"next-steps-1\">Next Steps\u003C/h2>\n\u003Cp>Now that you&#39;ve completed this tutorial:\u003C/p>\n\u003Col>\n\u003Cli>\u003Cp>\u003Cstrong>Extend Functionality\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Add user authentication\u003C/li>\n\u003Cli>Implement pagination\u003C/li>\n\u003Cli>Add data validation\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Improve Performance\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Add caching layer\u003C/li>\n\u003Cli>Optimize database queries\u003C/li>\n\u003Cli>Implement rate limiting\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003Cli>\u003Cp>\u003Cstrong>Enhance Security\u003C/strong>\u003C/p>\n\u003Cul>\n\u003Cli>Add input sanitization\u003C/li>\n\u003Cli>Implement HTTPS\u003C/li>\n\u003Cli>Add security headers\u003C/li>\n\u003C/ul>\n\u003C/li>\n\u003C/ol>\n\u003Ch2 id=\"additional-resources\">Additional Resources\u003C/h2>\n\u003Cul>\n\u003Cli>\u003Ca href=\"https://expressjs.com/\">Express.js Documentation\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://github.com/mapbox/node-sqlite3\">SQLite3 Node.js Documentation\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://jestjs.io/\">Jest Testing Framework\u003C/a>\u003C/li>\n\u003Cli>\u003Ca href=\"https://docs.docker.com/\">Docker Documentation\u003C/a>\u003C/li>\n\u003C/ul>\n\u003Ch2 id=\"troubleshooting-1\">Troubleshooting\u003C/h2>\n\u003Ch3 id=\"common-issues-1\">Common Issues\u003C/h3>\n\u003Cp>\u003Cstrong>Issue:\u003C/strong> Port already in use\u003Cbr>\u003Cstrong>Solution:\u003C/strong> Change the PORT environment variable or kill the process using the port\u003C/p>\n\u003Cp>\u003Cstrong>Issue:\u003C/strong> Database connection errors\u003Cbr>\u003Cstrong>Solution:\u003C/strong> Check file permissions and ensure the database directory exists\u003C/p>\n\u003Cp>\u003Cstrong>Issue:\u003C/strong> Tests failing\u003Cbr>\u003Cstrong>Solution:\u003C/strong> Ensure test database is properly isolated from development database\u003C/p>\n\u003Chr>\n\u003Cp>\u003Cstrong>Tutorial Completed Successfully!\u003C/strong> 🎉\u003C/p>\n\u003Cp>Did you find this tutorial helpful? \u003Ca href=\"feedback-link\">Share your feedback\u003C/a>\u003C/p>\n\u003Cpre>\u003Ccode>\n\u003C/code>\u003C/pre>\u003Ch3 id=\"template-validation-system\">Template Validation System\u003C/h3>\n\u003Cp>Implementing automated template validation and compliance checking:\u003C/p>\n\u003Cpre>\u003Ccode class=\"hljs language-javascript\">\u003Cspan class=\"hljs-comment\">// template-validator.js - Automated template validation system\u003C/span>\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> fs = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;fs&#x27;\u003C/span>).\u003Cspan class=\"hljs-property\">promises\u003C/span>;\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> path = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;path&#x27;\u003C/span>);\n\u003Cspan class=\"hljs-keyword\">const\u003C/span> matter = \u003Cspan class=\"hljs-built_in\">require\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;gray-matter&#x27;\u003C/span>);\n\n\u003Cspan class=\"hljs-keyword\">class\u003C/span> \u003Cspan class=\"hljs-title class_\">TemplateValidator\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\">templatesDirectory\u003C/span> = options.\u003Cspan class=\"hljs-property\">templatesDirectory\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./templates&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">rulesFile\u003C/span> = options.\u003Cspan class=\"hljs-property\">rulesFile\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;./validation-rules.json&#x27;\u003C/span>;\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">outputFormat\u003C/span> = options.\u003Cspan class=\"hljs-property\">outputFormat\u003C/span> || \u003Cspan class=\"hljs-string\">&#x27;json&#x27;\u003C/span>;\n        \n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span> = {};\n        \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span> = {\n            \u003Cspan class=\"hljs-attr\">passed\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">failed\u003C/span>: [],\n            \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: []\n        };\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">loadValidationRules\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> rulesContent = \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\">rulesFile\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;utf8&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span> = \u003Cspan class=\"hljs-title class_\">JSON\u003C/span>.\u003Cspan class=\"hljs-title function_\">parse\u003C/span>(rulesContent);\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 validation rules file found, using defaults&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">getDefaultRules\u003C/span>();\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">getDefaultRules\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n            \u003Cspan class=\"hljs-attr\">frontmatter\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">required_fields\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;title&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;description&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;keywords&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;layout&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;date&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;author&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;category&#x27;\u003C/span>],\n                \u003Cspan class=\"hljs-attr\">field_patterns\u003C/span>: {\n                    \u003Cspan class=\"hljs-attr\">title\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;^.{10,200}$&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">description\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;^.{50,500}$&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">keywords\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;^.+$&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">date\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;^\\\\d{4}-\\\\d{2}-\\\\d{2}$&#x27;\u003C/span>\n                },\n                \u003Cspan class=\"hljs-attr\">field_types\u003C/span>: {\n                    \u003Cspan class=\"hljs-attr\">keywords\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;array_or_string&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">ai\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;boolean&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">category\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;string&#x27;\u003C/span>\n                }\n            },\n            \u003Cspan class=\"hljs-attr\">content\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">min_length\u003C/span>: \u003Cspan class=\"hljs-number\">1000\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">max_length\u003C/span>: \u003Cspan class=\"hljs-number\">50000\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">required_sections\u003C/span>: [\u003Cspan class=\"hljs-string\">&#x27;## .*&#x27;\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;### .*&#x27;\u003C/span>],\n                \u003Cspan class=\"hljs-attr\">heading_hierarchy\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">code_block_syntax\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            },\n            \u003Cspan class=\"hljs-attr\">structure\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">required_patterns\u003C/span>: [\n                    \u003Cspan class=\"hljs-string\">&#x27;## Why .*\\\\?&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;## .* Conclusion.*&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;## .* (Overview|Introduction|Getting Started).*&#x27;\u003C/span>\n                ],\n                \u003Cspan class=\"hljs-attr\">forbidden_patterns\u003C/span>: [\n                    \u003Cspan class=\"hljs-string\">&#x27;TODO&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;FIXME&#x27;\u003C/span>,\n                    \u003Cspan class=\"hljs-string\">&#x27;\\\\[\\\\[.*\\\\]\\\\]&#x27;\u003C/span>\n                ]\n            },\n            \u003Cspan class=\"hljs-attr\">style\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">max_heading_length\u003C/span>: \u003Cspan class=\"hljs-number\">100\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">max_paragraph_length\u003C/span>: \u003Cspan class=\"hljs-number\">500\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">consistent_code_fencing\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">proper_link_formatting\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>\n            }\n        };\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">validateTemplate\u003C/span>(\u003Cspan class=\"hljs-params\">templatePath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> templateContent = \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">readFile\u003C/span>(templatePath, \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, content } = \u003Cspan class=\"hljs-title function_\">matter\u003C/span>(templateContent);\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> validation = {\n                \u003Cspan class=\"hljs-attr\">file\u003C/span>: templatePath,\n                \u003Cspan class=\"hljs-attr\">frontmatter\u003C/span>: {},\n                \u003Cspan class=\"hljs-attr\">content\u003C/span>: {},\n                \u003Cspan class=\"hljs-attr\">structure\u003C/span>: {},\n                \u003Cspan class=\"hljs-attr\">style\u003C/span>: {},\n                \u003Cspan class=\"hljs-attr\">overall\u003C/span>: { \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>, \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [], \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: [] }\n            };\n            \n            \u003Cspan class=\"hljs-comment\">// Validate frontmatter\u003C/span>\n            validation.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateFrontmatter\u003C/span>(frontmatter);\n            \n            \u003Cspan class=\"hljs-comment\">// Validate content\u003C/span>\n            validation.\u003Cspan class=\"hljs-property\">content\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateContent\u003C/span>(content);\n            \n            \u003Cspan class=\"hljs-comment\">// Validate structure\u003C/span>\n            validation.\u003Cspan class=\"hljs-property\">structure\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateStructure\u003C/span>(content);\n            \n            \u003Cspan class=\"hljs-comment\">// Validate style\u003C/span>\n            validation.\u003Cspan class=\"hljs-property\">style\u003C/span> = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateStyle\u003C/span>(content);\n            \n            \u003Cspan class=\"hljs-comment\">// Aggregate results\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> allChecks = [\n                validation.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>,\n                validation.\u003Cspan class=\"hljs-property\">content\u003C/span>, \n                validation.\u003Cspan class=\"hljs-property\">structure\u003C/span>,\n                validation.\u003Cspan class=\"hljs-property\">style\u003C/span>\n            ];\n            \n            validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span> = allChecks.\u003Cspan class=\"hljs-title function_\">every\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">check\u003C/span> =&gt;\u003C/span> check.\u003Cspan class=\"hljs-property\">passed\u003C/span>);\n            validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">errors\u003C/span> = allChecks.\u003Cspan class=\"hljs-title function_\">flatMap\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">check\u003C/span> =&gt;\u003C/span> check.\u003Cspan class=\"hljs-property\">errors\u003C/span>);\n            validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span> = allChecks.\u003Cspan class=\"hljs-title function_\">flatMap\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">check\u003C/span> =&gt;\u003C/span> check.\u003Cspan class=\"hljs-property\">warnings\u003C/span>);\n            \n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> validation;\n            \n        } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> {\n                \u003Cspan class=\"hljs-attr\">file\u003C/span>: templatePath,\n                \u003Cspan class=\"hljs-attr\">overall\u003C/span>: {\n                    \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">false\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [\u003Cspan class=\"hljs-string\">`Failed to read template: \u003Cspan class=\"hljs-subst\">${error.message}\u003C/span>`\u003C/span>],\n                    \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: []\n                }\n            };\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateFrontmatter\u003C/span>(\u003Cspan class=\"hljs-params\">frontmatter\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = { \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>, \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [], \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: [] };\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> rules = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span>.\u003Cspan class=\"hljs-property\">frontmatter\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Check required fields\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> field \u003Cspan class=\"hljs-keyword\">of\u003C/span> rules.\u003Cspan class=\"hljs-property\">required_fields\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!frontmatter.\u003Cspan class=\"hljs-title function_\">hasOwnProperty\u003C/span>(field)) {\n                result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Missing required frontmatter field: \u003Cspan class=\"hljs-subst\">${field}\u003C/span>`\u003C/span>);\n                result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check field patterns\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [field, pattern] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(rules.\u003Cspan class=\"hljs-property\">field_patterns\u003C/span>)) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (frontmatter[field]) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(pattern);\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!regex.\u003Cspan class=\"hljs-title function_\">test\u003C/span>(\u003Cspan class=\"hljs-title class_\">String\u003C/span>(frontmatter[field]))) {\n                    result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Field &#x27;\u003Cspan class=\"hljs-subst\">${field}\u003C/span>&#x27; doesn&#x27;t match required pattern: \u003Cspan class=\"hljs-subst\">${pattern}\u003C/span>`\u003C/span>);\n                    result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n                }\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check field types\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> [field, expectedType] \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>(rules.\u003Cspan class=\"hljs-property\">field_types\u003C/span>)) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (frontmatter[field] !== \u003Cspan class=\"hljs-literal\">undefined\u003C/span>) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> isValid = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateFieldType\u003C/span>(frontmatter[field], expectedType);\n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!isValid) {\n                    result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Field &#x27;\u003Cspan class=\"hljs-subst\">${field}\u003C/span>&#x27; has incorrect type, expected: \u003Cspan class=\"hljs-subst\">${expectedType}\u003C/span>`\u003C/span>);\n                    result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n                }\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for common issues\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (frontmatter.\u003Cspan class=\"hljs-property\">title\u003C/span> &amp;&amp; frontmatter.\u003Cspan class=\"hljs-property\">title\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">200\u003C/span>) {\n            result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Title is very long (&gt;200 chars), consider shortening&#x27;\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (frontmatter.\u003Cspan class=\"hljs-property\">keywords\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> keywordCount = \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">isArray\u003C/span>(frontmatter.\u003Cspan class=\"hljs-property\">keywords\u003C/span>) \n                ? frontmatter.\u003Cspan class=\"hljs-property\">keywords\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> \n                : frontmatter.\u003Cspan class=\"hljs-property\">keywords\u003C/span>.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;,&#x27;\u003C/span>).\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (keywordCount &lt; \u003Cspan class=\"hljs-number\">3\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Consider adding more keywords (recommended: 5-10)&#x27;\u003C/span>);\n            } \u003Cspan class=\"hljs-keyword\">else\u003C/span> \u003Cspan class=\"hljs-keyword\">if\u003C/span> (keywordCount &gt; \u003Cspan class=\"hljs-number\">15\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Too many keywords (&gt;15), consider reducing for focus&#x27;\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> result;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateFieldType\u003C/span>(\u003Cspan class=\"hljs-params\">value, expectedType\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">switch\u003C/span> (expectedType) {\n            \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;string&#x27;\u003C/span>:\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-keyword\">typeof\u003C/span> value === \u003Cspan class=\"hljs-string\">&#x27;string&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;boolean&#x27;\u003C/span>:\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-keyword\">typeof\u003C/span> value === \u003Cspan class=\"hljs-string\">&#x27;boolean&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;array&#x27;\u003C/span>:\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">isArray\u003C/span>(value);\n            \u003Cspan class=\"hljs-keyword\">case\u003C/span> \u003Cspan class=\"hljs-string\">&#x27;array_or_string&#x27;\u003C/span>:\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">isArray\u003C/span>(value) || \u003Cspan class=\"hljs-keyword\">typeof\u003C/span> value === \u003Cspan class=\"hljs-string\">&#x27;string&#x27;\u003C/span>;\n            \u003Cspan class=\"hljs-attr\">default\u003C/span>:\n                \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-literal\">true\u003C/span>;\n        }\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateContent\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = { \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>, \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [], \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: [] };\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> rules = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span>.\u003Cspan class=\"hljs-property\">content\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Check content length\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (content.\u003Cspan class=\"hljs-property\">length\u003C/span> &lt; rules.\u003Cspan class=\"hljs-property\">min_length\u003C/span>) {\n            result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Content too short (\u003Cspan class=\"hljs-subst\">${content.length}\u003C/span> chars, minimum: \u003Cspan class=\"hljs-subst\">${rules.min_length}\u003C/span>)`\u003C/span>);\n            result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (content.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; rules.\u003Cspan class=\"hljs-property\">max_length\u003C/span>) {\n            result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Content very long (\u003Cspan class=\"hljs-subst\">${content.length}\u003C/span> chars, consider splitting)`\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for required sections\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> section \u003Cspan class=\"hljs-keyword\">of\u003C/span> rules.\u003Cspan class=\"hljs-property\">required_sections\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(section, \u003Cspan class=\"hljs-string\">&#x27;gm&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!regex.\u003Cspan class=\"hljs-title function_\">test\u003C/span>(content)) {\n                result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Missing required section pattern: \u003Cspan class=\"hljs-subst\">${section}\u003C/span>`\u003C/span>);\n                result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check heading hierarchy\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (rules.\u003Cspan class=\"hljs-property\">heading_hierarchy\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> hierarchyIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateHeadingHierarchy\u003C/span>(content);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (hierarchyIssues.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...hierarchyIssues);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check code block syntax\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (rules.\u003Cspan class=\"hljs-property\">code_block_syntax\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> syntaxIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateCodeBlockSyntax\u003C/span>(content);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (syntaxIssues.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...syntaxIssues);\n                result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> result;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateStructure\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = { \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>, \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [], \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: [] };\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> rules = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span>.\u003Cspan class=\"hljs-property\">structure\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Check required patterns\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> pattern \u003Cspan class=\"hljs-keyword\">of\u003C/span> rules.\u003Cspan class=\"hljs-property\">required_patterns\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(pattern, \u003Cspan class=\"hljs-string\">&#x27;gm&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!regex.\u003Cspan class=\"hljs-title function_\">test\u003C/span>(content)) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Recommended pattern not found: \u003Cspan class=\"hljs-subst\">${pattern}\u003C/span>`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check forbidden patterns\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> pattern \u003Cspan class=\"hljs-keyword\">of\u003C/span> rules.\u003Cspan class=\"hljs-property\">forbidden_patterns\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> regex = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">RegExp\u003C/span>(pattern, \u003Cspan class=\"hljs-string\">&#x27;gm&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (regex.\u003Cspan class=\"hljs-title function_\">test\u003C/span>(content)) {\n                result.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Forbidden pattern found: \u003Cspan class=\"hljs-subst\">${pattern}\u003C/span>`\u003C/span>);\n                result.\u003Cspan class=\"hljs-property\">passed\u003C/span> = \u003Cspan class=\"hljs-literal\">false\u003C/span>;\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> result;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateStyle\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> result = { \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-literal\">true\u003C/span>, \u003Cspan class=\"hljs-attr\">errors\u003C/span>: [], \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: [] };\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> rules = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationRules\u003C/span>.\u003Cspan class=\"hljs-property\">style\u003C/span>;\n        \n        \u003Cspan class=\"hljs-comment\">// Check heading lengths\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#{1,6}\\s+(.+)$/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> heading \u003Cspan class=\"hljs-keyword\">of\u003C/span> headings) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> headingText = heading.\u003Cspan class=\"hljs-title function_\">replace\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s+/\u003C/span>, \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (headingText.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; rules.\u003Cspan class=\"hljs-property\">max_heading_length\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Long heading: &quot;\u003Cspan class=\"hljs-subst\">${headingText.substring(\u003Cspan class=\"hljs-number\">0\u003C/span>, \u003Cspan class=\"hljs-number\">50\u003C/span>)}\u003C/span>...&quot;`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check paragraph lengths\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> paragraphs = content.\u003Cspan class=\"hljs-title function_\">split\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\n\\s*\\n/\u003C/span>).\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">p\u003C/span> =&gt;\u003C/span> p.\u003Cspan class=\"hljs-title function_\">trim\u003C/span>() &amp;&amp; !p.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+\\s|^```|^\\s*[-*+]|\\|/\u003C/span>));\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> paragraph \u003Cspan class=\"hljs-keyword\">of\u003C/span> paragraphs) {\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (paragraph.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; rules.\u003Cspan class=\"hljs-property\">max_paragraph_length\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Long paragraph detected (\u003Cspan class=\"hljs-subst\">${paragraph.length}\u003C/span> chars)`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check code fence consistency\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (rules.\u003Cspan class=\"hljs-property\">consistent_code_fencing\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> fenceIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateCodeFencing\u003C/span>(content);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (fenceIssues.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...fenceIssues);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check link formatting\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (rules.\u003Cspan class=\"hljs-property\">proper_link_formatting\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> linkIssues = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateLinkFormatting\u003C/span>(content);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (linkIssues.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                result.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...linkIssues);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> result;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateHeadingHierarchy\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> headings = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^(#{1,6})\\s+(.+)$/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">let\u003C/span> previousLevel = \u003Cspan class=\"hljs-number\">0\u003C/span>;\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> heading \u003Cspan class=\"hljs-keyword\">of\u003C/span> headings) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> level = heading.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^#+/\u003C/span>)[\u003Cspan class=\"hljs-number\">0\u003C/span>].\u003Cspan class=\"hljs-property\">length\u003C/span>;\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (level &gt; previousLevel + \u003Cspan class=\"hljs-number\">1\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Heading hierarchy skip: went from h\u003Cspan class=\"hljs-subst\">${previousLevel}\u003C/span> to h\u003Cspan class=\"hljs-subst\">${level}\u003C/span>`\u003C/span>);\n            }\n            \n            previousLevel = level;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateCodeBlockSyntax\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> codeBlocks = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/```[\\\\s\\\\S]*?```/g\u003C/span>) || [];\n        \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; codeBlocks.\u003Cspan class=\"hljs-property\">length\u003C/span>; i++) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> block = codeBlocks[i];\n            \n            \u003Cspan class=\"hljs-comment\">// Check for unclosed code blocks\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!block.\u003Cspan class=\"hljs-title function_\">endsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;```&#x27;\u003C/span>)) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Unclosed code block at position \u003Cspan class=\"hljs-subst\">${i + \u003Cspan class=\"hljs-number\">1\u003C/span>}\u003C/span>`\u003C/span>);\n            }\n            \n            \u003Cspan class=\"hljs-comment\">// Check for nested backticks without proper escaping\u003C/span>\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> innerContent = block.\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(\u003Cspan class=\"hljs-number\">3\u003C/span>, -\u003Cspan class=\"hljs-number\">3\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (innerContent.\u003Cspan class=\"hljs-title function_\">includes\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;```&#x27;\u003C/span>) &amp;&amp; !block.\u003Cspan class=\"hljs-title function_\">startsWith\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;````&#x27;\u003C/span>)) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Nested code block needs more backticks at position \u003Cspan class=\"hljs-subst\">${i + \u003Cspan class=\"hljs-number\">1\u003C/span>}\u003C/span>`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateCodeFencing\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> fences = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^```+/gm\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> fenceLengths = fences.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">fence\u003C/span> =&gt;\u003C/span> fence.\u003Cspan class=\"hljs-property\">length\u003C/span>);\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (fenceLengths.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> mostCommon = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">getMostCommon\u003C/span>(fenceLengths);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> inconsistent = fenceLengths.\u003Cspan class=\"hljs-title function_\">filter\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">length\u003C/span> =&gt;\u003C/span> length !== mostCommon);\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (inconsistent.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Inconsistent code fence lengths: found \u003Cspan class=\"hljs-subst\">${inconsistent.length}\u003C/span> non-standard fences`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">validateLinkFormatting\u003C/span>(\u003Cspan class=\"hljs-params\">content\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> issues = [];\n        \n        \u003Cspan class=\"hljs-comment\">// Check for broken reference links\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> referenceLinks = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\\\[([^\\\\]]+)\\\\]\\\\[([^\\\\]]*)\\\\]/g\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> referenceDefinitions = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^\\\\[([^\\\\]]+)\\\\]:/gm\u003C/span>) || [];\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> definedReferences = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">Set\u003C/span>(\n            referenceDefinitions.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">def\u003C/span> =&gt;\u003C/span> def.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/^\\\\[([^\\\\]]+)\\\\]:/\u003C/span>)[\u003Cspan class=\"hljs-number\">1\u003C/span>])\n        );\n        \n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> link \u003Cspan class=\"hljs-keyword\">of\u003C/span> referenceLinks) {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> match = link.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\\\[([^\\\\]]+)\\\\]\\\\[([^\\\\]]*)\\\\]/\u003C/span>);\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> referenceName = match[\u003Cspan class=\"hljs-number\">2\u003C/span>] || match[\u003Cspan class=\"hljs-number\">1\u003C/span>];\n            \n            \u003Cspan class=\"hljs-keyword\">if\u003C/span> (!definedReferences.\u003Cspan class=\"hljs-title function_\">has\u003C/span>(referenceName)) {\n                issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Undefined reference link: \u003Cspan class=\"hljs-subst\">${referenceName}\u003C/span>`\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-comment\">// Check for malformed inline links\u003C/span>\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> malformedLinks = content.\u003Cspan class=\"hljs-title function_\">match\u003C/span>(\u003Cspan class=\"hljs-regexp\">/\\\\[[^\\\\]]+\\\\]\\\\([^)]*\\\\s[^)]*\\\\)/g\u003C/span>) || [];\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (malformedLinks.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            issues.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(\u003Cspan class=\"hljs-string\">`Found \u003Cspan class=\"hljs-subst\">${malformedLinks.length}\u003C/span> potentially malformed inline links`\u003C/span>);\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> issues;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">getMostCommon\u003C/span>(\u003Cspan class=\"hljs-params\">array\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> frequency = {};\n        \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> item \u003Cspan class=\"hljs-keyword\">of\u003C/span> array) {\n            frequency[item] = (frequency[item] || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>;\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Object\u003C/span>.\u003Cspan class=\"hljs-title function_\">keys\u003C/span>(frequency).\u003Cspan class=\"hljs-title function_\">reduce\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">a, b\u003C/span>) =&gt;\u003C/span> \n            frequency[a] &gt; frequency[b] ? a : b\n        );\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">validateAllTemplates\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">try\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">loadValidationRules\u003C/span>();\n            \n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> templateFiles = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">findTemplateFiles\u003C/span>(\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">templatesDirectory\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Found \u003Cspan class=\"hljs-subst\">${templateFiles.length}\u003C/span> template files to validate`\u003C/span>);\n            \n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> templateFile \u003Cspan class=\"hljs-keyword\">of\u003C/span> templateFiles) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> validation = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">validateTemplate\u003C/span>(templateFile);\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>) {\n                    \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(validation);\n                    \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`✅ \u003Cspan class=\"hljs-subst\">${templateFile}\u003C/span> - PASSED`\u003C/span>);\n                } \u003Cspan class=\"hljs-keyword\">else\u003C/span> {\n                    \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(validation);\n                    \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`❌ \u003Cspan class=\"hljs-subst\">${templateFile}\u003C/span> - FAILED`\u003C/span>);\n                    validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">errors\u003C/span>.\u003Cspan class=\"hljs-title function_\">forEach\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">error\u003C/span> =&gt;\u003C/span> {\n                        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`   Error: \u003Cspan class=\"hljs-subst\">${error}\u003C/span>`\u003C/span>);\n                    });\n                }\n                \n                \u003Cspan class=\"hljs-keyword\">if\u003C/span> (validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n                    \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                        \u003Cspan class=\"hljs-attr\">file\u003C/span>: templateFile,\n                        \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>\n                    });\n                    validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-title function_\">forEach\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">warning\u003C/span> =&gt;\u003C/span> {\n                        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`   Warning: \u003Cspan class=\"hljs-subst\">${warning}\u003C/span>`\u003C/span>);\n                    });\n                }\n            }\n            \n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateValidationReport\u003C/span>();\n            \n        } \u003Cspan class=\"hljs-keyword\">catch\u003C/span> (error) {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Validation failed:&#x27;\u003C/span>, error);\n            \u003Cspan class=\"hljs-keyword\">throw\u003C/span> error;\n        }\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">findTemplateFiles\u003C/span>(\u003Cspan class=\"hljs-params\">directory\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> files = [];\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>(directory, { \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>(directory, 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>()) {\n                \u003Cspan class=\"hljs-keyword\">const\u003C/span> subFiles = \u003Cspan class=\"hljs-keyword\">await\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">findTemplateFiles\u003C/span>(fullPath);\n                files.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(...subFiles);\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                files.\u003Cspan class=\"hljs-title function_\">push\u003C/span>(fullPath);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> files;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateValidationReport\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> report = {\n            \u003Cspan class=\"hljs-attr\">summary\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">total\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> + \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">passed\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">failed\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">success_rate\u003C/span>: (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> / \n                              (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> + \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span>) * \u003Cspan class=\"hljs-number\">100\u003C/span>).\u003Cspan class=\"hljs-title function_\">toFixed\u003C/span>(\u003Cspan class=\"hljs-number\">2\u003C/span>)\n            },\n            \u003Cspan class=\"hljs-attr\">details\u003C/span>: {\n                \u003Cspan class=\"hljs-attr\">passed_files\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">passed\u003C/span>.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">v\u003C/span> =&gt;\u003C/span> v.\u003Cspan class=\"hljs-property\">file\u003C/span>),\n                \u003Cspan class=\"hljs-attr\">failed_files\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">v\u003C/span> =&gt;\u003C/span> ({\n                    \u003Cspan class=\"hljs-attr\">file\u003C/span>: v.\u003Cspan class=\"hljs-property\">file\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">errors\u003C/span>: v.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">errors\u003C/span>,\n                    \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: v.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>\n                })),\n                \u003Cspan class=\"hljs-attr\">warnings\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>\n            },\n            \u003Cspan class=\"hljs-attr\">recommendations\u003C/span>: \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateRecommendations\u003C/span>()\n        };\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> report;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateRecommendations\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> recommendations = [];\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            recommendations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;critical&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.validationResults.failed.length}\u003C/span> templates have validation errors that need immediate attention`\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">warnings\u003C/span>.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            recommendations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;improvement&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">`\u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.validationResults.warnings.length}\u003C/span> templates have warnings that should be addressed`\u003C/span>\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> commonErrors = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">getCommonErrors\u003C/span>();\n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (commonErrors.\u003Cspan class=\"hljs-property\">length\u003C/span> &gt; \u003Cspan class=\"hljs-number\">0\u003C/span>) {\n            recommendations.\u003Cspan class=\"hljs-title function_\">push\u003C/span>({\n                \u003Cspan class=\"hljs-attr\">type\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;pattern&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">message\u003C/span>: \u003Cspan class=\"hljs-string\">&#x27;Most common validation issues&#x27;\u003C/span>,\n                \u003Cspan class=\"hljs-attr\">issues\u003C/span>: commonErrors\n            });\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> recommendations;\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">getCommonErrors\u003C/span>(\u003Cspan class=\"hljs-params\">\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> errorFreq = \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> validation \u003Cspan class=\"hljs-keyword\">of\u003C/span> \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">validationResults\u003C/span>.\u003Cspan class=\"hljs-property\">failed\u003C/span>) {\n            \u003Cspan class=\"hljs-keyword\">for\u003C/span> (\u003Cspan class=\"hljs-keyword\">const\u003C/span> error \u003Cspan class=\"hljs-keyword\">of\u003C/span> validation.\u003Cspan class=\"hljs-property\">overall\u003C/span>.\u003Cspan class=\"hljs-property\">errors\u003C/span>) {\n                errorFreq.\u003Cspan class=\"hljs-title function_\">set\u003C/span>(error, (errorFreq.\u003Cspan class=\"hljs-title function_\">get\u003C/span>(error) || \u003Cspan class=\"hljs-number\">0\u003C/span>) + \u003Cspan class=\"hljs-number\">1\u003C/span>);\n            }\n        }\n        \n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-title class_\">Array\u003C/span>.\u003Cspan class=\"hljs-title function_\">from\u003C/span>(errorFreq.\u003Cspan class=\"hljs-title function_\">entries\u003C/span>())\n            .\u003Cspan class=\"hljs-title function_\">sort\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">[,a], [,b]\u003C/span>) =&gt;\u003C/span> b - a)\n            .\u003Cspan class=\"hljs-title function_\">slice\u003C/span>(\u003Cspan class=\"hljs-number\">0\u003C/span>, \u003Cspan class=\"hljs-number\">5\u003C/span>)\n            .\u003Cspan class=\"hljs-title function_\">map\u003C/span>(\u003Cspan class=\"hljs-function\">(\u003Cspan class=\"hljs-params\">[error, count]\u003C/span>) =&gt;\u003C/span> ({ error, count }));\n    }\n    \n    \u003Cspan class=\"hljs-keyword\">async\u003C/span> \u003Cspan class=\"hljs-title function_\">saveValidationReport\u003C/span>(\u003Cspan class=\"hljs-params\">outputPath\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">const\u003C/span> report = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateValidationReport\u003C/span>();\n        \n        \u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-property\">outputFormat\u003C/span> === \u003Cspan class=\"hljs-string\">&#x27;json&#x27;\u003C/span>) {\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-keyword\">else\u003C/span> {\n            \u003Cspan class=\"hljs-keyword\">const\u003C/span> markdown = \u003Cspan class=\"hljs-variable language_\">this\u003C/span>.\u003Cspan class=\"hljs-title function_\">generateMarkdownReport\u003C/span>(report);\n            \u003Cspan class=\"hljs-keyword\">await\u003C/span> fs.\u003Cspan class=\"hljs-title function_\">writeFile\u003C/span>(outputPath, markdown);\n        }\n        \n        \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Validation report saved to: \u003Cspan class=\"hljs-subst\">${outputPath}\u003C/span>`\u003C/span>);\n    }\n    \n    \u003Cspan class=\"hljs-title function_\">generateMarkdownReport\u003C/span>(\u003Cspan class=\"hljs-params\">report\u003C/span>) {\n        \u003Cspan class=\"hljs-keyword\">return\u003C/span> \u003Cspan class=\"hljs-string\">`\n# Template Validation Report\n\n**Generated:** \u003Cspan class=\"hljs-subst\">${\u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-built_in\">Date\u003C/span>().toISOString()}\u003C/span>\n\n## Summary\n\n- **Total Templates:** \u003Cspan class=\"hljs-subst\">${report.summary.total}\u003C/span>\n- **Passed:** \u003Cspan class=\"hljs-subst\">${report.summary.passed}\u003C/span> (\u003Cspan class=\"hljs-subst\">${report.summary.success_rate}\u003C/span>%)\n- **Failed:** \u003Cspan class=\"hljs-subst\">${report.summary.failed}\u003C/span>\n- **Warnings:** \u003Cspan class=\"hljs-subst\">${report.summary.warnings}\u003C/span>\n\n## Failed Templates\n\n\u003Cspan class=\"hljs-subst\">${report.details.failed_files.map(f =&gt; \u003Cspan class=\"hljs-string\">`\n### \u003Cspan class=\"hljs-subst\">${f.file}\u003C/span>\n\n**Errors:**\n\u003Cspan class=\"hljs-subst\">${f.errors.map(e =&gt; \u003Cspan class=\"hljs-string\">`- \u003Cspan class=\"hljs-subst\">${e}\u003C/span>`\u003C/span>).join(\u003Cspan class=\"hljs-string\">&#x27;\\\\n&#x27;\u003C/span>)}\u003C/span>\n\n**Warnings:**\n\u003Cspan class=\"hljs-subst\">${f.warnings.map(w =&gt; \u003Cspan class=\"hljs-string\">`- \u003Cspan class=\"hljs-subst\">${w}\u003C/span>`\u003C/span>).join(\u003Cspan class=\"hljs-string\">&#x27;\\\\n&#x27;\u003C/span>)}\u003C/span>\n`\u003C/span>).join(\u003Cspan class=\"hljs-string\">&#x27;\\\\n&#x27;\u003C/span>)}\u003C/span>\n\n## Recommendations\n\n\u003Cspan class=\"hljs-subst\">${report.recommendations.map(r =&gt; \u003Cspan class=\"hljs-string\">`\n### \u003Cspan class=\"hljs-subst\">${r.type.toUpperCase()}\u003C/span>: \u003Cspan class=\"hljs-subst\">${r.message}\u003C/span>\n\n\u003Cspan class=\"hljs-subst\">${r.issues ? r.issues.map(i =&gt; \u003Cspan class=\"hljs-string\">`- \u003Cspan class=\"hljs-subst\">${i.error}\u003C/span> (\u003Cspan class=\"hljs-subst\">${i.count}\u003C/span> occurrences)`\u003C/span>).join(\u003Cspan class=\"hljs-string\">&#x27;\\\\n&#x27;\u003C/span>) : \u003Cspan class=\"hljs-string\">&#x27;&#x27;\u003C/span>}\u003C/span>\n`\u003C/span>).join(\u003Cspan class=\"hljs-string\">&#x27;\\\\n&#x27;\u003C/span>)}\u003C/span>\n\n---\n*Report generated by Template Validator*\n        `\u003C/span>.\u003Cspan class=\"hljs-title function_\">trim\u003C/span>();\n    }\n}\n\n\u003Cspan class=\"hljs-variable language_\">module\u003C/span>.\u003Cspan class=\"hljs-property\">exports\u003C/span> = \u003Cspan class=\"hljs-title class_\">TemplateValidator\u003C/span>;\n\n\u003Cspan class=\"hljs-comment\">// CLI Usage\u003C/span>\n\u003Cspan class=\"hljs-keyword\">if\u003C/span> (\u003Cspan class=\"hljs-built_in\">require\u003C/span>.\u003Cspan class=\"hljs-property\">main\u003C/span> === \u003Cspan class=\"hljs-variable language_\">module\u003C/span>) {\n    \u003Cspan class=\"hljs-keyword\">const\u003C/span> validator = \u003Cspan class=\"hljs-keyword\">new\u003C/span> \u003Cspan class=\"hljs-title class_\">TemplateValidator\u003C/span>({\n        \u003Cspan class=\"hljs-attr\">templatesDirectory\u003C/span>: process.\u003Cspan class=\"hljs-property\">argv\u003C/span>[\u003Cspan class=\"hljs-number\">2\u003C/span>] || \u003Cspan class=\"hljs-string\">&#x27;./templates&#x27;\u003C/span>,\n        \u003Cspan class=\"hljs-attr\">outputFormat\u003C/span>: process.\u003Cspan class=\"hljs-property\">argv\u003C/span>[\u003Cspan class=\"hljs-number\">3\u003C/span>] || \u003Cspan class=\"hljs-string\">&#x27;json&#x27;\u003C/span>\n    });\n    \n    validator.\u003Cspan class=\"hljs-title function_\">validateAllTemplates\u003C/span>()\n        .\u003Cspan class=\"hljs-title function_\">then\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">report\u003C/span> =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;\\\\n=== VALIDATION SUMMARY ===&#x27;\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Total: \u003Cspan class=\"hljs-subst\">${report.summary.total}\u003C/span>`\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Passed: \u003Cspan class=\"hljs-subst\">${report.summary.passed}\u003C/span>`\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Failed: \u003Cspan class=\"hljs-subst\">${report.summary.failed}\u003C/span>`\u003C/span>);\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">log\u003C/span>(\u003Cspan class=\"hljs-string\">`Success Rate: \u003Cspan class=\"hljs-subst\">${report.summary.success_rate}\u003C/span>%`\u003C/span>);\n            \n            \u003Cspan class=\"hljs-keyword\">return\u003C/span> validator.\u003Cspan class=\"hljs-title function_\">saveValidationReport\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;./validation-report.json&#x27;\u003C/span>);\n        })\n        .\u003Cspan class=\"hljs-title function_\">catch\u003C/span>(\u003Cspan class=\"hljs-function\">\u003Cspan class=\"hljs-params\">error\u003C/span> =&gt;\u003C/span> {\n            \u003Cspan class=\"hljs-variable language_\">console\u003C/span>.\u003Cspan class=\"hljs-title function_\">error\u003C/span>(\u003Cspan class=\"hljs-string\">&#x27;Validation failed:&#x27;\u003C/span>, error);\n            process.\u003Cspan class=\"hljs-title function_\">exit\u003C/span>(\u003Cspan class=\"hljs-number\">1\u003C/span>);\n        });\n}\n\u003C/code>\u003C/pre>\u003Ch2 id=\"integration-with-documentation-systems\">Integration with Documentation Systems\u003C/h2>\n\u003Cp>Documentation templates integrate seamlessly with modern content management workflows. When combined with \u003Ca href=\"/blog/markdown-automation-workflows-complete-guide\">automation systems and workflow optimization\u003C/a>, standardized templates become part of the continuous integration process, ensuring consistency is maintained automatically as content is created and updated across development environments.\u003C/p>\n\u003Cp>For comprehensive content management, template systems work effectively with \u003Ca href=\"/blog/markdown-version-control-git-integration-complete-guide\">version control and collaborative editing workflows\u003C/a> to ensure that standardized formats are preserved through collaborative editing processes, merge conflicts, and content evolution over time.\u003C/p>\n\u003Cp>When building sophisticated documentation platforms, standardization complements \u003Ca href=\"/blog/markdown-progressive-web-app-documentation-complete-guide\">progressive web app documentation systems\u003C/a> by ensuring that content delivered through offline-first documentation experiences maintains consistent structure and formatting, providing reliable user experiences regardless of connectivity or platform.\u003C/p>\n\u003Ch2 id=\"conclusion\">Conclusion\u003C/h2>\n\u003Cp>Advanced Markdown documentation templates and standardization systems represent a sophisticated approach to technical writing that transforms ad-hoc content creation into systematic, scalable documentation workflows. By implementing comprehensive template architectures, automated validation processes, and collaborative standardization practices, organizations can build documentation systems that maintain quality and consistency while enabling efficient content creation across diverse teams and documentation types.\u003C/p>\n\u003Cp>The key to successful template implementation lies in balancing structure with flexibility, ensuring that standardization serves content creators rather than constraining them. Whether you&#39;re building API documentation, user guides, or comprehensive technical manuals, the template systems and validation techniques covered in this guide provide the foundation for creating maintainable, consistent, and high-quality documentation that serves both creators and readers effectively.\u003C/p>\n\u003Cp>Remember to iterate on your template designs based on team feedback and usage patterns, implement validation as part of your content creation workflow, and continuously refine your standardization practices to support evolving documentation needs. With proper implementation of template systems and standardization processes, your Markdown-based documentation can deliver exceptional consistency while maintaining the simplicity and accessibility that makes Markdown such an effective content creation format.\u003C/p>\n",[15,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,75,78,80,83],{"id":16,"text":17,"level":18},"why-master-markdown-documentation-templates","Why Master Markdown Documentation Templates?",2,{"id":20,"text":21,"level":18},"foundation-template-architecture","Foundation Template Architecture",{"id":23,"text":24,"level":18},"authentication","Authentication",{"id":26,"text":27,"level":18},"endpoints","Endpoints",{"id":29,"text":30,"level":18},"error-handling","Error Handling",{"id":32,"text":33,"level":18},"rate-limiting","Rate Limiting",{"id":35,"text":36,"level":18},"sdks-and-libraries","SDKs and Libraries",{"id":38,"text":39,"level":18},"support","Support",{"id":41,"text":42,"level":18},"core-concepts","Core Concepts",{"id":44,"text":45,"level":18},"common-tasks","Common Tasks",{"id":47,"text":48,"level":18},"advanced-features","Advanced Features",{"id":50,"text":51,"level":18},"troubleshooting","Troubleshooting",{"id":53,"text":54,"level":18},"next-steps","Next Steps",{"id":56,"text":57,"level":18},"appendix","Appendix",{"id":59,"text":60,"level":18},"step-2-core-implementation","Step 2: Core Implementation",{"id":62,"text":63,"level":18},"step-3-advanced-features","Step 3: Advanced Features",{"id":65,"text":66,"level":18},"step-4-testing-and-validation","Step 4: Testing and Validation",{"id":68,"text":69,"level":18},"step-5-deployment-and-documentation","Step 5: Deployment and Documentation",{"id":71,"text":72,"level":18},"what-youve-accomplished","What You've Accomplished",{"id":74,"text":54,"level":18},"next-steps-1",{"id":76,"text":77,"level":18},"additional-resources","Additional Resources",{"id":79,"text":51,"level":18},"troubleshooting-1",{"id":81,"text":82,"level":18},"integration-with-documentation-systems","Integration with Documentation Systems",{"id":84,"text":85,"level":18},"conclusion","Conclusion",[],[88,96,104],{"slug":89,"title":90,"description":91,"excerpt":92,"date":93,"category":9,"author":10,"keywords":94,"readingMinutes":95},"markdown-code-annotations-documentation-complete-guide","Markdown Code Annotations and Documentation: Complete Guide for Technical Writing","Master code annotations, inline documentation, and technical writing in Markdown. Learn to create annotated code examples, documentation comments, and professional technical guides with proper formatting.","Code annotations and documentation in Markdown bridge the gap between raw code examples and comprehensive technical explanations, enabling writers to create clear, educational content that helps…","2025-08-31","markdown code annotations, markdown documentation, code comments markdown, technical writing markdown, annotated code examples, markdown code blocks, documentation comments",20,{"slug":97,"title":98,"description":99,"excerpt":100,"date":101,"category":9,"author":10,"keywords":102,"readingMinutes":103},"markdown-annotations-comments-complete-guide","Markdown Annotations and Comments: Complete Guide for Technical Documentation","Master Markdown annotations and comments for professional technical documentation. Learn platform-specific implementations, code annotations, editorial comments, and collaborative review workflows for enhanced content development.","Markdown annotations and comments enable sophisticated documentation workflows that separate content from editorial notes, facilitate collaborative review processes, and provide context for…","2025-09-10","markdown annotations, markdown comments, technical documentation comments, markdown editorial notes, code annotations markdown, collaborative writing markdown, documentation review process",25,{"slug":105,"title":106,"description":107,"excerpt":108,"date":109,"category":9,"author":10,"keywords":110,"readingMinutes":111},"markdown-keyboard-shortcuts-complete-guide","Markdown Keyboard Shortcuts: Complete Guide for Efficient Technical Writing","Master keyboard shortcuts and efficiency techniques for writing Markdown faster. Learn editor-specific shortcuts, workflow optimizations, and productivity tips for technical documentation and content creation.","Keyboard shortcuts and efficiency techniques in Markdown writing transform slow, mouse-dependent documentation workflows into lightning-fast content creation processes that boost productivity and…","2025-09-09","markdown keyboard shortcuts, markdown efficiency tips, markdown productivity, technical writing shortcuts, markdown workflow, fast markdown writing, markdown editor shortcuts",13,1792184946559]