{"record":{"id":"00d1a8c145f2573b","repo":"davila7/claude-code-templates","slug":"warning-could-not-parse-yaml-frontmatter-for-sk","errorCode":null,"errorMessage":"Warning: Could not parse YAML frontmatter for ${skillDirName}","messagePattern":"Warning: Could not parse YAML frontmatter for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/skill-dashboard.js","lineNumber":185,"sourceCode":"      return skills;\n    }\n  }\n\n  async parseSkill(skillMdPath, skillPath, skillDirName, source) {\n    try {\n      const content = await fs.readFile(skillMdPath, 'utf8');\n\n      // Parse YAML frontmatter\n      const frontmatterMatch = content.match(/^---\\n([\\s\\S]*?)\\n---/);\n      let frontmatter = {};\n      let markdownContent = content;\n\n      if (frontmatterMatch) {\n        try {\n          frontmatter = yaml.load(frontmatterMatch[1]);\n          markdownContent = content.substring(frontmatterMatch[0].length).trim();\n        } catch (error) {\n          console.warn(chalk.yellow(`Warning: Could not parse YAML frontmatter for ${skillDirName}`));\n        }\n      }\n\n      // Get file stats\n      const stats = await fs.stat(skillMdPath);\n\n      // Scan for supporting files\n      const supportingFiles = await this.scanSupportingFiles(skillPath);\n\n      // Categorize files by loading strategy\n      const categorizedFiles = this.categorizeFiles(supportingFiles, markdownContent);\n\n      return {\n        name: frontmatter.name || skillDirName,\n        description: frontmatter.description || 'No description available',\n        allowedTools: frontmatter['allowed-tools'] || frontmatter.allowedTools || null,\n        source,\n        path: skillPath,","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/skill-dashboard.js#L167-L203","documentation":"parseSkill reads a SKILL.md, extracts the YAML frontmatter between --- markers, and parses it with yaml.load. If YAML parsing throws, it warns 'Could not parse YAML frontmatter' and continues with undefined frontmatter — the skill loads with missing metadata (name, description) rather than being skipped. Note this warning deliberately omits the underlying error message.","triggerScenarios":"Calling parseSkill on a SKILL.md whose frontmatter block contains invalid YAML: tabs for indentation, unquoted strings with YAML special characters (:, {, }, *, &), duplicate keys, or non-UTF8 bytes.","commonSituations":"Skill authored in an editor that inserts tabs; description containing an unquoted colon (e.g. `description: Deploy: production`); copy-pasted frontmatter from markdown docs with smart quotes; frontmatter delimiters miscounted so body text gets parsed as YAML.","solutions":["Lint the frontmatter: `sed -n '/^---$/,/^---$/p' SKILL.md | sed '1d;$d' | yq -P`","Quote scalar values containing colons or special chars, and replace tabs with spaces","Ensure exactly two `---` delimiter lines with YAML only between them","Re-run the skill dashboard and confirm the skill shows its name/description"],"exampleFix":"# before\n---\ndescription: Deploy things: fast\n---\n# after\n---\ndescription: \"Deploy things: fast\"\n---","handlingStrategy":"validation","validationCode":"function frontmatterParses(content) {\n  const m = content.match(/^---\\n([\\s\\S]*?)\\n---\\n/);\n  if (!m) return false;\n  try { require('js-yaml').load(m[1]); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"catch (error) {\n  console.warn(`Invalid frontmatter, loading skill without metadata: ${error.message}`);\n  frontmatter = {}; // explicit default instead of undefined\n}","preventionTips":["Quote frontmatter values containing colons or special characters","Use spaces, never tabs, in YAML frontmatter","Add a frontmatter lint step (yamllint) to skill authoring workflows"],"tags":["yaml","frontmatter","skills","metadata"],"backgroundTag":"yaml-frontmatter-invalid","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}