@skillscraft/core
v0.9.1
Published
Parse, validate, and lint Agent Skills
Downloads
40
Maintainers
Readme
@skillscraft/core
Parse, validate, and lint Agent Skills against the Agent Skills specification.
Installation
npm install @skillscraft/coreWhat it exports
parseSkill(filePath)-- parse a SKILL.md file into aParsedSkillobject (frontmatter + body)validateSkill(skill)-- validate a parsed skill against the specification, returning errors and warningslintSkill(skill)-- lint a parsed skill for best practices (description quality, body length, naming)loadSkillManifest(dirPath)-- load a full skill manifest from a directory (skill + files + directory flags)LINT_RULES-- the set of built-in lint rules
All types from @skillscraft/spec are re-exported for convenience.
Usage
Parse a skill
import { parseSkill } from "@skillscraft/core";
const skill = await parseSkill("/path/to/my-skill/SKILL.md");
console.log(skill.frontmatter.name); // "my-skill"
console.log(skill.body); // markdown body contentValidate a skill
import { parseSkill, validateSkill } from "@skillscraft/core";
const skill = await parseSkill("/path/to/my-skill/SKILL.md");
const result = validateSkill(skill);
if (result.valid) {
console.log("Skill is valid.");
} else {
result.errors.forEach((e) => console.error(e.message));
}Lint a skill
import { parseSkill, lintSkill } from "@skillscraft/core";
const skill = await parseSkill("/path/to/my-skill/SKILL.md");
const result = lintSkill(skill);
result.diagnostics.forEach((d) =>
console.log(`[${d.severity}] ${d.message}`)
);License
Apache-2.0
