{"record":{"id":"b02e37f8a4dc2326","repo":"thedotmack/claude-mem","slug":"missing-onboarding-explainer-source-onboardinge","errorCode":null,"errorMessage":"Missing onboarding explainer source: ${onboardingExplainerSrc}","messagePattern":"Missing onboarding explainer source: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"scripts/build-hooks.js","lineNumber":687,"sourceCode":"        format: 'esm',\n        outfile: `${opencodeOutDir}/index.js`,\n        minify: true,\n        logLevel: 'error',\n        external: [\n          'fs', 'fs/promises', 'path', 'os', 'child_process', 'url',\n          'crypto', 'http', 'https', 'net', 'stream', 'util', 'events',\n        ],\n      });\n\n      const opencodeStats = fs.statSync(`${opencodeOutDir}/index.js`);\n      console.log(`✓ opencode plugin built (${(opencodeStats.size / 1024).toFixed(2)} KB)`);\n    }\n\n    console.log('\\n📋 Copying onboarding explainer to plugin tree...');\n    const onboardingExplainerSrc = 'src/services/worker/onboarding-explainer.md';\n    const onboardingExplainerDst = 'plugin/skills/how-it-works/onboarding-explainer.md';\n    if (!fs.existsSync(onboardingExplainerSrc)) {\n      throw new Error(`Missing onboarding explainer source: ${onboardingExplainerSrc}`);\n    }\n    fs.mkdirSync(path.dirname(onboardingExplainerDst), { recursive: true });\n    fs.copyFileSync(onboardingExplainerSrc, onboardingExplainerDst);\n    console.log(`✓ Copied ${onboardingExplainerSrc} → ${onboardingExplainerDst}`);\n\n    console.log('\\n📋 Verifying distribution files...');\n    const validCodexHookEvents = new Set([\n      'SessionStart',\n      'UserPromptSubmit',\n      'PreToolUse',\n      'PermissionRequest',\n      'PostToolUse',\n      'Stop',\n    ]);\n    const requiredDistributionFiles = [\n      'plugin/skills/mem-search/SKILL.md',\n      'plugin/skills/mode-creator/SKILL.md',\n      'plugin/skills/mode-creator/scripts/install-mode.mjs',","sourceCodeStart":669,"sourceCodeEnd":705,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/d768ba364302d12b76e69e4f021f0bb1d2d50ed6/scripts/build-hooks.js#L669-L705","documentation":"Build copies src/services/worker/onboarding-explainer.md into plugin/skills/how-it-works/onboarding-explainer.md. If the source markdown does not exist, the build aborts because the shipped skill tree would be missing the onboarding explainer users see. This is a source-tree completeness check, not a runtime guard.","triggerScenarios":"Running node scripts/build-hooks.js when src/services/worker/onboarding-explainer.md has been deleted, moved, or renamed without updating build-hooks.js. A partial checkout or a bad merge that dropped the file.","commonSituations":"Renaming/relocating the onboarding doc and forgetting to update the source path in build-hooks.js (line 686). Deleting the file as 'cleanup'. Switching branches that don't have the file.","solutions":["Restore the source: git checkout HEAD -- src/services/worker/onboarding-explainer.md.","If you intentionally moved the file, update the onboardingExplainerSrc path at scripts/build-hooks.js:687 to the new location.","Re-run the build; it prints '✓ Copied ... → plugin/skills/how-it-works/onboarding-explainer.md' on success."],"exampleFix":"# before: src/services/worker/onboarding-explainer.md missing (moved/renamed)\n\n# either restore the canonical location\ngit checkout HEAD -- src/services/worker/onboarding-explainer.md\n\n# or, if moved on purpose, update scripts/build-hooks.js:687\nconst onboardingExplainerSrc = 'src/services/worker/<new-location>/onboarding-explainer.md';","handlingStrategy":"validation","validationCode":"if (!fs.existsSync('src/services/worker/onboarding-explainer.md')) {\n  throw new Error('onboarding explainer source missing — restore or update build path');\n}","typeGuard":null,"tryCatchPattern":"// Build-time only. Restore the file from git or update the source path in\n// scripts/build-hooks.js if the doc moved intentionally.","preventionTips":["Keep src/services/worker/onboarding-explainer.md under source control and never delete it.","If you relocate the doc, update onboardingExplainerSrc in the same commit.","Add the file to a repo-integrity CI check."],"tags":["build","verification","onboarding","skills","source-tree"],"backgroundTag":null,"analyzedSha":"d768ba364302d12b76e69e4f021f0bb1d2d50ed6","analyzedAt":"2026-08-12T23:52:55.241Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}