{"record":{"id":"a8383870361b1585","repo":"tobi/qmd","slug":"qmd-skill-not-found-reinstall-qmd-or-set-qmd-skil","errorCode":null,"errorMessage":"QMD skill not found. Reinstall qmd or set QMD_SKILLS_DIR.","messagePattern":"QMD skill not found\\. Reinstall qmd or set QMD_SKILLS_DIR\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/qmd.ts","lineNumber":3312,"sourceCode":"    const subdir = resolve(skill.dir, subdirName);\n    if (!existsSync(subdir)) continue;\n    for (const entry of readdirSync(subdir).sort()) {\n      const filePath = resolve(subdir, entry);\n      try {\n        if (!statSync(filePath).isFile()) continue;\n        files.push({ relativePath: `${subdirName}/${basename(filePath)}`, content: readFileSync(filePath, \"utf-8\") });\n      } catch {\n        // Ignore unreadable supplementary files.\n      }\n    }\n  }\n  return files;\n}\n\nfunction showSkill(): void {\n  const skill = findSkill(\"qmd\");\n  if (!skill) {\n    throw new Error(\"QMD skill not found. Reinstall qmd or set QMD_SKILLS_DIR.\");\n  }\n  console.log(\"QMD Skill\");\n  console.log(\"\");\n  const content = readSkillContent(skill);\n  process.stdout.write(content.endsWith(\"\\n\") ? content : content + \"\\n\");\n}\n\nfunction copyDirectoryContents(sourceDir: string, targetDir: string): void {\n  mkdirSync(targetDir, { recursive: true });\n  for (const entry of readdirSync(sourceDir)) {\n    const sourcePath = resolve(sourceDir, entry);\n    const targetPath = resolve(targetDir, entry);\n    const stat = statSync(sourcePath);\n    if (stat.isDirectory()) {\n      copyDirectoryContents(sourcePath, targetPath);\n    } else if (stat.isFile()) {\n      copyFileSync(sourcePath, targetPath);\n    }","sourceCodeStart":3294,"sourceCodeEnd":3330,"githubUrl":"https://github.com/tobi/qmd/blob/dbfd0b4736aeaf761d1a16ca8e424f071df8feb9/src/cli/qmd.ts#L3294-L3330","documentation":"Thrown by `qmd skills show` when findSkill(\"qmd\") cannot locate the bundled qmd skill directory. The CLI searches built-in skill locations and QMD_SKILLS_DIR; finding nothing means the installation is missing the skill assets or the env var points elsewhere.","triggerScenarios":"Running `qmd skills show` when the qmd skill files are not installed alongside the binary/package, or QMD_SKILLS_DIR is set to a directory that does not contain a 'qmd' skill.","commonSituations":"Partial or corrupted install; a globally linked build (`bun link`) missing dist/skill assets; QMD_SKILLS_DIR pointing at a custom dir after moving skills out.","solutions":["Reinstall qmd (e.g. `bun install -g qmd` or rebuild from source)","Verify QMD_SKILLS_DIR, if set, contains a qmd/<skill dir with SKILL.md>","Run `qmd doctor` to diagnose install/config issues"],"exampleFix":"# before\nexport QMD_SKILLS_DIR=/wrong/path\n# after\nunset QMD_SKILLS_DIR   # use bundled skills, or point to a dir containing qmd/","handlingStrategy":"try-catch","validationCode":"import { existsSync } from \"node:fs\";\nconst skillsDir = process.env.QMD_SKILLS_DIR;\nconst ok = !skillsDir || existsSync(`${skillsDir}/qmd/SKILL.md`);","typeGuard":"null","tryCatchPattern":"try { execQmd([\"skills\", \"show\"]); } catch (e) { if ((e as Error).message.includes(\"QMD skill not found\")) { /* reinstall or fix QMD_SKILLS_DIR */ } else throw e; }","preventionTips":["Run `qmd doctor` after install to verify skill assets","Keep QMD_SKILLS_DIR pointing at a directory containing a qmd/ skill folder"],"tags":["skills","installation","env-var"],"backgroundTag":"missing-skill-assets","analyzedSha":"dbfd0b4736aeaf761d1a16ca8e424f071df8feb9","analyzedAt":"2026-08-28T18:07:46.628Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}