{"record":{"id":"5444ca16672f0d6b","repo":"google-gemini/gemini-cli","slug":"no-valid-skills-found-in-source-subpath-at","errorCode":null,"errorMessage":"No valid skills found in ${source}${subpath ? ` at path \"${subpath}\"` : ''}. Ensure a SKILL.md file exists with valid frontmatter.","messagePattern":"No valid skills found in (.+?)(.+?)\"` : ''\\}\\. Ensure a SKILL\\.md file exists with valid frontmatter\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/utils/skillUtils.ts","lineNumber":159,"sourceCode":"      sourcePath = path.join(sourcePath, subpath);\n    }\n\n    sourcePath = path.resolve(sourcePath);\n\n    // Quick security check to prevent directory traversal out of temp dir when cloning\n    if (tempDirToClean) {\n      const resolvedTemp = path.resolve(tempDirToClean);\n      const relative = path.relative(resolvedTemp, sourcePath);\n      if (isPathTraversal(relative)) {\n        throw new Error('Invalid path: Directory traversal not allowed.');\n      }\n    }\n\n    onLog(`Searching for skills in ${sourcePath}...`);\n    const skills = await loadSkillsFromDir(sourcePath);\n\n    if (skills.length === 0) {\n      throw new Error(\n        `No valid skills found in ${source}${subpath ? ` at path \"${subpath}\"` : ''}. Ensure a SKILL.md file exists with valid frontmatter.`,\n      );\n    }\n\n    const workspaceDir = process.cwd();\n    const storage = new Storage(workspaceDir);\n    const targetDir =\n      scope === 'workspace'\n        ? storage.getProjectSkillsDir()\n        : Storage.getUserSkillsDir();\n\n    if (!(await requestConsent(skills, targetDir))) {\n      throw new Error('Skill installation cancelled by user.');\n    }\n\n    const resolvedTarget = path.resolve(targetDir);\n    await fs.mkdir(resolvedTarget, { recursive: true });\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/utils/skillUtils.ts#L141-L177","documentation":"Thrown after scanning the resolved sourcePath with loadSkillsFromDir yields zero valid skills. A 'valid skill' requires a SKILL.md file with parseable, valid frontmatter; if none is found the install aborts. The message names the source and (if given) the subpath to help locate the problem.","triggerScenarios":"loadSkillsFromDir(sourcePath) returns an empty array. No SKILL.md exists under sourcePath, or all present SKILL.md files have invalid/missing frontmatter (missing required fields, YAML parse error).","commonSituations":"Pointing `source` at a repo root when the skill is in a subfolder (subpath needed). SKILL.md present but frontmatter is malformed (bad YAML, missing name/description). Cloning the wrong repo/branch. Directory contains only loose .md files not following the skill convention.","solutions":["Confirm a SKILL.md file exists at the target path with valid frontmatter (name, description, etc.).","If the skill is in a subfolder, pass the correct `subpath` so sourcePath resolves onto it.","Validate the SKILL.md frontmatter locally (YAML lint) and fix any parse errors.","Check you cloned the intended repo/branch/tag."],"exampleFix":"// before\n// installSkill({ source: 'https://github.com/x/y' })  // SKILL.md is in /skills/foo\n\n// after\n// installSkill({ source: 'https://github.com/x/y', subpath: 'skills/foo' })","handlingStrategy":"validation","validationCode":"const fs = require('fs');\nconst path = require('path');\nfunction assertSkillPresent(dir) {\n  const skillFile = path.join(dir, 'SKILL.md');\n  if (!fs.existsSync(skillFile)) {\n    throw new Error(`No SKILL.md found under ${dir}`);\n  }\n  const text = fs.readFileSync(skillFile, 'utf8');\n  if (!/^---[\\s\\S]*?---/.test(text)) {\n    throw new Error('SKILL.md is missing valid frontmatter');\n  }\n}","typeGuard":"const hasValidSkillFile = (dir) => {\n  const f = path.join(dir, 'SKILL.md');\n  if (!fs.existsSync(f)) return false;\n  return /^---[\\s\\S]*?---/.test(fs.readFileSync(f, 'utf8'));\n};","tryCatchPattern":null,"preventionTips":["Verify SKILL.md and its frontmatter before publishing a skill.","Point install commands at the exact skill folder or supply the correct subpath."],"tags":["skill","installation","frontmatter","validation","filesystem"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}