skills-reference
v1.0.7
Published
Reference library for Agent Skills
Downloads
793
Maintainers
Readme
skills-reference
TypeScript port of the Agent Skills reference tooling. It mirrors the Python skills-ref.
Installation
Prerequisites
- Node.js (v14.0.0 or higher)
- npm (v6.0.0 or higher)
From npm
# Install the package
npm install skills-referenceUsage
CLI
# Validate a skill
skills-reference validate path/to/skill
# Read skill properties (outputs JSON)
skills-reference read-properties path/to/skill
# Generate <available_skills> XML for agent prompts
skills-reference to-prompt path/to/skill-a path/to/skill-bNode.js API
CommonJS Syntax
const {
validate,
validateMetadata,
readProperties,
toPrompt,
} = require("skills-reference");
// Validate a skill directory
const errors = validate("path/to/skill");
if (errors.length > 0) {
console.log("Validation errors:", errors);
}
// Validate metadata only
const skillMetadata = {
name: "pdf-processing",
description:
"Extract text and tables from PDF files, fill forms, merge documents.",
license: "Apache-2.0",
metadata: {
author: "example-org",
version: "1.0",
},
};
const metadataErrors = validateMetadata(skillMetadata);
if (metadataErrors.length > 0) {
console.log("Metadata validation errors:", metadataErrors);
}
// Read skill properties
const props = readProperties("path/to/skill");
console.log(`Skill: ${props.name} - ${props.description}`);
// Generate prompt for available skills
const prompt = toPrompt(["path/to/skill-a", "path/to/skill-b"]);
console.log(prompt);ESM Syntax
import {
validate,
validateMetadata,
readProperties,
toPrompt,
} from "skills-reference";
// Validate a skill directory
const errors = validate("path/to/skill");
if (errors.length > 0) {
console.log("Validation errors:", errors);
}
// Validate metadata only
const skillMetadata = {
name: "pdf-processing",
description:
"Extract text and tables from PDF files, fill forms, merge documents.",
license: "Apache-2.0",
metadata: {
author: "example-org",
version: "1.0",
},
};
const metadataErrors = validateMetadata(skillMetadata);
if (metadataErrors.length > 0) {
console.log("Metadata validation errors:", metadataErrors);
}
// Read skill properties
const props = readProperties("path/to/skill");
console.log(`Skill: ${props.name} - ${props.description}`);
// Generate prompt for available skills
const prompt = toPrompt(["path/to/skill-a", "path/to/skill-b"]);
console.log(prompt);License
MIT
