Download the PHP package stolt/skill-validator without Composer
On this page you can find all versions of the php package stolt/skill-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download stolt/skill-validator
More information about stolt/skill-validator
Files in stolt/skill-validator
Package skill-validator
Short Description A library for parsing and validating SKILL.md files or raw SKILL.md content.
License MIT
Informations about the package skill-validator
skill-validator
A PHP library to parse and validate SKILL.md files or raw SKILL.md content against the
SKILL.md format specification.
Installation and usage
Usage
The validator can validate either existing SKILL.md files or raw SKILL.md content.
Validating a SKILL.md file
Validating all SKILL.md files in a directory
The method returns an array<string, ValidationResult> keyed by absolute file path, covering all SKILL.md files found
recursively under the given directory.
Validating raw SKILL.md content
[!TIP] The
validatealias method accepts either a file path, directory path, or raw content and delegates to the appropriate method automatically.
Accessing validation results and metadata
Validation returns a Stolt\Ai\Skill\ValidationResult object. When the SKILL.md content contains the required name
and description fields, the parsed metadata is exposed as a Stolt\Ai\Skill\Metadata object.
For an actual integration, the project list-skills-command can also be consolidated.
[!TIP] As of version
0.0.5you can use thetoSkillMd()method to collect a populatedSkillMdinstance of the stolt/skill-md package.
Validation rules
The validator checks that a SKILL.md document:
- starts with YAML frontmatter delimited by
---lines, - contains the required
namefield, - contains the required
descriptionfield, - uses a non-empty, lowercase, hyphenated skill name,
- contains Markdown instructions after the frontmatter,
- only uses supported frontmatter fields,
- uses lists for list-like fields such as
tags,paths, andallowed-tools, - uses a boolean value for
disable-model-invocation.
Supported frontmatter fields include:
namedescriptionwhen_to_useallowed-toolsdisable-model-invocationargument-hintargumentspathsmodeleffortmetadatacompatibilitylicenseauthorversiontags
Running tests
License
This library is licensed under the MIT license. Please see LICENSE.md for more details.
Changelog
Please see CHANGELOG.md for more details.
Inspiration
This library idea is inspired by the work on agent-skills-validator by ronaldtebrake.
Contributing
Please see CONTRIBUTING.md for more details.