tobi/qmd · error · Error

QMD skill not found. Reinstall qmd or set QMD_SKILLS_DIR.

Error message

QMD skill not found. Reinstall qmd or set QMD_SKILLS_DIR.

What it means

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.

Source

Thrown at src/cli/qmd.ts:3312

    const subdir = resolve(skill.dir, subdirName);
    if (!existsSync(subdir)) continue;
    for (const entry of readdirSync(subdir).sort()) {
      const filePath = resolve(subdir, entry);
      try {
        if (!statSync(filePath).isFile()) continue;
        files.push({ relativePath: `${subdirName}/${basename(filePath)}`, content: readFileSync(filePath, "utf-8") });
      } catch {
        // Ignore unreadable supplementary files.
      }
    }
  }
  return files;
}

function showSkill(): void {
  const skill = findSkill("qmd");
  if (!skill) {
    throw new Error("QMD skill not found. Reinstall qmd or set QMD_SKILLS_DIR.");
  }
  console.log("QMD Skill");
  console.log("");
  const content = readSkillContent(skill);
  process.stdout.write(content.endsWith("\n") ? content : content + "\n");
}

function copyDirectoryContents(sourceDir: string, targetDir: string): void {
  mkdirSync(targetDir, { recursive: true });
  for (const entry of readdirSync(sourceDir)) {
    const sourcePath = resolve(sourceDir, entry);
    const targetPath = resolve(targetDir, entry);
    const stat = statSync(sourcePath);
    if (stat.isDirectory()) {
      copyDirectoryContents(sourcePath, targetPath);
    } else if (stat.isFile()) {
      copyFileSync(sourcePath, targetPath);
    }

View on GitHub (pinned to dbfd0b4736)

Solutions

  1. Reinstall qmd (e.g. `bun install -g qmd` or rebuild from source)
  2. Verify QMD_SKILLS_DIR, if set, contains a qmd/<skill dir with SKILL.md>
  3. Run `qmd doctor` to diagnose install/config issues

Example fix

# before
export QMD_SKILLS_DIR=/wrong/path
# after
unset QMD_SKILLS_DIR   # use bundled skills, or point to a dir containing qmd/
Defensive patterns

Strategy: try-catch

Validate before calling

import { existsSync } from "node:fs";
const skillsDir = process.env.QMD_SKILLS_DIR;
const ok = !skillsDir || existsSync(`${skillsDir}/qmd/SKILL.md`);

Type guard

null

Try / catch

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; }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of tobi/qmd@dbfd0b4736 (2026-08-28). Data as JSON: /api/errors/a8383870361b1585. Report an issue: GitHub.