load-skills loads skill content from configurable locations and validates skill spec constraints.
pnpm add load-skillsimport { loadSkills } from "load-skills";
const { skills, report } = await loadSkills({
paths: ["./.agents/skills"],
recursive: false,
});config is optional. Calling loadSkills() uses:
paths: ["./.agents/skills"]recursive: false
skills includes loaded skill payloads:
- shape:
Record<string, Skill>(keyed by skill name) meta: typed frontmatter object with requirednameanddescriptioncontent:SKILL.mdcontent without frontmatterreferences: absolute file paths fromreferences/scripts: script descriptors fromscripts/as{ path, type }
report includes one entry per configured path:
paths: one entry per configured path:inputPath: raw path from configresolvedPath: absolute resolved pathcount: number of included skills from that pathskillNames: included skill names from that patherror(optional):path_not_foundorpath_not_directory
ignoredDuplicates: map of skipped duplicate skills (first-find-wins), keyed by kept skill nameinvalidSkills: invalid skill entries moved out ofskills; each item includeswarnings
paths is also a priority list. If the same meta.name appears in multiple paths, the first one found is included and later ones are ignored.
These warnings appear on report.invalidSkills[*].warnings.
missing_frontmatter:SKILL.mdis missing a valid--- ... ---frontmatter block.invalid_yaml_frontmatter: Frontmatter exists but YAML parsing failed or did not produce an object.missing_required_meta_name: Frontmatter is missing requiredname.missing_required_meta_description: Frontmatter is missing requireddescription.invalid_meta_name:nameis present but not a non-empty string.invalid_meta_description:descriptionis present but not a non-empty string.skill_md_content_size_limit_exceeded:SKILL.mdbody exceeds 500 lines.resource_read_error: A resource file or directory could not be read during scanning.