{"record":{"id":"6fb8e50d89b7e49e","repo":"davila7/claude-code-templates","slug":"warning-error-loading-skills-from-skillsdir","errorCode":null,"errorMessage":"Warning: Error loading skills from ${skillsDir}:","messagePattern":"Warning: Error loading skills from (.+?):","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/skill-dashboard.js","lineNumber":99,"sourceCode":"\n          if (await fs.pathExists(skillMdPath)) {\n            console.log(chalk.gray(`  ✓ Found SKILL.md in ${skillDir}`));\n            const skillData = await this.parseSkill(skillMdPath, skillPath, skillDir, source);\n            if (skillData) {\n              skills.push(skillData);\n              console.log(chalk.green(`  ✅ Loaded skill: ${skillData.name}`));\n            }\n          } else {\n            console.log(chalk.gray(`  ⊘ No SKILL.md in ${skillDir}`));\n          }\n        } catch (error) {\n          console.warn(chalk.yellow(`  ⚠ Error loading skill ${skillDir}:`), error.message);\n        }\n      }\n\n      return skills;\n    } catch (error) {\n      console.warn(chalk.yellow(`Warning: Error loading skills from ${skillsDir}:`), error.message);\n      return skills;\n    }\n  }\n\n  async loadPluginSkills() {\n    const skills = [];\n    const pluginsDir = path.join(this.claudeDir, 'plugins', 'marketplaces');\n\n    try {\n      if (!(await fs.pathExists(pluginsDir))) {\n        console.log(chalk.gray(`  ℹ Plugins directory does not exist: ${pluginsDir}`));\n        return skills;\n      }\n\n      const marketplaces = await fs.readdir(pluginsDir);\n      console.log(chalk.gray(`  📁 Found ${marketplaces.length} marketplace(s)`));\n\n      for (const marketplace of marketplaces) {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/skill-dashboard.js#L81-L117","documentation":"This is the outer catch of loadSkillsFromDirectory: the whole scan of a skills directory failed before per-skill iteration could complete — typically the directory itself is missing, unreadable, or the initial readdir threw. It returns the (usually empty) skills array so the dashboard renders an empty skills list rather than crashing.","triggerScenarios":"Calling loadSkillsFromDirectory where the skills path does not exist, is a file instead of a directory, or lacks read/execute permission for the process; also when readdir throws on special filesystem conditions (permission-denied on a subdirectory).","commonSituations":"Running the skill dashboard before any skills are installed and the directory was never created; skills path misconfigured (wrong env var / custom path typo); skills directory on a network mount that is down; restrictive permissions after restoring from archive.","solutions":["Confirm the directory exists and is readable: `ls -la <skillsDir>`; create it if absent (`mkdir -p`","Check the configured skills path (env var / settings) points at the intended directory","Fix permissions: `chmod -R u+rx <skillsDir>`","If an inner subdirectory is the culprit (some setups surface that here), find it with `find <skillsDir> ! -readable`"],"exampleFix":"// before\nconst skills = await loadSkillsFromDirectory('/wrong/path/skills');\n// after\nawait fs.ensureDir(skillsDir);\nconst skills = await loadSkillsFromDirectory(skillsDir);","handlingStrategy":"fallback","validationCode":"if (!(await fs.pathExists(skillsDir)) || !(await fs.stat(skillsDir)).isDirectory()) {\n  return []; // no skills installed — not an error\n}","typeGuard":null,"tryCatchPattern":"catch (error) {\n  console.warn(`Skills directory ${skillsDir} unreadable: ${error.message}`);\n  return skills; // empty/partial list keeps the dashboard alive\n}","preventionTips":["Create the skills directory at app startup (fs.ensureDir)","Guard against missing dirs before scanning instead of catching after","Check mount health before scanning network-backed skill directories"],"tags":["skills","filesystem","directory-not-found"],"backgroundTag":"directory-read-failed","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}