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
- 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
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
- Run `qmd doctor` after install to verify skill assets
- Keep QMD_SKILLS_DIR pointing at a directory containing a qmd/ skill folder
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
- Skill already exists: ${targetDir} (use --force to replace i
- Skill not found: ${name}
- No skill name provided. Usage: qmd skills get <name>
- Unknown skills subcommand: ${subcommand}
- Database path not set. Tests must set INDEX_PATH env var or
AI-assisted analysis of tobi/qmd@dbfd0b4736 (2026-08-28).
Data as JSON: /api/errors/a8383870361b1585.
Report an issue: GitHub.