PHPackages                             ronaldtebrake/agent-skills-validator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ronaldtebrake/agent-skills-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ronaldtebrake/agent-skills-validator
====================================

PHP validator for Agent Skills SKILL.md files per agentskills.io specification

1.0(3mo ago)21951[1 PRs](https://github.com/ronaldtebrake/agent-skills-validator/pulls)2MITPHPPHP ^8.1

Since Jan 10Pushed 3mo agoCompare

[ Source](https://github.com/ronaldtebrake/agent-skills-validator)[ Packagist](https://packagist.org/packages/ronaldtebrake/agent-skills-validator)[ RSS](/packages/ronaldtebrake-agent-skills-validator/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (5)Used By (2)

Agent Skills Validator
======================

[](#agent-skills-validator)

A PHP library for validating Agent Skills `SKILL.md` files according to the [agentskills.io specification](https://agentskills.io/specification).

Based on [validator.py](https://github.com/agentskills/agentskills/blob/main/skills-ref/src/skills_ref/validator.py)

Installation
------------

[](#installation)

Install via Composer:

```
composer require ronaldtebrake/agent-skills-validator
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony Filesystem component (^6.0 || ^7.0)

Usage
-----

[](#usage)

```
use AgentSkills\Validator\Validator;

$validator = new Validator();
$result = $validator->validateSkill('/path/to/skill/directory');

if ($result['valid']) {
    echo "Skill is valid!\n";
    print_r($result['metadata']);
} else {
    echo "Validation errors:\n";
    foreach ($result['errors'] as $error) {
        echo "  - $error\n";
    }
}
```

Return Format
-------------

[](#return-format)

The `validateSkill()` method returns an array with the following structure:

```
[
    'valid' => bool,        // Whether the skill passed validation
    'errors' => string[],   // Array of error messages (empty if valid)
    'metadata' => array     // Parsed frontmatter metadata
]
```

Validation Rules
----------------

[](#validation-rules)

The validator enforces the following rules per the Agent Skills specification:

### Required Fields

[](#required-fields)

- **name**: Must be a non-empty string, lowercase, max 64 characters, containing only letters, digits, and hyphens. Cannot start/end with hyphens or contain consecutive hyphens. Must match the directory name.
- **description**: Must be a non-empty string, max 1024 characters.

### Optional Fields

[](#optional-fields)

- **license**: Any string value
- **allowed-tools**: Array of tool names
- **metadata**: Object with arbitrary key-value pairs
- **compatibility**: String, max 500 characters

### File Structure

[](#file-structure)

- The skill directory must contain a `SKILL.md` file
- The file must have valid YAML frontmatter delimited by `---`
- Only the allowed fields listed above may be present in the frontmatter

Example SKILL.md
----------------

[](#example-skillmd)

```
---
name: my-awesome-skill
description: A skill that does something awesome
license: MIT
compatibility: Requires PHP 8.1+
metadata:
  author: John Doe
  version: "1.0.0"
---
# My Awesome Skill

This skill provides awesome functionality for AI agents.
```

CLI Tool for CI/CD
------------------

[](#cli-tool-for-cicd)

The package includes a CLI tool for validating skills in CI/CD environments. When installed via Composer, the binary is available at `vendor/bin/agent-skills-validator`:

```
# Validate all skills in a directory (automatically discovers subdirectories with SKILL.md)
vendor/bin/agent-skills-validator .claude/skills

# When running from the repository directly
php bin/agent-skills-validator .claude/skills

# If no path is provided, it defaults to the current directory
vendor/bin/agent-skills-validator
```

**Directory Discovery**: If you provide a directory path that doesn't contain a `SKILL.md` file, the tool will automatically search for all subdirectories containing `SKILL.md` files and validate them. If a directory already contains `SKILL.md`, it will be validated directly.

The CLI tool exits with code 0 on success and 1 if validation fails, making it suitable for CI/CD pipelines.

### GitHub Actions Example

[](#github-actions-example)

Create `.github/workflows/validate-skills.yml`:

```
name: Validate Agent Skills

on:
  pull_request:
    paths:
      - '**/SKILL.md'
      - '**/*/SKILL.md'

jobs:
  validate:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.1'

      - name: Install dependencies
        run: composer install --no-interaction --prefer-dist

      - name: Validate skills
        run: vendor/bin/agent-skills-validator .claude/skills
```

Testing
-------

[](#testing)

Run the test suite:

```
composer install
vendor/bin/phpunit
```

Specification Reference
-----------------------

[](#specification-reference)

This validator implements the validation rules from the [Agent Skills specification](https://agentskills.io/specification), based on the reference implementation at [agentskills/agentskills](https://github.com/agentskills/agentskills/blob/main/skills-ref/src/skills_ref/validator.py).

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE) file for details.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance81

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

4

Last Release

100d ago

Major Versions

0.2 → 1.02026-03-27

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16667281?v=4)[ronaldtebrake](/maintainers/ronaldtebrake)[@ronaldtebrake](https://github.com/ronaldtebrake)

---

Top Contributors

[![ronaldtebrake](https://avatars.githubusercontent.com/u/16667281?v=4)](https://github.com/ronaldtebrake "ronaldtebrake (5 commits)")

---

Tags

validationskillsagent-skillsagentskills.io

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ronaldtebrake-agent-skills-validator/health.svg)

```
[![Health](https://phpackages.com/badges/ronaldtebrake-agent-skills-validator/health.svg)](https://phpackages.com/packages/ronaldtebrake-agent-skills-validator)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M387](/packages/easycorp-easyadmin-bundle)[composer/semver

Version comparison library that offers utilities, version constraint parsing and validation.

3.3k522.3M994](/packages/composer-semver)[giggsey/libphonenumber-for-php

A library for parsing, formatting, storing and validating international phone numbers, a PHP Port of Google's libphonenumber.

5.0k159.6M527](/packages/giggsey-libphonenumber-for-php)[respect/validation

The most awesome validation engine ever created for PHP

6.0k39.9M415](/packages/respect-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
