A PHP library to abstract a SKILL.md file.
composer require stolt/skill-md $skillMdData = [
'name' => 'Code Review',
'description' => 'Performs automated code reviews.',
'body' => '# Some longer, skill describing Markdown content.',
'version' => '1.0.0',
'tags' => ['php', 'qa'],
];
$skillMd = SkillMd::fromArray($skillMdData);$skillMd = new SkillMd(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content.',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);
$skillMdViaFactory = SkillMd::create(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content.',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);$skillName = $skillMd->name();
$skillDescription = $skillMd->description();
$skillBody = $skillMd->body();
$skillVersion = $skillMd->version();
$skillTags = $skillMd->tags();
$skillLicense = $skillMd->get('license');
if ($skill->has('unsupported-field') === false) {
echo 'This field is not supported.';
}
if ($skill->get('unsupported-field') === null) {
echo 'This field is not supported and has no value.';
}The programmatical representation:
$skillMd = new SkillMd(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);
$markdown = $skillMd->toMarkdown();The Markdown representation:
---
name: code-review
description: Performs automated code reviews.
version: 1.0.0
license: MIT
tags:
- php
- qa
---
# Some longer, skill describing Markdown contentcomposer testThis library is licensed under the MIT license. Please see LICENSE.md for more details.
Please see CHANGELOG.md for more details.
Please see CONTRIBUTING.md for more details.